0) {
+ if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }
+ while(i >= 0) {
+ if(p < k) {
+ d = (this.data[i]&((1<>(p+=this.DB-k);
+ } else {
+ d = (this.data[i]>>(p-=k))&km;
+ if(p <= 0) { p += this.DB; --i; }
+ }
+ if(d > 0) m = true;
+ if(m) r += int2char(d);
+ }
+ }
+ return m?r:"0";
+}
+
+// (public) -this
+function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
+
+// (public) |this|
+function bnAbs() { return (this.s<0)?this.negate():this; }
+
+// (public) return + if this > a, - if this < a, 0 if equal
+function bnCompareTo(a) {
+ var r = this.s-a.s;
+ if(r != 0) return r;
+ var i = this.t;
+ r = i-a.t;
+ if(r != 0) return (this.s<0)?-r:r;
+ while(--i >= 0) if((r=this.data[i]-a.data[i]) != 0) return r;
+ return 0;
+}
+
+// returns bit length of the integer x
+function nbits(x) {
+ var r = 1, t;
+ if((t=x>>>16) != 0) { x = t; r += 16; }
+ if((t=x>>8) != 0) { x = t; r += 8; }
+ if((t=x>>4) != 0) { x = t; r += 4; }
+ if((t=x>>2) != 0) { x = t; r += 2; }
+ if((t=x>>1) != 0) { x = t; r += 1; }
+ return r;
+}
+
+// (public) return the number of bits in "this"
+function bnBitLength() {
+ if(this.t <= 0) return 0;
+ return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));
+}
+
+// (protected) r = this << n*DB
+function bnpDLShiftTo(n,r) {
+ var i;
+ for(i = this.t-1; i >= 0; --i) r.data[i+n] = this.data[i];
+ for(i = n-1; i >= 0; --i) r.data[i] = 0;
+ r.t = this.t+n;
+ r.s = this.s;
+}
+
+// (protected) r = this >> n*DB
+function bnpDRShiftTo(n,r) {
+ for(var i = n; i < this.t; ++i) r.data[i-n] = this.data[i];
+ r.t = Math.max(this.t-n,0);
+ r.s = this.s;
+}
+
+// (protected) r = this << n
+function bnpLShiftTo(n,r) {
+ var bs = n%this.DB;
+ var cbs = this.DB-bs;
+ var bm = (1<= 0; --i) {
+ r.data[i+ds+1] = (this.data[i]>>cbs)|c;
+ c = (this.data[i]&bm)<= 0; --i) r.data[i] = 0;
+ r.data[ds] = c;
+ r.t = this.t+ds+1;
+ r.s = this.s;
+ r.clamp();
+}
+
+// (protected) r = this >> n
+function bnpRShiftTo(n,r) {
+ r.s = this.s;
+ var ds = Math.floor(n/this.DB);
+ if(ds >= this.t) { r.t = 0; return; }
+ var bs = n%this.DB;
+ var cbs = this.DB-bs;
+ var bm = (1<>bs;
+ for(var i = ds+1; i < this.t; ++i) {
+ r.data[i-ds-1] |= (this.data[i]&bm)<>bs;
+ }
+ if(bs > 0) r.data[this.t-ds-1] |= (this.s&bm)<>= this.DB;
+ }
+ if(a.t < this.t) {
+ c -= a.s;
+ while(i < this.t) {
+ c += this.data[i];
+ r.data[i++] = c&this.DM;
+ c >>= this.DB;
+ }
+ c += this.s;
+ } else {
+ c += this.s;
+ while(i < a.t) {
+ c -= a.data[i];
+ r.data[i++] = c&this.DM;
+ c >>= this.DB;
+ }
+ c -= a.s;
+ }
+ r.s = (c<0)?-1:0;
+ if(c < -1) r.data[i++] = this.DV+c;
+ else if(c > 0) r.data[i++] = c;
+ r.t = i;
+ r.clamp();
+}
+
+// (protected) r = this * a, r != this,a (HAC 14.12)
+// "this" should be the larger one if appropriate.
+function bnpMultiplyTo(a,r) {
+ var x = this.abs(), y = a.abs();
+ var i = x.t;
+ r.t = i+y.t;
+ while(--i >= 0) r.data[i] = 0;
+ for(i = 0; i < y.t; ++i) r.data[i+x.t] = x.am(0,y.data[i],r,i,0,x.t);
+ r.s = 0;
+ r.clamp();
+ if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
+}
+
+// (protected) r = this^2, r != this (HAC 14.16)
+function bnpSquareTo(r) {
+ var x = this.abs();
+ var i = r.t = 2*x.t;
+ while(--i >= 0) r.data[i] = 0;
+ for(i = 0; i < x.t-1; ++i) {
+ var c = x.am(i,x.data[i],r,2*i,0,1);
+ if((r.data[i+x.t]+=x.am(i+1,2*x.data[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
+ r.data[i+x.t] -= x.DV;
+ r.data[i+x.t+1] = 1;
+ }
+ }
+ if(r.t > 0) r.data[r.t-1] += x.am(i,x.data[i],r,2*i,0,1);
+ r.s = 0;
+ r.clamp();
+}
+
+// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
+// r != q, this != m. q or r may be null.
+function bnpDivRemTo(m,q,r) {
+ var pm = m.abs();
+ if(pm.t <= 0) return;
+ var pt = this.abs();
+ if(pt.t < pm.t) {
+ if(q != null) q.fromInt(0);
+ if(r != null) this.copyTo(r);
+ return;
+ }
+ if(r == null) r = nbi();
+ var y = nbi(), ts = this.s, ms = m.s;
+ var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus
+ if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }
+ var ys = y.t;
+ var y0 = y.data[ys-1];
+ if(y0 == 0) return;
+ var yt = y0*(1<1)?y.data[ys-2]>>this.F2:0);
+ var d1 = this.FV/yt, d2 = (1<= 0) {
+ r.data[r.t++] = 1;
+ r.subTo(t,r);
+ }
+ BigInteger.ONE.dlShiftTo(ys,t);
+ t.subTo(y,y); // "negative" y so we can replace sub with am later
+ while(y.t < ys) y.data[y.t++] = 0;
+ while(--j >= 0) {
+ // Estimate quotient digit
+ var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);
+ if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
+ y.dlShiftTo(j,t);
+ r.subTo(t,r);
+ while(r.data[i] < --qd) r.subTo(t,r);
+ }
+ }
+ if(q != null) {
+ r.drShiftTo(ys,q);
+ if(ts != ms) BigInteger.ZERO.subTo(q,q);
+ }
+ r.t = ys;
+ r.clamp();
+ if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
+ if(ts < 0) BigInteger.ZERO.subTo(r,r);
+}
+
+// (public) this mod a
+function bnMod(a) {
+ var r = nbi();
+ this.abs().divRemTo(a,null,r);
+ if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
+ return r;
+}
+
+// Modular reduction using "classic" algorithm
+function Classic(m) { this.m = m; }
+function cConvert(x) {
+ if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
+ else return x;
+}
+function cRevert(x) { return x; }
+function cReduce(x) { x.divRemTo(this.m,null,x); }
+function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+Classic.prototype.convert = cConvert;
+Classic.prototype.revert = cRevert;
+Classic.prototype.reduce = cReduce;
+Classic.prototype.mulTo = cMulTo;
+Classic.prototype.sqrTo = cSqrTo;
+
+// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
+// justification:
+// xy == 1 (mod m)
+// xy = 1+km
+// xy(2-xy) = (1+km)(1-km)
+// x[y(2-xy)] = 1-k^2m^2
+// x[y(2-xy)] == 1 (mod m^2)
+// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
+// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
+// JS multiply "overflows" differently from C/C++, so care is needed here.
+function bnpInvDigit() {
+ if(this.t < 1) return 0;
+ var x = this.data[0];
+ if((x&1) == 0) return 0;
+ var y = x&3; // y == 1/x mod 2^2
+ y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
+ y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
+ y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
+ // last step - calculate inverse mod DV directly;
+ // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
+ y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits
+ // we really want the negative inverse, and -DV < y < DV
+ return (y>0)?this.DV-y:-y;
+}
+
+// Montgomery reduction
+function Montgomery(m) {
+ this.m = m;
+ this.mp = m.invDigit();
+ this.mpl = this.mp&0x7fff;
+ this.mph = this.mp>>15;
+ this.um = (1<<(m.DB-15))-1;
+ this.mt2 = 2*m.t;
+}
+
+// xR mod m
+function montConvert(x) {
+ var r = nbi();
+ x.abs().dlShiftTo(this.m.t,r);
+ r.divRemTo(this.m,null,r);
+ if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
+ return r;
+}
+
+// x/R mod m
+function montRevert(x) {
+ var r = nbi();
+ x.copyTo(r);
+ this.reduce(r);
+ return r;
+}
+
+// x = x/R mod m (HAC 14.32)
+function montReduce(x) {
+ while(x.t <= this.mt2) // pad x so am has enough room later
+ x.data[x.t++] = 0;
+ for(var i = 0; i < this.m.t; ++i) {
+ // faster way of calculating u0 = x.data[i]*mp mod DV
+ var j = x.data[i]&0x7fff;
+ var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
+ // use am to combine the multiply-shift-add into one call
+ j = i+this.m.t;
+ x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);
+ // propagate carry
+ while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }
+ }
+ x.clamp();
+ x.drShiftTo(this.m.t,x);
+ if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
+}
+
+// r = "x^2/R mod m"; x != r
+function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+// r = "xy/R mod m"; x,y != r
+function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+
+Montgomery.prototype.convert = montConvert;
+Montgomery.prototype.revert = montRevert;
+Montgomery.prototype.reduce = montReduce;
+Montgomery.prototype.mulTo = montMulTo;
+Montgomery.prototype.sqrTo = montSqrTo;
+
+// (protected) true iff this is even
+function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; }
+
+// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
+function bnpExp(e,z) {
+ if(e > 0xffffffff || e < 1) return BigInteger.ONE;
+ var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
+ g.copyTo(r);
+ while(--i >= 0) {
+ z.sqrTo(r,r2);
+ if((e&(1< 0) z.mulTo(r2,g,r);
+ else { var t = r; r = r2; r2 = t; }
+ }
+ return z.revert(r);
+}
+
+// (public) this^e % m, 0 <= e < 2^32
+function bnModPowInt(e,m) {
+ var z;
+ if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
+ return this.exp(e,z);
+}
+
+// protected
+BigInteger.prototype.copyTo = bnpCopyTo;
+BigInteger.prototype.fromInt = bnpFromInt;
+BigInteger.prototype.fromString = bnpFromString;
+BigInteger.prototype.clamp = bnpClamp;
+BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
+BigInteger.prototype.drShiftTo = bnpDRShiftTo;
+BigInteger.prototype.lShiftTo = bnpLShiftTo;
+BigInteger.prototype.rShiftTo = bnpRShiftTo;
+BigInteger.prototype.subTo = bnpSubTo;
+BigInteger.prototype.multiplyTo = bnpMultiplyTo;
+BigInteger.prototype.squareTo = bnpSquareTo;
+BigInteger.prototype.divRemTo = bnpDivRemTo;
+BigInteger.prototype.invDigit = bnpInvDigit;
+BigInteger.prototype.isEven = bnpIsEven;
+BigInteger.prototype.exp = bnpExp;
+
+// public
+BigInteger.prototype.toString = bnToString;
+BigInteger.prototype.negate = bnNegate;
+BigInteger.prototype.abs = bnAbs;
+BigInteger.prototype.compareTo = bnCompareTo;
+BigInteger.prototype.bitLength = bnBitLength;
+BigInteger.prototype.mod = bnMod;
+BigInteger.prototype.modPowInt = bnModPowInt;
+
+// "constants"
+BigInteger.ZERO = nbv(0);
+BigInteger.ONE = nbv(1);
+
+// jsbn2 lib
+
+//Copyright (c) 2005-2009 Tom Wu
+//All Rights Reserved.
+//See "LICENSE" for details (See jsbn.js for LICENSE).
+
+//Extended JavaScript BN functions, required for RSA private ops.
+
+//Version 1.1: new BigInteger("0", 10) returns "proper" zero
+
+//(public)
+function bnClone() { var r = nbi(); this.copyTo(r); return r; }
+
+//(public) return value as integer
+function bnIntValue() {
+if(this.s < 0) {
+ if(this.t == 1) return this.data[0]-this.DV;
+ else if(this.t == 0) return -1;
+} else if(this.t == 1) return this.data[0];
+else if(this.t == 0) return 0;
+// assumes 16 < DB < 32
+return ((this.data[1]&((1<<(32-this.DB))-1))<>24; }
+
+//(public) return value as short (assumes DB>=16)
+function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }
+
+//(protected) return x s.t. r^x < DV
+function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }
+
+//(public) 0 if this == 0, 1 if this > 0
+function bnSigNum() {
+if(this.s < 0) return -1;
+else if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;
+else return 1;
+}
+
+//(protected) convert to radix string
+function bnpToRadix(b) {
+if(b == null) b = 10;
+if(this.signum() == 0 || b < 2 || b > 36) return "0";
+var cs = this.chunkSize(b);
+var a = Math.pow(b,cs);
+var d = nbv(a), y = nbi(), z = nbi(), r = "";
+this.divRemTo(d,y,z);
+while(y.signum() > 0) {
+ r = (a+z.intValue()).toString(b).substr(1) + r;
+ y.divRemTo(d,y,z);
+}
+return z.intValue().toString(b) + r;
+}
+
+//(protected) convert from radix string
+function bnpFromRadix(s,b) {
+this.fromInt(0);
+if(b == null) b = 10;
+var cs = this.chunkSize(b);
+var d = Math.pow(b,cs), mi = false, j = 0, w = 0;
+for(var i = 0; i < s.length; ++i) {
+ var x = intAt(s,i);
+ if(x < 0) {
+ if(s.charAt(i) == "-" && this.signum() == 0) mi = true;
+ continue;
+ }
+ w = b*w+x;
+ if(++j >= cs) {
+ this.dMultiply(d);
+ this.dAddOffset(w,0);
+ j = 0;
+ w = 0;
+ }
+}
+if(j > 0) {
+ this.dMultiply(Math.pow(b,j));
+ this.dAddOffset(w,0);
+}
+if(mi) BigInteger.ZERO.subTo(this,this);
+}
+
+//(protected) alternate constructor
+function bnpFromNumber(a,b,c) {
+if("number" == typeof b) {
+ // new BigInteger(int,int,RNG)
+ if(a < 2) this.fromInt(1);
+ else {
+ this.fromNumber(a,c);
+ if(!this.testBit(a-1)) // force MSB set
+ this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
+ if(this.isEven()) this.dAddOffset(1,0); // force odd
+ while(!this.isProbablePrime(b)) {
+ this.dAddOffset(2,0);
+ if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);
+ }
+ }
+} else {
+ // new BigInteger(int,RNG)
+ var x = new Array(), t = a&7;
+ x.length = (a>>3)+1;
+ b.nextBytes(x);
+ if(t > 0) x[0] &= ((1< 0) {
+ if(p < this.DB && (d = this.data[i]>>p) != (this.s&this.DM)>>p)
+ r[k++] = d|(this.s<<(this.DB-p));
+ while(i >= 0) {
+ if(p < 8) {
+ d = (this.data[i]&((1<>(p+=this.DB-8);
+ } else {
+ d = (this.data[i]>>(p-=8))&0xff;
+ if(p <= 0) { p += this.DB; --i; }
+ }
+ if((d&0x80) != 0) d |= -256;
+ if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;
+ if(k > 0 || d != this.s) r[k++] = d;
+ }
+}
+return r;
+}
+
+function bnEquals(a) { return(this.compareTo(a)==0); }
+function bnMin(a) { return(this.compareTo(a)<0)?this:a; }
+function bnMax(a) { return(this.compareTo(a)>0)?this:a; }
+
+//(protected) r = this op a (bitwise)
+function bnpBitwiseTo(a,op,r) {
+var i, f, m = Math.min(a.t,this.t);
+for(i = 0; i < m; ++i) r.data[i] = op(this.data[i],a.data[i]);
+if(a.t < this.t) {
+ f = a.s&this.DM;
+ for(i = m; i < this.t; ++i) r.data[i] = op(this.data[i],f);
+ r.t = this.t;
+} else {
+ f = this.s&this.DM;
+ for(i = m; i < a.t; ++i) r.data[i] = op(f,a.data[i]);
+ r.t = a.t;
+}
+r.s = op(this.s,a.s);
+r.clamp();
+}
+
+//(public) this & a
+function op_and(x,y) { return x&y; }
+function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }
+
+//(public) this | a
+function op_or(x,y) { return x|y; }
+function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }
+
+//(public) this ^ a
+function op_xor(x,y) { return x^y; }
+function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }
+
+//(public) this & ~a
+function op_andnot(x,y) { return x&~y; }
+function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }
+
+//(public) ~this
+function bnNot() {
+var r = nbi();
+for(var i = 0; i < this.t; ++i) r.data[i] = this.DM&~this.data[i];
+r.t = this.t;
+r.s = ~this.s;
+return r;
+}
+
+//(public) this << n
+function bnShiftLeft(n) {
+var r = nbi();
+if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);
+return r;
+}
+
+//(public) this >> n
+function bnShiftRight(n) {
+var r = nbi();
+if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);
+return r;
+}
+
+//return index of lowest 1-bit in x, x < 2^31
+function lbit(x) {
+if(x == 0) return -1;
+var r = 0;
+if((x&0xffff) == 0) { x >>= 16; r += 16; }
+if((x&0xff) == 0) { x >>= 8; r += 8; }
+if((x&0xf) == 0) { x >>= 4; r += 4; }
+if((x&3) == 0) { x >>= 2; r += 2; }
+if((x&1) == 0) ++r;
+return r;
+}
+
+//(public) returns index of lowest 1-bit (or -1 if none)
+function bnGetLowestSetBit() {
+for(var i = 0; i < this.t; ++i)
+ if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);
+if(this.s < 0) return this.t*this.DB;
+return -1;
+}
+
+//return number of 1 bits in x
+function cbit(x) {
+var r = 0;
+while(x != 0) { x &= x-1; ++r; }
+return r;
+}
+
+//(public) return number of set bits
+function bnBitCount() {
+var r = 0, x = this.s&this.DM;
+for(var i = 0; i < this.t; ++i) r += cbit(this.data[i]^x);
+return r;
+}
+
+//(public) true iff nth bit is set
+function bnTestBit(n) {
+var j = Math.floor(n/this.DB);
+if(j >= this.t) return(this.s!=0);
+return((this.data[j]&(1<<(n%this.DB)))!=0);
+}
+
+//(protected) this op (1<>= this.DB;
+}
+if(a.t < this.t) {
+ c += a.s;
+ while(i < this.t) {
+ c += this.data[i];
+ r.data[i++] = c&this.DM;
+ c >>= this.DB;
+ }
+ c += this.s;
+} else {
+ c += this.s;
+ while(i < a.t) {
+ c += a.data[i];
+ r.data[i++] = c&this.DM;
+ c >>= this.DB;
+ }
+ c += a.s;
+}
+r.s = (c<0)?-1:0;
+if(c > 0) r.data[i++] = c;
+else if(c < -1) r.data[i++] = this.DV+c;
+r.t = i;
+r.clamp();
+}
+
+//(public) this + a
+function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }
+
+//(public) this - a
+function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }
+
+//(public) this * a
+function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }
+
+//(public) this / a
+function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }
+
+//(public) this % a
+function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }
+
+//(public) [this/a,this%a]
+function bnDivideAndRemainder(a) {
+var q = nbi(), r = nbi();
+this.divRemTo(a,q,r);
+return new Array(q,r);
+}
+
+//(protected) this *= n, this >= 0, 1 < n < DV
+function bnpDMultiply(n) {
+this.data[this.t] = this.am(0,n-1,this,0,0,this.t);
+++this.t;
+this.clamp();
+}
+
+//(protected) this += n << w words, this >= 0
+function bnpDAddOffset(n,w) {
+if(n == 0) return;
+while(this.t <= w) this.data[this.t++] = 0;
+this.data[w] += n;
+while(this.data[w] >= this.DV) {
+ this.data[w] -= this.DV;
+ if(++w >= this.t) this.data[this.t++] = 0;
+ ++this.data[w];
+}
+}
+
+//A "null" reducer
+function NullExp() {}
+function nNop(x) { return x; }
+function nMulTo(x,y,r) { x.multiplyTo(y,r); }
+function nSqrTo(x,r) { x.squareTo(r); }
+
+NullExp.prototype.convert = nNop;
+NullExp.prototype.revert = nNop;
+NullExp.prototype.mulTo = nMulTo;
+NullExp.prototype.sqrTo = nSqrTo;
+
+//(public) this^e
+function bnPow(e) { return this.exp(e,new NullExp()); }
+
+//(protected) r = lower n words of "this * a", a.t <= n
+//"this" should be the larger one if appropriate.
+function bnpMultiplyLowerTo(a,n,r) {
+var i = Math.min(this.t+a.t,n);
+r.s = 0; // assumes a,this >= 0
+r.t = i;
+while(i > 0) r.data[--i] = 0;
+var j;
+for(j = r.t-this.t; i < j; ++i) r.data[i+this.t] = this.am(0,a.data[i],r,i,0,this.t);
+for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a.data[i],r,i,0,n-i);
+r.clamp();
+}
+
+//(protected) r = "this * a" without lower n words, n > 0
+//"this" should be the larger one if appropriate.
+function bnpMultiplyUpperTo(a,n,r) {
+--n;
+var i = r.t = this.t+a.t-n;
+r.s = 0; // assumes a,this >= 0
+while(--i >= 0) r.data[i] = 0;
+for(i = Math.max(n-this.t,0); i < a.t; ++i)
+ r.data[this.t+i-n] = this.am(n-i,a.data[i],r,0,0,this.t+i-n);
+r.clamp();
+r.drShiftTo(1,r);
+}
+
+//Barrett modular reduction
+function Barrett(m) {
+// setup Barrett
+this.r2 = nbi();
+this.q3 = nbi();
+BigInteger.ONE.dlShiftTo(2*m.t,this.r2);
+this.mu = this.r2.divide(m);
+this.m = m;
+}
+
+function barrettConvert(x) {
+if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);
+else if(x.compareTo(this.m) < 0) return x;
+else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }
+}
+
+function barrettRevert(x) { return x; }
+
+//x = x mod m (HAC 14.42)
+function barrettReduce(x) {
+x.drShiftTo(this.m.t-1,this.r2);
+if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }
+this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);
+this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);
+while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);
+x.subTo(this.r2,x);
+while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
+}
+
+//r = x^2 mod m; x != r
+function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+//r = x*y mod m; x,y != r
+function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+
+Barrett.prototype.convert = barrettConvert;
+Barrett.prototype.revert = barrettRevert;
+Barrett.prototype.reduce = barrettReduce;
+Barrett.prototype.mulTo = barrettMulTo;
+Barrett.prototype.sqrTo = barrettSqrTo;
+
+//(public) this^e % m (HAC 14.85)
+function bnModPow(e,m) {
+var i = e.bitLength(), k, r = nbv(1), z;
+if(i <= 0) return r;
+else if(i < 18) k = 1;
+else if(i < 48) k = 3;
+else if(i < 144) k = 4;
+else if(i < 768) k = 5;
+else k = 6;
+if(i < 8)
+ z = new Classic(m);
+else if(m.isEven())
+ z = new Barrett(m);
+else
+ z = new Montgomery(m);
+
+// precomputation
+var g = new Array(), n = 3, k1 = k-1, km = (1< 1) {
+ var g2 = nbi();
+ z.sqrTo(g[1],g2);
+ while(n <= km) {
+ g[n] = nbi();
+ z.mulTo(g2,g[n-2],g[n]);
+ n += 2;
+ }
+}
+
+var j = e.t-1, w, is1 = true, r2 = nbi(), t;
+i = nbits(e.data[j])-1;
+while(j >= 0) {
+ if(i >= k1) w = (e.data[j]>>(i-k1))&km;
+ else {
+ w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);
+ if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);
+ }
+
+ n = k;
+ while((w&1) == 0) { w >>= 1; --n; }
+ if((i -= n) < 0) { i += this.DB; --j; }
+ if(is1) { // ret == 1, don't bother squaring or multiplying it
+ g[w].copyTo(r);
+ is1 = false;
+ } else {
+ while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }
+ if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }
+ z.mulTo(r2,g[w],r);
+ }
+
+ while(j >= 0 && (e.data[j]&(1< 0) {
+ x.rShiftTo(g,x);
+ y.rShiftTo(g,y);
+}
+while(x.signum() > 0) {
+ if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);
+ if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);
+ if(x.compareTo(y) >= 0) {
+ x.subTo(y,x);
+ x.rShiftTo(1,x);
+ } else {
+ y.subTo(x,y);
+ y.rShiftTo(1,y);
+ }
+}
+if(g > 0) y.lShiftTo(g,y);
+return y;
+}
+
+//(protected) this % n, n < 2^26
+function bnpModInt(n) {
+if(n <= 0) return 0;
+var d = this.DV%n, r = (this.s<0)?n-1:0;
+if(this.t > 0)
+ if(d == 0) r = this.data[0]%n;
+ else for(var i = this.t-1; i >= 0; --i) r = (d*r+this.data[i])%n;
+return r;
+}
+
+//(public) 1/this % m (HAC 14.61)
+function bnModInverse(m) {
+var ac = m.isEven();
+if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
+var u = m.clone(), v = this.clone();
+var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
+while(u.signum() != 0) {
+ while(u.isEven()) {
+ u.rShiftTo(1,u);
+ if(ac) {
+ if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
+ a.rShiftTo(1,a);
+ } else if(!b.isEven()) b.subTo(m,b);
+ b.rShiftTo(1,b);
+ }
+ while(v.isEven()) {
+ v.rShiftTo(1,v);
+ if(ac) {
+ if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
+ c.rShiftTo(1,c);
+ } else if(!d.isEven()) d.subTo(m,d);
+ d.rShiftTo(1,d);
+ }
+ if(u.compareTo(v) >= 0) {
+ u.subTo(v,u);
+ if(ac) a.subTo(c,a);
+ b.subTo(d,b);
+ } else {
+ v.subTo(u,v);
+ if(ac) c.subTo(a,c);
+ d.subTo(b,d);
+ }
+}
+if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
+if(d.compareTo(m) >= 0) return d.subtract(m);
+if(d.signum() < 0) d.addTo(m,d); else return d;
+if(d.signum() < 0) return d.add(m); else return d;
+}
+
+var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509];
+var lplim = (1<<26)/lowprimes[lowprimes.length-1];
+
+//(public) test primality with certainty >= 1-.5^t
+function bnIsProbablePrime(t) {
+var i, x = this.abs();
+if(x.t == 1 && x.data[0] <= lowprimes[lowprimes.length-1]) {
+ for(i = 0; i < lowprimes.length; ++i)
+ if(x.data[0] == lowprimes[i]) return true;
+ return false;
+}
+if(x.isEven()) return false;
+i = 1;
+while(i < lowprimes.length) {
+ var m = lowprimes[i], j = i+1;
+ while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];
+ m = x.modInt(m);
+ while(i < j) if(m%lowprimes[i++] == 0) return false;
+}
+return x.millerRabin(t);
+}
+
+//(protected) true if probably prime (HAC 4.24, Miller-Rabin)
+function bnpMillerRabin(t) {
+var n1 = this.subtract(BigInteger.ONE);
+var k = n1.getLowestSetBit();
+if(k <= 0) return false;
+var r = n1.shiftRight(k);
+var prng = bnGetPrng();
+var a;
+for(var i = 0; i < t; ++i) {
+ // select witness 'a' at random from between 1 and n1
+ do {
+ a = new BigInteger(this.bitLength(), prng);
+ }
+ while(a.compareTo(BigInteger.ONE) <= 0 || a.compareTo(n1) >= 0);
+ var y = a.modPow(r,this);
+ if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
+ var j = 1;
+ while(j++ < k && y.compareTo(n1) != 0) {
+ y = y.modPowInt(2,this);
+ if(y.compareTo(BigInteger.ONE) == 0) return false;
+ }
+ if(y.compareTo(n1) != 0) return false;
+ }
+}
+return true;
+}
+
+// get pseudo random number generator
+function bnGetPrng() {
+ // create prng with api that matches BigInteger secure random
+ return {
+ // x is an array to fill with bytes
+ nextBytes: function(x) {
+ for(var i = 0; i < x.length; ++i) {
+ x[i] = Math.floor(Math.random() * 0x0100);
+ }
+ }
+ };
+}
+
+//protected
+BigInteger.prototype.chunkSize = bnpChunkSize;
+BigInteger.prototype.toRadix = bnpToRadix;
+BigInteger.prototype.fromRadix = bnpFromRadix;
+BigInteger.prototype.fromNumber = bnpFromNumber;
+BigInteger.prototype.bitwiseTo = bnpBitwiseTo;
+BigInteger.prototype.changeBit = bnpChangeBit;
+BigInteger.prototype.addTo = bnpAddTo;
+BigInteger.prototype.dMultiply = bnpDMultiply;
+BigInteger.prototype.dAddOffset = bnpDAddOffset;
+BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;
+BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;
+BigInteger.prototype.modInt = bnpModInt;
+BigInteger.prototype.millerRabin = bnpMillerRabin;
+
+//public
+BigInteger.prototype.clone = bnClone;
+BigInteger.prototype.intValue = bnIntValue;
+BigInteger.prototype.byteValue = bnByteValue;
+BigInteger.prototype.shortValue = bnShortValue;
+BigInteger.prototype.signum = bnSigNum;
+BigInteger.prototype.toByteArray = bnToByteArray;
+BigInteger.prototype.equals = bnEquals;
+BigInteger.prototype.min = bnMin;
+BigInteger.prototype.max = bnMax;
+BigInteger.prototype.and = bnAnd;
+BigInteger.prototype.or = bnOr;
+BigInteger.prototype.xor = bnXor;
+BigInteger.prototype.andNot = bnAndNot;
+BigInteger.prototype.not = bnNot;
+BigInteger.prototype.shiftLeft = bnShiftLeft;
+BigInteger.prototype.shiftRight = bnShiftRight;
+BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;
+BigInteger.prototype.bitCount = bnBitCount;
+BigInteger.prototype.testBit = bnTestBit;
+BigInteger.prototype.setBit = bnSetBit;
+BigInteger.prototype.clearBit = bnClearBit;
+BigInteger.prototype.flipBit = bnFlipBit;
+BigInteger.prototype.add = bnAdd;
+BigInteger.prototype.subtract = bnSubtract;
+BigInteger.prototype.multiply = bnMultiply;
+BigInteger.prototype.divide = bnDivide;
+BigInteger.prototype.remainder = bnRemainder;
+BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;
+BigInteger.prototype.modPow = bnModPow;
+BigInteger.prototype.modInverse = bnModInverse;
+BigInteger.prototype.pow = bnPow;
+BigInteger.prototype.gcd = bnGCD;
+BigInteger.prototype.isProbablePrime = bnIsProbablePrime;
+
+//BigInteger interfaces not implemented in jsbn:
+
+//BigInteger(int signum, byte[] magnitude)
+//double doubleValue()
+//float floatValue()
+//int hashCode()
+//long longValue()
+//static BigInteger valueOf(long val)
+
+
+/***/ }),
+/* 122 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+var Buffer = __webpack_require__(13).Buffer
+var optimized = __webpack_require__(782)
+
+function BN () {
+ this.negative = 0
+ this.words = null
+ this.length = 0
+}
+
+BN.fromNumber = function (n) {
+ var bn = new BN()
+ bn.words = [n & 0x03ffffff]
+ bn.length = 1
+ return bn
+}
+
+BN.fromBuffer = function (b32) {
+ var bn = new BN()
+
+ bn.words = new Array(10)
+ bn.words[0] = (b32[28] & 0x03) << 24 | b32[29] << 16 | b32[30] << 8 | b32[31]
+ bn.words[1] = (b32[25] & 0x0F) << 22 | b32[26] << 14 | b32[27] << 6 | b32[28] >>> 2
+ bn.words[2] = (b32[22] & 0x3F) << 20 | b32[23] << 12 | b32[24] << 4 | b32[25] >>> 4
+ bn.words[3] = (b32[19] & 0xFF) << 18 | b32[20] << 10 | b32[21] << 2 | b32[22] >>> 6
+
+ bn.words[4] = (b32[15] & 0x03) << 24 | b32[16] << 16 | b32[17] << 8 | b32[18]
+ bn.words[5] = (b32[12] & 0x0F) << 22 | b32[13] << 14 | b32[14] << 6 | b32[15] >>> 2
+ bn.words[6] = (b32[9] & 0x3F) << 20 | b32[10] << 12 | b32[11] << 4 | b32[12] >>> 4
+ bn.words[7] = (b32[6] & 0xFF) << 18 | b32[7] << 10 | b32[8] << 2 | b32[9] >>> 6
+
+ bn.words[8] = (b32[2] & 0x03) << 24 | b32[3] << 16 | b32[4] << 8 | b32[5]
+ bn.words[9] = b32[0] << 14 | b32[1] << 6 | b32[2] >>> 2
+
+ bn.length = 10
+ return bn.strip()
+}
+
+BN.prototype.toBuffer = function () {
+ var w = this.words
+ for (var i = this.length; i < 10; ++i) w[i] = 0
+
+ return Buffer.from([
+ (w[9] >>> 14) & 0xFF, (w[9] >>> 6) & 0xFF, (w[9] & 0x3F) << 2 | ((w[8] >>> 24) & 0x03), // 0, 1, 2
+ (w[8] >>> 16) & 0xFF, (w[8] >>> 8) & 0xFF, w[8] & 0xFF, // 3, 4, 5
+
+ (w[7] >>> 18) & 0xFF, (w[7] >>> 10) & 0xFF, (w[7] >>> 2) & 0xFF, // 6, 7, 8
+ ((w[7] & 0x03) << 6) | ((w[6] >>> 20) & 0x3F), (w[6] >>> 12) & 0xFF, (w[6] >>> 4) & 0xFF, // 9, 10, 11
+ ((w[6] & 0x0F) << 4) | ((w[5] >>> 22) & 0x0F), (w[5] >>> 14) & 0xFF, (w[5] >>> 6) & 0xFF, // 12, 13, 14
+ ((w[5] & 0x3F) << 2) | ((w[4] >>> 24) & 0x03), (w[4] >>> 16) & 0xFF, (w[4] >>> 8) & 0xFF, w[4] & 0xFF, // 15, 16, 17, 18
+
+ (w[3] >>> 18) & 0xFF, (w[3] >>> 10) & 0xFF, (w[3] >>> 2) & 0xFF, // 19, 20, 21
+ ((w[3] & 0x03) << 6) | ((w[2] >>> 20) & 0x3F), (w[2] >>> 12) & 0xFF, (w[2] >>> 4) & 0xFF, // 22, 23, 24
+ ((w[2] & 0x0F) << 4) | ((w[1] >>> 22) & 0x0F), (w[1] >>> 14) & 0xFF, (w[1] >>> 6) & 0xFF, // 25, 26, 27
+ ((w[1] & 0x3F) << 2) | ((w[0] >>> 24) & 0x03), (w[0] >>> 16) & 0xFF, (w[0] >>> 8) & 0xFF, w[0] & 0xFF // 28, 29, 30, 31
+ ])
+}
+
+BN.prototype.clone = function () {
+ var r = new BN()
+ r.words = new Array(this.length)
+ for (var i = 0; i < this.length; i++) r.words[i] = this.words[i]
+ r.length = this.length
+ r.negative = this.negative
+ return r
+}
+
+BN.prototype.strip = function () {
+ while (this.length > 1 && (this.words[this.length - 1] | 0) === 0) this.length--
+ return this
+}
+
+BN.prototype.normSign = function () {
+ // -0 = 0
+ if (this.length === 1 && this.words[0] === 0) this.negative = 0
+ return this
+}
+
+BN.prototype.isEven = function () {
+ return (this.words[0] & 1) === 0
+}
+
+BN.prototype.isOdd = function () {
+ return (this.words[0] & 1) === 1
+}
+
+BN.prototype.isZero = function () {
+ return this.length === 1 && this.words[0] === 0
+}
+
+BN.prototype.ucmp = function (num) {
+ if (this.length !== num.length) return this.length > num.length ? 1 : -1
+
+ for (var i = this.length - 1; i >= 0; --i) {
+ if (this.words[i] !== num.words[i]) return this.words[i] > num.words[i] ? 1 : -1
+ }
+
+ return 0
+}
+
+BN.prototype.gtOne = function () {
+ return this.length > 1 || this.words[0] > 1
+}
+
+BN.prototype.isOverflow = function () {
+ return this.ucmp(BN.n) >= 0
+}
+
+BN.prototype.isHigh = function () {
+ return this.ucmp(BN.nh) === 1
+}
+
+BN.prototype.bitLengthGT256 = function () {
+ return this.length > 10 || (this.length === 10 && this.words[9] > 0x003fffff)
+}
+
+BN.prototype.iuaddn = function (num) {
+ this.words[0] += num
+
+ for (var i = 0; this.words[i] > 0x03ffffff && i < this.length; ++i) {
+ this.words[i] -= 0x04000000
+ this.words[i + 1] += 1
+ }
+
+ if (i === this.length) {
+ this.words[i] = 1
+ this.length += 1
+ }
+
+ return this
+}
+
+BN.prototype.iadd = function (num) {
+ // (-this) + num -> -(this - num)
+ // this + (-num) -> this - num
+ if (this.negative !== num.negative) {
+ if (this.negative !== 0) {
+ this.negative = 0
+ this.isub(num)
+ this.negative ^= 1
+ } else {
+ num.negative = 0
+ this.isub(num)
+ num.negative = 1
+ }
+
+ return this.normSign()
+ }
+
+ // a.length > b.length
+ var a
+ var b
+ if (this.length > num.length) {
+ a = this
+ b = num
+ } else {
+ a = num
+ b = this
+ }
+
+ for (var i = 0, carry = 0; i < b.length; ++i) {
+ var word = a.words[i] + b.words[i] + carry
+ this.words[i] = word & 0x03ffffff
+ carry = word >>> 26
+ }
+
+ for (; carry !== 0 && i < a.length; ++i) {
+ word = a.words[i] + carry
+ this.words[i] = word & 0x03ffffff
+ carry = word >>> 26
+ }
+
+ this.length = a.length
+ if (carry !== 0) {
+ this.words[this.length++] = carry
+ } else if (a !== this) {
+ for (; i < a.length; ++i) {
+ this.words[i] = a.words[i]
+ }
+ }
+
+ return this
+}
+
+BN.prototype.add = function (num) {
+ return this.clone().iadd(num)
+}
+
+BN.prototype.isub = function (num) {
+ // (-this) - num -> -(this + num)
+ // this - (-num) -> this + num
+ if (this.negative !== num.negative) {
+ if (this.negative !== 0) {
+ this.negative = 0
+ this.iadd(num)
+ this.negative = 1
+ } else {
+ num.negative = 0
+ this.iadd(num)
+ num.negative = 1
+ }
+
+ return this.normSign()
+ }
+
+ var cmp = this.ucmp(num)
+ if (cmp === 0) {
+ this.negative = 0
+ this.words[0] = 0
+ this.length = 1
+ return this
+ }
+
+ // a > b
+ var a
+ var b
+ if (cmp > 0) {
+ a = this
+ b = num
+ } else {
+ a = num
+ b = this
+ }
+
+ for (var i = 0, carry = 0; i < b.length; ++i) {
+ var word = a.words[i] - b.words[i] + carry
+ carry = word >> 26
+ this.words[i] = word & 0x03ffffff
+ }
+
+ for (; carry !== 0 && i < a.length; ++i) {
+ word = a.words[i] + carry
+ carry = word >> 26
+ this.words[i] = word & 0x03ffffff
+ }
+
+ if (carry === 0 && i < a.length && a !== this) {
+ for (; i < a.length; ++i) this.words[i] = a.words[i]
+ }
+
+ this.length = Math.max(this.length, i)
+
+ if (a !== this) this.negative ^= 1
+
+ return this.strip().normSign()
+}
+
+BN.prototype.sub = function (num) {
+ return this.clone().isub(num)
+}
+
+BN.umulTo = function (num1, num2, out) {
+ out.length = num1.length + num2.length - 1
+
+ var a1 = num1.words[0]
+ var b1 = num2.words[0]
+ var r1 = a1 * b1
+
+ var carry = (r1 / 0x04000000) | 0
+ out.words[0] = r1 & 0x03ffffff
+
+ for (var k = 1, maxK = out.length; k < maxK; k++) {
+ var ncarry = carry >>> 26
+ var rword = carry & 0x03ffffff
+ for (var j = Math.max(0, k - num1.length + 1), maxJ = Math.min(k, num2.length - 1); j <= maxJ; j++) {
+ var i = k - j
+ var a = num1.words[i]
+ var b = num2.words[j]
+ var r = a * b + rword
+ ncarry += (r / 0x04000000) | 0
+ rword = r & 0x03ffffff
+ }
+ out.words[k] = rword
+ carry = ncarry
+ }
+
+ if (carry !== 0) out.words[out.length++] = carry
+
+ return out.strip()
+}
+
+BN.umulTo10x10 = Math.imul ? optimized.umulTo10x10 : BN.umulTo
+
+BN.umulnTo = function (num, k, out) {
+ if (k === 0) {
+ out.words = [0]
+ out.length = 1
+ return out
+ }
+
+ for (var i = 0, carry = 0; i < num.length; ++i) {
+ var r = num.words[i] * k + carry
+ out.words[i] = r & 0x03ffffff
+ carry = (r / 0x04000000) | 0
+ }
+
+ if (carry > 0) {
+ out.words[i] = carry
+ out.length = num.length + 1
+ } else {
+ out.length = num.length
+ }
+
+ return out
+}
+
+BN.prototype.umul = function (num) {
+ var out = new BN()
+ out.words = new Array(this.length + num.length)
+
+ if (this.length === 10 && num.length === 10) {
+ return BN.umulTo10x10(this, num, out)
+ } else if (this.length === 1) {
+ return BN.umulnTo(num, this.words[0], out)
+ } else if (num.length === 1) {
+ return BN.umulnTo(this, num.words[0], out)
+ } else {
+ return BN.umulTo(this, num, out)
+ }
+}
+
+BN.prototype.isplit = function (output) {
+ output.length = Math.min(this.length, 9)
+ for (var i = 0; i < output.length; ++i) output.words[i] = this.words[i]
+
+ if (this.length <= 9) {
+ this.words[0] = 0
+ this.length = 1
+ return this
+ }
+
+ // Shift by 9 limbs
+ var prev = this.words[9]
+ output.words[output.length++] = prev & 0x003fffff
+
+ for (i = 10; i < this.length; ++i) {
+ var word = this.words[i]
+ this.words[i - 10] = ((word & 0x003fffff) << 4) | (prev >>> 22)
+ prev = word
+ }
+ prev >>>= 22
+ this.words[i - 10] = prev
+
+ if (prev === 0 && this.length > 10) {
+ this.length -= 10
+ } else {
+ this.length -= 9
+ }
+
+ return this
+}
+
+BN.prototype.fireduce = function () {
+ if (this.isOverflow()) this.isub(BN.n)
+ return this
+}
+
+BN.prototype.ureduce = function () {
+ var num = this.clone().isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp)
+ if (num.bitLengthGT256()) {
+ num = num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp)
+ if (num.bitLengthGT256()) num = num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp)
+ }
+
+ return num.fireduce()
+}
+
+BN.prototype.ishrn = function (n) {
+ var mask = (1 << n) - 1
+ var m = 26 - n
+
+ for (var i = this.length - 1, carry = 0; i >= 0; --i) {
+ var word = this.words[i]
+ this.words[i] = (carry << m) | (word >>> n)
+ carry = word & mask
+ }
+
+ if (this.length > 1 && this.words[this.length - 1] === 0) this.length -= 1
+
+ return this
+}
+
+BN.prototype.uinvm = function () {
+ var x = this.clone()
+ var y = BN.n.clone()
+
+ // A * x + B * y = x
+ var A = BN.fromNumber(1)
+ var B = BN.fromNumber(0)
+
+ // C * x + D * y = y
+ var C = BN.fromNumber(0)
+ var D = BN.fromNumber(1)
+
+ while (x.isEven() && y.isEven()) {
+ for (var k = 1, m = 1; (x.words[0] & m) === 0 && (y.words[0] & m) === 0 && k < 26; ++k, m <<= 1);
+ x.ishrn(k)
+ y.ishrn(k)
+ }
+
+ var yp = y.clone()
+ var xp = x.clone()
+
+ while (!x.isZero()) {
+ for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
+ if (i > 0) {
+ x.ishrn(i)
+ while (i-- > 0) {
+ if (A.isOdd() || B.isOdd()) {
+ A.iadd(yp)
+ B.isub(xp)
+ }
+
+ A.ishrn(1)
+ B.ishrn(1)
+ }
+ }
+
+ for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
+ if (j > 0) {
+ y.ishrn(j)
+ while (j-- > 0) {
+ if (C.isOdd() || D.isOdd()) {
+ C.iadd(yp)
+ D.isub(xp)
+ }
+
+ C.ishrn(1)
+ D.ishrn(1)
+ }
+ }
+
+ if (x.ucmp(y) >= 0) {
+ x.isub(y)
+ A.isub(C)
+ B.isub(D)
+ } else {
+ y.isub(x)
+ C.isub(A)
+ D.isub(B)
+ }
+ }
+
+ if (C.negative === 1) {
+ C.negative = 0
+ var result = C.ureduce()
+ result.negative ^= 1
+ return result.normSign().iadd(BN.n)
+ } else {
+ return C.ureduce()
+ }
+}
+
+BN.prototype.imulK = function () {
+ this.words[this.length] = 0
+ this.words[this.length + 1] = 0
+ this.length += 2
+
+ for (var i = 0, lo = 0; i < this.length; ++i) {
+ var w = this.words[i] | 0
+ lo += w * 0x3d1
+ this.words[i] = lo & 0x03ffffff
+ lo = w * 0x40 + ((lo / 0x04000000) | 0)
+ }
+
+ if (this.words[this.length - 1] === 0) {
+ this.length -= 1
+ if (this.words[this.length - 1] === 0) this.length -= 1
+ }
+
+ return this
+}
+
+BN.prototype.redIReduce = function () {
+ this.isplit(BN.tmp).imulK().iadd(BN.tmp)
+ if (this.bitLengthGT256()) this.isplit(BN.tmp).imulK().iadd(BN.tmp)
+
+ var cmp = this.ucmp(BN.p)
+ if (cmp === 0) {
+ this.words[0] = 0
+ this.length = 1
+ } else if (cmp > 0) {
+ this.isub(BN.p)
+ } else {
+ this.strip()
+ }
+
+ return this
+}
+
+BN.prototype.redNeg = function () {
+ if (this.isZero()) return BN.fromNumber(0)
+
+ return BN.p.sub(this)
+}
+
+BN.prototype.redAdd = function (num) {
+ return this.clone().redIAdd(num)
+}
+
+BN.prototype.redIAdd = function (num) {
+ this.iadd(num)
+ if (this.ucmp(BN.p) >= 0) this.isub(BN.p)
+
+ return this
+}
+
+BN.prototype.redIAdd7 = function () {
+ this.iuaddn(7)
+ if (this.ucmp(BN.p) >= 0) this.isub(BN.p)
+
+ return this
+}
+
+BN.prototype.redSub = function (num) {
+ return this.clone().redISub(num)
+}
+
+BN.prototype.redISub = function (num) {
+ this.isub(num)
+ if (this.negative !== 0) this.iadd(BN.p)
+
+ return this
+}
+
+BN.prototype.redMul = function (num) {
+ return this.umul(num).redIReduce()
+}
+
+BN.prototype.redSqr = function () {
+ return this.umul(this).redIReduce()
+}
+
+BN.prototype.redSqrt = function () {
+ if (this.isZero()) return this.clone()
+
+ var wv2 = this.redSqr()
+ var wv4 = wv2.redSqr()
+ var wv12 = wv4.redSqr().redMul(wv4)
+ var wv14 = wv12.redMul(wv2)
+ var wv15 = wv14.redMul(this)
+
+ var out = wv15
+ for (var i = 0; i < 54; ++i) out = out.redSqr().redSqr().redSqr().redSqr().redMul(wv15)
+ out = out.redSqr().redSqr().redSqr().redSqr().redMul(wv14)
+ for (i = 0; i < 5; ++i) out = out.redSqr().redSqr().redSqr().redSqr().redMul(wv15)
+ out = out.redSqr().redSqr().redSqr().redSqr().redMul(wv12)
+ out = out.redSqr().redSqr().redSqr().redSqr().redSqr().redSqr().redMul(wv12)
+
+ if (out.redSqr().ucmp(this) === 0) {
+ return out
+ } else {
+ return null
+ }
+}
+
+BN.prototype.redInvm = function () {
+ var a = this.clone()
+ var b = BN.p.clone()
+
+ var x1 = BN.fromNumber(1)
+ var x2 = BN.fromNumber(0)
+
+ while (a.gtOne() && b.gtOne()) {
+ for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
+ if (i > 0) {
+ a.ishrn(i)
+ while (i-- > 0) {
+ if (x1.isOdd()) x1.iadd(BN.p)
+ x1.ishrn(1)
+ }
+ }
+
+ for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
+ if (j > 0) {
+ b.ishrn(j)
+ while (j-- > 0) {
+ if (x2.isOdd()) x2.iadd(BN.p)
+ x2.ishrn(1)
+ }
+ }
+
+ if (a.ucmp(b) >= 0) {
+ a.isub(b)
+ x1.isub(x2)
+ } else {
+ b.isub(a)
+ x2.isub(x1)
+ }
+ }
+
+ var res
+ if (a.length === 1 && a.words[0] === 1) {
+ res = x1
+ } else {
+ res = x2
+ }
+
+ if (res.negative !== 0) res.iadd(BN.p)
+
+ if (res.negative !== 0) {
+ res.negative = 0
+ return res.redIReduce().redNeg()
+ } else {
+ return res.redIReduce()
+ }
+}
+
+BN.prototype.getNAF = function (w) {
+ var naf = []
+ var ws = 1 << (w + 1)
+ var wsm1 = ws - 1
+ var ws2 = ws >> 1
+
+ var k = this.clone()
+ while (!k.isZero()) {
+ for (var i = 0, m = 1; (k.words[0] & m) === 0 && i < 26; ++i, m <<= 1) naf.push(0)
+
+ if (i !== 0) {
+ k.ishrn(i)
+ } else {
+ var mod = k.words[0] & wsm1
+ if (mod >= ws2) {
+ naf.push(ws2 - mod)
+ k.iuaddn(mod - ws2).ishrn(1)
+ } else {
+ naf.push(mod)
+ k.words[0] -= mod
+ if (!k.isZero()) {
+ for (i = w - 1; i > 0; --i) naf.push(0)
+ k.ishrn(w)
+ }
+ }
+ }
+ }
+
+ return naf
+}
+
+BN.prototype.inspect = function () {
+ if (this.isZero()) return '0'
+
+ var buffer = this.toBuffer().toString('hex')
+ for (var i = 0; buffer[i] === '0'; ++i);
+ return buffer.slice(i)
+}
+
+BN.n = BN.fromBuffer(Buffer.from('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141', 'hex'))
+BN.nh = BN.n.clone().ishrn(1)
+BN.nc = BN.fromBuffer(Buffer.from('000000000000000000000000000000014551231950B75FC4402DA1732FC9BEBF', 'hex'))
+BN.p = BN.fromBuffer(Buffer.from('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F', 'hex'))
+BN.psn = BN.p.sub(BN.n)
+BN.tmp = new BN()
+BN.tmp.words = new Array(10)
+
+// WTF?! it speed-up benchmark on ~20%
+;(function () {
+ var x = BN.fromNumber(1)
+ x.words[3] = 0
+})()
+
+module.exports = BN
+
+
+/***/ }),
+/* 123 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(process) {/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+
+
+var printWarning = function() {};
+
+if (process.env.NODE_ENV !== 'production') {
+ var ReactPropTypesSecret = __webpack_require__(124);
+ var loggedTypeFailures = {};
+
+ printWarning = function(text) {
+ var message = 'Warning: ' + text;
+ if (typeof console !== 'undefined') {
+ console.error(message);
+ }
+ try {
+ // --- Welcome to debugging React ---
+ // This error was thrown as a convenience so that you can use this stack
+ // to find the callsite that caused this warning to fire.
+ throw new Error(message);
+ } catch (x) {}
+ };
+}
+
+/**
+ * Assert that the values match with the type specs.
+ * Error messages are memorized and will only be shown once.
+ *
+ * @param {object} typeSpecs Map of name to a ReactPropType
+ * @param {object} values Runtime values that need to be type-checked
+ * @param {string} location e.g. "prop", "context", "child context"
+ * @param {string} componentName Name of the component for error messages.
+ * @param {?Function} getStack Returns the component stack.
+ * @private
+ */
+function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
+ if (process.env.NODE_ENV !== 'production') {
+ for (var typeSpecName in typeSpecs) {
+ if (typeSpecs.hasOwnProperty(typeSpecName)) {
+ var error;
+ // Prop type validation may throw. In case they do, we don't want to
+ // fail the render phase where it didn't fail before. So we log it.
+ // After these have been cleaned up, we'll let them throw.
+ try {
+ // This is intentionally an invariant that gets caught. It's the same
+ // behavior as without this statement except with a better message.
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
+ var err = Error(
+ (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
+ 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
+ );
+ err.name = 'Invariant Violation';
+ throw err;
+ }
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
+ } catch (ex) {
+ error = ex;
+ }
+ if (error && !(error instanceof Error)) {
+ printWarning(
+ (componentName || 'React class') + ': type specification of ' +
+ location + ' `' + typeSpecName + '` is invalid; the type checker ' +
+ 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
+ 'You may have forgotten to pass an argument to the type checker ' +
+ 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
+ 'shape all require an argument).'
+ )
+
+ }
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
+ // Only monitor this failure once because there tends to be a lot of the
+ // same error.
+ loggedTypeFailures[error.message] = true;
+
+ var stack = getStack ? getStack() : '';
+
+ printWarning(
+ 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
+ );
+ }
+ }
+ }
+ }
+}
+
+module.exports = checkPropTypes;
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
+
+/***/ }),
+/* 124 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+
+
+var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
+
+module.exports = ReactPropTypesSecret;
+
+
+/***/ }),
+/* 125 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// optional / simple context binding
+var aFunction = __webpack_require__(351);
+module.exports = function (fn, that, length) {
+ aFunction(fn);
+ if (that === undefined) return fn;
+ switch (length) {
+ case 1: return function (a) {
+ return fn.call(that, a);
+ };
+ case 2: return function (a, b) {
+ return fn.call(that, a, b);
+ };
+ case 3: return function (a, b, c) {
+ return fn.call(that, a, b, c);
+ };
+ }
+ return function (/* ...args */) {
+ return fn.apply(that, arguments);
+ };
+};
+
+
+/***/ }),
+/* 126 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// 7.1.1 ToPrimitive(input [, PreferredType])
+var isObject = __webpack_require__(55);
+// instead of the ES6 spec version, we didn't implement @@toPrimitive case
+// and the second argument - flag - preferred type is a string
+module.exports = function (it, S) {
+ if (!isObject(it)) return it;
+ var fn, val;
+ if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
+ if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
+ if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
+ throw TypeError("Can't convert object to primitive value");
+};
+
+
+/***/ }),
+/* 127 */
+/***/ (function(module, exports) {
+
+var toString = {}.toString;
+
+module.exports = function (it) {
+ return toString.call(it).slice(8, -1);
+};
+
+
+/***/ }),
+/* 128 */
+/***/ (function(module, exports) {
+
+// 7.2.1 RequireObjectCoercible(argument)
+module.exports = function (it) {
+ if (it == undefined) throw TypeError("Can't call method on " + it);
+ return it;
+};
+
+
+/***/ }),
+/* 129 */
+/***/ (function(module, exports) {
+
+// 7.1.4 ToInteger
+var ceil = Math.ceil;
+var floor = Math.floor;
+module.exports = function (it) {
+ return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
+};
+
+
+/***/ }),
+/* 130 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var shared = __webpack_require__(131)('keys');
+var uid = __webpack_require__(95);
+module.exports = function (key) {
+ return shared[key] || (shared[key] = uid(key));
+};
+
+
+/***/ }),
+/* 131 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var core = __webpack_require__(26);
+var global = __webpack_require__(38);
+var SHARED = '__core-js_shared__';
+var store = global[SHARED] || (global[SHARED] = {});
+
+(module.exports = function (key, value) {
+ return store[key] || (store[key] = value !== undefined ? value : {});
+})('versions', []).push({
+ version: core.version,
+ mode: __webpack_require__(94) ? 'pure' : 'global',
+ copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
+});
+
+
+/***/ }),
+/* 132 */
+/***/ (function(module, exports) {
+
+// IE 8- don't enum bug keys
+module.exports = (
+ 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
+).split(',');
+
+
+/***/ }),
+/* 133 */
+/***/ (function(module, exports) {
+
+exports.f = Object.getOwnPropertySymbols;
+
+
+/***/ }),
+/* 134 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// 7.1.13 ToObject(argument)
+var defined = __webpack_require__(128);
+module.exports = function (it) {
+ return Object(defined(it));
+};
+
+
+/***/ }),
+/* 135 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+
+var _iterator = __webpack_require__(355);
+
+var _iterator2 = _interopRequireDefault(_iterator);
+
+var _symbol = __webpack_require__(366);
+
+var _symbol2 = _interopRequireDefault(_symbol);
+
+var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
+ return typeof obj === "undefined" ? "undefined" : _typeof(obj);
+} : function (obj) {
+ return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
+};
+
+/***/ }),
+/* 136 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
+var anObject = __webpack_require__(54);
+var dPs = __webpack_require__(359);
+var enumBugKeys = __webpack_require__(132);
+var IE_PROTO = __webpack_require__(130)('IE_PROTO');
+var Empty = function () { /* empty */ };
+var PROTOTYPE = 'prototype';
+
+// Create object with fake `null` prototype: use iframe Object with cleared prototype
+var createDict = function () {
+ // Thrash, waste and sodomy: IE GC bug
+ var iframe = __webpack_require__(196)('iframe');
+ var i = enumBugKeys.length;
+ var lt = '<';
+ var gt = '>';
+ var iframeDocument;
+ iframe.style.display = 'none';
+ __webpack_require__(360).appendChild(iframe);
+ iframe.src = 'javascript:'; // eslint-disable-line no-script-url
+ // createDict = iframe.contentWindow.Object;
+ // html.removeChild(iframe);
+ iframeDocument = iframe.contentWindow.document;
+ iframeDocument.open();
+ iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
+ iframeDocument.close();
+ createDict = iframeDocument.F;
+ while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
+ return createDict();
+};
+
+module.exports = Object.create || function create(O, Properties) {
+ var result;
+ if (O !== null) {
+ Empty[PROTOTYPE] = anObject(O);
+ result = new Empty();
+ Empty[PROTOTYPE] = null;
+ // add "__proto__" for Object.getPrototypeOf polyfill
+ result[IE_PROTO] = O;
+ } else result = createDict();
+ return Properties === undefined ? result : dPs(result, Properties);
+};
+
+
+/***/ }),
+/* 137 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var def = __webpack_require__(42).f;
+var has = __webpack_require__(43);
+var TAG = __webpack_require__(32)('toStringTag');
+
+module.exports = function (it, tag, stat) {
+ if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
+};
+
+
+/***/ }),
+/* 138 */
+/***/ (function(module, exports, __webpack_require__) {
+
+exports.f = __webpack_require__(32);
+
+
+/***/ }),
+/* 139 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var global = __webpack_require__(38);
+var core = __webpack_require__(26);
+var LIBRARY = __webpack_require__(94);
+var wksExt = __webpack_require__(138);
+var defineProperty = __webpack_require__(42).f;
+module.exports = function (name) {
+ var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
+ if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
+};
+
+
+/***/ }),
+/* 140 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__);
+
+
+
+
+
+
+var propTypes = {
+ label: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string.isRequired,
+ onClick: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func
+};
+
+var defaultProps = {
+ label: 'Close'
+};
+
+var CloseButton = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(CloseButton, _React$Component);
+
+ function CloseButton() {
+ __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, CloseButton);
+
+ return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ CloseButton.prototype.render = function render() {
+ var _props = this.props,
+ label = _props.label,
+ onClick = _props.onClick;
+
+ return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
+ 'button',
+ { type: 'button', className: 'close', onClick: onClick },
+ __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
+ 'span',
+ { 'aria-hidden': 'true' },
+ '\xD7'
+ ),
+ __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
+ 'span',
+ { className: 'sr-only' },
+ label
+ )
+ );
+ };
+
+ return CloseButton;
+}(__WEBPACK_IMPORTED_MODULE_4_react___default.a.Component);
+
+CloseButton.propTypes = propTypes;
+CloseButton.defaultProps = defaultProps;
+
+/* harmony default export */ __webpack_exports__["a"] = (CloseButton);
+
+/***/ }),
+/* 141 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_all__ = __webpack_require__(98);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_all___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_all__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__Button__ = __webpack_require__(74);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils_bootstrapUtils__ = __webpack_require__(9);
+
+
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ vertical: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ justified: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+
+ /**
+ * Display block buttons; only useful when used with the "vertical" prop.
+ * @type {bool}
+ */
+ block: __WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_all___default()(__WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool, function (_ref) {
+ var block = _ref.block,
+ vertical = _ref.vertical;
+ return block && !vertical ? new Error('`block` requires `vertical` to be set to have any effect') : null;
+ })
+};
+
+var defaultProps = {
+ block: false,
+ justified: false,
+ vertical: false
+};
+
+var ButtonGroup = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(ButtonGroup, _React$Component);
+
+ function ButtonGroup() {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, ButtonGroup);
+
+ return __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ ButtonGroup.prototype.render = function render() {
+ var _extends2;
+
+ var _props = this.props,
+ block = _props.block,
+ justified = _props.justified,
+ vertical = _props.vertical,
+ className = _props.className,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['block', 'justified', 'vertical', 'className']);
+
+ var _splitBsProps = Object(__WEBPACK_IMPORTED_MODULE_10__utils_bootstrapUtils__["f" /* splitBsProps */])(props),
+ bsProps = _splitBsProps[0],
+ elementProps = _splitBsProps[1];
+
+ var classes = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, Object(__WEBPACK_IMPORTED_MODULE_10__utils_bootstrapUtils__["d" /* getClassSet */])(bsProps), (_extends2 = {}, _extends2[Object(__WEBPACK_IMPORTED_MODULE_10__utils_bootstrapUtils__["e" /* prefix */])(bsProps)] = !vertical, _extends2[Object(__WEBPACK_IMPORTED_MODULE_10__utils_bootstrapUtils__["e" /* prefix */])(bsProps, 'vertical')] = vertical, _extends2[Object(__WEBPACK_IMPORTED_MODULE_10__utils_bootstrapUtils__["e" /* prefix */])(bsProps, 'justified')] = justified, _extends2[Object(__WEBPACK_IMPORTED_MODULE_10__utils_bootstrapUtils__["e" /* prefix */])(__WEBPACK_IMPORTED_MODULE_9__Button__["a" /* default */].defaultProps, 'block')] = block, _extends2));
+
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div', __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, elementProps, { className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, classes) }));
+ };
+
+ return ButtonGroup;
+}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
+
+ButtonGroup.propTypes = propTypes;
+ButtonGroup.defaultProps = defaultProps;
+
+/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_10__utils_bootstrapUtils__["a" /* bsClass */])('btn-group', ButtonGroup));
+
+/***/ }),
+/* 142 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.animationEnd = exports.animationDelay = exports.animationTiming = exports.animationDuration = exports.animationName = exports.transitionEnd = exports.transitionDuration = exports.transitionDelay = exports.transitionTiming = exports.transitionProperty = exports.transform = undefined;
+
+var _inDOM = __webpack_require__(39);
+
+var _inDOM2 = _interopRequireDefault(_inDOM);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var transform = 'transform';
+var prefix = void 0,
+ transitionEnd = void 0,
+ animationEnd = void 0;
+var transitionProperty = void 0,
+ transitionDuration = void 0,
+ transitionTiming = void 0,
+ transitionDelay = void 0;
+var animationName = void 0,
+ animationDuration = void 0,
+ animationTiming = void 0,
+ animationDelay = void 0;
+
+if (_inDOM2.default) {
+ var _getTransitionPropert = getTransitionProperties();
+
+ prefix = _getTransitionPropert.prefix;
+ exports.transitionEnd = transitionEnd = _getTransitionPropert.transitionEnd;
+ exports.animationEnd = animationEnd = _getTransitionPropert.animationEnd;
+
+
+ exports.transform = transform = prefix + '-' + transform;
+ exports.transitionProperty = transitionProperty = prefix + '-transition-property';
+ exports.transitionDuration = transitionDuration = prefix + '-transition-duration';
+ exports.transitionDelay = transitionDelay = prefix + '-transition-delay';
+ exports.transitionTiming = transitionTiming = prefix + '-transition-timing-function';
+
+ exports.animationName = animationName = prefix + '-animation-name';
+ exports.animationDuration = animationDuration = prefix + '-animation-duration';
+ exports.animationTiming = animationTiming = prefix + '-animation-delay';
+ exports.animationDelay = animationDelay = prefix + '-animation-timing-function';
+}
+
+exports.transform = transform;
+exports.transitionProperty = transitionProperty;
+exports.transitionTiming = transitionTiming;
+exports.transitionDelay = transitionDelay;
+exports.transitionDuration = transitionDuration;
+exports.transitionEnd = transitionEnd;
+exports.animationName = animationName;
+exports.animationDuration = animationDuration;
+exports.animationTiming = animationTiming;
+exports.animationDelay = animationDelay;
+exports.animationEnd = animationEnd;
+exports.default = {
+ transform: transform,
+ end: transitionEnd,
+ property: transitionProperty,
+ timing: transitionTiming,
+ delay: transitionDelay,
+ duration: transitionDuration
+};
+
+
+function getTransitionProperties() {
+ var style = document.createElement('div').style;
+
+ var vendorMap = {
+ O: function O(e) {
+ return 'o' + e.toLowerCase();
+ },
+ Moz: function Moz(e) {
+ return e.toLowerCase();
+ },
+ Webkit: function Webkit(e) {
+ return 'webkit' + e;
+ },
+ ms: function ms(e) {
+ return 'MS' + e;
+ }
+ };
+
+ var vendors = Object.keys(vendorMap);
+
+ var transitionEnd = void 0,
+ animationEnd = void 0;
+ var prefix = '';
+
+ for (var i = 0; i < vendors.length; i++) {
+ var vendor = vendors[i];
+
+ if (vendor + 'TransitionProperty' in style) {
+ prefix = '-' + vendor.toLowerCase();
+ transitionEnd = vendorMap[vendor]('TransitionEnd');
+ animationEnd = vendorMap[vendor]('AnimationEnd');
+ break;
+ }
+ }
+
+ if (!transitionEnd && 'transitionProperty' in style) transitionEnd = 'transitionend';
+
+ if (!animationEnd && 'animationName' in style) animationEnd = 'animationend';
+
+ style = null;
+
+ return { animationEnd: animationEnd, transitionEnd: transitionEnd, prefix: prefix };
+}
+
+/***/ }),
+/* 143 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__ = __webpack_require__(9);
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ /**
+ * An icon name without "glyphicon-" prefix. See e.g. http://getbootstrap.com/components/#glyphicons
+ */
+ glyph: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string.isRequired
+};
+
+var Glyphicon = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(Glyphicon, _React$Component);
+
+ function Glyphicon() {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, Glyphicon);
+
+ return __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ Glyphicon.prototype.render = function render() {
+ var _extends2;
+
+ var _props = this.props,
+ glyph = _props.glyph,
+ className = _props.className,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['glyph', 'className']);
+
+ var _splitBsProps = Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["f" /* splitBsProps */])(props),
+ bsProps = _splitBsProps[0],
+ elementProps = _splitBsProps[1];
+
+ var classes = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["d" /* getClassSet */])(bsProps), (_extends2 = {}, _extends2[Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["e" /* prefix */])(bsProps, glyph)] = true, _extends2));
+
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span', __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, elementProps, { className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, classes) }));
+ };
+
+ return Glyphicon;
+}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
+
+Glyphicon.propTypes = propTypes;
+
+/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["a" /* bsClass */])('glyphicon', Glyphicon));
+
+/***/ }),
+/* 144 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_dom_helpers_style__ = __webpack_require__(75);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_dom_helpers_style___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_dom_helpers_style__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_react_transition_group_Transition__ = __webpack_require__(213);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_react_transition_group_Transition___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_react_transition_group_Transition__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils_capitalize__ = __webpack_require__(212);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__utils_createChainedFunction__ = __webpack_require__(19);
+
+
+
+
+
+
+var _collapseStyles;
+
+
+
+
+
+
+
+
+
+
+var MARGINS = {
+ height: ['marginTop', 'marginBottom'],
+ width: ['marginLeft', 'marginRight']
+};
+
+// reading a dimension prop will cause the browser to recalculate,
+// which will let our animations work
+function triggerBrowserReflow(node) {
+ node.offsetHeight; // eslint-disable-line no-unused-expressions
+}
+
+function getDimensionValue(dimension, elem) {
+ var value = elem['offset' + Object(__WEBPACK_IMPORTED_MODULE_10__utils_capitalize__["a" /* default */])(dimension)];
+ var margins = MARGINS[dimension];
+
+ return value + parseInt(__WEBPACK_IMPORTED_MODULE_6_dom_helpers_style___default()(elem, margins[0]), 10) + parseInt(__WEBPACK_IMPORTED_MODULE_6_dom_helpers_style___default()(elem, margins[1]), 10);
+}
+
+var collapseStyles = (_collapseStyles = {}, _collapseStyles[__WEBPACK_IMPORTED_MODULE_9_react_transition_group_Transition__["EXITED"]] = 'collapse', _collapseStyles[__WEBPACK_IMPORTED_MODULE_9_react_transition_group_Transition__["EXITING"]] = 'collapsing', _collapseStyles[__WEBPACK_IMPORTED_MODULE_9_react_transition_group_Transition__["ENTERING"]] = 'collapsing', _collapseStyles[__WEBPACK_IMPORTED_MODULE_9_react_transition_group_Transition__["ENTERED"]] = 'collapse in', _collapseStyles);
+
+var propTypes = {
+ /**
+ * Show the component; triggers the expand or collapse animation
+ */
+ in: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
+
+ /**
+ * Wait until the first "enter" transition to mount the component (add it to the DOM)
+ */
+ mountOnEnter: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
+
+ /**
+ * Unmount the component (remove it from the DOM) when it is collapsed
+ */
+ unmountOnExit: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
+
+ /**
+ * Run the expand animation when the component mounts, if it is initially
+ * shown
+ */
+ appear: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
+
+ /**
+ * Duration of the collapse animation in milliseconds, to ensure that
+ * finishing callbacks are fired even if the original browser transition end
+ * events are canceled
+ */
+ timeout: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number,
+
+ /**
+ * Callback fired before the component expands
+ */
+ onEnter: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
+ /**
+ * Callback fired after the component starts to expand
+ */
+ onEntering: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
+ /**
+ * Callback fired after the component has expanded
+ */
+ onEntered: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
+ /**
+ * Callback fired before the component collapses
+ */
+ onExit: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
+ /**
+ * Callback fired after the component starts to collapse
+ */
+ onExiting: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
+ /**
+ * Callback fired after the component has collapsed
+ */
+ onExited: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
+
+ /**
+ * The dimension used when collapsing, or a function that returns the
+ * dimension
+ *
+ * _Note: Bootstrap only partially supports 'width'!
+ * You will need to supply your own CSS animation for the `.width` CSS class._
+ */
+ dimension: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.oneOf(['height', 'width']), __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func]),
+
+ /**
+ * Function that returns the height or width of the animating DOM node
+ *
+ * Allows for providing some custom logic for how much the Collapse component
+ * should animate in its specified dimension. Called with the current
+ * dimension prop value and the DOM node.
+ */
+ getDimensionValue: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
+
+ /**
+ * ARIA role of collapsible element
+ */
+ role: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string
+};
+
+var defaultProps = {
+ in: false,
+ timeout: 300,
+ mountOnEnter: false,
+ unmountOnExit: false,
+ appear: false,
+
+ dimension: 'height',
+ getDimensionValue: getDimensionValue
+};
+
+var Collapse = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(Collapse, _React$Component);
+
+ function Collapse() {
+ var _temp, _this, _ret;
+
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, Collapse);
+
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ return _ret = (_temp = (_this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleEnter = function (elem) {
+ elem.style[_this.getDimension()] = '0';
+ }, _this.handleEntering = function (elem) {
+ var dimension = _this.getDimension();
+ elem.style[dimension] = _this._getScrollDimensionValue(elem, dimension);
+ }, _this.handleEntered = function (elem) {
+ elem.style[_this.getDimension()] = null;
+ }, _this.handleExit = function (elem) {
+ var dimension = _this.getDimension();
+ elem.style[dimension] = _this.props.getDimensionValue(dimension, elem) + 'px';
+ triggerBrowserReflow(elem);
+ }, _this.handleExiting = function (elem) {
+ elem.style[_this.getDimension()] = '0';
+ }, _temp), __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(_this, _ret);
+ }
+
+ Collapse.prototype.getDimension = function getDimension() {
+ return typeof this.props.dimension === 'function' ? this.props.dimension() : this.props.dimension;
+ };
+
+ // for testing
+
+
+ Collapse.prototype._getScrollDimensionValue = function _getScrollDimensionValue(elem, dimension) {
+ return elem['scroll' + Object(__WEBPACK_IMPORTED_MODULE_10__utils_capitalize__["a" /* default */])(dimension)] + 'px';
+ };
+
+ /* -- Expanding -- */
+
+
+ /* -- Collapsing -- */
+
+
+ Collapse.prototype.render = function render() {
+ var _this2 = this;
+
+ var _props = this.props,
+ onEnter = _props.onEnter,
+ onEntering = _props.onEntering,
+ onEntered = _props.onEntered,
+ onExit = _props.onExit,
+ onExiting = _props.onExiting,
+ className = _props.className,
+ children = _props.children,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'className', 'children']);
+
+ delete props.dimension;
+ delete props.getDimensionValue;
+
+ var handleEnter = Object(__WEBPACK_IMPORTED_MODULE_11__utils_createChainedFunction__["a" /* default */])(this.handleEnter, onEnter);
+ var handleEntering = Object(__WEBPACK_IMPORTED_MODULE_11__utils_createChainedFunction__["a" /* default */])(this.handleEntering, onEntering);
+ var handleEntered = Object(__WEBPACK_IMPORTED_MODULE_11__utils_createChainedFunction__["a" /* default */])(this.handleEntered, onEntered);
+ var handleExit = Object(__WEBPACK_IMPORTED_MODULE_11__utils_createChainedFunction__["a" /* default */])(this.handleExit, onExit);
+ var handleExiting = Object(__WEBPACK_IMPORTED_MODULE_11__utils_createChainedFunction__["a" /* default */])(this.handleExiting, onExiting);
+
+ return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
+ __WEBPACK_IMPORTED_MODULE_9_react_transition_group_Transition___default.a,
+ __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, props, {
+ 'aria-expanded': props.role ? props.in : null,
+ onEnter: handleEnter,
+ onEntering: handleEntering,
+ onEntered: handleEntered,
+ onExit: handleExit,
+ onExiting: handleExiting
+ }),
+ function (state, innerProps) {
+ return __WEBPACK_IMPORTED_MODULE_7_react___default.a.cloneElement(children, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, innerProps, {
+ className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, children.props.className, collapseStyles[state], _this2.getDimension() === 'width' && 'width')
+ }));
+ }
+ );
+ };
+
+ return Collapse;
+}(__WEBPACK_IMPORTED_MODULE_7_react___default.a.Component);
+
+Collapse.propTypes = propTypes;
+Collapse.defaultProps = defaultProps;
+
+/* harmony default export */ __webpack_exports__["a"] = (Collapse);
+
+/***/ }),
+/* 145 */
+/***/ (function(module, exports) {
+
+// Source: http://jsfiddle.net/vWx8V/
+// http://stackoverflow.com/questions/5603195/full-list-of-javascript-keycodes
+
+/**
+ * Conenience method returns corresponding value for given keyName or keyCode.
+ *
+ * @param {Mixed} keyCode {Number} or keyName {String}
+ * @return {Mixed}
+ * @api public
+ */
+
+function keyCode(searchInput) {
+ // Keyboard Events
+ if (searchInput && 'object' === typeof searchInput) {
+ var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode
+ if (hasKeyCode) searchInput = hasKeyCode
+ }
+
+ // Numbers
+ if ('number' === typeof searchInput) return names[searchInput]
+
+ // Everything else (cast to string)
+ var search = String(searchInput)
+
+ // check codes
+ var foundNamedKey = codes[search.toLowerCase()]
+ if (foundNamedKey) return foundNamedKey
+
+ // check aliases
+ var foundNamedKey = aliases[search.toLowerCase()]
+ if (foundNamedKey) return foundNamedKey
+
+ // weird character?
+ if (search.length === 1) return search.charCodeAt(0)
+
+ return undefined
+}
+
+/**
+ * Compares a keyboard event with a given keyCode or keyName.
+ *
+ * @param {Event} event Keyboard event that should be tested
+ * @param {Mixed} keyCode {Number} or keyName {String}
+ * @return {Boolean}
+ * @api public
+ */
+keyCode.isEventKey = function isEventKey(event, nameOrCode) {
+ if (event && 'object' === typeof event) {
+ var keyCode = event.which || event.keyCode || event.charCode
+ if (keyCode === null || keyCode === undefined) { return false; }
+ if (typeof nameOrCode === 'string') {
+ // check codes
+ var foundNamedKey = codes[nameOrCode.toLowerCase()]
+ if (foundNamedKey) { return foundNamedKey === keyCode; }
+
+ // check aliases
+ var foundNamedKey = aliases[nameOrCode.toLowerCase()]
+ if (foundNamedKey) { return foundNamedKey === keyCode; }
+ } else if (typeof nameOrCode === 'number') {
+ return nameOrCode === keyCode;
+ }
+ return false;
+ }
+}
+
+exports = module.exports = keyCode;
+
+/**
+ * Get by name
+ *
+ * exports.code['enter'] // => 13
+ */
+
+var codes = exports.code = exports.codes = {
+ 'backspace': 8,
+ 'tab': 9,
+ 'enter': 13,
+ 'shift': 16,
+ 'ctrl': 17,
+ 'alt': 18,
+ 'pause/break': 19,
+ 'caps lock': 20,
+ 'esc': 27,
+ 'space': 32,
+ 'page up': 33,
+ 'page down': 34,
+ 'end': 35,
+ 'home': 36,
+ 'left': 37,
+ 'up': 38,
+ 'right': 39,
+ 'down': 40,
+ 'insert': 45,
+ 'delete': 46,
+ 'command': 91,
+ 'left command': 91,
+ 'right command': 93,
+ 'numpad *': 106,
+ 'numpad +': 107,
+ 'numpad -': 109,
+ 'numpad .': 110,
+ 'numpad /': 111,
+ 'num lock': 144,
+ 'scroll lock': 145,
+ 'my computer': 182,
+ 'my calculator': 183,
+ ';': 186,
+ '=': 187,
+ ',': 188,
+ '-': 189,
+ '.': 190,
+ '/': 191,
+ '`': 192,
+ '[': 219,
+ '\\': 220,
+ ']': 221,
+ "'": 222
+}
+
+// Helper aliases
+
+var aliases = exports.aliases = {
+ 'windows': 91,
+ '⇧': 16,
+ '⌥': 18,
+ '⌃': 17,
+ '⌘': 91,
+ 'ctl': 17,
+ 'control': 17,
+ 'option': 18,
+ 'pause': 19,
+ 'break': 19,
+ 'caps': 20,
+ 'return': 13,
+ 'escape': 27,
+ 'spc': 32,
+ 'spacebar': 32,
+ 'pgup': 33,
+ 'pgdn': 34,
+ 'ins': 45,
+ 'del': 46,
+ 'cmd': 91
+}
+
+/*!
+ * Programatically add the following
+ */
+
+// lower case chars
+for (i = 97; i < 123; i++) codes[String.fromCharCode(i)] = i - 32
+
+// numbers
+for (var i = 48; i < 58; i++) codes[i - 48] = i
+
+// function keys
+for (i = 1; i < 13; i++) codes['f'+i] = i + 111
+
+// numpad keys
+for (i = 0; i < 10; i++) codes['numpad '+i] = i + 96
+
+/**
+ * Get by code
+ *
+ * exports.name[13] // => 'Enter'
+ */
+
+var names = exports.names = exports.title = {} // title for backward compat
+
+// Create reverse mapping
+for (i in codes) names[codes[i]] = i
+
+// Add aliases
+for (var alias in aliases) {
+ codes[alias] = aliases[alias]
+}
+
+
+/***/ }),
+/* 146 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _inDOM = __webpack_require__(39);
+
+var _inDOM2 = _interopRequireDefault(_inDOM);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var on = function on() {};
+if (_inDOM2.default) {
+ on = function () {
+
+ if (document.addEventListener) return function (node, eventName, handler, capture) {
+ return node.addEventListener(eventName, handler, capture || false);
+ };else if (document.attachEvent) return function (node, eventName, handler) {
+ return node.attachEvent('on' + eventName, function (e) {
+ e = e || window.event;
+ e.target = e.target || e.srcElement;
+ e.currentTarget = node;
+ handler.call(node, e);
+ });
+ };
+ }();
+}
+
+exports.default = on;
+module.exports = exports['default'];
+
+/***/ }),
+/* 147 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _inDOM = __webpack_require__(39);
+
+var _inDOM2 = _interopRequireDefault(_inDOM);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var off = function off() {};
+if (_inDOM2.default) {
+ off = function () {
+ if (document.addEventListener) return function (node, eventName, handler, capture) {
+ return node.removeEventListener(eventName, handler, capture || false);
+ };else if (document.attachEvent) return function (node, eventName, handler) {
+ return node.detachEvent('on' + eventName, handler);
+ };
+ }();
+}
+
+exports.default = off;
+module.exports = exports['default'];
+
+/***/ }),
+/* 148 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+var _react = __webpack_require__(0);
+
+var _react2 = _interopRequireDefault(_react);
+
+var _createChainableTypeChecker = __webpack_require__(482);
+
+var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function elementType(props, propName, componentName, location, propFullName) {
+ var propValue = props[propName];
+ var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);
+
+ if (_react2.default.isValidElement(propValue)) {
+ return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + 'or a ReactClass).');
+ }
+
+ if (propType !== 'function' && propType !== 'string') {
+ return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + 'or a ReactClass).');
+ }
+
+ return null;
+}
+
+exports.default = (0, _createChainableTypeChecker2.default)(elementType);
+
+/***/ }),
+/* 149 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_uncontrollable__ = __webpack_require__(45);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_uncontrollable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_uncontrollable__);
+
+
+
+
+
+
+
+
+var TAB = 'tab';
+var PANE = 'pane';
+
+var idPropType = __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.number]);
+
+var propTypes = {
+ /**
+ * HTML id attribute, required if no `generateChildId` prop
+ * is specified.
+ */
+ id: function id(props) {
+ var error = null;
+
+ if (!props.generateChildId) {
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
+
+ error = idPropType.apply(undefined, [props].concat(args));
+
+ if (!error && !props.id) {
+ error = new Error('In order to properly initialize Tabs in a way that is accessible ' + 'to assistive technologies (such as screen readers) an `id` or a ' + '`generateChildId` prop to TabContainer is required');
+ }
+ }
+
+ return error;
+ },
+
+
+ /**
+ * A function that takes an `eventKey` and `type` and returns a unique id for
+ * child tab ``s and ``s. The function _must_ be a pure
+ * function, meaning it should always return the _same_ id for the same set
+ * of inputs. The default value requires that an `id` to be set for the
+ * ``.
+ *
+ * The `type` argument will either be `"tab"` or `"pane"`.
+ *
+ * @defaultValue (eventKey, type) => `${this.props.id}-${type}-${key}`
+ */
+ generateChildId: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
+
+ /**
+ * A callback fired when a tab is selected.
+ *
+ * @controllable activeKey
+ */
+ onSelect: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
+
+ /**
+ * The `eventKey` of the currently active tab.
+ *
+ * @controllable onSelect
+ */
+ activeKey: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.any
+};
+
+var childContextTypes = {
+ $bs_tabContainer: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.shape({
+ activeKey: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.any,
+ onSelect: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func.isRequired,
+ getTabId: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func.isRequired,
+ getPaneId: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func.isRequired
+ })
+};
+
+var TabContainer = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(TabContainer, _React$Component);
+
+ function TabContainer() {
+ __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, TabContainer);
+
+ return __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ TabContainer.prototype.getChildContext = function getChildContext() {
+ var _props = this.props,
+ activeKey = _props.activeKey,
+ onSelect = _props.onSelect,
+ generateChildId = _props.generateChildId,
+ id = _props.id;
+
+
+ var getId = generateChildId || function (key, type) {
+ return id ? id + '-' + type + '-' + key : null;
+ };
+
+ return {
+ $bs_tabContainer: {
+ activeKey: activeKey,
+ onSelect: onSelect,
+ getTabId: function getTabId(key) {
+ return getId(key, TAB);
+ },
+ getPaneId: function getPaneId(key) {
+ return getId(key, PANE);
+ }
+ }
+ };
+ };
+
+ TabContainer.prototype.render = function render() {
+ var _props2 = this.props,
+ children = _props2.children,
+ props = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default()(_props2, ['children']);
+
+ delete props.generateChildId;
+ delete props.onSelect;
+ delete props.activeKey;
+
+ return __WEBPACK_IMPORTED_MODULE_4_react___default.a.cloneElement(__WEBPACK_IMPORTED_MODULE_4_react___default.a.Children.only(children), props);
+ };
+
+ return TabContainer;
+}(__WEBPACK_IMPORTED_MODULE_4_react___default.a.Component);
+
+TabContainer.propTypes = propTypes;
+TabContainer.childContextTypes = childContextTypes;
+
+/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_6_uncontrollable___default()(TabContainer, { activeKey: 'onSelect' }));
+
+/***/ }),
+/* 150 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_elementType__ = __webpack_require__(17);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_elementType___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_elementType__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__ = __webpack_require__(9);
+
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ componentClass: __WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_elementType___default.a,
+
+ /**
+ * Sets a default animation strategy for all children ``s. Use
+ * `false` to disable, `true` to enable the default `` animation or
+ * a react-transition-group v2 ` ` component.
+ */
+ animation: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_elementType___default.a]),
+
+ /**
+ * Wait until the first "enter" transition to mount tabs (add them to the DOM)
+ */
+ mountOnEnter: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+
+ /**
+ * Unmount tabs (remove it from the DOM) when they are no longer visible
+ */
+ unmountOnExit: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool
+};
+
+var defaultProps = {
+ componentClass: 'div',
+ animation: true,
+ mountOnEnter: false,
+ unmountOnExit: false
+};
+
+var contextTypes = {
+ $bs_tabContainer: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.shape({
+ activeKey: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.any
+ })
+};
+
+var childContextTypes = {
+ $bs_tabContent: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.shape({
+ bsClass: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,
+ animation: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_elementType___default.a]),
+ activeKey: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.any,
+ mountOnEnter: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ unmountOnExit: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ onPaneEnter: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func.isRequired,
+ onPaneExited: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func.isRequired,
+ exiting: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool.isRequired
+ })
+};
+
+var TabContent = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(TabContent, _React$Component);
+
+ function TabContent(props, context) {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, TabContent);
+
+ var _this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.call(this, props, context));
+
+ _this.handlePaneEnter = _this.handlePaneEnter.bind(_this);
+ _this.handlePaneExited = _this.handlePaneExited.bind(_this);
+
+ // Active entries in state will be `null` unless `animation` is set. Need
+ // to track active child in case keys swap and the active child changes
+ // but the active key does not.
+ _this.state = {
+ activeKey: null,
+ activeChild: null
+ };
+ return _this;
+ }
+
+ TabContent.prototype.getChildContext = function getChildContext() {
+ var _props = this.props,
+ bsClass = _props.bsClass,
+ animation = _props.animation,
+ mountOnEnter = _props.mountOnEnter,
+ unmountOnExit = _props.unmountOnExit;
+
+
+ var stateActiveKey = this.state.activeKey;
+ var containerActiveKey = this.getContainerActiveKey();
+
+ var activeKey = stateActiveKey != null ? stateActiveKey : containerActiveKey;
+ var exiting = stateActiveKey != null && stateActiveKey !== containerActiveKey;
+
+ return {
+ $bs_tabContent: {
+ bsClass: bsClass,
+ animation: animation,
+ activeKey: activeKey,
+ mountOnEnter: mountOnEnter,
+ unmountOnExit: unmountOnExit,
+ onPaneEnter: this.handlePaneEnter,
+ onPaneExited: this.handlePaneExited,
+ exiting: exiting
+ }
+ };
+ };
+
+ TabContent.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
+ if (!nextProps.animation && this.state.activeChild) {
+ this.setState({ activeKey: null, activeChild: null });
+ }
+ };
+
+ TabContent.prototype.componentWillUnmount = function componentWillUnmount() {
+ this.isUnmounted = true;
+ };
+
+ TabContent.prototype.getContainerActiveKey = function getContainerActiveKey() {
+ var tabContainer = this.context.$bs_tabContainer;
+ return tabContainer && tabContainer.activeKey;
+ };
+
+ TabContent.prototype.handlePaneEnter = function handlePaneEnter(child, childKey) {
+ if (!this.props.animation) {
+ return false;
+ }
+
+ // It's possible that this child should be transitioning out.
+ if (childKey !== this.getContainerActiveKey()) {
+ return false;
+ }
+
+ this.setState({
+ activeKey: childKey,
+ activeChild: child
+ });
+
+ return true;
+ };
+
+ TabContent.prototype.handlePaneExited = function handlePaneExited(child) {
+ // This might happen as everything is unmounting.
+ if (this.isUnmounted) {
+ return;
+ }
+
+ this.setState(function (_ref) {
+ var activeChild = _ref.activeChild;
+
+ if (activeChild !== child) {
+ return null;
+ }
+
+ return {
+ activeKey: null,
+ activeChild: null
+ };
+ });
+ };
+
+ TabContent.prototype.render = function render() {
+ var _props2 = this.props,
+ Component = _props2.componentClass,
+ className = _props2.className,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props2, ['componentClass', 'className']);
+
+ var _splitBsPropsAndOmit = Object(__WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__["g" /* splitBsPropsAndOmit */])(props, ['animation', 'mountOnEnter', 'unmountOnExit']),
+ bsProps = _splitBsPropsAndOmit[0],
+ elementProps = _splitBsPropsAndOmit[1];
+
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(Component, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, elementProps, {
+ className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, Object(__WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__["e" /* prefix */])(bsProps, 'content'))
+ }));
+ };
+
+ return TabContent;
+}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
+
+TabContent.propTypes = propTypes;
+TabContent.defaultProps = defaultProps;
+TabContent.contextTypes = contextTypes;
+TabContent.childContextTypes = childContextTypes;
+
+/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__["a" /* bsClass */])('tab', TabContent));
+
+/***/ }),
+/* 151 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js__ = __webpack_require__(239);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_Embark_web3__ = __webpack_require__(152);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ipfs_api__ = __webpack_require__(502);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ipfs_api___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_ipfs_api__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_p_iteration__ = __webpack_require__(813);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_p_iteration___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_p_iteration__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_eth_ens_namehash__ = __webpack_require__(815);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_eth_ens_namehash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_eth_ens_namehash__);
+function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
+
+
+
+
+
+var EmbarkJS = {
+ onReady: function (cb) {
+ if (typeof __embarkContext === 'undefined') {
+ return cb();
+ }
+ return __embarkContext.execWhenReady(cb);
+ }
+};
+
+EmbarkJS.isNewWeb3 = function (web3Obj) {
+ var _web3 = web3Obj || new __WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js___default.a();
+ if (typeof _web3.version === "string") {
+ return true;
+ }
+ return parseInt(_web3.version.api.split('.')[0], 10) >= 1;
+};
+
+EmbarkJS.Contract = function (options) {
+ var self = this;
+ var i, abiElement;
+ var ContractClass;
+
+ this.abi = options.abi;
+ this.address = options.address;
+ this.gas = options.gas;
+ this.code = '0x' + options.code;
+ //this.web3 = options.web3 || web3;
+ this.web3 = options.web3;
+ if (!this.web3 && typeof __WEBPACK_IMPORTED_MODULE_1_Embark_web3__["a" /* default */] !== 'undefined') {
+ this.web3 = __WEBPACK_IMPORTED_MODULE_1_Embark_web3__["a" /* default */];
+ } else if (!this.web3) {
+ this.web3 = window.web3;
+ }
+
+ if (EmbarkJS.isNewWeb3(this.web3)) {
+ ContractClass = new this.web3.eth.Contract(this.abi, this.address);
+ ContractClass.setProvider(this.web3.currentProvider);
+ ContractClass.options.data = this.code;
+ ContractClass.options.from = this.from || this.web3.eth.defaultAccount;
+ ContractClass.abi = ContractClass.options.abi;
+ ContractClass.address = this.address;
+ ContractClass.gas = this.gas;
+
+ let originalMethods = Object.keys(ContractClass);
+
+ ContractClass._jsonInterface.forEach(abi => {
+ if (originalMethods.indexOf(abi.name) >= 0) {
+ console.log(abi.name + " is a reserved word and cannot be used as a contract method, property or event");
+ return;
+ }
+
+ if (!abi.inputs) {
+ return;
+ }
+
+ let numExpectedInputs = abi.inputs.length;
+
+ if (abi.type === 'function' && abi.constant) {
+ ContractClass[abi.name] = function () {
+ let options = {},
+ cb = null,
+ args = Array.from(arguments || []).slice(0, numExpectedInputs);
+ if (typeof arguments[numExpectedInputs] === 'function') {
+ cb = arguments[numExpectedInputs];
+ } else if (typeof arguments[numExpectedInputs] === 'object') {
+ options = arguments[numExpectedInputs];
+ cb = arguments[numExpectedInputs + 1];
+ }
+
+ let ref = ContractClass.methods[abi.name];
+ let call = ref.apply(ref, ...arguments).call;
+ return call.apply(call, []);
+ };
+ } else if (abi.type === 'function') {
+ ContractClass[abi.name] = function () {
+ let options = {},
+ cb = null,
+ args = Array.from(arguments || []).slice(0, numExpectedInputs);
+ if (typeof arguments[numExpectedInputs] === 'function') {
+ cb = arguments[numExpectedInputs];
+ } else if (typeof arguments[numExpectedInputs] === 'object') {
+ options = arguments[numExpectedInputs];
+ cb = arguments[numExpectedInputs + 1];
+ }
+
+ let ref = ContractClass.methods[abi.name];
+ let send = ref.apply(ref, args).send;
+ return send.apply(send, [options, cb]);
+ };
+ } else if (abi.type === 'event') {
+ ContractClass[abi.name] = function (options, cb) {
+ let ref = ContractClass.events[abi.name];
+ return ref.apply(ref, [options, cb]);
+ };
+ }
+ });
+
+ return ContractClass;
+ } else {
+ ContractClass = this.web3.eth.contract(this.abi);
+
+ this.eventList = [];
+
+ if (this.abi) {
+ for (i = 0; i < this.abi.length; i++) {
+ abiElement = this.abi[i];
+ if (abiElement.type === 'event') {
+ this.eventList.push(abiElement.name);
+ }
+ }
+ }
+
+ var messageEvents = function () {
+ this.cb = function () {};
+ };
+
+ messageEvents.prototype.then = function (cb) {
+ this.cb = cb;
+ };
+
+ messageEvents.prototype.error = function (err) {
+ return err;
+ };
+
+ this._originalContractObject = ContractClass.at(this.address);
+ this._methods = Object.getOwnPropertyNames(this._originalContractObject).filter(function (p) {
+ // TODO: check for forbidden properties
+ if (self.eventList.indexOf(p) >= 0) {
+
+ self[p] = function () {
+ var promise = new messageEvents();
+ var args = Array.prototype.slice.call(arguments);
+ args.push(function (err, result) {
+ if (err) {
+ promise.error(err);
+ } else {
+ promise.cb(result);
+ }
+ });
+
+ self._originalContractObject[p].apply(self._originalContractObject[p], args);
+ return promise;
+ };
+ return true;
+ } else if (typeof self._originalContractObject[p] === 'function') {
+ self[p] = function (_args) {
+ var args = Array.prototype.slice.call(arguments);
+ var fn = self._originalContractObject[p];
+ var props = self.abi.find(x => x.name == p);
+
+ var promise = new Promise(function (resolve, reject) {
+ args.push(function (err, transaction) {
+ promise.tx = transaction;
+ if (err) {
+ return reject(err);
+ }
+
+ var getConfirmation = function () {
+ self.web3.eth.getTransactionReceipt(transaction, function (err, receipt) {
+ if (err) {
+ return reject(err);
+ }
+
+ if (receipt !== null) {
+ return resolve(receipt);
+ }
+
+ setTimeout(getConfirmation, 1000);
+ });
+ };
+
+ if (typeof transaction !== "string" || props.constant) {
+ resolve(transaction);
+ } else {
+ getConfirmation();
+ }
+ });
+
+ fn.apply(fn, args);
+ });
+
+ return promise;
+ };
+ return true;
+ }
+ return false;
+ });
+ }
+};
+
+EmbarkJS.Contract.prototype.deploy = function (args, _options) {
+ var self = this;
+ var contractParams;
+ var options = _options || {};
+
+ contractParams = args || [];
+
+ contractParams.push({
+ from: this.web3.eth.accounts[0],
+ data: this.code,
+ gas: options.gas || 800000
+ });
+
+ var contractObject = this.web3.eth.contract(this.abi);
+
+ var promise = new Promise(function (resolve, reject) {
+ contractParams.push(function (err, transaction) {
+ if (err) {
+ reject(err);
+ } else if (transaction.address !== undefined) {
+ resolve(new EmbarkJS.Contract({
+ abi: self.abi,
+ code: self.code,
+ address: transaction.address
+ }));
+ }
+ });
+
+ // returns promise
+ // deploys contract
+ // wraps it around EmbarkJS.Contract
+ contractObject["new"].apply(contractObject, contractParams);
+ });
+
+ return promise;
+};
+
+EmbarkJS.Contract.prototype.new = EmbarkJS.Contract.prototype.deploy;
+
+EmbarkJS.Contract.prototype.at = function (address) {
+ return new EmbarkJS.Contract({ abi: this.abi, code: this.code, address: address });
+};
+
+EmbarkJS.Contract.prototype.send = function (value, unit, _options) {
+ var options, wei;
+ if (typeof unit === 'object') {
+ options = unit;
+ wei = value;
+ } else {
+ options = _options || {};
+ wei = this.web3.toWei(value, unit);
+ }
+
+ options.to = this.address;
+ options.value = wei;
+
+ this.web3.eth.sendTransaction(options);
+};
+
+EmbarkJS.Storage = {};
+
+EmbarkJS.Storage.Providers = {};
+
+EmbarkJS.Storage.saveText = function (text) {
+ if (!this.currentStorage) {
+ throw new Error('Storage provider not set; e.g EmbarkJS.Storage.setProvider("ipfs")');
+ }
+ return this.currentStorage.saveText(text);
+};
+
+EmbarkJS.Storage.get = function (hash) {
+ if (!this.currentStorage) {
+ throw new Error('Storage provider not set; e.g EmbarkJS.Storage.setProvider("ipfs")');
+ }
+ return this.currentStorage.get(hash);
+};
+
+EmbarkJS.Storage.uploadFile = function (inputSelector) {
+ if (!this.currentStorage) {
+ throw new Error('Storage provider not set; e.g EmbarkJS.Storage.setProvider("ipfs")');
+ }
+ return this.currentStorage.uploadFile(inputSelector);
+};
+
+EmbarkJS.Storage.getUrl = function (hash) {
+ if (!this.currentStorage) {
+ throw new Error('Storage provider not set; e.g EmbarkJS.Storage.setProvider("ipfs")');
+ }
+ return this.currentStorage.getUrl(hash);
+};
+
+EmbarkJS.Storage.registerProvider = function (providerName, obj) {
+ EmbarkJS.Storage.Providers[providerName] = obj;
+};
+
+EmbarkJS.Storage.setProvider = function (provider, options) {
+ let providerObj = this.Providers[provider];
+
+ if (!providerObj) {
+ throw new Error('Unknown storage provider');
+ }
+
+ this.currentStorage = providerObj;
+
+ return providerObj.setProvider(options);
+};
+
+EmbarkJS.Storage.isAvailable = function () {
+ if (!this.currentStorage) {
+ throw new Error('Storage provider not set; e.g EmbarkJS.Storage.setProvider("ipfs")');
+ }
+ return this.currentStorage.isAvailable();
+};
+
+EmbarkJS.Messages = {};
+
+EmbarkJS.Messages.Providers = {};
+
+EmbarkJS.Messages.registerProvider = function (providerName, obj) {
+ EmbarkJS.Messages.Providers[providerName] = obj;
+};
+
+EmbarkJS.Messages.setProvider = function (provider, options) {
+ let providerObj = this.Providers[provider];
+
+ if (!providerObj) {
+ throw new Error('Unknown messages provider');
+ }
+
+ this.currentMessages = providerObj;
+
+ return providerObj.setProvider(options);
+};
+
+EmbarkJS.Messages.isAvailable = function () {
+ return this.currentMessages.isAvailable();
+};
+
+EmbarkJS.Messages.sendMessage = function (options) {
+ if (!this.currentMessages) {
+ throw new Error('Messages provider not set; e.g EmbarkJS.Messages.setProvider("whisper")');
+ }
+ return this.currentMessages.sendMessage(options);
+};
+
+EmbarkJS.Messages.listenTo = function (options, callback) {
+ if (!this.currentMessages) {
+ throw new Error('Messages provider not set; e.g EmbarkJS.Messages.setProvider("whisper")');
+ }
+ return this.currentMessages.listenTo(options, callback);
+};
+
+EmbarkJS.Names = {};
+
+EmbarkJS.Names.Providers = {};
+
+EmbarkJS.Names.registerProvider = function (providerName, obj) {
+ EmbarkJS.Names.Providers[providerName] = obj;
+};
+
+EmbarkJS.Names.setProvider = function (provider, options) {
+ let providerObj = this.Providers[provider];
+
+ if (!providerObj) {
+ throw new Error('Unknown name system provider');
+ }
+
+ this.currentNameSystems = providerObj;
+
+ return providerObj.setProvider(options);
+};
+
+// resolve resolves a name into an identifier of some kind
+EmbarkJS.Names.resolve = function (name) {
+ if (!this.currentNameSystems) {
+ throw new Error('Name system provider not set; e.g EmbarkJS.Names.setProvider("ens")');
+ }
+ return this.currentNameSystems.resolve(name);
+};
+
+// the reverse of resolve, resolves using an identifier to get to a name
+EmbarkJS.Names.lookup = function (identifier) {
+ if (!this.currentNameSystems) {
+ throw new Error('Name system provider not set; e.g EmbarkJS.Names.setProvider("ens")');
+ }
+ return this.currentNameSystems.lookup(identifier);
+};
+
+// To Implement
+
+/*
+// register a name
+EmbarkJS.Names.register = function(name, options) {
+
+}
+*/
+
+EmbarkJS.Utils = {
+ fromAscii: function (str) {
+ var _web3 = new __WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js___default.a();
+ return _web3.utils ? _web3.utils.fromAscii(str) : _web3.fromAscii(str);
+ },
+ toAscii: function (str) {
+ var _web3 = new __WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js___default.a();
+ return _web3.utils.toAscii(str);
+ }
+};
+
+/* harmony default export */ __webpack_exports__["a"] = (EmbarkJS);
+
+let __MessageEvents = function () {
+ this.cb = function () {};
+};
+
+__MessageEvents.prototype.then = function (cb) {
+ this.cb = cb;
+};
+
+__MessageEvents.prototype.error = function (err) {
+ return err;
+};
+
+__MessageEvents.prototype.stop = function () {
+ this.filter.stopWatching();
+};
+
+/*global EmbarkJS, Web3, __MessageEvents */
+
+// for the whisper v5 and web3.js 1.0
+let __embarkWhisperNewWeb3 = {};
+
+__embarkWhisperNewWeb3.setProvider = function (options) {
+ const self = this;
+ let provider;
+ if (options === undefined) {
+ provider = "localhost:8546";
+ } else {
+ provider = options.server + ':' + options.port;
+ }
+ // TODO: take into account type
+ self.web3 = new __WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js___default.a(new __WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js___default.a.providers.WebsocketProvider("ws://" + provider));
+ self.getWhisperVersion(function (err, version) {
+ if (err) {
+ console.log("whisper not available");
+ } else if (version >= 5) {
+ self.web3.shh.newSymKey().then(id => {
+ self.symKeyID = id;
+ });
+ self.web3.shh.newKeyPair().then(id => {
+ self.sig = id;
+ });
+ } else {
+ throw new Error("version of whisper not supported");
+ }
+ self.whisperVersion = self.web3.version.whisper;
+ });
+};
+
+__embarkWhisperNewWeb3.sendMessage = function (options) {
+ var topics, data, ttl, payload;
+ topics = options.topic || options.topics;
+ data = options.data || options.payload;
+ ttl = options.ttl || 100;
+ var powTime = options.powTime || 3;
+ var powTarget = options.powTarget || 0.5;
+
+ if (topics === undefined) {
+ throw new Error("missing option: topic");
+ }
+
+ if (data === undefined) {
+ throw new Error("missing option: data");
+ }
+
+ topics = this.web3.utils.toHex(topics).slice(0, 10);
+
+ payload = JSON.stringify(data);
+
+ let message = {
+ symKeyID: this.symKeyID, // encrypts using the sym key ID
+ sig: this.sig, // signs the message using the keyPair ID
+ ttl: ttl,
+ topic: topics,
+ payload: EmbarkJS.Utils.fromAscii(payload),
+ powTime: powTime,
+ powTarget: powTarget
+ };
+
+ this.web3.shh.post(message, function () {});
+};
+
+__embarkWhisperNewWeb3.listenTo = function (options, callback) {
+ var topics = options.topic || options.topics;
+
+ let promise = new __MessageEvents();
+
+ if (typeof topics === 'string') {
+ topics = [this.web3.utils.toHex(topics).slice(0, 10)];
+ } else {
+ topics = topics.map(t => this.web3.utils.toHex(t).slice(0, 10));
+ }
+
+ let filter = this.web3.shh.subscribe("messages", {
+ symKeyID: this.symKeyID,
+ topics: topics
+ }).on('data', function (result) {
+ var payload = JSON.parse(EmbarkJS.Utils.toAscii(result.payload));
+ var data;
+ data = {
+ topic: EmbarkJS.Utils.toAscii(result.topic),
+ data: payload,
+ //from: result.from,
+ time: result.timestamp
+ };
+
+ if (callback) {
+ return callback(null, data);
+ }
+ promise.cb(payload, data, result);
+ });
+
+ promise.filter = filter;
+
+ return promise;
+};
+
+__embarkWhisperNewWeb3.getWhisperVersion = function (cb) {
+ this.web3.shh.getVersion(function (err, version) {
+ cb(err, version);
+ });
+};
+
+__embarkWhisperNewWeb3.isAvailable = function () {
+ return new Promise((resolve, reject) => {
+ if (!this.web3.shh) {
+ return resolve(false);
+ }
+ try {
+ this.getWhisperVersion(err => {
+ resolve(Boolean(!err));
+ });
+ } catch (err) {
+ reject(err);
+ }
+ });
+};
+
+EmbarkJS.Messages.registerProvider('whisper', __embarkWhisperNewWeb3);
+
+
+let __embarkIPFS = {};
+
+__embarkIPFS.setProvider = function (options) {
+ var self = this;
+ var promise = new Promise(function (resolve, reject) {
+ try {
+ if (options === undefined) {
+ self._config = options;
+ self._ipfsConnection = __WEBPACK_IMPORTED_MODULE_2_ipfs_api___default()('localhost', '5001');
+ self._getUrl = "http://localhost:8080/ipfs/";
+ } else {
+ var ipfsOptions = { host: options.host || options.server, protocol: 'http' };
+ if (options.protocol) {
+ ipfsOptions.protocol = options.protocol;
+ }
+ if (options.port && options.port !== 'false') {
+ ipfsOptions.port = options.port;
+ }
+ self._ipfsConnection = __WEBPACK_IMPORTED_MODULE_2_ipfs_api___default()(ipfsOptions);
+ self._getUrl = options.getUrl || "http://localhost:8080/ipfs/";
+ }
+ resolve(self);
+ } catch (err) {
+ console.error(err);
+ self._ipfsConnection = null;
+ reject(new Error('Failed to connect to IPFS'));
+ }
+ });
+ return promise;
+};
+
+__embarkIPFS.saveText = function (text) {
+ const self = this;
+ var promise = new Promise(function (resolve, reject) {
+ if (!self._ipfsConnection) {
+ var connectionError = new Error('No IPFS connection. Please ensure to call Embark.Storage.setProvider()');
+ reject(connectionError);
+ }
+ self._ipfsConnection.add(self._ipfsConnection.Buffer.from(text), function (err, result) {
+ if (err) {
+ reject(err);
+ } else {
+ resolve(result[0].path);
+ }
+ });
+ });
+
+ return promise;
+};
+
+__embarkIPFS.get = function (hash) {
+ const self = this;
+ // TODO: detect type, then convert if needed
+ //var ipfsHash = web3.toAscii(hash);
+ var promise = new Promise(function (resolve, reject) {
+ if (!self._ipfsConnection) {
+ var connectionError = new Error('No IPFS connection. Please ensure to call Embark.Storage.setProvider()');
+ reject(connectionError);
+ }
+ self._ipfsConnection.get(hash, function (err, files) {
+ if (err) {
+ return reject(err);
+ }
+ resolve(files[0].content.toString());
+ });
+ });
+
+ return promise;
+};
+
+__embarkIPFS.uploadFile = function (inputSelector) {
+ const self = this;
+ var file = inputSelector[0].files[0];
+
+ if (file === undefined) {
+ throw new Error('no file found');
+ }
+
+ var promise = new Promise(function (resolve, reject) {
+ if (!self._ipfsConnection) {
+ var connectionError = new Error('No IPFS connection. Please ensure to call Embark.Storage.setProvider()');
+ reject(connectionError);
+ }
+ var reader = new FileReader();
+ reader.onloadend = function () {
+ var fileContent = reader.result;
+ var buffer = self._ipfsConnection.Buffer.from(fileContent);
+ self._ipfsConnection.add(buffer, function (err, result) {
+ if (err) {
+ reject(err);
+ } else {
+ resolve(result[0].path);
+ }
+ });
+ };
+ reader.readAsArrayBuffer(file);
+ });
+
+ return promise;
+};
+
+__embarkIPFS.isAvailable = function () {
+ return new Promise(resolve => {
+ if (!this._ipfsConnection) {
+ return resolve(false);
+ }
+ this._ipfsConnection.id().then(id => {
+ resolve(Boolean(id));
+ }).catch(() => {
+ resolve(false);
+ });
+ });
+};
+
+__embarkIPFS.getUrl = function (hash) {
+ return (this._getUrl || "http://localhost:8080/ipfs/") + hash;
+};
+
+EmbarkJS.Storage.registerProvider('ipfs', __embarkIPFS);
+
+/* global EmbarkJS */
+
+
+
+let __embarkStorage = {};
+
+__embarkStorage.setProviders = (() => {
+ var _ref = _asyncToGenerator(function* (dappConnOptions) {
+ try {
+ let workingConnFound = yield Object(__WEBPACK_IMPORTED_MODULE_3_p_iteration__["findSeries"])(dappConnOptions, (() => {
+ var _ref2 = _asyncToGenerator(function* (dappConn) {
+ if (dappConn === '$BZZ' || dappConn.provider === 'swarm') {
+ let options = dappConn;
+ if (dappConn === '$BZZ') options = { "useOnlyGivenProvider": true };
+ try {
+ yield EmbarkJS.Storage.setProvider('swarm', options);
+ let isAvailable = yield EmbarkJS.Storage.isAvailable();
+ return isAvailable;
+ } catch (err) {
+ return false; // catch errors for when bzz object not initialised but config has requested it to be used
+ }
+ } else if (dappConn.provider === 'ipfs') {
+ // set the provider then check the connection, if true, use that provider, else, check next provider
+ try {
+ yield EmbarkJS.Storage.setProvider('ipfs', dappConn);
+ let isAvailable = yield EmbarkJS.Storage.isAvailable();
+ return isAvailable;
+ } catch (err) {
+ return false;
+ }
+ }
+ });
+
+ return function (_x2) {
+ return _ref2.apply(this, arguments);
+ };
+ })());
+ if (!workingConnFound) throw new Error('Could not connect to a storage provider using any of the dappConnections in the storage config');
+ } catch (err) {
+ throw new Error('Failed to connect to a storage provider: ' + err.message);
+ }
+ });
+
+ return function (_x) {
+ return _ref.apply(this, arguments);
+ };
+})();
+
+
+
+/*global web3, EmbarkJS*/
+let __embarkENS = {};
+
+// registry interface for later
+__embarkENS.registryInterface = [{
+ "constant": true,
+ "inputs": [{
+ "name": "node",
+ "type": "bytes32"
+ }],
+ "name": "resolver",
+ "outputs": [{
+ "name": "",
+ "type": "address"
+ }],
+ "type": "function"
+}, {
+ "constant": true,
+ "inputs": [{
+ "name": "node",
+ "type": "bytes32"
+ }],
+ "name": "owner",
+ "outputs": [{
+ "name": "",
+ "type": "address"
+ }],
+ "type": "function"
+}, {
+ "constant": false,
+ "inputs": [{
+ "name": "node",
+ "type": "bytes32"
+ }, {
+ "name": "resolver",
+ "type": "address"
+ }],
+ "name": "setResolver",
+ "outputs": [],
+ "type": "function"
+}, {
+ "constant": false,
+ "inputs": [{
+ "name": "node",
+ "type": "bytes32"
+ }, {
+ "name": "label",
+ "type": "bytes32"
+ }, {
+ "name": "owner",
+ "type": "address"
+ }],
+ "name": "setSubnodeOwner",
+ "outputs": [],
+ "type": "function"
+}, {
+ "constant": false,
+ "inputs": [{
+ "name": "node",
+ "type": "bytes32"
+ }, {
+ "name": "owner",
+ "type": "address"
+ }],
+ "name": "setOwner",
+ "outputs": [],
+ "type": "function"
+}];
+
+__embarkENS.resolverInterface = [{
+ "constant": true,
+ "inputs": [{
+ "name": "node",
+ "type": "bytes32"
+ }],
+ "name": "addr",
+ "outputs": [{
+ "name": "",
+ "type": "address"
+ }],
+ "type": "function"
+}, {
+ "constant": true,
+ "inputs": [{
+ "name": "node",
+ "type": "bytes32"
+ }],
+ "name": "content",
+ "outputs": [{
+ "name": "",
+ "type": "bytes32"
+ }],
+ "type": "function"
+}, {
+ "constant": true,
+ "inputs": [{
+ "name": "node",
+ "type": "bytes32"
+ }],
+ "name": "name",
+ "outputs": [{
+ "name": "",
+ "type": "string"
+ }],
+ "type": "function"
+}, {
+ "constant": true,
+ "inputs": [{
+ "name": "node",
+ "type": "bytes32"
+ }, {
+ "name": "kind",
+ "type": "bytes32"
+ }],
+ "name": "has",
+ "outputs": [{
+ "name": "",
+ "type": "bool"
+ }],
+ "type": "function"
+}, {
+ "constant": false,
+ "inputs": [{
+ "name": "node",
+ "type": "bytes32"
+ }, {
+ "name": "addr",
+ "type": "address"
+ }],
+ "name": "setAddr",
+ "outputs": [],
+ "type": "function"
+}, {
+ "constant": false,
+ "inputs": [{
+ "name": "node",
+ "type": "bytes32"
+ }, {
+ "name": "hash",
+ "type": "bytes32"
+ }],
+ "name": "setContent",
+ "outputs": [],
+ "type": "function"
+}, {
+ "constant": false,
+ "inputs": [{
+ "name": "node",
+ "type": "bytes32"
+ }, {
+ "name": "name",
+ "type": "string"
+ }],
+ "name": "setName",
+ "outputs": [],
+ "type": "function"
+}, {
+ "constant": true,
+ "inputs": [{
+ "name": "node",
+ "type": "bytes32"
+ }, {
+ "name": "contentType",
+ "type": "uint256"
+ }],
+ "name": "ABI",
+ "outputs": [{
+ "name": "",
+ "type": "uint256"
+ }, {
+ "name": "",
+ "type": "bytes"
+ }],
+ "payable": false,
+ "type": "function"
+}];
+
+__embarkENS.registryAddresses = {
+ // Mainnet
+ "1": "0x314159265dd8dbb310642f98f50c066173c1259b",
+ // Ropsten
+ "3": "0x112234455c3a32fd11230c42e7bccd4a84e02010",
+ // Rinkeby
+ "4": "0xe7410170f87102DF0055eB195163A03B7F2Bff4A"
+};
+
+__embarkENS.setProvider = function () {
+ const self = this;
+ // get network id and then assign ENS contract based on that
+ let registryAddresses = this.registryAddresses;
+ this.ens = null;
+ __WEBPACK_IMPORTED_MODULE_1_Embark_web3__["a" /* default */].eth.net.getId().then(id => {
+ if (registryAddresses[id] !== undefined) {
+ EmbarkJS.onReady(() => {
+ self.ens = new EmbarkJS.Contract({ abi: self.registryInterface, address: registryAddresses[id] });
+ });
+ }
+ // todo: deploy at this point
+ }).catch(e => {
+ if (e.message.indexOf('Provider not set or invalid') > -1) {
+ console.warn('ENS is not available in this chain');
+ return;
+ }
+ console.error(e);
+ });
+};
+
+__embarkENS.resolve = function (name) {
+ const self = this;
+
+ if (self.ens === undefined) return;
+
+ let node = __WEBPACK_IMPORTED_MODULE_4_eth_ens_namehash___default.a.hash(name);
+
+ return self.ens.methods.resolver(node).call().then(resolverAddress => {
+ let resolverContract = new EmbarkJS.Contract({ abi: self.resolverInterface, address: resolverAddress });
+ return resolverContract.methods.addr(node).call();
+ }).then(addr => {
+ return addr;
+ }).catch(err => err);
+};
+
+__embarkENS.lookup = function (address) {
+ const self = this;
+
+ if (self.ens === undefined) return;
+
+ if (address.startsWith("0x")) address = address.slice(2);
+
+ let node = __WEBPACK_IMPORTED_MODULE_4_eth_ens_namehash___default.a.hash(address.toLowerCase() + ".addr.reverse");
+
+ return self.ens.methods.resolver(node).call().then(resolverAddress => {
+ let resolverContract = new EmbarkJS.Contract({ abi: self.resolverInterface, address: resolverAddress });
+ return resolverContract.methods.name(node).call();
+ }).then(name => {
+ if (name === "" || name === undefined) throw Error("ENS name not found");
+ return name;
+ }).catch(err => err);
+};
+
+EmbarkJS.Names.registerProvider('ens', __embarkENS);
+var whenEnvIsLoaded = function (cb) {
+ if (typeof document !== 'undefined' && document !== null && !/comp|inter|loaded/.test(document.readyState)) {
+ document.addEventListener('DOMContentLoaded', cb);
+ } else {
+ cb();
+ }
+};
+whenEnvIsLoaded(function () {
+
+ EmbarkJS.Messages.setProvider('whisper', { "server": "localhost", "port": 8546, "type": "ws" });
+});
+
+var whenEnvIsLoaded = function (cb) {
+ if (typeof document !== 'undefined' && document !== null && !/comp|inter|loaded/.test(document.readyState)) {
+ document.addEventListener('DOMContentLoaded', cb);
+ } else {
+ cb();
+ }
+};
+whenEnvIsLoaded(function () {
+
+ __embarkStorage.setProviders([{ "provider": "ipfs", "host": "localhost", "port": 5001, "getUrl": "http://localhost:8080/ipfs/" }]);
+});
+
+var whenEnvIsLoaded = function (cb) {
+ if (typeof document !== 'undefined' && document !== null && !/comp|inter|loaded/.test(document.readyState)) {
+ document.addEventListener('DOMContentLoaded', cb);
+ } else {
+ cb();
+ }
+};
+whenEnvIsLoaded(function () {
+
+ EmbarkJS.Names.setProvider('ens', {});
+});
+
+/***/ }),
+/* 152 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js__ = __webpack_require__(239);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js__);
+
+
+
+if (typeof web3 !== 'undefined') {} else {
+ var web3 = new __WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js___default.a();
+}function __reduce(arr, memo, iteratee, cb) {
+ if (typeof cb !== 'function') {
+ if (typeof memo === 'function' && typeof iteratee === 'function') {
+ cb = iteratee;
+ iteratee = memo;
+ memo = [];
+ } else {
+ throw new TypeError('expected callback to be a function');
+ }
+ }
+
+ if (!Array.isArray(arr)) {
+ cb(new TypeError('expected an array'));
+ return;
+ }
+
+ if (typeof iteratee !== 'function') {
+ cb(new TypeError('expected iteratee to be a function'));
+ return;
+ }
+
+ (function next(i, acc) {
+ if (i === arr.length) {
+ cb(null, acc);
+ return;
+ }
+
+ iteratee(acc, arr[i], function (err, val) {
+ if (err) {
+ cb(err);
+ return;
+ }
+ next(i + 1, val);
+ });
+ })(0, memo);
+};
+
+function __isNewWeb3_1() {
+ return typeof web3.version === "string";
+};
+
+function __getAccounts(cb) {
+ if (__isNewWeb3_1()) {
+ web3.eth.getAccounts().then(function (accounts) {
+ cb(null, accounts);
+ return null;
+ }).catch(function (err) {
+ cb(err);
+ return null;
+ });
+ return;
+ }
+ web3.eth.getAccounts(cb);
+};
+
+var __mainContext = __mainContext || this;
+__mainContext.__LoadManager = function () {
+ this.list = [];this.done = false;this.err = null;
+};
+__mainContext.__LoadManager.prototype.execWhenReady = function (cb) {
+ if (this.done) {
+ cb(this.err);
+ } else {
+ this.list.push(cb);
+ }
+};
+__mainContext.__LoadManager.prototype.doFirst = function (todo) {
+ var self = this;todo(function (err) {
+ self.done = true;self.err = err;self.list.map(x => x.apply(x, [self.err]));
+ });
+};
+__mainContext.__loadManagerInstance = new __mainContext.__LoadManager();
+var whenEnvIsLoaded = function (cb) {
+ if (typeof document !== 'undefined' && document !== null && !/comp|inter|loaded/.test(document.readyState)) {
+ document.addEventListener('DOMContentLoaded', cb);
+ } else {
+ cb();
+ }
+};
+whenEnvIsLoaded(function () {
+ __mainContext.__loadManagerInstance.doFirst(function (done) {
+ __mainContext.web3 = undefined;
+ __reduce(["$WEB3", "ws://localhost:8546", "http://localhost:8545"], function (prev, value, next) {
+ if (prev === false) {
+ return next(null, false);
+ }
+
+ if (value === '$WEB3' && typeof web3 !== 'undefined' && typeof __WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js___default.a !== 'undefined') {
+ web3.setProvider(web3.givenProvider);
+ } else if (value !== '$WEB3' && typeof __WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js___default.a !== 'undefined' && (typeof web3 === 'undefined' || typeof web3 !== 'undefined' && (!web3.isConnected || web3.isConnected && !web3.isConnected()))) {
+ if (value.indexOf('ws://') >= 0) {
+ web3.setProvider(new __WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js___default.a.providers.WebsocketProvider(value));
+ } else {
+ web3.setProvider(new __WEBPACK_IMPORTED_MODULE_0__home_i0026_nvm_versions_node_v10_5_0_lib_node_modules_embark_js_web3_1_0_min_js___default.a.providers.HttpProvider(value));
+ }
+ } else if (value === '$WEB3') {
+ return next(null, '');
+ }
+
+ __getAccounts(function (err, account) {
+ if (err) {
+ next(null, true);
+ } else {
+ next(null, false);
+ }
+ });
+ }, function (err, _result) {
+ __getAccounts(function (err, accounts) {
+
+ if (web3.eth.currentProvider && web3.eth.currentProvider.isMetaMask) {
+ console.log("%cNote: Embark has detected you are in the development environment and using Metamask, please make sure Metamask is connected to your local node", "font-size: 2em");
+ }
+
+ if (accounts) {
+ web3.eth.defaultAccount = accounts[0];
+ }
+ done(err);
+ });
+ });
+ });
+});
+
+global.__embarkContext = __mainContext.__loadManagerInstance;
+
+window.web3 = web3;
+
+/* harmony default export */ __webpack_exports__["a"] = (web3);
+/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(18)))
+
+/***/ }),
+/* 153 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/* WEBPACK VAR INJECTION */(function(global, module) {/**
+ * lodash (Custom Build)
+ * Build: `lodash modularize exports="npm" -o ./`
+ * Copyright jQuery Foundation and other contributors
+ * Released under MIT license
+ * Based on Underscore.js 1.8.3
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ */
+
+/** Used as the size to enable large array optimizations. */
+var LARGE_ARRAY_SIZE = 200;
+
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/** Used to stand-in for `undefined` hash values. */
+var HASH_UNDEFINED = '__lodash_hash_undefined__';
+
+/** Used to compose bitmasks for comparison styles. */
+var UNORDERED_COMPARE_FLAG = 1,
+ PARTIAL_COMPARE_FLAG = 2;
+
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0,
+ MAX_SAFE_INTEGER = 9007199254740991;
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ genTag = '[object GeneratorFunction]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ promiseTag = '[object Promise]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ symbolTag = '[object Symbol]',
+ weakMapTag = '[object WeakMap]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ dataViewTag = '[object DataView]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/** Used to match property names within property paths. */
+var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
+ reIsPlainProp = /^\w*$/,
+ reLeadingDot = /^\./,
+ rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
+
+/**
+ * Used to match `RegExp`
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
+ */
+var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
+
+/** Used to match backslashes in property paths. */
+var reEscapeChar = /\\(\\)?/g;
+
+/** Used to detect host constructors (Safari). */
+var reIsHostCtor = /^\[object .+?Constructor\]$/;
+
+/** Used to detect unsigned integer values. */
+var reIsUint = /^(?:0|[1-9]\d*)$/;
+
+/** Used to identify `toStringTag` values of typed arrays. */
+var typedArrayTags = {};
+typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
+typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
+typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
+typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
+typedArrayTags[uint32Tag] = true;
+typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
+typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
+typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
+typedArrayTags[errorTag] = typedArrayTags[funcTag] =
+typedArrayTags[mapTag] = typedArrayTags[numberTag] =
+typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
+typedArrayTags[setTag] = typedArrayTags[stringTag] =
+typedArrayTags[weakMapTag] = false;
+
+/** Detect free variable `global` from Node.js. */
+var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
+
+/** Detect free variable `self`. */
+var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
+
+/** Used as a reference to the global object. */
+var root = freeGlobal || freeSelf || Function('return this')();
+
+/** Detect free variable `exports`. */
+var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
+
+/** Detect free variable `module`. */
+var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
+
+/** Detect the popular CommonJS extension `module.exports`. */
+var moduleExports = freeModule && freeModule.exports === freeExports;
+
+/** Detect free variable `process` from Node.js. */
+var freeProcess = moduleExports && freeGlobal.process;
+
+/** Used to access faster Node.js helpers. */
+var nodeUtil = (function() {
+ try {
+ return freeProcess && freeProcess.binding('util');
+ } catch (e) {}
+}());
+
+/* Node.js helper references. */
+var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
+
+/**
+ * A specialized version of `_.map` for arrays without support for iteratee
+ * shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function arrayMap(array, iteratee) {
+ var index = -1,
+ length = array ? array.length : 0,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+}
+
+/**
+ * A specialized version of `_.some` for arrays without support for iteratee
+ * shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+function arraySome(array, predicate) {
+ var index = -1,
+ length = array ? array.length : 0;
+
+ while (++index < length) {
+ if (predicate(array[index], index, array)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new accessor function.
+ */
+function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : object[key];
+ };
+}
+
+/**
+ * The base implementation of `_.times` without support for iteratee shorthands
+ * or max array length checks.
+ *
+ * @private
+ * @param {number} n The number of times to invoke `iteratee`.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the array of results.
+ */
+function baseTimes(n, iteratee) {
+ var index = -1,
+ result = Array(n);
+
+ while (++index < n) {
+ result[index] = iteratee(index);
+ }
+ return result;
+}
+
+/**
+ * The base implementation of `_.unary` without support for storing metadata.
+ *
+ * @private
+ * @param {Function} func The function to cap arguments for.
+ * @returns {Function} Returns the new capped function.
+ */
+function baseUnary(func) {
+ return function(value) {
+ return func(value);
+ };
+}
+
+/**
+ * Gets the value at `key` of `object`.
+ *
+ * @private
+ * @param {Object} [object] The object to query.
+ * @param {string} key The key of the property to get.
+ * @returns {*} Returns the property value.
+ */
+function getValue(object, key) {
+ return object == null ? undefined : object[key];
+}
+
+/**
+ * Checks if `value` is a host object in IE < 9.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
+ */
+function isHostObject(value) {
+ // Many host objects are `Object` objects that can coerce to strings
+ // despite having improperly defined `toString` methods.
+ var result = false;
+ if (value != null && typeof value.toString != 'function') {
+ try {
+ result = !!(value + '');
+ } catch (e) {}
+ }
+ return result;
+}
+
+/**
+ * Converts `map` to its key-value pairs.
+ *
+ * @private
+ * @param {Object} map The map to convert.
+ * @returns {Array} Returns the key-value pairs.
+ */
+function mapToArray(map) {
+ var index = -1,
+ result = Array(map.size);
+
+ map.forEach(function(value, key) {
+ result[++index] = [key, value];
+ });
+ return result;
+}
+
+/**
+ * Creates a unary function that invokes `func` with its argument transformed.
+ *
+ * @private
+ * @param {Function} func The function to wrap.
+ * @param {Function} transform The argument transform.
+ * @returns {Function} Returns the new function.
+ */
+function overArg(func, transform) {
+ return function(arg) {
+ return func(transform(arg));
+ };
+}
+
+/**
+ * Converts `set` to an array of its values.
+ *
+ * @private
+ * @param {Object} set The set to convert.
+ * @returns {Array} Returns the values.
+ */
+function setToArray(set) {
+ var index = -1,
+ result = Array(set.size);
+
+ set.forEach(function(value) {
+ result[++index] = value;
+ });
+ return result;
+}
+
+/** Used for built-in method references. */
+var arrayProto = Array.prototype,
+ funcProto = Function.prototype,
+ objectProto = Object.prototype;
+
+/** Used to detect overreaching core-js shims. */
+var coreJsData = root['__core-js_shared__'];
+
+/** Used to detect methods masquerading as native. */
+var maskSrcKey = (function() {
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
+ return uid ? ('Symbol(src)_1.' + uid) : '';
+}());
+
+/** Used to resolve the decompiled source of functions. */
+var funcToString = funcProto.toString;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objectToString = objectProto.toString;
+
+/** Used to detect if a method is native. */
+var reIsNative = RegExp('^' +
+ funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+);
+
+/** Built-in value references. */
+var Symbol = root.Symbol,
+ Uint8Array = root.Uint8Array,
+ propertyIsEnumerable = objectProto.propertyIsEnumerable,
+ splice = arrayProto.splice;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeKeys = overArg(Object.keys, Object);
+
+/* Built-in method references that are verified to be native. */
+var DataView = getNative(root, 'DataView'),
+ Map = getNative(root, 'Map'),
+ Promise = getNative(root, 'Promise'),
+ Set = getNative(root, 'Set'),
+ WeakMap = getNative(root, 'WeakMap'),
+ nativeCreate = getNative(Object, 'create');
+
+/** Used to detect maps, sets, and weakmaps. */
+var dataViewCtorString = toSource(DataView),
+ mapCtorString = toSource(Map),
+ promiseCtorString = toSource(Promise),
+ setCtorString = toSource(Set),
+ weakMapCtorString = toSource(WeakMap);
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol ? Symbol.prototype : undefined,
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
+
+/**
+ * Creates a hash object.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */
+function Hash(entries) {
+ var index = -1,
+ length = entries ? entries.length : 0;
+
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+}
+
+/**
+ * Removes all key-value entries from the hash.
+ *
+ * @private
+ * @name clear
+ * @memberOf Hash
+ */
+function hashClear() {
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
+}
+
+/**
+ * Removes `key` and its value from the hash.
+ *
+ * @private
+ * @name delete
+ * @memberOf Hash
+ * @param {Object} hash The hash to modify.
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */
+function hashDelete(key) {
+ return this.has(key) && delete this.__data__[key];
+}
+
+/**
+ * Gets the hash value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf Hash
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */
+function hashGet(key) {
+ var data = this.__data__;
+ if (nativeCreate) {
+ var result = data[key];
+ return result === HASH_UNDEFINED ? undefined : result;
+ }
+ return hasOwnProperty.call(data, key) ? data[key] : undefined;
+}
+
+/**
+ * Checks if a hash value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf Hash
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+function hashHas(key) {
+ var data = this.__data__;
+ return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
+}
+
+/**
+ * Sets the hash `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf Hash
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the hash instance.
+ */
+function hashSet(key, value) {
+ var data = this.__data__;
+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
+ return this;
+}
+
+// Add methods to `Hash`.
+Hash.prototype.clear = hashClear;
+Hash.prototype['delete'] = hashDelete;
+Hash.prototype.get = hashGet;
+Hash.prototype.has = hashHas;
+Hash.prototype.set = hashSet;
+
+/**
+ * Creates an list cache object.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */
+function ListCache(entries) {
+ var index = -1,
+ length = entries ? entries.length : 0;
+
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+}
+
+/**
+ * Removes all key-value entries from the list cache.
+ *
+ * @private
+ * @name clear
+ * @memberOf ListCache
+ */
+function listCacheClear() {
+ this.__data__ = [];
+}
+
+/**
+ * Removes `key` and its value from the list cache.
+ *
+ * @private
+ * @name delete
+ * @memberOf ListCache
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */
+function listCacheDelete(key) {
+ var data = this.__data__,
+ index = assocIndexOf(data, key);
+
+ if (index < 0) {
+ return false;
+ }
+ var lastIndex = data.length - 1;
+ if (index == lastIndex) {
+ data.pop();
+ } else {
+ splice.call(data, index, 1);
+ }
+ return true;
+}
+
+/**
+ * Gets the list cache value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf ListCache
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */
+function listCacheGet(key) {
+ var data = this.__data__,
+ index = assocIndexOf(data, key);
+
+ return index < 0 ? undefined : data[index][1];
+}
+
+/**
+ * Checks if a list cache value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf ListCache
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+function listCacheHas(key) {
+ return assocIndexOf(this.__data__, key) > -1;
+}
+
+/**
+ * Sets the list cache `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf ListCache
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the list cache instance.
+ */
+function listCacheSet(key, value) {
+ var data = this.__data__,
+ index = assocIndexOf(data, key);
+
+ if (index < 0) {
+ data.push([key, value]);
+ } else {
+ data[index][1] = value;
+ }
+ return this;
+}
+
+// Add methods to `ListCache`.
+ListCache.prototype.clear = listCacheClear;
+ListCache.prototype['delete'] = listCacheDelete;
+ListCache.prototype.get = listCacheGet;
+ListCache.prototype.has = listCacheHas;
+ListCache.prototype.set = listCacheSet;
+
+/**
+ * Creates a map cache object to store key-value pairs.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */
+function MapCache(entries) {
+ var index = -1,
+ length = entries ? entries.length : 0;
+
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+}
+
+/**
+ * Removes all key-value entries from the map.
+ *
+ * @private
+ * @name clear
+ * @memberOf MapCache
+ */
+function mapCacheClear() {
+ this.__data__ = {
+ 'hash': new Hash,
+ 'map': new (Map || ListCache),
+ 'string': new Hash
+ };
+}
+
+/**
+ * Removes `key` and its value from the map.
+ *
+ * @private
+ * @name delete
+ * @memberOf MapCache
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */
+function mapCacheDelete(key) {
+ return getMapData(this, key)['delete'](key);
+}
+
+/**
+ * Gets the map value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf MapCache
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */
+function mapCacheGet(key) {
+ return getMapData(this, key).get(key);
+}
+
+/**
+ * Checks if a map value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf MapCache
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+function mapCacheHas(key) {
+ return getMapData(this, key).has(key);
+}
+
+/**
+ * Sets the map `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf MapCache
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the map cache instance.
+ */
+function mapCacheSet(key, value) {
+ getMapData(this, key).set(key, value);
+ return this;
+}
+
+// Add methods to `MapCache`.
+MapCache.prototype.clear = mapCacheClear;
+MapCache.prototype['delete'] = mapCacheDelete;
+MapCache.prototype.get = mapCacheGet;
+MapCache.prototype.has = mapCacheHas;
+MapCache.prototype.set = mapCacheSet;
+
+/**
+ *
+ * Creates an array cache object to store unique values.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [values] The values to cache.
+ */
+function SetCache(values) {
+ var index = -1,
+ length = values ? values.length : 0;
+
+ this.__data__ = new MapCache;
+ while (++index < length) {
+ this.add(values[index]);
+ }
+}
+
+/**
+ * Adds `value` to the array cache.
+ *
+ * @private
+ * @name add
+ * @memberOf SetCache
+ * @alias push
+ * @param {*} value The value to cache.
+ * @returns {Object} Returns the cache instance.
+ */
+function setCacheAdd(value) {
+ this.__data__.set(value, HASH_UNDEFINED);
+ return this;
+}
+
+/**
+ * Checks if `value` is in the array cache.
+ *
+ * @private
+ * @name has
+ * @memberOf SetCache
+ * @param {*} value The value to search for.
+ * @returns {number} Returns `true` if `value` is found, else `false`.
+ */
+function setCacheHas(value) {
+ return this.__data__.has(value);
+}
+
+// Add methods to `SetCache`.
+SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
+SetCache.prototype.has = setCacheHas;
+
+/**
+ * Creates a stack cache object to store key-value pairs.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */
+function Stack(entries) {
+ this.__data__ = new ListCache(entries);
+}
+
+/**
+ * Removes all key-value entries from the stack.
+ *
+ * @private
+ * @name clear
+ * @memberOf Stack
+ */
+function stackClear() {
+ this.__data__ = new ListCache;
+}
+
+/**
+ * Removes `key` and its value from the stack.
+ *
+ * @private
+ * @name delete
+ * @memberOf Stack
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */
+function stackDelete(key) {
+ return this.__data__['delete'](key);
+}
+
+/**
+ * Gets the stack value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf Stack
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */
+function stackGet(key) {
+ return this.__data__.get(key);
+}
+
+/**
+ * Checks if a stack value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf Stack
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+function stackHas(key) {
+ return this.__data__.has(key);
+}
+
+/**
+ * Sets the stack `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf Stack
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the stack cache instance.
+ */
+function stackSet(key, value) {
+ var cache = this.__data__;
+ if (cache instanceof ListCache) {
+ var pairs = cache.__data__;
+ if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
+ pairs.push([key, value]);
+ return this;
+ }
+ cache = this.__data__ = new MapCache(pairs);
+ }
+ cache.set(key, value);
+ return this;
+}
+
+// Add methods to `Stack`.
+Stack.prototype.clear = stackClear;
+Stack.prototype['delete'] = stackDelete;
+Stack.prototype.get = stackGet;
+Stack.prototype.has = stackHas;
+Stack.prototype.set = stackSet;
+
+/**
+ * Creates an array of the enumerable property names of the array-like `value`.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @param {boolean} inherited Specify returning inherited property names.
+ * @returns {Array} Returns the array of property names.
+ */
+function arrayLikeKeys(value, inherited) {
+ // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
+ // Safari 9 makes `arguments.length` enumerable in strict mode.
+ var result = (isArray(value) || isArguments(value))
+ ? baseTimes(value.length, String)
+ : [];
+
+ var length = result.length,
+ skipIndexes = !!length;
+
+ for (var key in value) {
+ if ((inherited || hasOwnProperty.call(value, key)) &&
+ !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+/**
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} key The key to search for.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function assocIndexOf(array, key) {
+ var length = array.length;
+ while (length--) {
+ if (eq(array[length][0], key)) {
+ return length;
+ }
+ }
+ return -1;
+}
+
+/**
+ * The base implementation of `_.forEach` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object} Returns `collection`.
+ */
+var baseEach = createBaseEach(baseForOwn);
+
+/**
+ * The base implementation of `baseForOwn` which iterates over `object`
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+var baseFor = createBaseFor();
+
+/**
+ * The base implementation of `_.forOwn` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForOwn(object, iteratee) {
+ return object && baseFor(object, iteratee, keys);
+}
+
+/**
+ * The base implementation of `_.get` without support for default values.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to get.
+ * @returns {*} Returns the resolved value.
+ */
+function baseGet(object, path) {
+ path = isKey(path, object) ? [path] : castPath(path);
+
+ var index = 0,
+ length = path.length;
+
+ while (object != null && index < length) {
+ object = object[toKey(path[index++])];
+ }
+ return (index && index == length) ? object : undefined;
+}
+
+/**
+ * The base implementation of `getTag`.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */
+function baseGetTag(value) {
+ return objectToString.call(value);
+}
+
+/**
+ * The base implementation of `_.hasIn` without support for deep paths.
+ *
+ * @private
+ * @param {Object} [object] The object to query.
+ * @param {Array|string} key The key to check.
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
+ */
+function baseHasIn(object, key) {
+ return object != null && key in Object(object);
+}
+
+/**
+ * The base implementation of `_.isEqual` which supports partial comparisons
+ * and tracks traversed objects.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {Function} [customizer] The function to customize comparisons.
+ * @param {boolean} [bitmask] The bitmask of comparison flags.
+ * The bitmask may be composed of the following flags:
+ * 1 - Unordered comparison
+ * 2 - Partial comparison
+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ */
+function baseIsEqual(value, other, customizer, bitmask, stack) {
+ if (value === other) {
+ return true;
+ }
+ if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
+ return value !== value && other !== other;
+ }
+ return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
+}
+
+/**
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
+ * deep comparisons and tracks traversed objects enabling objects with circular
+ * references to be compared.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparisons.
+ * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`
+ * for more details.
+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
+ var objIsArr = isArray(object),
+ othIsArr = isArray(other),
+ objTag = arrayTag,
+ othTag = arrayTag;
+
+ if (!objIsArr) {
+ objTag = getTag(object);
+ objTag = objTag == argsTag ? objectTag : objTag;
+ }
+ if (!othIsArr) {
+ othTag = getTag(other);
+ othTag = othTag == argsTag ? objectTag : othTag;
+ }
+ var objIsObj = objTag == objectTag && !isHostObject(object),
+ othIsObj = othTag == objectTag && !isHostObject(other),
+ isSameTag = objTag == othTag;
+
+ if (isSameTag && !objIsObj) {
+ stack || (stack = new Stack);
+ return (objIsArr || isTypedArray(object))
+ ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)
+ : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
+ }
+ if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
+
+ if (objIsWrapped || othIsWrapped) {
+ var objUnwrapped = objIsWrapped ? object.value() : object,
+ othUnwrapped = othIsWrapped ? other.value() : other;
+
+ stack || (stack = new Stack);
+ return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
+ }
+ }
+ if (!isSameTag) {
+ return false;
+ }
+ stack || (stack = new Stack);
+ return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
+}
+
+/**
+ * The base implementation of `_.isMatch` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Object} source The object of property values to match.
+ * @param {Array} matchData The property names, values, and compare flags to match.
+ * @param {Function} [customizer] The function to customize comparisons.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ */
+function baseIsMatch(object, source, matchData, customizer) {
+ var index = matchData.length,
+ length = index,
+ noCustomizer = !customizer;
+
+ if (object == null) {
+ return !length;
+ }
+ object = Object(object);
+ while (index--) {
+ var data = matchData[index];
+ if ((noCustomizer && data[2])
+ ? data[1] !== object[data[0]]
+ : !(data[0] in object)
+ ) {
+ return false;
+ }
+ }
+ while (++index < length) {
+ data = matchData[index];
+ var key = data[0],
+ objValue = object[key],
+ srcValue = data[1];
+
+ if (noCustomizer && data[2]) {
+ if (objValue === undefined && !(key in object)) {
+ return false;
+ }
+ } else {
+ var stack = new Stack;
+ if (customizer) {
+ var result = customizer(objValue, srcValue, key, object, source, stack);
+ }
+ if (!(result === undefined
+ ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)
+ : result
+ )) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+/**
+ * The base implementation of `_.isNative` without bad shim checks.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function,
+ * else `false`.
+ */
+function baseIsNative(value) {
+ if (!isObject(value) || isMasked(value)) {
+ return false;
+ }
+ var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
+ return pattern.test(toSource(value));
+}
+
+/**
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
+ */
+function baseIsTypedArray(value) {
+ return isObjectLike(value) &&
+ isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
+}
+
+/**
+ * The base implementation of `_.iteratee`.
+ *
+ * @private
+ * @param {*} [value=_.identity] The value to convert to an iteratee.
+ * @returns {Function} Returns the iteratee.
+ */
+function baseIteratee(value) {
+ // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
+ // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
+ if (typeof value == 'function') {
+ return value;
+ }
+ if (value == null) {
+ return identity;
+ }
+ if (typeof value == 'object') {
+ return isArray(value)
+ ? baseMatchesProperty(value[0], value[1])
+ : baseMatches(value);
+ }
+ return property(value);
+}
+
+/**
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+function baseKeys(object) {
+ if (!isPrototype(object)) {
+ return nativeKeys(object);
+ }
+ var result = [];
+ for (var key in Object(object)) {
+ if (hasOwnProperty.call(object, key) && key != 'constructor') {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+/**
+ * The base implementation of `_.map` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function baseMap(collection, iteratee) {
+ var index = -1,
+ result = isArrayLike(collection) ? Array(collection.length) : [];
+
+ baseEach(collection, function(value, key, collection) {
+ result[++index] = iteratee(value, key, collection);
+ });
+ return result;
+}
+
+/**
+ * The base implementation of `_.matches` which doesn't clone `source`.
+ *
+ * @private
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new spec function.
+ */
+function baseMatches(source) {
+ var matchData = getMatchData(source);
+ if (matchData.length == 1 && matchData[0][2]) {
+ return matchesStrictComparable(matchData[0][0], matchData[0][1]);
+ }
+ return function(object) {
+ return object === source || baseIsMatch(object, source, matchData);
+ };
+}
+
+/**
+ * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
+ *
+ * @private
+ * @param {string} path The path of the property to get.
+ * @param {*} srcValue The value to match.
+ * @returns {Function} Returns the new spec function.
+ */
+function baseMatchesProperty(path, srcValue) {
+ if (isKey(path) && isStrictComparable(srcValue)) {
+ return matchesStrictComparable(toKey(path), srcValue);
+ }
+ return function(object) {
+ var objValue = get(object, path);
+ return (objValue === undefined && objValue === srcValue)
+ ? hasIn(object, path)
+ : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
+ };
+}
+
+/**
+ * A specialized version of `baseProperty` which supports deep paths.
+ *
+ * @private
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new accessor function.
+ */
+function basePropertyDeep(path) {
+ return function(object) {
+ return baseGet(object, path);
+ };
+}
+
+/**
+ * The base implementation of `_.toString` which doesn't convert nullish
+ * values to empty strings.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == 'string') {
+ return value;
+ }
+ if (isSymbol(value)) {
+ return symbolToString ? symbolToString.call(value) : '';
+ }
+ var result = (value + '');
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
+
+/**
+ * Casts `value` to a path array if it's not one.
+ *
+ * @private
+ * @param {*} value The value to inspect.
+ * @returns {Array} Returns the cast property path array.
+ */
+function castPath(value) {
+ return isArray(value) ? value : stringToPath(value);
+}
+
+/**
+ * Creates a `baseEach` or `baseEachRight` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseEach(eachFunc, fromRight) {
+ return function(collection, iteratee) {
+ if (collection == null) {
+ return collection;
+ }
+ if (!isArrayLike(collection)) {
+ return eachFunc(collection, iteratee);
+ }
+ var length = collection.length,
+ index = fromRight ? length : -1,
+ iterable = Object(collection);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (iteratee(iterable[index], index, iterable) === false) {
+ break;
+ }
+ }
+ return collection;
+ };
+}
+
+/**
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseFor(fromRight) {
+ return function(object, iteratee, keysFunc) {
+ var index = -1,
+ iterable = Object(object),
+ props = keysFunc(object),
+ length = props.length;
+
+ while (length--) {
+ var key = props[fromRight ? length : ++index];
+ if (iteratee(iterable[key], key, iterable) === false) {
+ break;
+ }
+ }
+ return object;
+ };
+}
+
+/**
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Array} array The array to compare.
+ * @param {Array} other The other array to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} customizer The function to customize comparisons.
+ * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
+ * for more details.
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
+ */
+function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
+ var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
+ arrLength = array.length,
+ othLength = other.length;
+
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
+ return false;
+ }
+ // Assume cyclic values are equal.
+ var stacked = stack.get(array);
+ if (stacked && stack.get(other)) {
+ return stacked == other;
+ }
+ var index = -1,
+ result = true,
+ seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;
+
+ stack.set(array, other);
+ stack.set(other, array);
+
+ // Ignore non-index properties.
+ while (++index < arrLength) {
+ var arrValue = array[index],
+ othValue = other[index];
+
+ if (customizer) {
+ var compared = isPartial
+ ? customizer(othValue, arrValue, index, other, array, stack)
+ : customizer(arrValue, othValue, index, array, other, stack);
+ }
+ if (compared !== undefined) {
+ if (compared) {
+ continue;
+ }
+ result = false;
+ break;
+ }
+ // Recursively compare arrays (susceptible to call stack limits).
+ if (seen) {
+ if (!arraySome(other, function(othValue, othIndex) {
+ if (!seen.has(othIndex) &&
+ (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
+ return seen.add(othIndex);
+ }
+ })) {
+ result = false;
+ break;
+ }
+ } else if (!(
+ arrValue === othValue ||
+ equalFunc(arrValue, othValue, customizer, bitmask, stack)
+ )) {
+ result = false;
+ break;
+ }
+ }
+ stack['delete'](array);
+ stack['delete'](other);
+ return result;
+}
+
+/**
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
+ * the same `toStringTag`.
+ *
+ * **Note:** This function only supports comparing values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {string} tag The `toStringTag` of the objects to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} customizer The function to customize comparisons.
+ * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
+ * for more details.
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
+ switch (tag) {
+ case dataViewTag:
+ if ((object.byteLength != other.byteLength) ||
+ (object.byteOffset != other.byteOffset)) {
+ return false;
+ }
+ object = object.buffer;
+ other = other.buffer;
+
+ case arrayBufferTag:
+ if ((object.byteLength != other.byteLength) ||
+ !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
+ return false;
+ }
+ return true;
+
+ case boolTag:
+ case dateTag:
+ case numberTag:
+ // Coerce booleans to `1` or `0` and dates to milliseconds.
+ // Invalid dates are coerced to `NaN`.
+ return eq(+object, +other);
+
+ case errorTag:
+ return object.name == other.name && object.message == other.message;
+
+ case regexpTag:
+ case stringTag:
+ // Coerce regexes to strings and treat strings, primitives and objects,
+ // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
+ // for more details.
+ return object == (other + '');
+
+ case mapTag:
+ var convert = mapToArray;
+
+ case setTag:
+ var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
+ convert || (convert = setToArray);
+
+ if (object.size != other.size && !isPartial) {
+ return false;
+ }
+ // Assume cyclic values are equal.
+ var stacked = stack.get(object);
+ if (stacked) {
+ return stacked == other;
+ }
+ bitmask |= UNORDERED_COMPARE_FLAG;
+
+ // Recursively compare objects (susceptible to call stack limits).
+ stack.set(object, other);
+ var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
+ stack['delete'](object);
+ return result;
+
+ case symbolTag:
+ if (symbolValueOf) {
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
+ }
+ }
+ return false;
+}
+
+/**
+ * A specialized version of `baseIsEqualDeep` for objects with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} customizer The function to customize comparisons.
+ * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
+ * for more details.
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
+ var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
+ objProps = keys(object),
+ objLength = objProps.length,
+ othProps = keys(other),
+ othLength = othProps.length;
+
+ if (objLength != othLength && !isPartial) {
+ return false;
+ }
+ var index = objLength;
+ while (index--) {
+ var key = objProps[index];
+ if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
+ return false;
+ }
+ }
+ // Assume cyclic values are equal.
+ var stacked = stack.get(object);
+ if (stacked && stack.get(other)) {
+ return stacked == other;
+ }
+ var result = true;
+ stack.set(object, other);
+ stack.set(other, object);
+
+ var skipCtor = isPartial;
+ while (++index < objLength) {
+ key = objProps[index];
+ var objValue = object[key],
+ othValue = other[key];
+
+ if (customizer) {
+ var compared = isPartial
+ ? customizer(othValue, objValue, key, other, object, stack)
+ : customizer(objValue, othValue, key, object, other, stack);
+ }
+ // Recursively compare objects (susceptible to call stack limits).
+ if (!(compared === undefined
+ ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))
+ : compared
+ )) {
+ result = false;
+ break;
+ }
+ skipCtor || (skipCtor = key == 'constructor');
+ }
+ if (result && !skipCtor) {
+ var objCtor = object.constructor,
+ othCtor = other.constructor;
+
+ // Non `Object` object instances with different constructors are not equal.
+ if (objCtor != othCtor &&
+ ('constructor' in object && 'constructor' in other) &&
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
+ result = false;
+ }
+ }
+ stack['delete'](object);
+ stack['delete'](other);
+ return result;
+}
+
+/**
+ * Gets the data for `map`.
+ *
+ * @private
+ * @param {Object} map The map to query.
+ * @param {string} key The reference key.
+ * @returns {*} Returns the map data.
+ */
+function getMapData(map, key) {
+ var data = map.__data__;
+ return isKeyable(key)
+ ? data[typeof key == 'string' ? 'string' : 'hash']
+ : data.map;
+}
+
+/**
+ * Gets the property names, values, and compare flags of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the match data of `object`.
+ */
+function getMatchData(object) {
+ var result = keys(object),
+ length = result.length;
+
+ while (length--) {
+ var key = result[length],
+ value = object[key];
+
+ result[length] = [key, value, isStrictComparable(value)];
+ }
+ return result;
+}
+
+/**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */
+function getNative(object, key) {
+ var value = getValue(object, key);
+ return baseIsNative(value) ? value : undefined;
+}
+
+/**
+ * Gets the `toStringTag` of `value`.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */
+var getTag = baseGetTag;
+
+// Fallback for data views, maps, sets, and weak maps in IE 11,
+// for data views in Edge < 14, and promises in Node.js.
+if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
+ (Map && getTag(new Map) != mapTag) ||
+ (Promise && getTag(Promise.resolve()) != promiseTag) ||
+ (Set && getTag(new Set) != setTag) ||
+ (WeakMap && getTag(new WeakMap) != weakMapTag)) {
+ getTag = function(value) {
+ var result = objectToString.call(value),
+ Ctor = result == objectTag ? value.constructor : undefined,
+ ctorString = Ctor ? toSource(Ctor) : undefined;
+
+ if (ctorString) {
+ switch (ctorString) {
+ case dataViewCtorString: return dataViewTag;
+ case mapCtorString: return mapTag;
+ case promiseCtorString: return promiseTag;
+ case setCtorString: return setTag;
+ case weakMapCtorString: return weakMapTag;
+ }
+ }
+ return result;
+ };
+}
+
+/**
+ * Checks if `path` exists on `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path to check.
+ * @param {Function} hasFunc The function to check properties.
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
+ */
+function hasPath(object, path, hasFunc) {
+ path = isKey(path, object) ? [path] : castPath(path);
+
+ var result,
+ index = -1,
+ length = path.length;
+
+ while (++index < length) {
+ var key = toKey(path[index]);
+ if (!(result = object != null && hasFunc(object, key))) {
+ break;
+ }
+ object = object[key];
+ }
+ if (result) {
+ return result;
+ }
+ var length = object ? object.length : 0;
+ return !!length && isLength(length) && isIndex(key, length) &&
+ (isArray(object) || isArguments(object));
+}
+
+/**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+function isIndex(value, length) {
+ length = length == null ? MAX_SAFE_INTEGER : length;
+ return !!length &&
+ (typeof value == 'number' || reIsUint.test(value)) &&
+ (value > -1 && value % 1 == 0 && value < length);
+}
+
+/**
+ * Checks if `value` is a property name and not a property path.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {Object} [object] The object to query keys on.
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
+ */
+function isKey(value, object) {
+ if (isArray(value)) {
+ return false;
+ }
+ var type = typeof value;
+ if (type == 'number' || type == 'symbol' || type == 'boolean' ||
+ value == null || isSymbol(value)) {
+ return true;
+ }
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
+ (object != null && value in Object(object));
+}
+
+/**
+ * Checks if `value` is suitable for use as unique object key.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
+ */
+function isKeyable(value) {
+ var type = typeof value;
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
+ ? (value !== '__proto__')
+ : (value === null);
+}
+
+/**
+ * Checks if `func` has its source masked.
+ *
+ * @private
+ * @param {Function} func The function to check.
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
+ */
+function isMasked(func) {
+ return !!maskSrcKey && (maskSrcKey in func);
+}
+
+/**
+ * Checks if `value` is likely a prototype object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
+ */
+function isPrototype(value) {
+ var Ctor = value && value.constructor,
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
+
+ return value === proto;
+}
+
+/**
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
+ * equality comparisons, else `false`.
+ */
+function isStrictComparable(value) {
+ return value === value && !isObject(value);
+}
+
+/**
+ * A specialized version of `matchesProperty` for source values suitable
+ * for strict equality comparisons, i.e. `===`.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @param {*} srcValue The value to match.
+ * @returns {Function} Returns the new spec function.
+ */
+function matchesStrictComparable(key, srcValue) {
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ return object[key] === srcValue &&
+ (srcValue !== undefined || (key in Object(object)));
+ };
+}
+
+/**
+ * Converts `string` to a property path array.
+ *
+ * @private
+ * @param {string} string The string to convert.
+ * @returns {Array} Returns the property path array.
+ */
+var stringToPath = memoize(function(string) {
+ string = toString(string);
+
+ var result = [];
+ if (reLeadingDot.test(string)) {
+ result.push('');
+ }
+ string.replace(rePropName, function(match, number, quote, string) {
+ result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
+ });
+ return result;
+});
+
+/**
+ * Converts `value` to a string key if it's not a string or symbol.
+ *
+ * @private
+ * @param {*} value The value to inspect.
+ * @returns {string|symbol} Returns the key.
+ */
+function toKey(value) {
+ if (typeof value == 'string' || isSymbol(value)) {
+ return value;
+ }
+ var result = (value + '');
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
+
+/**
+ * Converts `func` to its source code.
+ *
+ * @private
+ * @param {Function} func The function to process.
+ * @returns {string} Returns the source code.
+ */
+function toSource(func) {
+ if (func != null) {
+ try {
+ return funcToString.call(func);
+ } catch (e) {}
+ try {
+ return (func + '');
+ } catch (e) {}
+ }
+ return '';
+}
+
+/**
+ * Creates an array of values by running each element in `collection` thru
+ * `iteratee`. The iteratee is invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * Many lodash methods are guarded to work as iteratees for methods like
+ * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
+ *
+ * The guarded methods are:
+ * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
+ * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
+ * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
+ * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ * @example
+ *
+ * function square(n) {
+ * return n * n;
+ * }
+ *
+ * _.map([4, 8], square);
+ * // => [16, 64]
+ *
+ * _.map({ 'a': 4, 'b': 8 }, square);
+ * // => [16, 64] (iteration order is not guaranteed)
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.map(users, 'user');
+ * // => ['barney', 'fred']
+ */
+function map(collection, iteratee) {
+ var func = isArray(collection) ? arrayMap : baseMap;
+ return func(collection, baseIteratee(iteratee, 3));
+}
+
+/**
+ * Creates a function that memoizes the result of `func`. If `resolver` is
+ * provided, it determines the cache key for storing the result based on the
+ * arguments provided to the memoized function. By default, the first argument
+ * provided to the memoized function is used as the map cache key. The `func`
+ * is invoked with the `this` binding of the memoized function.
+ *
+ * **Note:** The cache is exposed as the `cache` property on the memoized
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
+ * constructor with one whose instances implement the
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
+ * method interface of `delete`, `get`, `has`, and `set`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {Function} func The function to have its output memoized.
+ * @param {Function} [resolver] The function to resolve the cache key.
+ * @returns {Function} Returns the new memoized function.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': 2 };
+ * var other = { 'c': 3, 'd': 4 };
+ *
+ * var values = _.memoize(_.values);
+ * values(object);
+ * // => [1, 2]
+ *
+ * values(other);
+ * // => [3, 4]
+ *
+ * object.a = 2;
+ * values(object);
+ * // => [1, 2]
+ *
+ * // Modify the result cache.
+ * values.cache.set(object, ['a', 'b']);
+ * values(object);
+ * // => ['a', 'b']
+ *
+ * // Replace `_.memoize.Cache`.
+ * _.memoize.Cache = WeakMap;
+ */
+function memoize(func, resolver) {
+ if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ var memoized = function() {
+ var args = arguments,
+ key = resolver ? resolver.apply(this, args) : args[0],
+ cache = memoized.cache;
+
+ if (cache.has(key)) {
+ return cache.get(key);
+ }
+ var result = func.apply(this, args);
+ memoized.cache = cache.set(key, result);
+ return result;
+ };
+ memoized.cache = new (memoize.Cache || MapCache);
+ return memoized;
+}
+
+// Assign cache to `_.memoize`.
+memoize.Cache = MapCache;
+
+/**
+ * Performs a
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * comparison between two values to determine if they are equivalent.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ * @example
+ *
+ * var object = { 'a': 1 };
+ * var other = { 'a': 1 };
+ *
+ * _.eq(object, object);
+ * // => true
+ *
+ * _.eq(object, other);
+ * // => false
+ *
+ * _.eq('a', 'a');
+ * // => true
+ *
+ * _.eq('a', Object('a'));
+ * // => false
+ *
+ * _.eq(NaN, NaN);
+ * // => true
+ */
+function eq(value, other) {
+ return value === other || (value !== value && other !== other);
+}
+
+/**
+ * Checks if `value` is likely an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
+ * else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */
+function isArguments(value) {
+ // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
+ (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
+}
+
+/**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(document.body.children);
+ * // => false
+ *
+ * _.isArray('abc');
+ * // => false
+ *
+ * _.isArray(_.noop);
+ * // => false
+ */
+var isArray = Array.isArray;
+
+/**
+ * Checks if `value` is array-like. A value is considered array-like if it's
+ * not a function and has a `value.length` that's an integer greater than or
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ * @example
+ *
+ * _.isArrayLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isArrayLike(document.body.children);
+ * // => true
+ *
+ * _.isArrayLike('abc');
+ * // => true
+ *
+ * _.isArrayLike(_.noop);
+ * // => false
+ */
+function isArrayLike(value) {
+ return value != null && isLength(value.length) && !isFunction(value);
+}
+
+/**
+ * This method is like `_.isArrayLike` except that it also checks if `value`
+ * is an object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array-like object,
+ * else `false`.
+ * @example
+ *
+ * _.isArrayLikeObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isArrayLikeObject(document.body.children);
+ * // => true
+ *
+ * _.isArrayLikeObject('abc');
+ * // => false
+ *
+ * _.isArrayLikeObject(_.noop);
+ * // => false
+ */
+function isArrayLikeObject(value) {
+ return isObjectLike(value) && isArrayLike(value);
+}
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+function isFunction(value) {
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in Safari 8-9 which returns 'object' for typed array and other constructors.
+ var tag = isObject(value) ? objectToString.call(value) : '';
+ return tag == funcTag || tag == genTag;
+}
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This method is loosely based on
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ * @example
+ *
+ * _.isLength(3);
+ * // => true
+ *
+ * _.isLength(Number.MIN_VALUE);
+ * // => false
+ *
+ * _.isLength(Infinity);
+ * // => false
+ *
+ * _.isLength('3');
+ * // => false
+ */
+function isLength(value) {
+ return typeof value == 'number' &&
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+/**
+ * Checks if `value` is the
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+}
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+ return typeof value == 'symbol' ||
+ (isObjectLike(value) && objectToString.call(value) == symbolTag);
+}
+
+/**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
+ * @example
+ *
+ * _.isTypedArray(new Uint8Array);
+ * // => true
+ *
+ * _.isTypedArray([]);
+ * // => false
+ */
+var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
+
+/**
+ * Converts `value` to a string. An empty string is returned for `null`
+ * and `undefined` values. The sign of `-0` is preserved.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ * @example
+ *
+ * _.toString(null);
+ * // => ''
+ *
+ * _.toString(-0);
+ * // => '-0'
+ *
+ * _.toString([1, 2, 3]);
+ * // => '1,2,3'
+ */
+function toString(value) {
+ return value == null ? '' : baseToString(value);
+}
+
+/**
+ * Gets the value at `path` of `object`. If the resolved value is
+ * `undefined`, the `defaultValue` is returned in its place.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.7.0
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to get.
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
+ * @returns {*} Returns the resolved value.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
+ *
+ * _.get(object, 'a[0].b.c');
+ * // => 3
+ *
+ * _.get(object, ['a', '0', 'b', 'c']);
+ * // => 3
+ *
+ * _.get(object, 'a.b.c', 'default');
+ * // => 'default'
+ */
+function get(object, path, defaultValue) {
+ var result = object == null ? undefined : baseGet(object, path);
+ return result === undefined ? defaultValue : result;
+}
+
+/**
+ * Checks if `path` is a direct or inherited property of `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path to check.
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
+ * @example
+ *
+ * var object = _.create({ 'a': _.create({ 'b': 2 }) });
+ *
+ * _.hasIn(object, 'a');
+ * // => true
+ *
+ * _.hasIn(object, 'a.b');
+ * // => true
+ *
+ * _.hasIn(object, ['a', 'b']);
+ * // => true
+ *
+ * _.hasIn(object, 'b');
+ * // => false
+ */
+function hasIn(object, path) {
+ return object != null && hasPath(object, path, baseHasIn);
+}
+
+/**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */
+function keys(object) {
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
+}
+
+/**
+ * This method returns the first argument it receives.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Util
+ * @param {*} value Any value.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * var object = { 'a': 1 };
+ *
+ * console.log(_.identity(object) === object);
+ * // => true
+ */
+function identity(value) {
+ return value;
+}
+
+/**
+ * Creates a function that returns the value at `path` of a given object.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.4.0
+ * @category Util
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new accessor function.
+ * @example
+ *
+ * var objects = [
+ * { 'a': { 'b': 2 } },
+ * { 'a': { 'b': 1 } }
+ * ];
+ *
+ * _.map(objects, _.property('a.b'));
+ * // => [2, 1]
+ *
+ * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
+ * // => [1, 2]
+ */
+function property(path) {
+ return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
+}
+
+module.exports = map;
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(18), __webpack_require__(40)(module)))
+
+/***/ }),
+/* 154 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+const map = __webpack_require__(153)
+
+function Protocols (proto) {
+ if (typeof (proto) === 'number') {
+ if (Protocols.codes[proto]) {
+ return Protocols.codes[proto]
+ }
+
+ throw new Error('no protocol with code: ' + proto)
+ } else if (typeof (proto) === 'string' || proto instanceof String) {
+ if (Protocols.names[proto]) {
+ return Protocols.names[proto]
+ }
+
+ throw new Error('no protocol with name: ' + proto)
+ }
+
+ throw new Error('invalid protocol id type: ' + proto)
+}
+
+const V = -1
+Protocols.lengthPrefixedVarSize = V
+Protocols.V = V
+
+Protocols.table = [
+ [4, 32, 'ip4'],
+ [6, 16, 'tcp'],
+ [17, 16, 'udp'],
+ [33, 16, 'dccp'],
+ [41, 128, 'ip6'],
+ [54, V, 'dns4', 'resolvable'],
+ [55, V, 'dns6', 'resolvable'],
+ [56, V, 'dnsaddr', 'resolvable'],
+ [132, 16, 'sctp'],
+ // all of the below use varint for size
+ [302, 0, 'utp'],
+ [421, Protocols.lengthPrefixedVarSize, 'ipfs'],
+ [480, 0, 'http'],
+ [443, 0, 'https'],
+ [477, 0, 'ws'],
+ [478, 0, 'wss'],
+ [479, 0, 'p2p-websocket-star'],
+ [275, 0, 'p2p-webrtc-star'],
+ [276, 0, 'p2p-webrtc-direct'],
+ [290, 0, 'p2p-circuit']
+]
+
+Protocols.names = {}
+Protocols.codes = {}
+
+// populate tables
+map(Protocols.table, function (row) {
+ const proto = p.apply(null, row)
+ Protocols.codes[proto.code] = proto
+ Protocols.names[proto.name] = proto
+})
+
+Protocols.object = p
+
+function p (code, size, name, resolvable) {
+ return {
+ code: code,
+ size: size,
+ name: name,
+ resolvable: Boolean(resolvable)
+ }
+}
+
+module.exports = Protocols
+
+
+/***/ }),
+/* 155 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(Buffer) {
+
+const promisify = __webpack_require__(10)
+const ConcatStream = __webpack_require__(77)
+const once = __webpack_require__(29)
+const isStream = __webpack_require__(247)
+const SendFilesStream = __webpack_require__(80)
+
+module.exports = (send) => {
+ const createAddStream = SendFilesStream(send, 'add')
+
+ return promisify((_files, options, _callback) => {
+ if (typeof options === 'function') {
+ _callback = options
+ options = null
+ }
+
+ const callback = once(_callback)
+
+ if (!options) {
+ options = {}
+ }
+
+ const ok = Buffer.isBuffer(_files) ||
+ isStream.readable(_files) ||
+ Array.isArray(_files)
+
+ if (!ok) {
+ return callback(new Error('"files" must be a buffer, readable stream, or array of objects'))
+ }
+
+ const files = [].concat(_files)
+
+ const stream = createAddStream(options)
+ const concat = ConcatStream((result) => callback(null, result))
+ stream.once('error', callback)
+ stream.pipe(concat)
+
+ files.forEach((file) => stream.write(file))
+ stream.end()
+ })
+}
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6).Buffer))
+
+/***/ }),
+/* 156 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(process, setImmediate, global) {// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// A bit simpler than readable streams.
+// Implement an async ._write(chunk, encoding, cb), and it'll handle all
+// the drain event emission and buffering.
+
+
+
+/**/
+
+var pna = __webpack_require__(108);
+/* */
+
+module.exports = Writable;
+
+/* */
+function WriteReq(chunk, encoding, cb) {
+ this.chunk = chunk;
+ this.encoding = encoding;
+ this.callback = cb;
+ this.next = null;
+}
+
+// It seems a linked list but it is not
+// there will be only 2 of these for each stream
+function CorkedRequest(state) {
+ var _this = this;
+
+ this.next = null;
+ this.entry = null;
+ this.finish = function () {
+ onCorkedFinish(_this, state);
+ };
+}
+/* */
+
+/**/
+var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
+/* */
+
+/**/
+var Duplex;
+/* */
+
+Writable.WritableState = WritableState;
+
+/**/
+var util = __webpack_require__(78);
+util.inherits = __webpack_require__(14);
+/* */
+
+/**/
+var internalUtil = {
+ deprecate: __webpack_require__(516)
+};
+/* */
+
+/**/
+var Stream = __webpack_require__(244);
+/* */
+
+/**/
+
+var Buffer = __webpack_require__(13).Buffer;
+var OurUint8Array = global.Uint8Array || function () {};
+function _uint8ArrayToBuffer(chunk) {
+ return Buffer.from(chunk);
+}
+function _isUint8Array(obj) {
+ return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
+}
+
+/* */
+
+var destroyImpl = __webpack_require__(245);
+
+util.inherits(Writable, Stream);
+
+function nop() {}
+
+function WritableState(options, stream) {
+ Duplex = Duplex || __webpack_require__(46);
+
+ options = options || {};
+
+ // Duplex streams are both readable and writable, but share
+ // the same options object.
+ // However, some cases require setting options to different
+ // values for the readable and the writable sides of the duplex stream.
+ // These options can be provided separately as readableXXX and writableXXX.
+ var isDuplex = stream instanceof Duplex;
+
+ // object stream flag to indicate whether or not this stream
+ // contains buffers or objects.
+ this.objectMode = !!options.objectMode;
+
+ if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
+
+ // the point at which write() starts returning false
+ // Note: 0 is a valid value, means that we always return false if
+ // the entire buffer is not flushed immediately on write()
+ var hwm = options.highWaterMark;
+ var writableHwm = options.writableHighWaterMark;
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+
+ if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
+
+ // cast to ints.
+ this.highWaterMark = Math.floor(this.highWaterMark);
+
+ // if _final has been called
+ this.finalCalled = false;
+
+ // drain event flag.
+ this.needDrain = false;
+ // at the start of calling end()
+ this.ending = false;
+ // when end() has been called, and returned
+ this.ended = false;
+ // when 'finish' is emitted
+ this.finished = false;
+
+ // has it been destroyed
+ this.destroyed = false;
+
+ // should we decode strings into buffers before passing to _write?
+ // this is here so that some node-core streams can optimize string
+ // handling at a lower level.
+ var noDecode = options.decodeStrings === false;
+ this.decodeStrings = !noDecode;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // not an actual buffer we keep track of, but a measurement
+ // of how much we're waiting to get pushed to some underlying
+ // socket or file.
+ this.length = 0;
+
+ // a flag to see when we're in the middle of a write.
+ this.writing = false;
+
+ // when true all writes will be buffered until .uncork() call
+ this.corked = 0;
+
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, because any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
+ this.sync = true;
+
+ // a flag to know if we're processing previously buffered items, which
+ // may call the _write() callback in the same tick, so that we don't
+ // end up in an overlapped onwrite situation.
+ this.bufferProcessing = false;
+
+ // the callback that's passed to _write(chunk,cb)
+ this.onwrite = function (er) {
+ onwrite(stream, er);
+ };
+
+ // the callback that the user supplies to write(chunk,encoding,cb)
+ this.writecb = null;
+
+ // the amount that is being written when _write is called.
+ this.writelen = 0;
+
+ this.bufferedRequest = null;
+ this.lastBufferedRequest = null;
+
+ // number of pending user-supplied write callbacks
+ // this must be 0 before 'finish' can be emitted
+ this.pendingcb = 0;
+
+ // emit prefinish if the only thing we're waiting for is _write cbs
+ // This is relevant for synchronous Transform streams
+ this.prefinished = false;
+
+ // True if the error was already emitted and should not be thrown again
+ this.errorEmitted = false;
+
+ // count buffered requests
+ this.bufferedRequestCount = 0;
+
+ // allocate the first CorkedRequest, there is always
+ // one allocated and free to use, and we maintain at most two
+ this.corkedRequestsFree = new CorkedRequest(this);
+}
+
+WritableState.prototype.getBuffer = function getBuffer() {
+ var current = this.bufferedRequest;
+ var out = [];
+ while (current) {
+ out.push(current);
+ current = current.next;
+ }
+ return out;
+};
+
+(function () {
+ try {
+ Object.defineProperty(WritableState.prototype, 'buffer', {
+ get: internalUtil.deprecate(function () {
+ return this.getBuffer();
+ }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
+ });
+ } catch (_) {}
+})();
+
+// Test _writableState for inheritance to account for Duplex streams,
+// whose prototype chain only points to Readable.
+var realHasInstance;
+if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
+ realHasInstance = Function.prototype[Symbol.hasInstance];
+ Object.defineProperty(Writable, Symbol.hasInstance, {
+ value: function (object) {
+ if (realHasInstance.call(this, object)) return true;
+ if (this !== Writable) return false;
+
+ return object && object._writableState instanceof WritableState;
+ }
+ });
+} else {
+ realHasInstance = function (object) {
+ return object instanceof this;
+ };
+}
+
+function Writable(options) {
+ Duplex = Duplex || __webpack_require__(46);
+
+ // Writable ctor is applied to Duplexes, too.
+ // `realHasInstance` is necessary because using plain `instanceof`
+ // would return false, as no `_writableState` property is attached.
+
+ // Trying to use the custom `instanceof` for Writable here will also break the
+ // Node.js LazyTransform implementation, which has a non-trivial getter for
+ // `_writableState` that would lead to infinite recursion.
+ if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
+ return new Writable(options);
+ }
+
+ this._writableState = new WritableState(options, this);
+
+ // legacy.
+ this.writable = true;
+
+ if (options) {
+ if (typeof options.write === 'function') this._write = options.write;
+
+ if (typeof options.writev === 'function') this._writev = options.writev;
+
+ if (typeof options.destroy === 'function') this._destroy = options.destroy;
+
+ if (typeof options.final === 'function') this._final = options.final;
+ }
+
+ Stream.call(this);
+}
+
+// Otherwise people can pipe Writable streams, which is just wrong.
+Writable.prototype.pipe = function () {
+ this.emit('error', new Error('Cannot pipe, not readable'));
+};
+
+function writeAfterEnd(stream, cb) {
+ var er = new Error('write after end');
+ // TODO: defer error events consistently everywhere, not just the cb
+ stream.emit('error', er);
+ pna.nextTick(cb, er);
+}
+
+// Checks that a user-supplied chunk is valid, especially for the particular
+// mode the stream is in. Currently this means that `null` is never accepted
+// and undefined/non-string values are only allowed in object mode.
+function validChunk(stream, state, chunk, cb) {
+ var valid = true;
+ var er = false;
+
+ if (chunk === null) {
+ er = new TypeError('May not write null values to stream');
+ } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
+ er = new TypeError('Invalid non-string/buffer chunk');
+ }
+ if (er) {
+ stream.emit('error', er);
+ pna.nextTick(cb, er);
+ valid = false;
+ }
+ return valid;
+}
+
+Writable.prototype.write = function (chunk, encoding, cb) {
+ var state = this._writableState;
+ var ret = false;
+ var isBuf = !state.objectMode && _isUint8Array(chunk);
+
+ if (isBuf && !Buffer.isBuffer(chunk)) {
+ chunk = _uint8ArrayToBuffer(chunk);
+ }
+
+ if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
+
+ if (typeof cb !== 'function') cb = nop;
+
+ if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
+ state.pendingcb++;
+ ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
+ }
+
+ return ret;
+};
+
+Writable.prototype.cork = function () {
+ var state = this._writableState;
+
+ state.corked++;
+};
+
+Writable.prototype.uncork = function () {
+ var state = this._writableState;
+
+ if (state.corked) {
+ state.corked--;
+
+ if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
+ }
+};
+
+Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
+ // node::ParseEncoding() requires lower case.
+ if (typeof encoding === 'string') encoding = encoding.toLowerCase();
+ if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
+ this._writableState.defaultEncoding = encoding;
+ return this;
+};
+
+function decodeChunk(state, chunk, encoding) {
+ if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
+ chunk = Buffer.from(chunk, encoding);
+ }
+ return chunk;
+}
+
+Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function () {
+ return this._writableState.highWaterMark;
+ }
+});
+
+// if we're already writing something, then just put this
+// in the queue, and wait our turn. Otherwise, call _write
+// If we return false, then we need a drain event, so set that flag.
+function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
+ if (!isBuf) {
+ var newChunk = decodeChunk(state, chunk, encoding);
+ if (chunk !== newChunk) {
+ isBuf = true;
+ encoding = 'buffer';
+ chunk = newChunk;
+ }
+ }
+ var len = state.objectMode ? 1 : chunk.length;
+
+ state.length += len;
+
+ var ret = state.length < state.highWaterMark;
+ // we must ensure that previous needDrain will not be reset to false.
+ if (!ret) state.needDrain = true;
+
+ if (state.writing || state.corked) {
+ var last = state.lastBufferedRequest;
+ state.lastBufferedRequest = {
+ chunk: chunk,
+ encoding: encoding,
+ isBuf: isBuf,
+ callback: cb,
+ next: null
+ };
+ if (last) {
+ last.next = state.lastBufferedRequest;
+ } else {
+ state.bufferedRequest = state.lastBufferedRequest;
+ }
+ state.bufferedRequestCount += 1;
+ } else {
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+ }
+
+ return ret;
+}
+
+function doWrite(stream, state, writev, len, chunk, encoding, cb) {
+ state.writelen = len;
+ state.writecb = cb;
+ state.writing = true;
+ state.sync = true;
+ if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
+ state.sync = false;
+}
+
+function onwriteError(stream, state, sync, er, cb) {
+ --state.pendingcb;
+
+ if (sync) {
+ // defer the callback if we are being called synchronously
+ // to avoid piling up things on the stack
+ pna.nextTick(cb, er);
+ // this can emit finish, and it will always happen
+ // after error
+ pna.nextTick(finishMaybe, stream, state);
+ stream._writableState.errorEmitted = true;
+ stream.emit('error', er);
+ } else {
+ // the caller expect this to happen before if
+ // it is async
+ cb(er);
+ stream._writableState.errorEmitted = true;
+ stream.emit('error', er);
+ // this can emit finish, but finish must
+ // always follow error
+ finishMaybe(stream, state);
+ }
+}
+
+function onwriteStateUpdate(state) {
+ state.writing = false;
+ state.writecb = null;
+ state.length -= state.writelen;
+ state.writelen = 0;
+}
+
+function onwrite(stream, er) {
+ var state = stream._writableState;
+ var sync = state.sync;
+ var cb = state.writecb;
+
+ onwriteStateUpdate(state);
+
+ if (er) onwriteError(stream, state, sync, er, cb);else {
+ // Check if we're actually ready to finish, but don't emit yet
+ var finished = needFinish(state);
+
+ if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
+ clearBuffer(stream, state);
+ }
+
+ if (sync) {
+ /**/
+ asyncWrite(afterWrite, stream, state, finished, cb);
+ /* */
+ } else {
+ afterWrite(stream, state, finished, cb);
+ }
+ }
+}
+
+function afterWrite(stream, state, finished, cb) {
+ if (!finished) onwriteDrain(stream, state);
+ state.pendingcb--;
+ cb();
+ finishMaybe(stream, state);
+}
+
+// Must force callback to be called on nextTick, so that we don't
+// emit 'drain' before the write() consumer gets the 'false' return
+// value, and has a chance to attach a 'drain' listener.
+function onwriteDrain(stream, state) {
+ if (state.length === 0 && state.needDrain) {
+ state.needDrain = false;
+ stream.emit('drain');
+ }
+}
+
+// if there's something in the buffer waiting, then process it
+function clearBuffer(stream, state) {
+ state.bufferProcessing = true;
+ var entry = state.bufferedRequest;
+
+ if (stream._writev && entry && entry.next) {
+ // Fast case, write everything using _writev()
+ var l = state.bufferedRequestCount;
+ var buffer = new Array(l);
+ var holder = state.corkedRequestsFree;
+ holder.entry = entry;
+
+ var count = 0;
+ var allBuffers = true;
+ while (entry) {
+ buffer[count] = entry;
+ if (!entry.isBuf) allBuffers = false;
+ entry = entry.next;
+ count += 1;
+ }
+ buffer.allBuffers = allBuffers;
+
+ doWrite(stream, state, true, state.length, buffer, '', holder.finish);
+
+ // doWrite is almost always async, defer these to save a bit of time
+ // as the hot path ends with doWrite
+ state.pendingcb++;
+ state.lastBufferedRequest = null;
+ if (holder.next) {
+ state.corkedRequestsFree = holder.next;
+ holder.next = null;
+ } else {
+ state.corkedRequestsFree = new CorkedRequest(state);
+ }
+ state.bufferedRequestCount = 0;
+ } else {
+ // Slow case, write chunks one-by-one
+ while (entry) {
+ var chunk = entry.chunk;
+ var encoding = entry.encoding;
+ var cb = entry.callback;
+ var len = state.objectMode ? 1 : chunk.length;
+
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+ entry = entry.next;
+ state.bufferedRequestCount--;
+ // if we didn't call the onwrite immediately, then
+ // it means that we need to wait until it does.
+ // also, that means that the chunk and cb are currently
+ // being processed, so move the buffer counter past them.
+ if (state.writing) {
+ break;
+ }
+ }
+
+ if (entry === null) state.lastBufferedRequest = null;
+ }
+
+ state.bufferedRequest = entry;
+ state.bufferProcessing = false;
+}
+
+Writable.prototype._write = function (chunk, encoding, cb) {
+ cb(new Error('_write() is not implemented'));
+};
+
+Writable.prototype._writev = null;
+
+Writable.prototype.end = function (chunk, encoding, cb) {
+ var state = this._writableState;
+
+ if (typeof chunk === 'function') {
+ cb = chunk;
+ chunk = null;
+ encoding = null;
+ } else if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
+
+ // .end() fully uncorks
+ if (state.corked) {
+ state.corked = 1;
+ this.uncork();
+ }
+
+ // ignore unnecessary end() calls.
+ if (!state.ending && !state.finished) endWritable(this, state, cb);
+};
+
+function needFinish(state) {
+ return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
+}
+function callFinal(stream, state) {
+ stream._final(function (err) {
+ state.pendingcb--;
+ if (err) {
+ stream.emit('error', err);
+ }
+ state.prefinished = true;
+ stream.emit('prefinish');
+ finishMaybe(stream, state);
+ });
+}
+function prefinish(stream, state) {
+ if (!state.prefinished && !state.finalCalled) {
+ if (typeof stream._final === 'function') {
+ state.pendingcb++;
+ state.finalCalled = true;
+ pna.nextTick(callFinal, stream, state);
+ } else {
+ state.prefinished = true;
+ stream.emit('prefinish');
+ }
+ }
+}
+
+function finishMaybe(stream, state) {
+ var need = needFinish(state);
+ if (need) {
+ prefinish(stream, state);
+ if (state.pendingcb === 0) {
+ state.finished = true;
+ stream.emit('finish');
+ }
+ }
+ return need;
+}
+
+function endWritable(stream, state, cb) {
+ state.ending = true;
+ finishMaybe(stream, state);
+ if (cb) {
+ if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
+ }
+ state.ended = true;
+ stream.writable = false;
+}
+
+function onCorkedFinish(corkReq, state, err) {
+ var entry = corkReq.entry;
+ corkReq.entry = null;
+ while (entry) {
+ var cb = entry.callback;
+ state.pendingcb--;
+ cb(err);
+ entry = entry.next;
+ }
+ if (state.corkedRequestsFree) {
+ state.corkedRequestsFree.next = corkReq;
+ } else {
+ state.corkedRequestsFree = corkReq;
+ }
+}
+
+Object.defineProperty(Writable.prototype, 'destroyed', {
+ get: function () {
+ if (this._writableState === undefined) {
+ return false;
+ }
+ return this._writableState.destroyed;
+ },
+ set: function (value) {
+ // we ignore the value if the stream
+ // has not been initialized yet
+ if (!this._writableState) {
+ return;
+ }
+
+ // backward compatibility, the user is explicitly
+ // managing destroyed
+ this._writableState.destroyed = value;
+ }
+});
+
+Writable.prototype.destroy = destroyImpl.destroy;
+Writable.prototype._undestroy = destroyImpl.undestroy;
+Writable.prototype._destroy = function (err, cb) {
+ this.end();
+ cb(err);
+};
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11), __webpack_require__(76).setImmediate, __webpack_require__(18)))
+
+/***/ }),
+/* 157 */
+/***/ (function(module, exports) {
+
+/**
+ * This method returns `undefined`.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.3.0
+ * @category Util
+ * @example
+ *
+ * _.times(2, _.noop);
+ * // => [undefined, undefined]
+ */
+function noop() {
+ // No operation performed.
+}
+
+module.exports = noop;
+
+
+/***/ }),
+/* 158 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var Symbol = __webpack_require__(250),
+ getRawTag = __webpack_require__(526),
+ objectToString = __webpack_require__(527);
+
+/** `Object#toString` result references. */
+var nullTag = '[object Null]',
+ undefinedTag = '[object Undefined]';
+
+/** Built-in value references. */
+var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
+
+/**
+ * The base implementation of `getTag` without fallbacks for buggy environments.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */
+function baseGetTag(value) {
+ if (value == null) {
+ return value === undefined ? undefinedTag : nullTag;
+ }
+ return (symToStringTag && symToStringTag in Object(value))
+ ? getRawTag(value)
+ : objectToString(value);
+}
+
+module.exports = baseGetTag;
+
+
+/***/ }),
+/* 159 */
+/***/ (function(module, exports) {
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+ return value != null && typeof value == 'object';
+}
+
+module.exports = isObjectLike;
+
+
+/***/ }),
+/* 160 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = onlyOnce;
+function onlyOnce(fn) {
+ return function () {
+ if (fn === null) throw new Error("Callback was already called.");
+ var callFn = fn;
+ fn = null;
+ callFn.apply(this, arguments);
+ };
+}
+module.exports = exports["default"];
+
+/***/ }),
+/* 161 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.isAsync = undefined;
+
+var _asyncify = __webpack_require__(547);
+
+var _asyncify2 = _interopRequireDefault(_asyncify);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var supportsSymbol = typeof Symbol === 'function';
+
+function isAsync(fn) {
+ return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction';
+}
+
+function wrapAsync(asyncFn) {
+ return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn;
+}
+
+exports.default = wrapAsync;
+exports.isAsync = isAsync;
+
+/***/ }),
+/* 162 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var once = __webpack_require__(29);
+
+var noop = function() {};
+
+var isRequest = function(stream) {
+ return stream.setHeader && typeof stream.abort === 'function';
+};
+
+var isChildProcess = function(stream) {
+ return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
+};
+
+var eos = function(stream, opts, callback) {
+ if (typeof opts === 'function') return eos(stream, null, opts);
+ if (!opts) opts = {};
+
+ callback = once(callback || noop);
+
+ var ws = stream._writableState;
+ var rs = stream._readableState;
+ var readable = opts.readable || (opts.readable !== false && stream.readable);
+ var writable = opts.writable || (opts.writable !== false && stream.writable);
+
+ var onlegacyfinish = function() {
+ if (!stream.writable) onfinish();
+ };
+
+ var onfinish = function() {
+ writable = false;
+ if (!readable) callback.call(stream);
+ };
+
+ var onend = function() {
+ readable = false;
+ if (!writable) callback.call(stream);
+ };
+
+ var onexit = function(exitCode) {
+ callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
+ };
+
+ var onerror = function(err) {
+ callback.call(stream, err);
+ };
+
+ var onclose = function() {
+ if (readable && !(rs && rs.ended)) return callback.call(stream, new Error('premature close'));
+ if (writable && !(ws && ws.ended)) return callback.call(stream, new Error('premature close'));
+ };
+
+ var onrequest = function() {
+ stream.req.on('finish', onfinish);
+ };
+
+ if (isRequest(stream)) {
+ stream.on('complete', onfinish);
+ stream.on('abort', onclose);
+ if (stream.req) onrequest();
+ else stream.on('request', onrequest);
+ } else if (writable && !ws) { // legacy streams
+ stream.on('end', onlegacyfinish);
+ stream.on('close', onlegacyfinish);
+ }
+
+ if (isChildProcess(stream)) stream.on('exit', onexit);
+
+ stream.on('end', onend);
+ stream.on('finish', onfinish);
+ if (opts.error !== false) stream.on('error', onerror);
+ stream.on('close', onclose);
+
+ return function() {
+ stream.removeListener('complete', onfinish);
+ stream.removeListener('abort', onclose);
+ stream.removeListener('request', onrequest);
+ if (stream.req) stream.req.removeListener('finish', onfinish);
+ stream.removeListener('end', onlegacyfinish);
+ stream.removeListener('close', onlegacyfinish);
+ stream.removeListener('finish', onfinish);
+ stream.removeListener('exit', onexit);
+ stream.removeListener('end', onend);
+ stream.removeListener('error', onerror);
+ stream.removeListener('close', onclose);
+ };
+};
+
+module.exports = eos;
+
+
+/***/ }),
+/* 163 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/* WEBPACK VAR INJECTION */(function(process) {var pull = __webpack_require__(259)
+var looper = __webpack_require__(560)
+
+function destroy(stream, cb) {
+ function onClose () {
+ cleanup(); cb()
+ }
+ function onError (err) {
+ cleanup(); cb(err)
+ }
+ function cleanup() {
+ stream.removeListener('close', onClose)
+ stream.removeListener('error', onError)
+ }
+ stream.on('close', onClose)
+ stream.on('error', onError)
+}
+
+function destroy (stream) {
+ if(!stream.destroy)
+ console.error(
+ 'warning, stream-to-pull-stream: \n'
+ + 'the wrapped node-stream does not implement `destroy`, \n'
+ + 'this may cause resource leaks.'
+ )
+ else stream.destroy()
+
+}
+
+function write(read, stream, cb) {
+ var ended, closed = false, did
+ function done () {
+ if(did) return
+ did = true
+ cb && cb(ended === true ? null : ended)
+ }
+
+ function onClose () {
+ if(closed) return
+ closed = true
+ cleanup()
+ if(!ended) read(ended = true, done)
+ else done()
+ }
+ function onError (err) {
+ cleanup()
+ if(!ended) read(ended = err, done)
+ }
+ function cleanup() {
+ stream.on('finish', onClose)
+ stream.removeListener('close', onClose)
+ stream.removeListener('error', onError)
+ }
+ stream.on('close', onClose)
+ stream.on('finish', onClose)
+ stream.on('error', onError)
+ process.nextTick(function () {
+ looper(function (next) {
+ read(null, function (end, data) {
+ ended = ended || end
+ //you can't "end" a stdout stream, so this needs to be handled specially.
+ if(end === true)
+ return stream._isStdio ? done() : stream.end()
+
+ if(ended = ended || end) {
+ destroy(stream)
+ return done(ended)
+ }
+
+ //I noticed a problem streaming to the terminal:
+ //sometimes the end got cut off, creating invalid output.
+ //it seems that stdout always emits "drain" when it ends.
+ //so this seems to work, but i have been unable to reproduce this test
+ //automatically, so you need to run ./test/stdout.js a few times and the end is valid json.
+ if(stream._isStdio)
+ stream.write(data, function () { next() })
+ else {
+ var pause = stream.write(data)
+ if(pause === false)
+ stream.once('drain', next)
+ else next()
+ }
+ })
+ })
+ })
+}
+
+function first (emitter, events, handler) {
+ function listener (val) {
+ events.forEach(function (e) {
+ emitter.removeListener(e, listener)
+ })
+ handler(val)
+ }
+ events.forEach(function (e) {
+ emitter.on(e, listener)
+ })
+ return emitter
+}
+
+function read2(stream) {
+ var ended = false, waiting = false
+ var _cb
+
+ function read () {
+ var data = stream.read()
+ if(data !== null && _cb) {
+ var cb = _cb; _cb = null
+ cb(null, data)
+ }
+ }
+
+ stream.on('readable', function () {
+ waiting = true
+ _cb && read()
+ })
+ .on('end', function () {
+ ended = true
+ _cb && _cb(ended)
+ })
+ .on('error', function (err) {
+ ended = err
+ _cb && _cb(ended)
+ })
+
+ return function (end, cb) {
+ _cb = cb
+ if(ended)
+ cb(ended)
+ else if(waiting)
+ read()
+ }
+}
+
+function read1(stream) {
+ var buffer = [], cbs = [], ended, paused = false
+
+ var draining
+ function drain() {
+ while((buffer.length || ended) && cbs.length)
+ cbs.shift()(buffer.length ? null : ended, buffer.shift())
+ if(!buffer.length && (paused)) {
+ paused = false
+ stream.resume()
+ }
+ }
+
+ stream.on('data', function (data) {
+ buffer.push(data)
+ drain()
+ if(buffer.length && stream.pause) {
+ paused = true
+ stream.pause()
+ }
+ })
+ stream.on('end', function () {
+ ended = true
+ drain()
+ })
+ stream.on('close', function () {
+ ended = true
+ drain()
+ })
+ stream.on('error', function (err) {
+ ended = err
+ drain()
+ })
+ return function (abort, cb) {
+ if(!cb) throw new Error('*must* provide cb')
+ if(abort) {
+ function onAbort () {
+ while(cbs.length) cbs.shift()(abort)
+ cb(abort)
+ }
+ //if the stream happens to have already ended, then we don't need to abort.
+ if(ended) return onAbort()
+ stream.once('close', onAbort)
+ destroy(stream)
+ }
+ else {
+ cbs.push(cb)
+ drain()
+ }
+ }
+}
+
+var read = read1
+
+var sink = function (stream, cb) {
+ return function (read) {
+ return write(read, stream, cb)
+ }
+}
+
+var source = function (stream) {
+ return read1(stream)
+}
+
+exports = module.exports = function (stream, cb) {
+ return (
+ (stream.writable && stream.write)
+ ? stream.readable
+ ? function(_read) {
+ write(_read, stream, cb);
+ return read1(stream)
+ }
+ : sink(stream, cb)
+ : source(stream)
+ )
+}
+
+exports.sink = sink
+exports.source = source
+exports.read = read
+exports.read1 = read1
+exports.read2 = read2
+exports.duplex = function (stream, cb) {
+ return {
+ source: source(stream),
+ sink: sink(stream, cb)
+ }
+}
+exports.transform = function (stream) {
+ return function (read) {
+ var _source = source(stream)
+ sink(stream)(read); return _source
+ }
+}
+
+
+
+
+
+
+
+
+
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
+
+/***/ }),
+/* 164 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(Buffer) {
+
+// spec and table at: https://github.com/multiformats/multicodec
+
+exports = module.exports
+
+// Miscellaneous
+exports['raw'] = Buffer.from('55', 'hex')
+
+// bases encodings
+exports['base1'] = Buffer.from('01', 'hex')
+exports['base2'] = Buffer.from('00', 'hex')
+exports['base8'] = Buffer.from('07', 'hex')
+exports['base10'] = Buffer.from('09', 'hex')
+
+// Serialization formats
+exports['cbor'] = Buffer.from('51', 'hex')
+exports['protobuf'] = Buffer.from('50', 'hex')
+exports['rlp'] = Buffer.from('60', 'hex')
+exports['bencode'] = Buffer.from('63', 'hex')
+
+// Multiformats
+exports['multicodec'] = Buffer.from('30', 'hex')
+exports['multihash'] = Buffer.from('31', 'hex')
+exports['multiaddr'] = Buffer.from('32', 'hex')
+exports['multibase'] = Buffer.from('33', 'hex')
+exports['md4'] = Buffer.from('d4', 'hex')
+exports['md5'] = Buffer.from('d5', 'hex')
+
+// multihashes
+exports['sha1'] = Buffer.from('11', 'hex')
+exports['sha2-256'] = Buffer.from('12', 'hex')
+exports['sha2-512'] = Buffer.from('13', 'hex')
+exports['dbl-sha2-256'] = Buffer.from('56', 'hex')
+exports['sha3-224'] = Buffer.from('17', 'hex')
+exports['sha3-256'] = Buffer.from('16', 'hex')
+exports['sha3-384'] = Buffer.from('15', 'hex')
+exports['sha3-512'] = Buffer.from('14', 'hex')
+exports['shake-128'] = Buffer.from('18', 'hex')
+exports['shake-256'] = Buffer.from('19', 'hex')
+exports['keccak-224'] = Buffer.from('1a', 'hex')
+exports['keccak-256'] = Buffer.from('1b', 'hex')
+exports['keccak-384'] = Buffer.from('1c', 'hex')
+exports['keccak-512'] = Buffer.from('1d', 'hex')
+exports['murmur3'] = Buffer.from('22', 'hex')
+exports['blake2b-8'] = Buffer.from('b201', 'hex')
+exports['blake2b-16'] = Buffer.from('b202', 'hex')
+exports['blake2b-24'] = Buffer.from('b203', 'hex')
+exports['blake2b-32'] = Buffer.from('b204', 'hex')
+exports['blake2b-40'] = Buffer.from('b205', 'hex')
+exports['blake2b-48'] = Buffer.from('b206', 'hex')
+exports['blake2b-56'] = Buffer.from('b207', 'hex')
+exports['blake2b-64'] = Buffer.from('b208', 'hex')
+exports['blake2b-72'] = Buffer.from('b209', 'hex')
+exports['blake2b-80'] = Buffer.from('b20a', 'hex')
+exports['blake2b-88'] = Buffer.from('b20b', 'hex')
+exports['blake2b-96'] = Buffer.from('b20c', 'hex')
+exports['blake2b-104'] = Buffer.from('b20d', 'hex')
+exports['blake2b-112'] = Buffer.from('b20e', 'hex')
+exports['blake2b-120'] = Buffer.from('b20f', 'hex')
+exports['blake2b-128'] = Buffer.from('b210', 'hex')
+exports['blake2b-136'] = Buffer.from('b211', 'hex')
+exports['blake2b-144'] = Buffer.from('b212', 'hex')
+exports['blake2b-152'] = Buffer.from('b213', 'hex')
+exports['blake2b-160'] = Buffer.from('b214', 'hex')
+exports['blake2b-168'] = Buffer.from('b215', 'hex')
+exports['blake2b-176'] = Buffer.from('b216', 'hex')
+exports['blake2b-184'] = Buffer.from('b217', 'hex')
+exports['blake2b-192'] = Buffer.from('b218', 'hex')
+exports['blake2b-200'] = Buffer.from('b219', 'hex')
+exports['blake2b-208'] = Buffer.from('b21a', 'hex')
+exports['blake2b-216'] = Buffer.from('b21b', 'hex')
+exports['blake2b-224'] = Buffer.from('b21c', 'hex')
+exports['blake2b-232'] = Buffer.from('b21d', 'hex')
+exports['blake2b-240'] = Buffer.from('b21e', 'hex')
+exports['blake2b-248'] = Buffer.from('b21f', 'hex')
+exports['blake2b-256'] = Buffer.from('b220', 'hex')
+exports['blake2b-264'] = Buffer.from('b221', 'hex')
+exports['blake2b-272'] = Buffer.from('b222', 'hex')
+exports['blake2b-280'] = Buffer.from('b223', 'hex')
+exports['blake2b-288'] = Buffer.from('b224', 'hex')
+exports['blake2b-296'] = Buffer.from('b225', 'hex')
+exports['blake2b-304'] = Buffer.from('b226', 'hex')
+exports['blake2b-312'] = Buffer.from('b227', 'hex')
+exports['blake2b-320'] = Buffer.from('b228', 'hex')
+exports['blake2b-328'] = Buffer.from('b229', 'hex')
+exports['blake2b-336'] = Buffer.from('b22a', 'hex')
+exports['blake2b-344'] = Buffer.from('b22b', 'hex')
+exports['blake2b-352'] = Buffer.from('b22c', 'hex')
+exports['blake2b-360'] = Buffer.from('b22d', 'hex')
+exports['blake2b-368'] = Buffer.from('b22e', 'hex')
+exports['blake2b-376'] = Buffer.from('b22f', 'hex')
+exports['blake2b-384'] = Buffer.from('b230', 'hex')
+exports['blake2b-392'] = Buffer.from('b231', 'hex')
+exports['blake2b-400'] = Buffer.from('b232', 'hex')
+exports['blake2b-408'] = Buffer.from('b233', 'hex')
+exports['blake2b-416'] = Buffer.from('b234', 'hex')
+exports['blake2b-424'] = Buffer.from('b235', 'hex')
+exports['blake2b-432'] = Buffer.from('b236', 'hex')
+exports['blake2b-440'] = Buffer.from('b237', 'hex')
+exports['blake2b-448'] = Buffer.from('b238', 'hex')
+exports['blake2b-456'] = Buffer.from('b239', 'hex')
+exports['blake2b-464'] = Buffer.from('b23a', 'hex')
+exports['blake2b-472'] = Buffer.from('b23b', 'hex')
+exports['blake2b-480'] = Buffer.from('b23c', 'hex')
+exports['blake2b-488'] = Buffer.from('b23d', 'hex')
+exports['blake2b-496'] = Buffer.from('b23e', 'hex')
+exports['blake2b-504'] = Buffer.from('b23f', 'hex')
+exports['blake2b-512'] = Buffer.from('b240', 'hex')
+exports['blake2s-8'] = Buffer.from('b241', 'hex')
+exports['blake2s-16'] = Buffer.from('b242', 'hex')
+exports['blake2s-24'] = Buffer.from('b243', 'hex')
+exports['blake2s-32'] = Buffer.from('b244', 'hex')
+exports['blake2s-40'] = Buffer.from('b245', 'hex')
+exports['blake2s-48'] = Buffer.from('b246', 'hex')
+exports['blake2s-56'] = Buffer.from('b247', 'hex')
+exports['blake2s-64'] = Buffer.from('b248', 'hex')
+exports['blake2s-72'] = Buffer.from('b249', 'hex')
+exports['blake2s-80'] = Buffer.from('b24a', 'hex')
+exports['blake2s-88'] = Buffer.from('b24b', 'hex')
+exports['blake2s-96'] = Buffer.from('b24c', 'hex')
+exports['blake2s-104'] = Buffer.from('b24d', 'hex')
+exports['blake2s-112'] = Buffer.from('b24e', 'hex')
+exports['blake2s-120'] = Buffer.from('b24f', 'hex')
+exports['blake2s-128'] = Buffer.from('b250', 'hex')
+exports['blake2s-136'] = Buffer.from('b251', 'hex')
+exports['blake2s-144'] = Buffer.from('b252', 'hex')
+exports['blake2s-152'] = Buffer.from('b253', 'hex')
+exports['blake2s-160'] = Buffer.from('b254', 'hex')
+exports['blake2s-168'] = Buffer.from('b255', 'hex')
+exports['blake2s-176'] = Buffer.from('b256', 'hex')
+exports['blake2s-184'] = Buffer.from('b257', 'hex')
+exports['blake2s-192'] = Buffer.from('b258', 'hex')
+exports['blake2s-200'] = Buffer.from('b259', 'hex')
+exports['blake2s-208'] = Buffer.from('b25a', 'hex')
+exports['blake2s-216'] = Buffer.from('b25b', 'hex')
+exports['blake2s-224'] = Buffer.from('b25c', 'hex')
+exports['blake2s-232'] = Buffer.from('b25d', 'hex')
+exports['blake2s-240'] = Buffer.from('b25e', 'hex')
+exports['blake2s-248'] = Buffer.from('b25f', 'hex')
+exports['blake2s-256'] = Buffer.from('b260', 'hex')
+exports['skein256-8'] = Buffer.from('b301', 'hex')
+exports['skein256-16'] = Buffer.from('b302', 'hex')
+exports['skein256-24'] = Buffer.from('b303', 'hex')
+exports['skein256-32'] = Buffer.from('b304', 'hex')
+exports['skein256-40'] = Buffer.from('b305', 'hex')
+exports['skein256-48'] = Buffer.from('b306', 'hex')
+exports['skein256-56'] = Buffer.from('b307', 'hex')
+exports['skein256-64'] = Buffer.from('b308', 'hex')
+exports['skein256-72'] = Buffer.from('b309', 'hex')
+exports['skein256-80'] = Buffer.from('b30a', 'hex')
+exports['skein256-88'] = Buffer.from('b30b', 'hex')
+exports['skein256-96'] = Buffer.from('b30c', 'hex')
+exports['skein256-104'] = Buffer.from('b30d', 'hex')
+exports['skein256-112'] = Buffer.from('b30e', 'hex')
+exports['skein256-120'] = Buffer.from('b30f', 'hex')
+exports['skein256-128'] = Buffer.from('b310', 'hex')
+exports['skein256-136'] = Buffer.from('b311', 'hex')
+exports['skein256-144'] = Buffer.from('b312', 'hex')
+exports['skein256-152'] = Buffer.from('b313', 'hex')
+exports['skein256-160'] = Buffer.from('b314', 'hex')
+exports['skein256-168'] = Buffer.from('b315', 'hex')
+exports['skein256-176'] = Buffer.from('b316', 'hex')
+exports['skein256-184'] = Buffer.from('b317', 'hex')
+exports['skein256-192'] = Buffer.from('b318', 'hex')
+exports['skein256-200'] = Buffer.from('b319', 'hex')
+exports['skein256-208'] = Buffer.from('b31a', 'hex')
+exports['skein256-216'] = Buffer.from('b31b', 'hex')
+exports['skein256-224'] = Buffer.from('b31c', 'hex')
+exports['skein256-232'] = Buffer.from('b31d', 'hex')
+exports['skein256-240'] = Buffer.from('b31e', 'hex')
+exports['skein256-248'] = Buffer.from('b31f', 'hex')
+exports['skein256-256'] = Buffer.from('b320', 'hex')
+exports['skein512-8'] = Buffer.from('b321', 'hex')
+exports['skein512-16'] = Buffer.from('b322', 'hex')
+exports['skein512-24'] = Buffer.from('b323', 'hex')
+exports['skein512-32'] = Buffer.from('b324', 'hex')
+exports['skein512-40'] = Buffer.from('b325', 'hex')
+exports['skein512-48'] = Buffer.from('b326', 'hex')
+exports['skein512-56'] = Buffer.from('b327', 'hex')
+exports['skein512-64'] = Buffer.from('b328', 'hex')
+exports['skein512-72'] = Buffer.from('b329', 'hex')
+exports['skein512-80'] = Buffer.from('b32a', 'hex')
+exports['skein512-88'] = Buffer.from('b32b', 'hex')
+exports['skein512-96'] = Buffer.from('b32c', 'hex')
+exports['skein512-104'] = Buffer.from('b32d', 'hex')
+exports['skein512-112'] = Buffer.from('b32e', 'hex')
+exports['skein512-120'] = Buffer.from('b32f', 'hex')
+exports['skein512-128'] = Buffer.from('b330', 'hex')
+exports['skein512-136'] = Buffer.from('b331', 'hex')
+exports['skein512-144'] = Buffer.from('b332', 'hex')
+exports['skein512-152'] = Buffer.from('b333', 'hex')
+exports['skein512-160'] = Buffer.from('b334', 'hex')
+exports['skein512-168'] = Buffer.from('b335', 'hex')
+exports['skein512-176'] = Buffer.from('b336', 'hex')
+exports['skein512-184'] = Buffer.from('b337', 'hex')
+exports['skein512-192'] = Buffer.from('b338', 'hex')
+exports['skein512-200'] = Buffer.from('b339', 'hex')
+exports['skein512-208'] = Buffer.from('b33a', 'hex')
+exports['skein512-216'] = Buffer.from('b33b', 'hex')
+exports['skein512-224'] = Buffer.from('b33c', 'hex')
+exports['skein512-232'] = Buffer.from('b33d', 'hex')
+exports['skein512-240'] = Buffer.from('b33e', 'hex')
+exports['skein512-248'] = Buffer.from('b33f', 'hex')
+exports['skein512-256'] = Buffer.from('b340', 'hex')
+exports['skein512-264'] = Buffer.from('b341', 'hex')
+exports['skein512-272'] = Buffer.from('b342', 'hex')
+exports['skein512-280'] = Buffer.from('b343', 'hex')
+exports['skein512-288'] = Buffer.from('b344', 'hex')
+exports['skein512-296'] = Buffer.from('b345', 'hex')
+exports['skein512-304'] = Buffer.from('b346', 'hex')
+exports['skein512-312'] = Buffer.from('b347', 'hex')
+exports['skein512-320'] = Buffer.from('b348', 'hex')
+exports['skein512-328'] = Buffer.from('b349', 'hex')
+exports['skein512-336'] = Buffer.from('b34a', 'hex')
+exports['skein512-344'] = Buffer.from('b34b', 'hex')
+exports['skein512-352'] = Buffer.from('b34c', 'hex')
+exports['skein512-360'] = Buffer.from('b34d', 'hex')
+exports['skein512-368'] = Buffer.from('b34e', 'hex')
+exports['skein512-376'] = Buffer.from('b34f', 'hex')
+exports['skein512-384'] = Buffer.from('b350', 'hex')
+exports['skein512-392'] = Buffer.from('b351', 'hex')
+exports['skein512-400'] = Buffer.from('b352', 'hex')
+exports['skein512-408'] = Buffer.from('b353', 'hex')
+exports['skein512-416'] = Buffer.from('b354', 'hex')
+exports['skein512-424'] = Buffer.from('b355', 'hex')
+exports['skein512-432'] = Buffer.from('b356', 'hex')
+exports['skein512-440'] = Buffer.from('b357', 'hex')
+exports['skein512-448'] = Buffer.from('b358', 'hex')
+exports['skein512-456'] = Buffer.from('b359', 'hex')
+exports['skein512-464'] = Buffer.from('b35a', 'hex')
+exports['skein512-472'] = Buffer.from('b35b', 'hex')
+exports['skein512-480'] = Buffer.from('b35c', 'hex')
+exports['skein512-488'] = Buffer.from('b35d', 'hex')
+exports['skein512-496'] = Buffer.from('b35e', 'hex')
+exports['skein512-504'] = Buffer.from('b35f', 'hex')
+exports['skein512-512'] = Buffer.from('b360', 'hex')
+exports['skein1024-8'] = Buffer.from('b361', 'hex')
+exports['skein1024-16'] = Buffer.from('b362', 'hex')
+exports['skein1024-24'] = Buffer.from('b363', 'hex')
+exports['skein1024-32'] = Buffer.from('b364', 'hex')
+exports['skein1024-40'] = Buffer.from('b365', 'hex')
+exports['skein1024-48'] = Buffer.from('b366', 'hex')
+exports['skein1024-56'] = Buffer.from('b367', 'hex')
+exports['skein1024-64'] = Buffer.from('b368', 'hex')
+exports['skein1024-72'] = Buffer.from('b369', 'hex')
+exports['skein1024-80'] = Buffer.from('b36a', 'hex')
+exports['skein1024-88'] = Buffer.from('b36b', 'hex')
+exports['skein1024-96'] = Buffer.from('b36c', 'hex')
+exports['skein1024-104'] = Buffer.from('b36d', 'hex')
+exports['skein1024-112'] = Buffer.from('b36e', 'hex')
+exports['skein1024-120'] = Buffer.from('b36f', 'hex')
+exports['skein1024-128'] = Buffer.from('b370', 'hex')
+exports['skein1024-136'] = Buffer.from('b371', 'hex')
+exports['skein1024-144'] = Buffer.from('b372', 'hex')
+exports['skein1024-152'] = Buffer.from('b373', 'hex')
+exports['skein1024-160'] = Buffer.from('b374', 'hex')
+exports['skein1024-168'] = Buffer.from('b375', 'hex')
+exports['skein1024-176'] = Buffer.from('b376', 'hex')
+exports['skein1024-184'] = Buffer.from('b377', 'hex')
+exports['skein1024-192'] = Buffer.from('b378', 'hex')
+exports['skein1024-200'] = Buffer.from('b379', 'hex')
+exports['skein1024-208'] = Buffer.from('b37a', 'hex')
+exports['skein1024-216'] = Buffer.from('b37b', 'hex')
+exports['skein1024-224'] = Buffer.from('b37c', 'hex')
+exports['skein1024-232'] = Buffer.from('b37d', 'hex')
+exports['skein1024-240'] = Buffer.from('b37e', 'hex')
+exports['skein1024-248'] = Buffer.from('b37f', 'hex')
+exports['skein1024-256'] = Buffer.from('b380', 'hex')
+exports['skein1024-264'] = Buffer.from('b381', 'hex')
+exports['skein1024-272'] = Buffer.from('b382', 'hex')
+exports['skein1024-280'] = Buffer.from('b383', 'hex')
+exports['skein1024-288'] = Buffer.from('b384', 'hex')
+exports['skein1024-296'] = Buffer.from('b385', 'hex')
+exports['skein1024-304'] = Buffer.from('b386', 'hex')
+exports['skein1024-312'] = Buffer.from('b387', 'hex')
+exports['skein1024-320'] = Buffer.from('b388', 'hex')
+exports['skein1024-328'] = Buffer.from('b389', 'hex')
+exports['skein1024-336'] = Buffer.from('b38a', 'hex')
+exports['skein1024-344'] = Buffer.from('b38b', 'hex')
+exports['skein1024-352'] = Buffer.from('b38c', 'hex')
+exports['skein1024-360'] = Buffer.from('b38d', 'hex')
+exports['skein1024-368'] = Buffer.from('b38e', 'hex')
+exports['skein1024-376'] = Buffer.from('b38f', 'hex')
+exports['skein1024-384'] = Buffer.from('b390', 'hex')
+exports['skein1024-392'] = Buffer.from('b391', 'hex')
+exports['skein1024-400'] = Buffer.from('b392', 'hex')
+exports['skein1024-408'] = Buffer.from('b393', 'hex')
+exports['skein1024-416'] = Buffer.from('b394', 'hex')
+exports['skein1024-424'] = Buffer.from('b395', 'hex')
+exports['skein1024-432'] = Buffer.from('b396', 'hex')
+exports['skein1024-440'] = Buffer.from('b397', 'hex')
+exports['skein1024-448'] = Buffer.from('b398', 'hex')
+exports['skein1024-456'] = Buffer.from('b399', 'hex')
+exports['skein1024-464'] = Buffer.from('b39a', 'hex')
+exports['skein1024-472'] = Buffer.from('b39b', 'hex')
+exports['skein1024-480'] = Buffer.from('b39c', 'hex')
+exports['skein1024-488'] = Buffer.from('b39d', 'hex')
+exports['skein1024-496'] = Buffer.from('b39e', 'hex')
+exports['skein1024-504'] = Buffer.from('b39f', 'hex')
+exports['skein1024-512'] = Buffer.from('b3a0', 'hex')
+exports['skein1024-520'] = Buffer.from('b3a1', 'hex')
+exports['skein1024-528'] = Buffer.from('b3a2', 'hex')
+exports['skein1024-536'] = Buffer.from('b3a3', 'hex')
+exports['skein1024-544'] = Buffer.from('b3a4', 'hex')
+exports['skein1024-552'] = Buffer.from('b3a5', 'hex')
+exports['skein1024-560'] = Buffer.from('b3a6', 'hex')
+exports['skein1024-568'] = Buffer.from('b3a7', 'hex')
+exports['skein1024-576'] = Buffer.from('b3a8', 'hex')
+exports['skein1024-584'] = Buffer.from('b3a9', 'hex')
+exports['skein1024-592'] = Buffer.from('b3aa', 'hex')
+exports['skein1024-600'] = Buffer.from('b3ab', 'hex')
+exports['skein1024-608'] = Buffer.from('b3ac', 'hex')
+exports['skein1024-616'] = Buffer.from('b3ad', 'hex')
+exports['skein1024-624'] = Buffer.from('b3ae', 'hex')
+exports['skein1024-632'] = Buffer.from('b3af', 'hex')
+exports['skein1024-640'] = Buffer.from('b3b0', 'hex')
+exports['skein1024-648'] = Buffer.from('b3b1', 'hex')
+exports['skein1024-656'] = Buffer.from('b3b2', 'hex')
+exports['skein1024-664'] = Buffer.from('b3b3', 'hex')
+exports['skein1024-672'] = Buffer.from('b3b4', 'hex')
+exports['skein1024-680'] = Buffer.from('b3b5', 'hex')
+exports['skein1024-688'] = Buffer.from('b3b6', 'hex')
+exports['skein1024-696'] = Buffer.from('b3b7', 'hex')
+exports['skein1024-704'] = Buffer.from('b3b8', 'hex')
+exports['skein1024-712'] = Buffer.from('b3b9', 'hex')
+exports['skein1024-720'] = Buffer.from('b3ba', 'hex')
+exports['skein1024-728'] = Buffer.from('b3bb', 'hex')
+exports['skein1024-736'] = Buffer.from('b3bc', 'hex')
+exports['skein1024-744'] = Buffer.from('b3bd', 'hex')
+exports['skein1024-752'] = Buffer.from('b3be', 'hex')
+exports['skein1024-760'] = Buffer.from('b3bf', 'hex')
+exports['skein1024-768'] = Buffer.from('b3c0', 'hex')
+exports['skein1024-776'] = Buffer.from('b3c1', 'hex')
+exports['skein1024-784'] = Buffer.from('b3c2', 'hex')
+exports['skein1024-792'] = Buffer.from('b3c3', 'hex')
+exports['skein1024-800'] = Buffer.from('b3c4', 'hex')
+exports['skein1024-808'] = Buffer.from('b3c5', 'hex')
+exports['skein1024-816'] = Buffer.from('b3c6', 'hex')
+exports['skein1024-824'] = Buffer.from('b3c7', 'hex')
+exports['skein1024-832'] = Buffer.from('b3c8', 'hex')
+exports['skein1024-840'] = Buffer.from('b3c9', 'hex')
+exports['skein1024-848'] = Buffer.from('b3ca', 'hex')
+exports['skein1024-856'] = Buffer.from('b3cb', 'hex')
+exports['skein1024-864'] = Buffer.from('b3cc', 'hex')
+exports['skein1024-872'] = Buffer.from('b3cd', 'hex')
+exports['skein1024-880'] = Buffer.from('b3ce', 'hex')
+exports['skein1024-888'] = Buffer.from('b3cf', 'hex')
+exports['skein1024-896'] = Buffer.from('b3d0', 'hex')
+exports['skein1024-904'] = Buffer.from('b3d1', 'hex')
+exports['skein1024-912'] = Buffer.from('b3d2', 'hex')
+exports['skein1024-920'] = Buffer.from('b3d3', 'hex')
+exports['skein1024-928'] = Buffer.from('b3d4', 'hex')
+exports['skein1024-936'] = Buffer.from('b3d5', 'hex')
+exports['skein1024-944'] = Buffer.from('b3d6', 'hex')
+exports['skein1024-952'] = Buffer.from('b3d7', 'hex')
+exports['skein1024-960'] = Buffer.from('b3d8', 'hex')
+exports['skein1024-968'] = Buffer.from('b3d9', 'hex')
+exports['skein1024-976'] = Buffer.from('b3da', 'hex')
+exports['skein1024-984'] = Buffer.from('b3db', 'hex')
+exports['skein1024-992'] = Buffer.from('b3dc', 'hex')
+exports['skein1024-1000'] = Buffer.from('b3dd', 'hex')
+exports['skein1024-1008'] = Buffer.from('b3de', 'hex')
+exports['skein1024-1016'] = Buffer.from('b3df', 'hex')
+exports['skein1024-1024'] = Buffer.from('b3e0', 'hex')
+
+// multiaddrs
+exports['ip4'] = Buffer.from('04', 'hex')
+exports['ip6'] = Buffer.from('29', 'hex')
+exports['tcp'] = Buffer.from('06', 'hex')
+exports['udp'] = Buffer.from('0111', 'hex')
+exports['dccp'] = Buffer.from('21', 'hex')
+exports['sctp'] = Buffer.from('84', 'hex')
+exports['udt'] = Buffer.from('012d', 'hex')
+exports['utp'] = Buffer.from('012e', 'hex')
+exports['ipfs'] = Buffer.from('01a5', 'hex')
+exports['http'] = Buffer.from('01e0', 'hex')
+exports['https'] = Buffer.from('01bb', 'hex')
+exports['quic'] = Buffer.from('01cc', 'hex')
+exports['ws'] = Buffer.from('01dd', 'hex')
+exports['onion'] = Buffer.from('01bc', 'hex')
+exports['p2p-circuit'] = Buffer.from('0122', 'hex')
+
+// archiving formats
+
+// image formats
+
+// video formats
+
+// VCS formats
+exports['git-raw'] = Buffer.from('78', 'hex')
+
+// IPLD formats
+exports['dag-pb'] = Buffer.from('70', 'hex')
+exports['dag-cbor'] = Buffer.from('71', 'hex')
+exports['git-raw'] = Buffer.from('78', 'hex')
+exports['eth-block'] = Buffer.from('90', 'hex')
+exports['eth-block-list'] = Buffer.from('91', 'hex')
+exports['eth-tx-trie'] = Buffer.from('92', 'hex')
+exports['eth-tx'] = Buffer.from('93', 'hex')
+exports['eth-tx-receipt-trie'] = Buffer.from('94', 'hex')
+exports['eth-tx-receipt'] = Buffer.from('95', 'hex')
+exports['eth-state-trie'] = Buffer.from('96', 'hex')
+exports['eth-account-snapshot'] = Buffer.from('97', 'hex')
+exports['eth-storage-trie'] = Buffer.from('98', 'hex')
+
+exports['bitcoin-block'] = Buffer.from('b0', 'hex')
+exports['bitcoin-tx'] = Buffer.from('b1', 'hex')
+exports['zcash-block'] = Buffer.from('c0', 'hex')
+exports['zcash-tx'] = Buffer.from('c1', 'hex')
+exports['stellar-block'] = Buffer.from('d0', 'hex')
+exports['stellar-tx'] = Buffer.from('d1', 'hex')
+
+exports['torrent-info'] = Buffer.from('7b', 'hex')
+exports['torrent-file'] = Buffer.from('7c', 'hex')
+exports['ed25519-pub'] = Buffer.from('ed', 'hex')
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6).Buffer))
+
+/***/ }),
+/* 165 */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+exports.source = __webpack_require__(267)
+exports.through = __webpack_require__(571)
+exports.sink = __webpack_require__(268)
+exports.duplex = __webpack_require__(572)
+
+
+/***/ }),
+/* 166 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+const pump = __webpack_require__(47)
+const tar = __webpack_require__(573)
+const ReadableStream = __webpack_require__(20).Readable
+
+class ObjectsStreams extends ReadableStream {
+ constructor (options) {
+ const opts = Object.assign(options || {}, { objectMode: true })
+ super(opts)
+ }
+
+ _read () {}
+}
+
+/*
+ Transform a tar stream into a stream of objects:
+
+ Output format:
+ { path: 'string', content: Stream }
+*/
+const TarStreamToObjects = (inputStream, callback) => {
+ let outputStream = new ObjectsStreams()
+ let extractStream = tar.extract()
+
+ extractStream
+ .on('entry', (header, stream, next) => {
+ stream.on('end', next)
+
+ if (header.type !== 'directory') {
+ outputStream.push({
+ path: header.name,
+ content: stream
+ })
+ } else {
+ outputStream.push({
+ path: header.name
+ })
+ stream.resume()
+ }
+ })
+ .on('finish', () => outputStream.push(null))
+
+ pump(inputStream, extractStream)
+ callback(null, outputStream)
+}
+
+module.exports = TarStreamToObjects
+
+
+/***/ }),
+/* 167 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+var abortCb = __webpack_require__(277)
+
+module.exports = function values (array, onAbort) {
+ if(!array)
+ return function (abort, cb) {
+ if(abort) return abortCb(cb, abort, onAbort)
+ return cb(true)
+ }
+ if(!Array.isArray(array))
+ array = Object.keys(array).map(function (k) {
+ return array[k]
+ })
+ var i = 0
+ return function (abort, cb) {
+ if(abort)
+ return abortCb(cb, abort, onAbort)
+ if(i >= array.length)
+ cb(true)
+ else
+ cb(null, array[i++])
+ }
+}
+
+
+/***/ }),
+/* 168 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var drain = __webpack_require__(82)
+
+module.exports = function reduce (reducer, acc, cb ) {
+ if(!cb) cb = acc, acc = null
+ var sink = drain(function (data) {
+ acc = reducer(acc, data)
+ }, function (err) {
+ cb(err, acc)
+ })
+ if (arguments.length === 2)
+ return function (source) {
+ source(null, function (end, data) {
+ //if ended immediately, and no initial...
+ if(end) return cb(end === true ? null : end)
+ acc = data; sink(source)
+ })
+ }
+ else
+ return sink
+}
+
+
+/***/ }),
+/* 169 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var tester = __webpack_require__(279)
+
+module.exports = function filter (test) {
+ //regexp
+ test = tester(test)
+ return function (read) {
+ return function next (end, cb) {
+ var sync, loop = true
+ while(loop) {
+ loop = false
+ sync = true
+ read(end, function (end, data) {
+ if(!end && !test(data))
+ return sync ? loop = true : next(end, cb)
+ cb(end, data)
+ })
+ sync = false
+ }
+ }
+ }
+}
+
+
+
+/***/ }),
+/* 170 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var has = Object.prototype.hasOwnProperty;
+
+var hexTable = (function () {
+ var array = [];
+ for (var i = 0; i < 256; ++i) {
+ array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
+ }
+
+ return array;
+}());
+
+var compactQueue = function compactQueue(queue) {
+ var obj;
+
+ while (queue.length) {
+ var item = queue.pop();
+ obj = item.obj[item.prop];
+
+ if (Array.isArray(obj)) {
+ var compacted = [];
+
+ for (var j = 0; j < obj.length; ++j) {
+ if (typeof obj[j] !== 'undefined') {
+ compacted.push(obj[j]);
+ }
+ }
+
+ item.obj[item.prop] = compacted;
+ }
+ }
+
+ return obj;
+};
+
+var arrayToObject = function arrayToObject(source, options) {
+ var obj = options && options.plainObjects ? Object.create(null) : {};
+ for (var i = 0; i < source.length; ++i) {
+ if (typeof source[i] !== 'undefined') {
+ obj[i] = source[i];
+ }
+ }
+
+ return obj;
+};
+
+var merge = function merge(target, source, options) {
+ if (!source) {
+ return target;
+ }
+
+ if (typeof source !== 'object') {
+ if (Array.isArray(target)) {
+ target.push(source);
+ } else if (typeof target === 'object') {
+ if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {
+ target[source] = true;
+ }
+ } else {
+ return [target, source];
+ }
+
+ return target;
+ }
+
+ if (typeof target !== 'object') {
+ return [target].concat(source);
+ }
+
+ var mergeTarget = target;
+ if (Array.isArray(target) && !Array.isArray(source)) {
+ mergeTarget = arrayToObject(target, options);
+ }
+
+ if (Array.isArray(target) && Array.isArray(source)) {
+ source.forEach(function (item, i) {
+ if (has.call(target, i)) {
+ if (target[i] && typeof target[i] === 'object') {
+ target[i] = merge(target[i], item, options);
+ } else {
+ target.push(item);
+ }
+ } else {
+ target[i] = item;
+ }
+ });
+ return target;
+ }
+
+ return Object.keys(source).reduce(function (acc, key) {
+ var value = source[key];
+
+ if (has.call(acc, key)) {
+ acc[key] = merge(acc[key], value, options);
+ } else {
+ acc[key] = value;
+ }
+ return acc;
+ }, mergeTarget);
+};
+
+var assign = function assignSingleSource(target, source) {
+ return Object.keys(source).reduce(function (acc, key) {
+ acc[key] = source[key];
+ return acc;
+ }, target);
+};
+
+var decode = function (str) {
+ try {
+ return decodeURIComponent(str.replace(/\+/g, ' '));
+ } catch (e) {
+ return str;
+ }
+};
+
+var encode = function encode(str) {
+ // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
+ // It has been adapted here for stricter adherence to RFC 3986
+ if (str.length === 0) {
+ return str;
+ }
+
+ var string = typeof str === 'string' ? str : String(str);
+
+ var out = '';
+ for (var i = 0; i < string.length; ++i) {
+ var c = string.charCodeAt(i);
+
+ if (
+ c === 0x2D // -
+ || c === 0x2E // .
+ || c === 0x5F // _
+ || c === 0x7E // ~
+ || (c >= 0x30 && c <= 0x39) // 0-9
+ || (c >= 0x41 && c <= 0x5A) // a-z
+ || (c >= 0x61 && c <= 0x7A) // A-Z
+ ) {
+ out += string.charAt(i);
+ continue;
+ }
+
+ if (c < 0x80) {
+ out = out + hexTable[c];
+ continue;
+ }
+
+ if (c < 0x800) {
+ out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
+ continue;
+ }
+
+ if (c < 0xD800 || c >= 0xE000) {
+ out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
+ continue;
+ }
+
+ i += 1;
+ c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
+ out += hexTable[0xF0 | (c >> 18)]
+ + hexTable[0x80 | ((c >> 12) & 0x3F)]
+ + hexTable[0x80 | ((c >> 6) & 0x3F)]
+ + hexTable[0x80 | (c & 0x3F)];
+ }
+
+ return out;
+};
+
+var compact = function compact(value) {
+ var queue = [{ obj: { o: value }, prop: 'o' }];
+ var refs = [];
+
+ for (var i = 0; i < queue.length; ++i) {
+ var item = queue[i];
+ var obj = item.obj[item.prop];
+
+ var keys = Object.keys(obj);
+ for (var j = 0; j < keys.length; ++j) {
+ var key = keys[j];
+ var val = obj[key];
+ if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
+ queue.push({ obj: obj, prop: key });
+ refs.push(val);
+ }
+ }
+ }
+
+ return compactQueue(queue);
+};
+
+var isRegExp = function isRegExp(obj) {
+ return Object.prototype.toString.call(obj) === '[object RegExp]';
+};
+
+var isBuffer = function isBuffer(obj) {
+ if (obj === null || typeof obj === 'undefined') {
+ return false;
+ }
+
+ return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
+};
+
+module.exports = {
+ arrayToObject: arrayToObject,
+ assign: assign,
+ compact: compact,
+ decode: decode,
+ encode: encode,
+ isBuffer: isBuffer,
+ isRegExp: isRegExp,
+ merge: merge
+};
+
+
+/***/ }),
+/* 171 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+
+var punycode = __webpack_require__(289);
+var util = __webpack_require__(611);
+
+exports.parse = urlParse;
+exports.resolve = urlResolve;
+exports.resolveObject = urlResolveObject;
+exports.format = urlFormat;
+
+exports.Url = Url;
+
+function Url() {
+ 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;
+}
+
+// Reference: RFC 3986, RFC 1808, RFC 2396
+
+// define these here so at least they only have to be
+// compiled once on the first module load.
+var protocolPattern = /^([a-z0-9.+-]+:)/i,
+ portPattern = /:[0-9]*$/,
+
+ // Special case for a simple path URL
+ simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
+
+ // RFC 2396: characters reserved for delimiting URLs.
+ // We actually just auto-escape these.
+ delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
+
+ // RFC 2396: characters not allowed for various reasons.
+ unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims),
+
+ // Allowed by RFCs, but cause of XSS attacks. Always escape these.
+ autoEscape = ['\''].concat(unwise),
+ // Characters that are never ever allowed in a hostname.
+ // Note that any invalid chars are also handled, but these
+ // are the ones that are *expected* to be seen, so we fast-path
+ // them.
+ nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),
+ hostEndingChars = ['/', '?', '#'],
+ hostnameMaxLen = 255,
+ hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
+ hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
+ // protocols that can allow "unsafe" and "unwise" chars.
+ unsafeProtocol = {
+ 'javascript': true,
+ 'javascript:': true
+ },
+ // protocols that never have a hostname.
+ hostlessProtocol = {
+ 'javascript': true,
+ 'javascript:': true
+ },
+ // protocols that always contain a // bit.
+ slashedProtocol = {
+ 'http': true,
+ 'https': true,
+ 'ftp': true,
+ 'gopher': true,
+ 'file': true,
+ 'http:': true,
+ 'https:': true,
+ 'ftp:': true,
+ 'gopher:': true,
+ 'file:': true
+ },
+ querystring = __webpack_require__(612);
+
+function urlParse(url, parseQueryString, slashesDenoteHost) {
+ if (url && util.isObject(url) && url instanceof Url) return url;
+
+ var u = new Url;
+ u.parse(url, parseQueryString, slashesDenoteHost);
+ return u;
+}
+
+Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
+ if (!util.isString(url)) {
+ throw new TypeError("Parameter 'url' must be a string, not " + typeof url);
+ }
+
+ // Copy chrome, IE, opera backslash-handling behavior.
+ // Back slashes before the query string get converted to forward slashes
+ // See: https://code.google.com/p/chromium/issues/detail?id=25916
+ var queryIndex = url.indexOf('?'),
+ splitter =
+ (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',
+ uSplit = url.split(splitter),
+ slashRegex = /\\/g;
+ uSplit[0] = uSplit[0].replace(slashRegex, '/');
+ url = uSplit.join(splitter);
+
+ var rest = url;
+
+ // trim before proceeding.
+ // This is to support parse stuff like " http://foo.com \n"
+ rest = rest.trim();
+
+ if (!slashesDenoteHost && url.split('#').length === 1) {
+ // Try fast path regexp
+ var simplePath = simplePathPattern.exec(rest);
+ if (simplePath) {
+ this.path = rest;
+ this.href = rest;
+ this.pathname = simplePath[1];
+ if (simplePath[2]) {
+ this.search = simplePath[2];
+ if (parseQueryString) {
+ this.query = querystring.parse(this.search.substr(1));
+ } else {
+ this.query = this.search.substr(1);
+ }
+ } else if (parseQueryString) {
+ this.search = '';
+ this.query = {};
+ }
+ return this;
+ }
+ }
+
+ var proto = protocolPattern.exec(rest);
+ if (proto) {
+ proto = proto[0];
+ var lowerProto = proto.toLowerCase();
+ this.protocol = lowerProto;
+ rest = rest.substr(proto.length);
+ }
+
+ // figure out if it's got a host
+ // user@server is *always* interpreted as a hostname, and url
+ // resolution will treat //foo/bar as host=foo,path=bar because that's
+ // how the browser resolves relative URLs.
+ if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
+ var slashes = rest.substr(0, 2) === '//';
+ if (slashes && !(proto && hostlessProtocol[proto])) {
+ rest = rest.substr(2);
+ this.slashes = true;
+ }
+ }
+
+ if (!hostlessProtocol[proto] &&
+ (slashes || (proto && !slashedProtocol[proto]))) {
+
+ // there's a hostname.
+ // the first instance of /, ?, ;, or # ends the host.
+ //
+ // If there is an @ in the hostname, then non-host chars *are* allowed
+ // to the left of the last @ sign, unless some host-ending character
+ // comes *before* the @-sign.
+ // URLs are obnoxious.
+ //
+ // ex:
+ // http://a@b@c/ => user:a@b host:c
+ // http://a@b?@c => user:a host:c path:/?@c
+
+ // v0.12 TODO(isaacs): This is not quite how Chrome does things.
+ // Review our test case against browsers more comprehensively.
+
+ // find the first instance of any hostEndingChars
+ var hostEnd = -1;
+ for (var i = 0; i < hostEndingChars.length; i++) {
+ var hec = rest.indexOf(hostEndingChars[i]);
+ if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
+ hostEnd = hec;
+ }
+
+ // at this point, either we have an explicit point where the
+ // auth portion cannot go past, or the last @ char is the decider.
+ var auth, atSign;
+ if (hostEnd === -1) {
+ // atSign can be anywhere.
+ atSign = rest.lastIndexOf('@');
+ } else {
+ // atSign must be in auth portion.
+ // http://a@b/c@d => host:b auth:a path:/c@d
+ atSign = rest.lastIndexOf('@', hostEnd);
+ }
+
+ // Now we have a portion which is definitely the auth.
+ // Pull that off.
+ if (atSign !== -1) {
+ auth = rest.slice(0, atSign);
+ rest = rest.slice(atSign + 1);
+ this.auth = decodeURIComponent(auth);
+ }
+
+ // the host is the remaining to the left of the first non-host char
+ hostEnd = -1;
+ for (var i = 0; i < nonHostChars.length; i++) {
+ var hec = rest.indexOf(nonHostChars[i]);
+ if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
+ hostEnd = hec;
+ }
+ // if we still have not hit it, then the entire thing is a host.
+ if (hostEnd === -1)
+ hostEnd = rest.length;
+
+ this.host = rest.slice(0, hostEnd);
+ rest = rest.slice(hostEnd);
+
+ // pull out port.
+ this.parseHost();
+
+ // we've indicated that there is a hostname,
+ // so even if it's empty, it has to be present.
+ this.hostname = this.hostname || '';
+
+ // if hostname begins with [ and ends with ]
+ // assume that it's an IPv6 address.
+ var ipv6Hostname = this.hostname[0] === '[' &&
+ this.hostname[this.hostname.length - 1] === ']';
+
+ // validate a little.
+ if (!ipv6Hostname) {
+ var hostparts = this.hostname.split(/\./);
+ for (var i = 0, l = hostparts.length; i < l; i++) {
+ var part = hostparts[i];
+ if (!part) continue;
+ if (!part.match(hostnamePartPattern)) {
+ var newpart = '';
+ for (var j = 0, k = part.length; j < k; j++) {
+ if (part.charCodeAt(j) > 127) {
+ // we replace non-ASCII char with a temporary placeholder
+ // we need this to make sure size of hostname is not
+ // broken by replacing non-ASCII by nothing
+ newpart += 'x';
+ } else {
+ newpart += part[j];
+ }
+ }
+ // we test again with ASCII char only
+ if (!newpart.match(hostnamePartPattern)) {
+ var validParts = hostparts.slice(0, i);
+ var notHost = hostparts.slice(i + 1);
+ var bit = part.match(hostnamePartStart);
+ if (bit) {
+ validParts.push(bit[1]);
+ notHost.unshift(bit[2]);
+ }
+ if (notHost.length) {
+ rest = '/' + notHost.join('.') + rest;
+ }
+ this.hostname = validParts.join('.');
+ break;
+ }
+ }
+ }
+ }
+
+ if (this.hostname.length > hostnameMaxLen) {
+ this.hostname = '';
+ } else {
+ // hostnames are always lower case.
+ this.hostname = this.hostname.toLowerCase();
+ }
+
+ if (!ipv6Hostname) {
+ // IDNA Support: Returns a punycoded representation of "domain".
+ // It only converts parts of the domain name that
+ // have non-ASCII characters, i.e. it doesn't matter if
+ // you call it with a domain that already is ASCII-only.
+ this.hostname = punycode.toASCII(this.hostname);
+ }
+
+ var p = this.port ? ':' + this.port : '';
+ var h = this.hostname || '';
+ this.host = h + p;
+ this.href += this.host;
+
+ // strip [ and ] from the hostname
+ // the host field still retains them, though
+ if (ipv6Hostname) {
+ this.hostname = this.hostname.substr(1, this.hostname.length - 2);
+ if (rest[0] !== '/') {
+ rest = '/' + rest;
+ }
+ }
+ }
+
+ // now rest is set to the post-host stuff.
+ // chop off any delim chars.
+ if (!unsafeProtocol[lowerProto]) {
+
+ // First, make 100% sure that any "autoEscape" chars get
+ // escaped, even if encodeURIComponent doesn't think they
+ // need to be.
+ for (var i = 0, l = autoEscape.length; i < l; i++) {
+ var ae = autoEscape[i];
+ if (rest.indexOf(ae) === -1)
+ continue;
+ var esc = encodeURIComponent(ae);
+ if (esc === ae) {
+ esc = escape(ae);
+ }
+ rest = rest.split(ae).join(esc);
+ }
+ }
+
+
+ // chop off from the tail first.
+ var hash = rest.indexOf('#');
+ if (hash !== -1) {
+ // got a fragment string.
+ this.hash = rest.substr(hash);
+ rest = rest.slice(0, hash);
+ }
+ var qm = rest.indexOf('?');
+ if (qm !== -1) {
+ this.search = rest.substr(qm);
+ this.query = rest.substr(qm + 1);
+ if (parseQueryString) {
+ this.query = querystring.parse(this.query);
+ }
+ rest = rest.slice(0, qm);
+ } else if (parseQueryString) {
+ // no query string, but parseQueryString still requested
+ this.search = '';
+ this.query = {};
+ }
+ if (rest) this.pathname = rest;
+ if (slashedProtocol[lowerProto] &&
+ this.hostname && !this.pathname) {
+ this.pathname = '/';
+ }
+
+ //to support http.request
+ if (this.pathname || this.search) {
+ var p = this.pathname || '';
+ var s = this.search || '';
+ this.path = p + s;
+ }
+
+ // finally, reconstruct the href based on what has been validated.
+ this.href = this.format();
+ return this;
+};
+
+// format a parsed object into a url string
+function urlFormat(obj) {
+ // ensure it's an object, and not a string url.
+ // If it's an obj, this is a no-op.
+ // this way, you can call url_format() on strings
+ // to clean up potentially wonky urls.
+ if (util.isString(obj)) obj = urlParse(obj);
+ if (!(obj instanceof Url)) return Url.prototype.format.call(obj);
+ return obj.format();
+}
+
+Url.prototype.format = function() {
+ var auth = this.auth || '';
+ if (auth) {
+ auth = encodeURIComponent(auth);
+ auth = auth.replace(/%3A/i, ':');
+ auth += '@';
+ }
+
+ var protocol = this.protocol || '',
+ pathname = this.pathname || '',
+ hash = this.hash || '',
+ host = false,
+ query = '';
+
+ if (this.host) {
+ host = auth + this.host;
+ } else if (this.hostname) {
+ host = auth + (this.hostname.indexOf(':') === -1 ?
+ this.hostname :
+ '[' + this.hostname + ']');
+ if (this.port) {
+ host += ':' + this.port;
+ }
+ }
+
+ if (this.query &&
+ util.isObject(this.query) &&
+ Object.keys(this.query).length) {
+ query = querystring.stringify(this.query);
+ }
+
+ var search = this.search || (query && ('?' + query)) || '';
+
+ if (protocol && protocol.substr(-1) !== ':') protocol += ':';
+
+ // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.
+ // unless they had them to begin with.
+ if (this.slashes ||
+ (!protocol || slashedProtocol[protocol]) && host !== false) {
+ host = '//' + (host || '');
+ if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;
+ } else if (!host) {
+ host = '';
+ }
+
+ if (hash && hash.charAt(0) !== '#') hash = '#' + hash;
+ if (search && search.charAt(0) !== '?') search = '?' + search;
+
+ pathname = pathname.replace(/[?#]/g, function(match) {
+ return encodeURIComponent(match);
+ });
+ search = search.replace('#', '%23');
+
+ return protocol + host + pathname + search + hash;
+};
+
+function urlResolve(source, relative) {
+ return urlParse(source, false, true).resolve(relative);
+}
+
+Url.prototype.resolve = function(relative) {
+ return this.resolveObject(urlParse(relative, false, true)).format();
+};
+
+function urlResolveObject(source, relative) {
+ if (!source) return relative;
+ return urlParse(source, false, true).resolveObject(relative);
+}
+
+Url.prototype.resolveObject = function(relative) {
+ if (util.isString(relative)) {
+ var rel = new Url();
+ rel.parse(relative, false, true);
+ relative = rel;
+ }
+
+ var result = new Url();
+ var tkeys = Object.keys(this);
+ for (var tk = 0; tk < tkeys.length; tk++) {
+ var tkey = tkeys[tk];
+ result[tkey] = this[tkey];
+ }
+
+ // hash is always overridden, no matter what.
+ // even href="" will remove it.
+ result.hash = relative.hash;
+
+ // if the relative url is empty, then there's nothing left to do here.
+ if (relative.href === '') {
+ result.href = result.format();
+ return result;
+ }
+
+ // hrefs like //foo/bar always cut to the protocol.
+ if (relative.slashes && !relative.protocol) {
+ // take everything except the protocol from relative
+ var rkeys = Object.keys(relative);
+ for (var rk = 0; rk < rkeys.length; rk++) {
+ var rkey = rkeys[rk];
+ if (rkey !== 'protocol')
+ result[rkey] = relative[rkey];
+ }
+
+ //urlParse appends trailing / to urls like http://www.example.com
+ if (slashedProtocol[result.protocol] &&
+ result.hostname && !result.pathname) {
+ result.path = result.pathname = '/';
+ }
+
+ result.href = result.format();
+ return result;
+ }
+
+ if (relative.protocol && relative.protocol !== result.protocol) {
+ // if it's a known url protocol, then changing
+ // the protocol does weird things
+ // first, if it's not file:, then we MUST have a host,
+ // and if there was a path
+ // to begin with, then we MUST have a path.
+ // if it is file:, then the host is dropped,
+ // because that's known to be hostless.
+ // anything else is assumed to be absolute.
+ if (!slashedProtocol[relative.protocol]) {
+ var keys = Object.keys(relative);
+ for (var v = 0; v < keys.length; v++) {
+ var k = keys[v];
+ result[k] = relative[k];
+ }
+ result.href = result.format();
+ return result;
+ }
+
+ result.protocol = relative.protocol;
+ if (!relative.host && !hostlessProtocol[relative.protocol]) {
+ var relPath = (relative.pathname || '').split('/');
+ while (relPath.length && !(relative.host = relPath.shift()));
+ if (!relative.host) relative.host = '';
+ if (!relative.hostname) relative.hostname = '';
+ if (relPath[0] !== '') relPath.unshift('');
+ if (relPath.length < 2) relPath.unshift('');
+ result.pathname = relPath.join('/');
+ } else {
+ result.pathname = relative.pathname;
+ }
+ result.search = relative.search;
+ result.query = relative.query;
+ result.host = relative.host || '';
+ result.auth = relative.auth;
+ result.hostname = relative.hostname || relative.host;
+ result.port = relative.port;
+ // to support http.request
+ if (result.pathname || result.search) {
+ var p = result.pathname || '';
+ var s = result.search || '';
+ result.path = p + s;
+ }
+ result.slashes = result.slashes || relative.slashes;
+ result.href = result.format();
+ return result;
+ }
+
+ var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),
+ isRelAbs = (
+ relative.host ||
+ relative.pathname && relative.pathname.charAt(0) === '/'
+ ),
+ mustEndAbs = (isRelAbs || isSourceAbs ||
+ (result.host && relative.pathname)),
+ removeAllDots = mustEndAbs,
+ srcPath = result.pathname && result.pathname.split('/') || [],
+ relPath = relative.pathname && relative.pathname.split('/') || [],
+ psychotic = result.protocol && !slashedProtocol[result.protocol];
+
+ // if the url is a non-slashed url, then relative
+ // links like ../.. should be able
+ // to crawl up to the hostname, as well. This is strange.
+ // result.protocol has already been set by now.
+ // Later on, put the first path part into the host field.
+ if (psychotic) {
+ result.hostname = '';
+ result.port = null;
+ if (result.host) {
+ if (srcPath[0] === '') srcPath[0] = result.host;
+ else srcPath.unshift(result.host);
+ }
+ result.host = '';
+ if (relative.protocol) {
+ relative.hostname = null;
+ relative.port = null;
+ if (relative.host) {
+ if (relPath[0] === '') relPath[0] = relative.host;
+ else relPath.unshift(relative.host);
+ }
+ relative.host = null;
+ }
+ mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');
+ }
+
+ if (isRelAbs) {
+ // it's absolute.
+ result.host = (relative.host || relative.host === '') ?
+ relative.host : result.host;
+ result.hostname = (relative.hostname || relative.hostname === '') ?
+ relative.hostname : result.hostname;
+ result.search = relative.search;
+ result.query = relative.query;
+ srcPath = relPath;
+ // fall through to the dot-handling below.
+ } else if (relPath.length) {
+ // it's relative
+ // throw away the existing file, and take the new path instead.
+ if (!srcPath) srcPath = [];
+ srcPath.pop();
+ srcPath = srcPath.concat(relPath);
+ result.search = relative.search;
+ result.query = relative.query;
+ } else if (!util.isNullOrUndefined(relative.search)) {
+ // just pull out the search.
+ // like href='?foo'.
+ // Put this after the other two cases because it simplifies the booleans
+ if (psychotic) {
+ result.hostname = result.host = srcPath.shift();
+ //occationaly the auth can get stuck only in host
+ //this especially happens in cases like
+ //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
+ var authInHost = result.host && result.host.indexOf('@') > 0 ?
+ result.host.split('@') : false;
+ if (authInHost) {
+ result.auth = authInHost.shift();
+ result.host = result.hostname = authInHost.shift();
+ }
+ }
+ result.search = relative.search;
+ result.query = relative.query;
+ //to support http.request
+ if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
+ result.path = (result.pathname ? result.pathname : '') +
+ (result.search ? result.search : '');
+ }
+ result.href = result.format();
+ return result;
+ }
+
+ if (!srcPath.length) {
+ // no path at all. easy.
+ // we've already handled the other stuff above.
+ result.pathname = null;
+ //to support http.request
+ if (result.search) {
+ result.path = '/' + result.search;
+ } else {
+ result.path = null;
+ }
+ result.href = result.format();
+ return result;
+ }
+
+ // if a url ENDs in . or .., then it must get a trailing slash.
+ // however, if it ends in anything else non-slashy,
+ // then it must NOT get a trailing slash.
+ var last = srcPath.slice(-1)[0];
+ var hasTrailingSlash = (
+ (result.host || relative.host || srcPath.length > 1) &&
+ (last === '.' || last === '..') || last === '');
+
+ // strip single dots, resolve double dots to parent dir
+ // if the path tries to go above the root, `up` ends up > 0
+ var up = 0;
+ for (var i = srcPath.length; i >= 0; i--) {
+ last = srcPath[i];
+ if (last === '.') {
+ srcPath.splice(i, 1);
+ } else if (last === '..') {
+ srcPath.splice(i, 1);
+ up++;
+ } else if (up) {
+ srcPath.splice(i, 1);
+ up--;
+ }
+ }
+
+ // if the path is allowed to go above the root, restore leading ..s
+ if (!mustEndAbs && !removeAllDots) {
+ for (; up--; up) {
+ srcPath.unshift('..');
+ }
+ }
+
+ if (mustEndAbs && srcPath[0] !== '' &&
+ (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {
+ srcPath.unshift('');
+ }
+
+ if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {
+ srcPath.push('');
+ }
+
+ var isAbsolute = srcPath[0] === '' ||
+ (srcPath[0] && srcPath[0].charAt(0) === '/');
+
+ // put the host back
+ if (psychotic) {
+ result.hostname = result.host = isAbsolute ? '' :
+ srcPath.length ? srcPath.shift() : '';
+ //occationaly the auth can get stuck only in host
+ //this especially happens in cases like
+ //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
+ var authInHost = result.host && result.host.indexOf('@') > 0 ?
+ result.host.split('@') : false;
+ if (authInHost) {
+ result.auth = authInHost.shift();
+ result.host = result.hostname = authInHost.shift();
+ }
+ }
+
+ mustEndAbs = mustEndAbs || (result.host && srcPath.length);
+
+ if (mustEndAbs && !isAbsolute) {
+ srcPath.unshift('');
+ }
+
+ if (!srcPath.length) {
+ result.pathname = null;
+ result.path = null;
+ } else {
+ result.pathname = srcPath.join('/');
+ }
+
+ //to support request.http
+ if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
+ result.path = (result.pathname ? result.pathname : '') +
+ (result.search ? result.search : '');
+ }
+ result.auth = relative.auth || result.auth;
+ result.slashes = result.slashes || relative.slashes;
+ result.href = result.format();
+ return result;
+};
+
+Url.prototype.parseHost = function() {
+ var host = this.host;
+ var port = portPattern.exec(host);
+ if (port) {
+ port = port[0];
+ if (port !== ':') {
+ this.port = port.substr(1);
+ }
+ host = host.substr(0, host.length - port.length);
+ }
+ if (host) this.hostname = host;
+};
+
+
+/***/ }),
+/* 172 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+const once = __webpack_require__(29)
+const ConcatStream = __webpack_require__(77)
+const SendFilesStream = __webpack_require__(80)
+
+module.exports = (send, path) => {
+ const sendFilesStream = SendFilesStream(send, path)
+ return (file, options, _callback) => {
+ const callback = once(_callback)
+ const stream = sendFilesStream(options)
+ const concat = ConcatStream((results) => callback(null, results))
+ stream.once('error', callback)
+ stream.pipe(concat)
+ stream.write(file)
+ stream.end()
+ }
+}
+
+
+/***/ }),
+/* 173 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+module.exports = Stream;
+
+var EE = __webpack_require__(109).EventEmitter;
+var inherits = __webpack_require__(14);
+
+inherits(Stream, EE);
+Stream.Readable = __webpack_require__(20);
+Stream.Writable = __webpack_require__(636);
+Stream.Duplex = __webpack_require__(264);
+Stream.Transform = __webpack_require__(273);
+Stream.PassThrough = __webpack_require__(637);
+
+// Backwards-compat with node 0.4.x
+Stream.Stream = Stream;
+
+
+
+// old-style streams. Note that the pipe method (the only relevant
+// part of this class) is overridden in the Readable class.
+
+function Stream() {
+ EE.call(this);
+}
+
+Stream.prototype.pipe = function(dest, options) {
+ var source = this;
+
+ function ondata(chunk) {
+ if (dest.writable) {
+ if (false === dest.write(chunk) && source.pause) {
+ source.pause();
+ }
+ }
+ }
+
+ source.on('data', ondata);
+
+ function ondrain() {
+ if (source.readable && source.resume) {
+ source.resume();
+ }
+ }
+
+ dest.on('drain', ondrain);
+
+ // If the 'end' option is not supplied, dest.end() will be called when
+ // source gets the 'end' or 'close' events. Only dest.end() once.
+ if (!dest._isStdio && (!options || options.end !== false)) {
+ source.on('end', onend);
+ source.on('close', onclose);
+ }
+
+ var didOnEnd = false;
+ function onend() {
+ if (didOnEnd) return;
+ didOnEnd = true;
+
+ dest.end();
+ }
+
+
+ function onclose() {
+ if (didOnEnd) return;
+ didOnEnd = true;
+
+ if (typeof dest.destroy === 'function') dest.destroy();
+ }
+
+ // don't leave dangling pipes when there are errors.
+ function onerror(er) {
+ cleanup();
+ if (EE.listenerCount(this, 'error') === 0) {
+ throw er; // Unhandled stream error in pipe.
+ }
+ }
+
+ source.on('error', onerror);
+ dest.on('error', onerror);
+
+ // remove all the event listeners that were added.
+ function cleanup() {
+ source.removeListener('data', ondata);
+ dest.removeListener('drain', ondrain);
+
+ source.removeListener('end', onend);
+ source.removeListener('close', onclose);
+
+ source.removeListener('error', onerror);
+ dest.removeListener('error', onerror);
+
+ source.removeListener('end', cleanup);
+ source.removeListener('close', cleanup);
+
+ dest.removeListener('close', cleanup);
+ }
+
+ source.on('end', cleanup);
+ source.on('close', cleanup);
+
+ dest.on('close', cleanup);
+
+ dest.emit('pipe', source);
+
+ // Allow for unix-like usage: A.pipe(B).pipe(C)
+ return dest;
+};
+
+
+/***/ }),
+/* 174 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(Buffer) {
+
+const mh = __webpack_require__(34)
+const assert = __webpack_require__(113)
+
+class DAGNode {
+ constructor (data, links, serialized, multihash) {
+ assert(serialized, 'DAGNode needs its serialized format')
+ assert(multihash, 'DAGNode needs its multihash')
+
+ if (typeof multihash === 'string') {
+ multihash = mh.fromB58String(multihash)
+ }
+
+ this._data = data || Buffer.alloc(0)
+ this._links = links || []
+ this._serialized = serialized
+ this._multihash = multihash
+
+ this._size = this.links.reduce((sum, l) => sum + l.size, this.serialized.length)
+
+ this._json = {
+ data: this.data,
+ links: this.links.map((l) => l.toJSON()),
+ multihash: mh.toB58String(this.multihash),
+ size: this.size
+ }
+ }
+
+ toJSON () {
+ return this._json
+ }
+
+ toString () {
+ const mhStr = mh.toB58String(this.multihash)
+ return `DAGNode <${mhStr} - data: "${this.data.toString()}", links: ${this.links.length}, size: ${this.size}>`
+ }
+
+ get data () {
+ return this._data
+ }
+
+ set data (data) {
+ throw new Error("Can't set property: 'data' is immutable")
+ }
+
+ get links () {
+ return this._links
+ }
+
+ set links (links) {
+ throw new Error("Can't set property: 'links' is immutable")
+ }
+
+ get serialized () {
+ return this._serialized
+ }
+
+ set serialized (serialized) {
+ throw new Error("Can't set property: 'serialized' is immutable")
+ }
+
+ get size () {
+ return this._size
+ }
+
+ set size (size) {
+ throw new Error("Can't set property: 'size' is immutable")
+ }
+
+ get multihash () {
+ return this._multihash
+ }
+
+ set multihash (multihash) {
+ throw new Error("Can't set property: 'multihash' is immutable")
+ }
+}
+
+exports = module.exports = DAGNode
+exports.create = __webpack_require__(114)
+exports.clone = __webpack_require__(686)
+exports.addLink = __webpack_require__(687)
+exports.rmLink = __webpack_require__(688)
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6).Buffer))
+
+/***/ }),
+/* 175 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(Buffer) {
+
+const CID = __webpack_require__(33)
+const protons = __webpack_require__(87)
+const proto = protons(__webpack_require__(683))
+const DAGLink = __webpack_require__(49)
+const DAGNode = __webpack_require__(174)
+
+exports = module.exports
+
+function cid (node, callback) {
+ if (node.multihash) {
+ return callback(null, new CID(node.multihash))
+ }
+ callback(new Error('not valid dagPB node'))
+}
+
+function serialize (node, callback) {
+ let serialized
+
+ // If the node is not an instance of a DAGNode, the link.hash might be a Base58 encoded string; decode it
+ if (node.constructor.name !== 'DAGNode' && node.links) {
+ node.links = node.links.map((link) => {
+ return DAGLink.util.isDagLink(link) ? link : DAGLink.util.createDagLinkFromB58EncodedHash(link)
+ })
+ }
+
+ try {
+ serialized = proto.PBNode.encode(toProtoBuf(node))
+ } catch (err) {
+ return callback(err)
+ }
+
+ callback(null, serialized)
+}
+
+function deserialize (data, callback) {
+ const pbn = proto.PBNode.decode(data)
+
+ const links = pbn.Links.map((link) => {
+ return new DAGLink(link.Name, link.Tsize, link.Hash)
+ })
+
+ const buf = pbn.Data == null ? Buffer.alloc(0) : Buffer.from(pbn.Data)
+
+ DAGNode.create(buf, links, callback)
+}
+
+function toProtoBuf (node) {
+ const pbn = {}
+
+ if (node.data && node.data.length > 0) {
+ pbn.Data = node.data
+ } else {
+ // NOTE: this has to be null in order to match go-ipfs serialization `null !== new Buffer(0)`
+ pbn.Data = null
+ }
+
+ if (node.links && node.links.length > 0) {
+ pbn.Links = node.links.map((link) => {
+ return {
+ Hash: link.multihash,
+ Name: link.name,
+ Tsize: link.size
+ }
+ })
+ } else {
+ pbn.Links = null
+ }
+
+ return pbn
+}
+
+exports.serialize = serialize
+exports.deserialize = deserialize
+exports.cid = cid
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6).Buffer))
+
+/***/ }),
+/* 176 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.defined = function (val) {
+ return val !== null && val !== undefined && (typeof val !== 'number' || !isNaN(val))
+}
+
+
+/***/ }),
+/* 177 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(Buffer) {/*
+ * Id is an object representation of a peer Id. a peer Id is a multihash
+ */
+
+
+
+const mh = __webpack_require__(34)
+const crypto = __webpack_require__(720)
+const assert = __webpack_require__(113)
+const waterfall = __webpack_require__(295)
+
+class PeerId {
+ constructor (id, privKey, pubKey) {
+ assert(Buffer.isBuffer(id), 'invalid id provided')
+
+ if (privKey && pubKey) {
+ assert(privKey.public.bytes.equals(pubKey.bytes), 'inconsistent arguments')
+ }
+
+ this._id = id
+ this._idB58String = mh.toB58String(this.id)
+ this._privKey = privKey
+ this._pubKey = pubKey
+ }
+
+ get id () {
+ return this._id
+ }
+
+ set id (val) {
+ throw new Error('Id is immutable')
+ }
+
+ get privKey () {
+ return this._privKey
+ }
+
+ set privKey (privKey) {
+ this._privKey = privKey
+ }
+
+ get pubKey () {
+ if (this._pubKey) {
+ return this._pubKey
+ }
+
+ if (this._privKey) {
+ return this._privKey.public
+ }
+ }
+
+ set pubKey (pubKey) {
+ this._pubKey = pubKey
+ }
+
+ // Return the protobuf version of the public key, matching go ipfs formatting
+ marshalPubKey () {
+ if (this.pubKey) {
+ return crypto.keys.marshalPublicKey(this.pubKey)
+ }
+ }
+
+ // Return the protobuf version of the private key, matching go ipfs formatting
+ marshalPrivKey () {
+ if (this.privKey) {
+ return crypto.keys.marshalPrivateKey(this.privKey)
+ }
+ }
+
+ // pretty print
+ toPrint () {
+ return this.toJSON()
+ }
+
+ // return the jsonified version of the key, matching the formatting
+ // of go-ipfs for its config file
+ toJSON () {
+ return {
+ id: this.toB58String(),
+ privKey: toB64Opt(this.marshalPrivKey()),
+ pubKey: toB64Opt(this.marshalPubKey())
+ }
+ }
+
+ // encode/decode functions
+ toHexString () {
+ return mh.toHexString(this.id)
+ }
+
+ toBytes () {
+ return this.id
+ }
+
+ toB58String () {
+ return this._idB58String
+ }
+
+ isEqual (id) {
+ if (Buffer.isBuffer(id)) {
+ return this.id.equals(id)
+ } else if (id.id) {
+ return this.id.equals(id.id)
+ } else {
+ throw new Error('not valid Id')
+ }
+ }
+
+ /*
+ * Check if this PeerId instance is valid (privKey -> pubKey -> Id)
+ */
+ isValid (callback) {
+ // TODO Needs better checking
+ if (this.privKey &&
+ this.privKey.public &&
+ this.privKey.public.bytes &&
+ Buffer.isBuffer(this.pubKey.bytes) &&
+ this.privKey.public.bytes.equals(this.pubKey.bytes)) {
+ callback()
+ } else {
+ callback(new Error('Keys not match'))
+ }
+ }
+}
+
+exports = module.exports = PeerId
+
+// generation
+exports.create = function (opts, callback) {
+ if (typeof opts === 'function') {
+ callback = opts
+ opts = {}
+ }
+ opts = opts || {}
+ opts.bits = opts.bits || 2048
+
+ waterfall([
+ (cb) => crypto.keys.generateKeyPair('RSA', opts.bits, cb),
+ (privKey, cb) => privKey.public.hash((err, digest) => {
+ cb(err, digest, privKey)
+ })
+ ], (err, digest, privKey) => {
+ if (err) {
+ return callback(err)
+ }
+
+ callback(null, new PeerId(digest, privKey))
+ })
+}
+
+exports.createFromHexString = function (str) {
+ return new PeerId(mh.fromHexString(str))
+}
+
+exports.createFromBytes = function (buf) {
+ return new PeerId(buf)
+}
+
+exports.createFromB58String = function (str) {
+ return new PeerId(mh.fromB58String(str))
+}
+
+// Public Key input will be a buffer
+exports.createFromPubKey = function (key, callback) {
+ if (typeof callback !== 'function') {
+ throw new Error('callback is required')
+ }
+
+ let pubKey
+
+ try {
+ let buf = key
+ if (typeof buf === 'string') {
+ buf = Buffer.from(key, 'base64')
+ }
+
+ if (!Buffer.isBuffer(buf)) throw new Error('Supplied key is neither a base64 string nor a buffer')
+
+ pubKey = crypto.keys.unmarshalPublicKey(buf)
+ } catch (err) {
+ return callback(err)
+ }
+
+ pubKey.hash((err, digest) => {
+ if (err) {
+ return callback(err)
+ }
+
+ callback(null, new PeerId(digest, null, pubKey))
+ })
+}
+
+// Private key input will be a string
+exports.createFromPrivKey = function (key, callback) {
+ if (typeof callback !== 'function') {
+ throw new Error('callback is required')
+ }
+
+ let buf = key
+
+ try {
+ if (typeof buf === 'string') {
+ buf = Buffer.from(key, 'base64')
+ }
+
+ if (!Buffer.isBuffer(buf)) throw new Error('Supplied key is neither a base64 string nor a buffer')
+ } catch (err) {
+ return callback(err)
+ }
+
+ waterfall([
+ (cb) => crypto.keys.unmarshalPrivateKey(buf, cb),
+ (privKey, cb) => privKey.public.hash((err, digest) => {
+ cb(err, digest, privKey)
+ })
+ ], (err, digest, privKey) => {
+ if (err) {
+ return callback(err)
+ }
+
+ callback(null, new PeerId(digest, privKey, privKey.public))
+ })
+}
+
+exports.createFromJSON = function (obj, callback) {
+ if (typeof callback !== 'function') {
+ throw new Error('callback is required')
+ }
+
+ let id
+ let rawPrivKey
+ let rawPubKey
+ let pub
+
+ try {
+ id = mh.fromB58String(obj.id)
+ rawPrivKey = obj.privKey && Buffer.from(obj.privKey, 'base64')
+ rawPubKey = obj.pubKey && Buffer.from(obj.pubKey, 'base64')
+ pub = rawPubKey && crypto.keys.unmarshalPublicKey(rawPubKey)
+ } catch (err) {
+ return callback(err)
+ }
+
+ if (rawPrivKey) {
+ waterfall([
+ (cb) => crypto.keys.unmarshalPrivateKey(rawPrivKey, cb),
+ (priv, cb) => priv.public.hash((err, digest) => {
+ cb(err, digest, priv)
+ }),
+ (privDigest, priv, cb) => {
+ if (pub) {
+ pub.hash((err, pubDigest) => {
+ cb(err, privDigest, priv, pubDigest)
+ })
+ } else {
+ cb(null, privDigest, priv)
+ }
+ }
+ ], (err, privDigest, priv, pubDigest) => {
+ if (err) {
+ return callback(err)
+ }
+
+ if (pub && !privDigest.equals(pubDigest)) {
+ return callback(new Error('Public and private key do not match'))
+ }
+
+ if (id && !privDigest.equals(id)) {
+ return callback(new Error('Id and private key do not match'))
+ }
+
+ callback(null, new PeerId(id, priv, pub))
+ })
+ } else {
+ callback(null, new PeerId(id, null, pub))
+ }
+}
+
+exports.isPeerId = function (peerId) {
+ return Boolean(typeof peerId === 'object' &&
+ peerId._id &&
+ peerId._idB58String)
+}
+
+function toB64Opt (val) {
+ if (val) {
+ return val.toString('base64')
+ }
+}
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6).Buffer))
+
+/***/ }),
+/* 178 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+// Based on npmjs.com/nodeify but without additional `nextTick` calls
+// to keep the overhead low
+module.exports = function nodeify (promise, cb) {
+ return promise.then((res) => {
+ cb(null, res)
+ }, (err) => {
+ cb(err)
+ })
+}
+
+
+/***/ }),
+/* 179 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* global self */
+
+
+
+module.exports = () => {
+ // This is only a shim for interfaces, not for functionality
+ if (typeof self !== 'undefined') {
+ __webpack_require__(721)(self)
+
+ if (self.crypto) {
+ return self.crypto
+ }
+ }
+
+ throw new Error('Please use an environment with crypto support')
+}
+
+
+/***/ }),
+/* 180 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(Buffer) {
+var inherits = __webpack_require__(14)
+var HashBase = __webpack_require__(304)
+
+var ARRAY16 = new Array(16)
+
+function MD5 () {
+ HashBase.call(this, 64)
+
+ // state
+ this._a = 0x67452301
+ this._b = 0xefcdab89
+ this._c = 0x98badcfe
+ this._d = 0x10325476
+}
+
+inherits(MD5, HashBase)
+
+MD5.prototype._update = function () {
+ var M = ARRAY16
+ for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)
+
+ var a = this._a
+ var b = this._b
+ var c = this._c
+ var d = this._d
+
+ a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)
+ d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)
+ c = fnF(c, d, a, b, M[2], 0x242070db, 17)
+ b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)
+ a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)
+ d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)
+ c = fnF(c, d, a, b, M[6], 0xa8304613, 17)
+ b = fnF(b, c, d, a, M[7], 0xfd469501, 22)
+ a = fnF(a, b, c, d, M[8], 0x698098d8, 7)
+ d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)
+ c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)
+ b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)
+ a = fnF(a, b, c, d, M[12], 0x6b901122, 7)
+ d = fnF(d, a, b, c, M[13], 0xfd987193, 12)
+ c = fnF(c, d, a, b, M[14], 0xa679438e, 17)
+ b = fnF(b, c, d, a, M[15], 0x49b40821, 22)
+
+ a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)
+ d = fnG(d, a, b, c, M[6], 0xc040b340, 9)
+ c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)
+ b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)
+ a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)
+ d = fnG(d, a, b, c, M[10], 0x02441453, 9)
+ c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)
+ b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)
+ a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)
+ d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)
+ c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)
+ b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)
+ a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)
+ d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)
+ c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)
+ b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)
+
+ a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)
+ d = fnH(d, a, b, c, M[8], 0x8771f681, 11)
+ c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)
+ b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)
+ a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)
+ d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)
+ c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)
+ b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)
+ a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)
+ d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)
+ c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)
+ b = fnH(b, c, d, a, M[6], 0x04881d05, 23)
+ a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)
+ d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)
+ c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)
+ b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)
+
+ a = fnI(a, b, c, d, M[0], 0xf4292244, 6)
+ d = fnI(d, a, b, c, M[7], 0x432aff97, 10)
+ c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)
+ b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)
+ a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)
+ d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)
+ c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)
+ b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)
+ a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)
+ d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)
+ c = fnI(c, d, a, b, M[6], 0xa3014314, 15)
+ b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)
+ a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)
+ d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)
+ c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)
+ b = fnI(b, c, d, a, M[9], 0xeb86d391, 21)
+
+ this._a = (this._a + a) | 0
+ this._b = (this._b + b) | 0
+ this._c = (this._c + c) | 0
+ this._d = (this._d + d) | 0
+}
+
+MD5.prototype._digest = function () {
+ // create padding and handle blocks
+ this._block[this._blockOffset++] = 0x80
+ if (this._blockOffset > 56) {
+ this._block.fill(0, this._blockOffset, 64)
+ this._update()
+ this._blockOffset = 0
+ }
+
+ this._block.fill(0, this._blockOffset, 56)
+ this._block.writeUInt32LE(this._length[0], 56)
+ this._block.writeUInt32LE(this._length[1], 60)
+ this._update()
+
+ // produce result
+ var buffer = new Buffer(16)
+ buffer.writeInt32LE(this._a, 0)
+ buffer.writeInt32LE(this._b, 4)
+ buffer.writeInt32LE(this._c, 8)
+ buffer.writeInt32LE(this._d, 12)
+ return buffer
+}
+
+function rotl (x, n) {
+ return (x << n) | (x >>> (32 - n))
+}
+
+function fnF (a, b, c, d, m, k, s) {
+ return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0
+}
+
+function fnG (a, b, c, d, m, k, s) {
+ return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0
+}
+
+function fnH (a, b, c, d, m, k, s) {
+ return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0
+}
+
+function fnI (a, b, c, d, m, k, s) {
+ return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0
+}
+
+module.exports = MD5
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6).Buffer))
+
+/***/ }),
+/* 181 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+module.exports = `enum KeyType {
+ RSA = 0;
+ Ed25519 = 1;
+ Secp256k1 = 2;
+}
+message PublicKey {
+ required KeyType Type = 1;
+ required bytes Data = 2;
+}
+message PrivateKey {
+ required KeyType Type = 1;
+ required bytes Data = 2;
+}`
+
+/***/ }),
+/* 182 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/**
+ * Node.js module for Forge.
+ *
+ * @author Dave Longley
+ *
+ * Copyright 2011-2016 Digital Bazaar, Inc.
+ */
+module.exports = __webpack_require__(12);
+__webpack_require__(51);
+__webpack_require__(737);
+__webpack_require__(35);
+__webpack_require__(183);
+__webpack_require__(318);
+__webpack_require__(119);
+__webpack_require__(739);
+__webpack_require__(89);
+__webpack_require__(740);
+__webpack_require__(320);
+__webpack_require__(741);
+__webpack_require__(317);
+__webpack_require__(185);
+__webpack_require__(64);
+__webpack_require__(313);
+__webpack_require__(315);
+__webpack_require__(742);
+__webpack_require__(307);
+__webpack_require__(314);
+__webpack_require__(311);
+__webpack_require__(187);
+__webpack_require__(31);
+__webpack_require__(312);
+__webpack_require__(743);
+__webpack_require__(744);
+__webpack_require__(306);
+__webpack_require__(15);
+
+
+/***/ }),
+/* 183 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/**
+ * Cipher base API.
+ *
+ * @author Dave Longley
+ *
+ * Copyright (c) 2010-2014 Digital Bazaar, Inc.
+ */
+var forge = __webpack_require__(12);
+__webpack_require__(15);
+
+module.exports = forge.cipher = forge.cipher || {};
+
+// registered algorithms
+forge.cipher.algorithms = forge.cipher.algorithms || {};
+
+/**
+ * Creates a cipher object that can be used to encrypt data using the given
+ * algorithm and key. The algorithm may be provided as a string value for a
+ * previously registered algorithm or it may be given as a cipher algorithm
+ * API object.
+ *
+ * @param algorithm the algorithm to use, either a string or an algorithm API
+ * object.
+ * @param key the key to use, as a binary-encoded string of bytes or a
+ * byte buffer.
+ *
+ * @return the cipher.
+ */
+forge.cipher.createCipher = function(algorithm, key) {
+ var api = algorithm;
+ if(typeof api === 'string') {
+ api = forge.cipher.getAlgorithm(api);
+ if(api) {
+ api = api();
+ }
+ }
+ if(!api) {
+ throw new Error('Unsupported algorithm: ' + algorithm);
+ }
+
+ // assume block cipher
+ return new forge.cipher.BlockCipher({
+ algorithm: api,
+ key: key,
+ decrypt: false
+ });
+};
+
+/**
+ * Creates a decipher object that can be used to decrypt data using the given
+ * algorithm and key. The algorithm may be provided as a string value for a
+ * previously registered algorithm or it may be given as a cipher algorithm
+ * API object.
+ *
+ * @param algorithm the algorithm to use, either a string or an algorithm API
+ * object.
+ * @param key the key to use, as a binary-encoded string of bytes or a
+ * byte buffer.
+ *
+ * @return the cipher.
+ */
+forge.cipher.createDecipher = function(algorithm, key) {
+ var api = algorithm;
+ if(typeof api === 'string') {
+ api = forge.cipher.getAlgorithm(api);
+ if(api) {
+ api = api();
+ }
+ }
+ if(!api) {
+ throw new Error('Unsupported algorithm: ' + algorithm);
+ }
+
+ // assume block cipher
+ return new forge.cipher.BlockCipher({
+ algorithm: api,
+ key: key,
+ decrypt: true
+ });
+};
+
+/**
+ * Registers an algorithm by name. If the name was already registered, the
+ * algorithm API object will be overwritten.
+ *
+ * @param name the name of the algorithm.
+ * @param algorithm the algorithm API object.
+ */
+forge.cipher.registerAlgorithm = function(name, algorithm) {
+ name = name.toUpperCase();
+ forge.cipher.algorithms[name] = algorithm;
+};
+
+/**
+ * Gets a registered algorithm by name.
+ *
+ * @param name the name of the algorithm.
+ *
+ * @return the algorithm, if found, null if not.
+ */
+forge.cipher.getAlgorithm = function(name) {
+ name = name.toUpperCase();
+ if(name in forge.cipher.algorithms) {
+ return forge.cipher.algorithms[name];
+ }
+ return null;
+};
+
+var BlockCipher = forge.cipher.BlockCipher = function(options) {
+ this.algorithm = options.algorithm;
+ this.mode = this.algorithm.mode;
+ this.blockSize = this.mode.blockSize;
+ this._finish = false;
+ this._input = null;
+ this.output = null;
+ this._op = options.decrypt ? this.mode.decrypt : this.mode.encrypt;
+ this._decrypt = options.decrypt;
+ this.algorithm.initialize(options);
+};
+
+/**
+ * Starts or restarts the encryption or decryption process, whichever
+ * was previously configured.
+ *
+ * For non-GCM mode, the IV may be a binary-encoded string of bytes, an array
+ * of bytes, a byte buffer, or an array of 32-bit integers. If the IV is in
+ * bytes, then it must be Nb (16) bytes in length. If the IV is given in as
+ * 32-bit integers, then it must be 4 integers long.
+ *
+ * Note: an IV is not required or used in ECB mode.
+ *
+ * For GCM-mode, the IV must be given as a binary-encoded string of bytes or
+ * a byte buffer. The number of bytes should be 12 (96 bits) as recommended
+ * by NIST SP-800-38D but another length may be given.
+ *
+ * @param options the options to use:
+ * iv the initialization vector to use as a binary-encoded string of
+ * bytes, null to reuse the last ciphered block from a previous
+ * update() (this "residue" method is for legacy support only).
+ * additionalData additional authentication data as a binary-encoded
+ * string of bytes, for 'GCM' mode, (default: none).
+ * tagLength desired length of authentication tag, in bits, for
+ * 'GCM' mode (0-128, default: 128).
+ * tag the authentication tag to check if decrypting, as a
+ * binary-encoded string of bytes.
+ * output the output the buffer to write to, null to create one.
+ */
+BlockCipher.prototype.start = function(options) {
+ options = options || {};
+ var opts = {};
+ for(var key in options) {
+ opts[key] = options[key];
+ }
+ opts.decrypt = this._decrypt;
+ this._finish = false;
+ this._input = forge.util.createBuffer();
+ this.output = options.output || forge.util.createBuffer();
+ this.mode.start(opts);
+};
+
+/**
+ * Updates the next block according to the cipher mode.
+ *
+ * @param input the buffer to read from.
+ */
+BlockCipher.prototype.update = function(input) {
+ if(input) {
+ // input given, so empty it into the input buffer
+ this._input.putBuffer(input);
+ }
+
+ // do cipher operation until it needs more input and not finished
+ while(!this._op.call(this.mode, this._input, this.output, this._finish) &&
+ !this._finish) {}
+
+ // free consumed memory from input buffer
+ this._input.compact();
+};
+
+/**
+ * Finishes encrypting or decrypting.
+ *
+ * @param pad a padding function to use in CBC mode, null for default,
+ * signature(blockSize, buffer, decrypt).
+ *
+ * @return true if successful, false on error.
+ */
+BlockCipher.prototype.finish = function(pad) {
+ // backwards-compatibility w/deprecated padding API
+ // Note: will overwrite padding functions even after another start() call
+ if(pad && (this.mode.name === 'ECB' || this.mode.name === 'CBC')) {
+ this.mode.pad = function(input) {
+ return pad(this.blockSize, input, false);
+ };
+ this.mode.unpad = function(output) {
+ return pad(this.blockSize, output, true);
+ };
+ }
+
+ // build options for padding and afterFinish functions
+ var options = {};
+ options.decrypt = this._decrypt;
+
+ // get # of bytes that won't fill a block
+ options.overflow = this._input.length() % this.blockSize;
+
+ if(!this._decrypt && this.mode.pad) {
+ if(!this.mode.pad(this._input, options)) {
+ return false;
+ }
+ }
+
+ // do final update
+ this._finish = true;
+ this.update();
+
+ if(this._decrypt && this.mode.unpad) {
+ if(!this.mode.unpad(this.output, options)) {
+ return false;
+ }
+ }
+
+ if(this.mode.afterFinish) {
+ if(!this.mode.afterFinish(this.output, options)) {
+ return false;
+ }
+ }
+
+ return true;
+};
+
+
+/***/ }),
+/* 184 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/**
+ * Message Digest Algorithm 5 with 128-bit digest (MD5) implementation.
+ *
+ * @author Dave Longley
+ *
+ * Copyright (c) 2010-2014 Digital Bazaar, Inc.
+ */
+var forge = __webpack_require__(12);
+__webpack_require__(36);
+__webpack_require__(15);
+
+var md5 = module.exports = forge.md5 = forge.md5 || {};
+forge.md.md5 = forge.md.algorithms.md5 = md5;
+
+/**
+ * Creates an MD5 message digest object.
+ *
+ * @return a message digest object.
+ */
+md5.create = function() {
+ // do initialization as necessary
+ if(!_initialized) {
+ _init();
+ }
+
+ // MD5 state contains four 32-bit integers
+ var _state = null;
+
+ // input buffer
+ var _input = forge.util.createBuffer();
+
+ // used for word storage
+ var _w = new Array(16);
+
+ // message digest object
+ var md = {
+ algorithm: 'md5',
+ blockLength: 64,
+ digestLength: 16,
+ // 56-bit length of message so far (does not including padding)
+ messageLength: 0,
+ // true message length
+ fullMessageLength: null,
+ // size of message length in bytes
+ messageLengthSize: 8
+ };
+
+ /**
+ * Starts the digest.
+ *
+ * @return this digest object.
+ */
+ md.start = function() {
+ // up to 56-bit message length for convenience
+ md.messageLength = 0;
+
+ // full message length (set md.messageLength64 for backwards-compatibility)
+ md.fullMessageLength = md.messageLength64 = [];
+ var int32s = md.messageLengthSize / 4;
+ for(var i = 0; i < int32s; ++i) {
+ md.fullMessageLength.push(0);
+ }
+ _input = forge.util.createBuffer();
+ _state = {
+ h0: 0x67452301,
+ h1: 0xEFCDAB89,
+ h2: 0x98BADCFE,
+ h3: 0x10325476
+ };
+ return md;
+ };
+ // start digest automatically for first time
+ md.start();
+
+ /**
+ * Updates the digest with the given message input. The given input can
+ * treated as raw input (no encoding will be applied) or an encoding of
+ * 'utf8' maybe given to encode the input using UTF-8.
+ *
+ * @param msg the message input to update with.
+ * @param encoding the encoding to use (default: 'raw', other: 'utf8').
+ *
+ * @return this digest object.
+ */
+ md.update = function(msg, encoding) {
+ if(encoding === 'utf8') {
+ msg = forge.util.encodeUtf8(msg);
+ }
+
+ // update message length
+ var len = msg.length;
+ md.messageLength += len;
+ len = [(len / 0x100000000) >>> 0, len >>> 0];
+ for(var i = md.fullMessageLength.length - 1; i >= 0; --i) {
+ md.fullMessageLength[i] += len[1];
+ len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0);
+ md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0;
+ len[0] = (len[1] / 0x100000000) >>> 0;
+ }
+
+ // add bytes to input buffer
+ _input.putBytes(msg);
+
+ // process bytes
+ _update(_state, _w, _input);
+
+ // compact input buffer every 2K or if empty
+ if(_input.read > 2048 || _input.length() === 0) {
+ _input.compact();
+ }
+
+ return md;
+ };
+
+ /**
+ * Produces the digest.
+ *
+ * @return a byte buffer containing the digest value.
+ */
+ md.digest = function() {
+ /* Note: Here we copy the remaining bytes in the input buffer and
+ add the appropriate MD5 padding. Then we do the final update
+ on a copy of the state so that if the user wants to get
+ intermediate digests they can do so. */
+
+ /* Determine the number of bytes that must be added to the message
+ to ensure its length is congruent to 448 mod 512. In other words,
+ the data to be digested must be a multiple of 512 bits (or 128 bytes).
+ This data includes the message, some padding, and the length of the
+ message. Since the length of the message will be encoded as 8 bytes (64
+ bits), that means that the last segment of the data must have 56 bytes
+ (448 bits) of message and padding. Therefore, the length of the message
+ plus the padding must be congruent to 448 mod 512 because
+ 512 - 128 = 448.
+
+ In order to fill up the message length it must be filled with
+ padding that begins with 1 bit followed by all 0 bits. Padding
+ must *always* be present, so if the message length is already
+ congruent to 448 mod 512, then 512 padding bits must be added. */
+
+ var finalBlock = forge.util.createBuffer();
+ finalBlock.putBytes(_input.bytes());
+
+ // compute remaining size to be digested (include message length size)
+ var remaining = (
+ md.fullMessageLength[md.fullMessageLength.length - 1] +
+ md.messageLengthSize);
+
+ // add padding for overflow blockSize - overflow
+ // _padding starts with 1 byte with first bit is set (byte value 128), then
+ // there may be up to (blockSize - 1) other pad bytes
+ var overflow = remaining & (md.blockLength - 1);
+ finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow));
+
+ // serialize message length in bits in little-endian order; since length
+ // is stored in bytes we multiply by 8 and add carry
+ var bits, carry = 0;
+ for(var i = md.fullMessageLength.length - 1; i >= 0; --i) {
+ bits = md.fullMessageLength[i] * 8 + carry;
+ carry = (bits / 0x100000000) >>> 0;
+ finalBlock.putInt32Le(bits >>> 0);
+ }
+
+ var s2 = {
+ h0: _state.h0,
+ h1: _state.h1,
+ h2: _state.h2,
+ h3: _state.h3
+ };
+ _update(s2, _w, finalBlock);
+ var rval = forge.util.createBuffer();
+ rval.putInt32Le(s2.h0);
+ rval.putInt32Le(s2.h1);
+ rval.putInt32Le(s2.h2);
+ rval.putInt32Le(s2.h3);
+ return rval;
+ };
+
+ return md;
+};
+
+// padding, constant tables for calculating md5
+var _padding = null;
+var _g = null;
+var _r = null;
+var _k = null;
+var _initialized = false;
+
+/**
+ * Initializes the constant tables.
+ */
+function _init() {
+ // create padding
+ _padding = String.fromCharCode(128);
+ _padding += forge.util.fillString(String.fromCharCode(0x00), 64);
+
+ // g values
+ _g = [
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12,
+ 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2,
+ 0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9];
+
+ // rounds table
+ _r = [
+ 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,
+ 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20,
+ 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23,
+ 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21];
+
+ // get the result of abs(sin(i + 1)) as a 32-bit integer
+ _k = new Array(64);
+ for(var i = 0; i < 64; ++i) {
+ _k[i] = Math.floor(Math.abs(Math.sin(i + 1)) * 0x100000000);
+ }
+
+ // now initialized
+ _initialized = true;
+}
+
+/**
+ * Updates an MD5 state with the given byte buffer.
+ *
+ * @param s the MD5 state to update.
+ * @param w the array to use to store words.
+ * @param bytes the byte buffer to update with.
+ */
+function _update(s, w, bytes) {
+ // consume 512 bit (64 byte) chunks
+ var t, a, b, c, d, f, r, i;
+ var len = bytes.length();
+ while(len >= 64) {
+ // initialize hash value for this chunk
+ a = s.h0;
+ b = s.h1;
+ c = s.h2;
+ d = s.h3;
+
+ // round 1
+ for(i = 0; i < 16; ++i) {
+ w[i] = bytes.getInt32Le();
+ f = d ^ (b & (c ^ d));
+ t = (a + f + _k[i] + w[i]);
+ r = _r[i];
+ a = d;
+ d = c;
+ c = b;
+ b += (t << r) | (t >>> (32 - r));
+ }
+ // round 2
+ for(; i < 32; ++i) {
+ f = c ^ (d & (b ^ c));
+ t = (a + f + _k[i] + w[_g[i]]);
+ r = _r[i];
+ a = d;
+ d = c;
+ c = b;
+ b += (t << r) | (t >>> (32 - r));
+ }
+ // round 3
+ for(; i < 48; ++i) {
+ f = b ^ c ^ d;
+ t = (a + f + _k[i] + w[_g[i]]);
+ r = _r[i];
+ a = d;
+ d = c;
+ c = b;
+ b += (t << r) | (t >>> (32 - r));
+ }
+ // round 4
+ for(; i < 64; ++i) {
+ f = c ^ (b | ~d);
+ t = (a + f + _k[i] + w[_g[i]]);
+ r = _r[i];
+ a = d;
+ d = c;
+ c = b;
+ b += (t << r) | (t >>> (32 - r));
+ }
+
+ // update hash state
+ s.h0 = (s.h0 + a) | 0;
+ s.h1 = (s.h1 + b) | 0;
+ s.h2 = (s.h2 + c) | 0;
+ s.h3 = (s.h3 + d) | 0;
+
+ len -= 64;
+ }
+}
+
+
+/***/ }),
+/* 185 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/* WEBPACK VAR INJECTION */(function(Buffer) {/**
+ * Password-Based Key-Derivation Function #2 implementation.
+ *
+ * See RFC 2898 for details.
+ *
+ * @author Dave Longley
+ *
+ * Copyright (c) 2010-2013 Digital Bazaar, Inc.
+ */
+var forge = __webpack_require__(12);
+__webpack_require__(89);
+__webpack_require__(36);
+__webpack_require__(15);
+
+var pkcs5 = forge.pkcs5 = forge.pkcs5 || {};
+
+var crypto;
+if(forge.util.isNodejs && !forge.options.usePureJavaScript) {
+ crypto = __webpack_require__(309);
+}
+
+/**
+ * Derives a key from a password.
+ *
+ * @param p the password as a binary-encoded string of bytes.
+ * @param s the salt as a binary-encoded string of bytes.
+ * @param c the iteration count, a positive integer.
+ * @param dkLen the intended length, in bytes, of the derived key,
+ * (max: 2^32 - 1) * hash length of the PRF.
+ * @param [md] the message digest (or algorithm identifier as a string) to use
+ * in the PRF, defaults to SHA-1.
+ * @param [callback(err, key)] presence triggers asynchronous version, called
+ * once the operation completes.
+ *
+ * @return the derived key, as a binary-encoded string of bytes, for the
+ * synchronous version (if no callback is specified).
+ */
+module.exports = forge.pbkdf2 = pkcs5.pbkdf2 = function(
+ p, s, c, dkLen, md, callback) {
+ if(typeof md === 'function') {
+ callback = md;
+ md = null;
+ }
+
+ // use native implementation if possible and not disabled, note that
+ // some node versions only support SHA-1, others allow digest to be changed
+ if(forge.util.isNodejs && !forge.options.usePureJavaScript &&
+ crypto.pbkdf2 && (md === null || typeof md !== 'object') &&
+ (crypto.pbkdf2Sync.length > 4 || (!md || md === 'sha1'))) {
+ if(typeof md !== 'string') {
+ // default prf to SHA-1
+ md = 'sha1';
+ }
+ p = new Buffer(p, 'binary');
+ s = new Buffer(s, 'binary');
+ if(!callback) {
+ if(crypto.pbkdf2Sync.length === 4) {
+ return crypto.pbkdf2Sync(p, s, c, dkLen).toString('binary');
+ }
+ return crypto.pbkdf2Sync(p, s, c, dkLen, md).toString('binary');
+ }
+ if(crypto.pbkdf2Sync.length === 4) {
+ return crypto.pbkdf2(p, s, c, dkLen, function(err, key) {
+ if(err) {
+ return callback(err);
+ }
+ callback(null, key.toString('binary'));
+ });
+ }
+ return crypto.pbkdf2(p, s, c, dkLen, md, function(err, key) {
+ if(err) {
+ return callback(err);
+ }
+ callback(null, key.toString('binary'));
+ });
+ }
+
+ if(typeof md === 'undefined' || md === null) {
+ // default prf to SHA-1
+ md = 'sha1';
+ }
+ if(typeof md === 'string') {
+ if(!(md in forge.md.algorithms)) {
+ throw new Error('Unknown hash algorithm: ' + md);
+ }
+ md = forge.md[md].create();
+ }
+
+ var hLen = md.digestLength;
+
+ /* 1. If dkLen > (2^32 - 1) * hLen, output "derived key too long" and
+ stop. */
+ if(dkLen > (0xFFFFFFFF * hLen)) {
+ var err = new Error('Derived key is too long.');
+ if(callback) {
+ return callback(err);
+ }
+ throw err;
+ }
+
+ /* 2. Let len be the number of hLen-octet blocks in the derived key,
+ rounding up, and let r be the number of octets in the last
+ block:
+
+ len = CEIL(dkLen / hLen),
+ r = dkLen - (len - 1) * hLen. */
+ var len = Math.ceil(dkLen / hLen);
+ var r = dkLen - (len - 1) * hLen;
+
+ /* 3. For each block of the derived key apply the function F defined
+ below to the password P, the salt S, the iteration count c, and
+ the block index to compute the block:
+
+ T_1 = F(P, S, c, 1),
+ T_2 = F(P, S, c, 2),
+ ...
+ T_len = F(P, S, c, len),
+
+ where the function F is defined as the exclusive-or sum of the
+ first c iterates of the underlying pseudorandom function PRF
+ applied to the password P and the concatenation of the salt S
+ and the block index i:
+
+ F(P, S, c, i) = u_1 XOR u_2 XOR ... XOR u_c
+
+ where
+
+ u_1 = PRF(P, S || INT(i)),
+ u_2 = PRF(P, u_1),
+ ...
+ u_c = PRF(P, u_{c-1}).
+
+ Here, INT(i) is a four-octet encoding of the integer i, most
+ significant octet first. */
+ var prf = forge.hmac.create();
+ prf.start(md, p);
+ var dk = '';
+ var xor, u_c, u_c1;
+
+ // sync version
+ if(!callback) {
+ for(var i = 1; i <= len; ++i) {
+ // PRF(P, S || INT(i)) (first iteration)
+ prf.start(null, null);
+ prf.update(s);
+ prf.update(forge.util.int32ToBytes(i));
+ xor = u_c1 = prf.digest().getBytes();
+
+ // PRF(P, u_{c-1}) (other iterations)
+ for(var j = 2; j <= c; ++j) {
+ prf.start(null, null);
+ prf.update(u_c1);
+ u_c = prf.digest().getBytes();
+ // F(p, s, c, i)
+ xor = forge.util.xorBytes(xor, u_c, hLen);
+ u_c1 = u_c;
+ }
+
+ /* 4. Concatenate the blocks and extract the first dkLen octets to
+ produce a derived key DK:
+
+ DK = T_1 || T_2 || ... || T_len<0..r-1> */
+ dk += (i < len) ? xor : xor.substr(0, r);
+ }
+ /* 5. Output the derived key DK. */
+ return dk;
+ }
+
+ // async version
+ var i = 1, j;
+ function outer() {
+ if(i > len) {
+ // done
+ return callback(null, dk);
+ }
+
+ // PRF(P, S || INT(i)) (first iteration)
+ prf.start(null, null);
+ prf.update(s);
+ prf.update(forge.util.int32ToBytes(i));
+ xor = u_c1 = prf.digest().getBytes();
+
+ // PRF(P, u_{c-1}) (other iterations)
+ j = 2;
+ inner();
+ }
+
+ function inner() {
+ if(j <= c) {
+ prf.start(null, null);
+ prf.update(u_c1);
+ u_c = prf.digest().getBytes();
+ // F(p, s, c, i)
+ xor = forge.util.xorBytes(xor, u_c, hLen);
+ u_c1 = u_c;
+ ++j;
+ return forge.util.setImmediate(inner);
+ }
+
+ /* 4. Concatenate the blocks and extract the first dkLen octets to
+ produce a derived key DK:
+
+ DK = T_1 || T_2 || ... || T_len<0..r-1> */
+ dk += (i < len) ? xor : xor.substr(0, r);
+
+ ++i;
+ outer();
+ }
+
+ outer();
+};
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6).Buffer))
+
+/***/ }),
+/* 186 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/**
+ * Javascript implementation of X.509 and related components (such as
+ * Certification Signing Requests) of a Public Key Infrastructure.
+ *
+ * @author Dave Longley
+ *
+ * Copyright (c) 2010-2014 Digital Bazaar, Inc.
+ *
+ * The ASN.1 representation of an X.509v3 certificate is as follows
+ * (see RFC 2459):
+ *
+ * Certificate ::= SEQUENCE {
+ * tbsCertificate TBSCertificate,
+ * signatureAlgorithm AlgorithmIdentifier,
+ * signatureValue BIT STRING
+ * }
+ *
+ * TBSCertificate ::= SEQUENCE {
+ * version [0] EXPLICIT Version DEFAULT v1,
+ * serialNumber CertificateSerialNumber,
+ * signature AlgorithmIdentifier,
+ * issuer Name,
+ * validity Validity,
+ * subject Name,
+ * subjectPublicKeyInfo SubjectPublicKeyInfo,
+ * issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
+ * -- If present, version shall be v2 or v3
+ * subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
+ * -- If present, version shall be v2 or v3
+ * extensions [3] EXPLICIT Extensions OPTIONAL
+ * -- If present, version shall be v3
+ * }
+ *
+ * Version ::= INTEGER { v1(0), v2(1), v3(2) }
+ *
+ * CertificateSerialNumber ::= INTEGER
+ *
+ * Name ::= CHOICE {
+ * // only one possible choice for now
+ * RDNSequence
+ * }
+ *
+ * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
+ *
+ * RelativeDistinguishedName ::= SET OF AttributeTypeAndValue
+ *
+ * AttributeTypeAndValue ::= SEQUENCE {
+ * type AttributeType,
+ * value AttributeValue
+ * }
+ * AttributeType ::= OBJECT IDENTIFIER
+ * AttributeValue ::= ANY DEFINED BY AttributeType
+ *
+ * Validity ::= SEQUENCE {
+ * notBefore Time,
+ * notAfter Time
+ * }
+ *
+ * Time ::= CHOICE {
+ * utcTime UTCTime,
+ * generalTime GeneralizedTime
+ * }
+ *
+ * UniqueIdentifier ::= BIT STRING
+ *
+ * SubjectPublicKeyInfo ::= SEQUENCE {
+ * algorithm AlgorithmIdentifier,
+ * subjectPublicKey BIT STRING
+ * }
+ *
+ * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
+ *
+ * Extension ::= SEQUENCE {
+ * extnID OBJECT IDENTIFIER,
+ * critical BOOLEAN DEFAULT FALSE,
+ * extnValue OCTET STRING
+ * }
+ *
+ * The only key algorithm currently supported for PKI is RSA.
+ *
+ * RSASSA-PSS signatures are described in RFC 3447 and RFC 4055.
+ *
+ * PKCS#10 v1.7 describes certificate signing requests:
+ *
+ * CertificationRequestInfo:
+ *
+ * CertificationRequestInfo ::= SEQUENCE {
+ * version INTEGER { v1(0) } (v1,...),
+ * subject Name,
+ * subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }},
+ * attributes [0] Attributes{{ CRIAttributes }}
+ * }
+ *
+ * Attributes { ATTRIBUTE:IOSet } ::= SET OF Attribute{{ IOSet }}
+ *
+ * CRIAttributes ATTRIBUTE ::= {
+ * ... -- add any locally defined attributes here -- }
+ *
+ * Attribute { ATTRIBUTE:IOSet } ::= SEQUENCE {
+ * type ATTRIBUTE.&id({IOSet}),
+ * values SET SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{@type})
+ * }
+ *
+ * CertificationRequest ::= SEQUENCE {
+ * certificationRequestInfo CertificationRequestInfo,
+ * signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }},
+ * signature BIT STRING
+ * }
+ */
+var forge = __webpack_require__(12);
+__webpack_require__(51);
+__webpack_require__(35);
+__webpack_require__(119);
+__webpack_require__(36);
+__webpack_require__(738);
+__webpack_require__(52);
+__webpack_require__(64);
+__webpack_require__(187);
+__webpack_require__(120);
+__webpack_require__(15);
+
+// shortcut for asn.1 API
+var asn1 = forge.asn1;
+
+/* Public Key Infrastructure (PKI) implementation. */
+var pki = module.exports = forge.pki = forge.pki || {};
+var oids = pki.oids;
+
+// short name OID mappings
+var _shortNames = {};
+_shortNames['CN'] = oids['commonName'];
+_shortNames['commonName'] = 'CN';
+_shortNames['C'] = oids['countryName'];
+_shortNames['countryName'] = 'C';
+_shortNames['L'] = oids['localityName'];
+_shortNames['localityName'] = 'L';
+_shortNames['ST'] = oids['stateOrProvinceName'];
+_shortNames['stateOrProvinceName'] = 'ST';
+_shortNames['O'] = oids['organizationName'];
+_shortNames['organizationName'] = 'O';
+_shortNames['OU'] = oids['organizationalUnitName'];
+_shortNames['organizationalUnitName'] = 'OU';
+_shortNames['E'] = oids['emailAddress'];
+_shortNames['emailAddress'] = 'E';
+
+// validator for an SubjectPublicKeyInfo structure
+// Note: Currently only works with an RSA public key
+var publicKeyValidator = forge.pki.rsa.publicKeyValidator;
+
+// validator for an X.509v3 certificate
+var x509CertificateValidator = {
+ name: 'Certificate',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ value: [{
+ name: 'Certificate.TBSCertificate',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ captureAsn1: 'tbsCertificate',
+ value: [{
+ name: 'Certificate.TBSCertificate.version',
+ tagClass: asn1.Class.CONTEXT_SPECIFIC,
+ type: 0,
+ constructed: true,
+ optional: true,
+ value: [{
+ name: 'Certificate.TBSCertificate.version.integer',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.INTEGER,
+ constructed: false,
+ capture: 'certVersion'
+ }]
+ }, {
+ name: 'Certificate.TBSCertificate.serialNumber',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.INTEGER,
+ constructed: false,
+ capture: 'certSerialNumber'
+ }, {
+ name: 'Certificate.TBSCertificate.signature',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ value: [{
+ name: 'Certificate.TBSCertificate.signature.algorithm',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OID,
+ constructed: false,
+ capture: 'certinfoSignatureOid'
+ }, {
+ name: 'Certificate.TBSCertificate.signature.parameters',
+ tagClass: asn1.Class.UNIVERSAL,
+ optional: true,
+ captureAsn1: 'certinfoSignatureParams'
+ }]
+ }, {
+ name: 'Certificate.TBSCertificate.issuer',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ captureAsn1: 'certIssuer'
+ }, {
+ name: 'Certificate.TBSCertificate.validity',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ // Note: UTC and generalized times may both appear so the capture
+ // names are based on their detected order, the names used below
+ // are only for the common case, which validity time really means
+ // "notBefore" and which means "notAfter" will be determined by order
+ value: [{
+ // notBefore (Time) (UTC time case)
+ name: 'Certificate.TBSCertificate.validity.notBefore (utc)',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.UTCTIME,
+ constructed: false,
+ optional: true,
+ capture: 'certValidity1UTCTime'
+ }, {
+ // notBefore (Time) (generalized time case)
+ name: 'Certificate.TBSCertificate.validity.notBefore (generalized)',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.GENERALIZEDTIME,
+ constructed: false,
+ optional: true,
+ capture: 'certValidity2GeneralizedTime'
+ }, {
+ // notAfter (Time) (only UTC time is supported)
+ name: 'Certificate.TBSCertificate.validity.notAfter (utc)',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.UTCTIME,
+ constructed: false,
+ optional: true,
+ capture: 'certValidity3UTCTime'
+ }, {
+ // notAfter (Time) (only UTC time is supported)
+ name: 'Certificate.TBSCertificate.validity.notAfter (generalized)',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.GENERALIZEDTIME,
+ constructed: false,
+ optional: true,
+ capture: 'certValidity4GeneralizedTime'
+ }]
+ }, {
+ // Name (subject) (RDNSequence)
+ name: 'Certificate.TBSCertificate.subject',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ captureAsn1: 'certSubject'
+ },
+ // SubjectPublicKeyInfo
+ publicKeyValidator,
+ {
+ // issuerUniqueID (optional)
+ name: 'Certificate.TBSCertificate.issuerUniqueID',
+ tagClass: asn1.Class.CONTEXT_SPECIFIC,
+ type: 1,
+ constructed: true,
+ optional: true,
+ value: [{
+ name: 'Certificate.TBSCertificate.issuerUniqueID.id',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.BITSTRING,
+ constructed: false,
+ // TODO: support arbitrary bit length ids
+ captureBitStringValue: 'certIssuerUniqueId'
+ }]
+ }, {
+ // subjectUniqueID (optional)
+ name: 'Certificate.TBSCertificate.subjectUniqueID',
+ tagClass: asn1.Class.CONTEXT_SPECIFIC,
+ type: 2,
+ constructed: true,
+ optional: true,
+ value: [{
+ name: 'Certificate.TBSCertificate.subjectUniqueID.id',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.BITSTRING,
+ constructed: false,
+ // TODO: support arbitrary bit length ids
+ captureBitStringValue: 'certSubjectUniqueId'
+ }]
+ }, {
+ // Extensions (optional)
+ name: 'Certificate.TBSCertificate.extensions',
+ tagClass: asn1.Class.CONTEXT_SPECIFIC,
+ type: 3,
+ constructed: true,
+ captureAsn1: 'certExtensions',
+ optional: true
+ }]
+ }, {
+ // AlgorithmIdentifier (signature algorithm)
+ name: 'Certificate.signatureAlgorithm',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ value: [{
+ // algorithm
+ name: 'Certificate.signatureAlgorithm.algorithm',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OID,
+ constructed: false,
+ capture: 'certSignatureOid'
+ }, {
+ name: 'Certificate.TBSCertificate.signature.parameters',
+ tagClass: asn1.Class.UNIVERSAL,
+ optional: true,
+ captureAsn1: 'certSignatureParams'
+ }]
+ }, {
+ // SignatureValue
+ name: 'Certificate.signatureValue',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.BITSTRING,
+ constructed: false,
+ captureBitStringValue: 'certSignature'
+ }]
+};
+
+var rsassaPssParameterValidator = {
+ name: 'rsapss',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ value: [{
+ name: 'rsapss.hashAlgorithm',
+ tagClass: asn1.Class.CONTEXT_SPECIFIC,
+ type: 0,
+ constructed: true,
+ value: [{
+ name: 'rsapss.hashAlgorithm.AlgorithmIdentifier',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Class.SEQUENCE,
+ constructed: true,
+ optional: true,
+ value: [{
+ name: 'rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OID,
+ constructed: false,
+ capture: 'hashOid'
+ /* parameter block omitted, for SHA1 NULL anyhow. */
+ }]
+ }]
+ }, {
+ name: 'rsapss.maskGenAlgorithm',
+ tagClass: asn1.Class.CONTEXT_SPECIFIC,
+ type: 1,
+ constructed: true,
+ value: [{
+ name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Class.SEQUENCE,
+ constructed: true,
+ optional: true,
+ value: [{
+ name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OID,
+ constructed: false,
+ capture: 'maskGenOid'
+ }, {
+ name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier.params',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ value: [{
+ name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OID,
+ constructed: false,
+ capture: 'maskGenHashOid'
+ /* parameter block omitted, for SHA1 NULL anyhow. */
+ }]
+ }]
+ }]
+ }, {
+ name: 'rsapss.saltLength',
+ tagClass: asn1.Class.CONTEXT_SPECIFIC,
+ type: 2,
+ optional: true,
+ value: [{
+ name: 'rsapss.saltLength.saltLength',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Class.INTEGER,
+ constructed: false,
+ capture: 'saltLength'
+ }]
+ }, {
+ name: 'rsapss.trailerField',
+ tagClass: asn1.Class.CONTEXT_SPECIFIC,
+ type: 3,
+ optional: true,
+ value: [{
+ name: 'rsapss.trailer.trailer',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Class.INTEGER,
+ constructed: false,
+ capture: 'trailer'
+ }]
+ }]
+};
+
+// validator for a CertificationRequestInfo structure
+var certificationRequestInfoValidator = {
+ name: 'CertificationRequestInfo',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ captureAsn1: 'certificationRequestInfo',
+ value: [{
+ name: 'CertificationRequestInfo.integer',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.INTEGER,
+ constructed: false,
+ capture: 'certificationRequestInfoVersion'
+ }, {
+ // Name (subject) (RDNSequence)
+ name: 'CertificationRequestInfo.subject',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ captureAsn1: 'certificationRequestInfoSubject'
+ },
+ // SubjectPublicKeyInfo
+ publicKeyValidator,
+ {
+ name: 'CertificationRequestInfo.attributes',
+ tagClass: asn1.Class.CONTEXT_SPECIFIC,
+ type: 0,
+ constructed: true,
+ optional: true,
+ capture: 'certificationRequestInfoAttributes',
+ value: [{
+ name: 'CertificationRequestInfo.attributes',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ value: [{
+ name: 'CertificationRequestInfo.attributes.type',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OID,
+ constructed: false
+ }, {
+ name: 'CertificationRequestInfo.attributes.value',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SET,
+ constructed: true
+ }]
+ }]
+ }]
+};
+
+// validator for a CertificationRequest structure
+var certificationRequestValidator = {
+ name: 'CertificationRequest',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ captureAsn1: 'csr',
+ value: [
+ certificationRequestInfoValidator, {
+ // AlgorithmIdentifier (signature algorithm)
+ name: 'CertificationRequest.signatureAlgorithm',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ value: [{
+ // algorithm
+ name: 'CertificationRequest.signatureAlgorithm.algorithm',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OID,
+ constructed: false,
+ capture: 'csrSignatureOid'
+ }, {
+ name: 'CertificationRequest.signatureAlgorithm.parameters',
+ tagClass: asn1.Class.UNIVERSAL,
+ optional: true,
+ captureAsn1: 'csrSignatureParams'
+ }]
+ }, {
+ // signature
+ name: 'CertificationRequest.signature',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.BITSTRING,
+ constructed: false,
+ captureBitStringValue: 'csrSignature'
+ }]
+};
+
+/**
+ * Converts an RDNSequence of ASN.1 DER-encoded RelativeDistinguishedName
+ * sets into an array with objects that have type and value properties.
+ *
+ * @param rdn the RDNSequence to convert.
+ * @param md a message digest to append type and value to if provided.
+ */
+pki.RDNAttributesAsArray = function(rdn, md) {
+ var rval = [];
+
+ // each value in 'rdn' in is a SET of RelativeDistinguishedName
+ var set, attr, obj;
+ for(var si = 0; si < rdn.value.length; ++si) {
+ // get the RelativeDistinguishedName set
+ set = rdn.value[si];
+
+ // each value in the SET is an AttributeTypeAndValue sequence
+ // containing first a type (an OID) and second a value (defined by
+ // the OID)
+ for(var i = 0; i < set.value.length; ++i) {
+ obj = {};
+ attr = set.value[i];
+ obj.type = asn1.derToOid(attr.value[0].value);
+ obj.value = attr.value[1].value;
+ obj.valueTagClass = attr.value[1].type;
+ // if the OID is known, get its name and short name
+ if(obj.type in oids) {
+ obj.name = oids[obj.type];
+ if(obj.name in _shortNames) {
+ obj.shortName = _shortNames[obj.name];
+ }
+ }
+ if(md) {
+ md.update(obj.type);
+ md.update(obj.value);
+ }
+ rval.push(obj);
+ }
+ }
+
+ return rval;
+};
+
+/**
+ * Converts ASN.1 CRIAttributes into an array with objects that have type and
+ * value properties.
+ *
+ * @param attributes the CRIAttributes to convert.
+ */
+pki.CRIAttributesAsArray = function(attributes) {
+ var rval = [];
+
+ // each value in 'attributes' in is a SEQUENCE with an OID and a SET
+ for(var si = 0; si < attributes.length; ++si) {
+ // get the attribute sequence
+ var seq = attributes[si];
+
+ // each value in the SEQUENCE containing first a type (an OID) and
+ // second a set of values (defined by the OID)
+ var type = asn1.derToOid(seq.value[0].value);
+ var values = seq.value[1].value;
+ for(var vi = 0; vi < values.length; ++vi) {
+ var obj = {};
+ obj.type = type;
+ obj.value = values[vi].value;
+ obj.valueTagClass = values[vi].type;
+ // if the OID is known, get its name and short name
+ if(obj.type in oids) {
+ obj.name = oids[obj.type];
+ if(obj.name in _shortNames) {
+ obj.shortName = _shortNames[obj.name];
+ }
+ }
+ // parse extensions
+ if(obj.type === oids.extensionRequest) {
+ obj.extensions = [];
+ for(var ei = 0; ei < obj.value.length; ++ei) {
+ obj.extensions.push(pki.certificateExtensionFromAsn1(obj.value[ei]));
+ }
+ }
+ rval.push(obj);
+ }
+ }
+
+ return rval;
+};
+
+/**
+ * Gets an issuer or subject attribute from its name, type, or short name.
+ *
+ * @param obj the issuer or subject object.
+ * @param options a short name string or an object with:
+ * shortName the short name for the attribute.
+ * name the name for the attribute.
+ * type the type for the attribute.
+ *
+ * @return the attribute.
+ */
+function _getAttribute(obj, options) {
+ if(typeof options === 'string') {
+ options = {shortName: options};
+ }
+
+ var rval = null;
+ var attr;
+ for(var i = 0; rval === null && i < obj.attributes.length; ++i) {
+ attr = obj.attributes[i];
+ if(options.type && options.type === attr.type) {
+ rval = attr;
+ } else if(options.name && options.name === attr.name) {
+ rval = attr;
+ } else if(options.shortName && options.shortName === attr.shortName) {
+ rval = attr;
+ }
+ }
+ return rval;
+}
+
+/**
+ * Converts signature parameters from ASN.1 structure.
+ *
+ * Currently only RSASSA-PSS supported. The PKCS#1 v1.5 signature scheme had
+ * no parameters.
+ *
+ * RSASSA-PSS-params ::= SEQUENCE {
+ * hashAlgorithm [0] HashAlgorithm DEFAULT
+ * sha1Identifier,
+ * maskGenAlgorithm [1] MaskGenAlgorithm DEFAULT
+ * mgf1SHA1Identifier,
+ * saltLength [2] INTEGER DEFAULT 20,
+ * trailerField [3] INTEGER DEFAULT 1
+ * }
+ *
+ * HashAlgorithm ::= AlgorithmIdentifier
+ *
+ * MaskGenAlgorithm ::= AlgorithmIdentifier
+ *
+ * AlgorithmIdentifer ::= SEQUENCE {
+ * algorithm OBJECT IDENTIFIER,
+ * parameters ANY DEFINED BY algorithm OPTIONAL
+ * }
+ *
+ * @param oid The OID specifying the signature algorithm
+ * @param obj The ASN.1 structure holding the parameters
+ * @param fillDefaults Whether to use return default values where omitted
+ * @return signature parameter object
+ */
+var _readSignatureParameters = function(oid, obj, fillDefaults) {
+ var params = {};
+
+ if(oid !== oids['RSASSA-PSS']) {
+ return params;
+ }
+
+ if(fillDefaults) {
+ params = {
+ hash: {
+ algorithmOid: oids['sha1']
+ },
+ mgf: {
+ algorithmOid: oids['mgf1'],
+ hash: {
+ algorithmOid: oids['sha1']
+ }
+ },
+ saltLength: 20
+ };
+ }
+
+ var capture = {};
+ var errors = [];
+ if(!asn1.validate(obj, rsassaPssParameterValidator, capture, errors)) {
+ var error = new Error('Cannot read RSASSA-PSS parameter block.');
+ error.errors = errors;
+ throw error;
+ }
+
+ if(capture.hashOid !== undefined) {
+ params.hash = params.hash || {};
+ params.hash.algorithmOid = asn1.derToOid(capture.hashOid);
+ }
+
+ if(capture.maskGenOid !== undefined) {
+ params.mgf = params.mgf || {};
+ params.mgf.algorithmOid = asn1.derToOid(capture.maskGenOid);
+ params.mgf.hash = params.mgf.hash || {};
+ params.mgf.hash.algorithmOid = asn1.derToOid(capture.maskGenHashOid);
+ }
+
+ if(capture.saltLength !== undefined) {
+ params.saltLength = capture.saltLength.charCodeAt(0);
+ }
+
+ return params;
+};
+
+/**
+ * Converts an X.509 certificate from PEM format.
+ *
+ * Note: If the certificate is to be verified then compute hash should
+ * be set to true. This will scan the TBSCertificate part of the ASN.1
+ * object while it is converted so it doesn't need to be converted back
+ * to ASN.1-DER-encoding later.
+ *
+ * @param pem the PEM-formatted certificate.
+ * @param computeHash true to compute the hash for verification.
+ * @param strict true to be strict when checking ASN.1 value lengths, false to
+ * allow truncated values (default: true).
+ *
+ * @return the certificate.
+ */
+pki.certificateFromPem = function(pem, computeHash, strict) {
+ var msg = forge.pem.decode(pem)[0];
+
+ if(msg.type !== 'CERTIFICATE' &&
+ msg.type !== 'X509 CERTIFICATE' &&
+ msg.type !== 'TRUSTED CERTIFICATE') {
+ var error = new Error('Could not convert certificate from PEM; PEM header type ' +
+ 'is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');
+ error.headerType = msg.type;
+ throw error;
+ }
+ if(msg.procType && msg.procType.type === 'ENCRYPTED') {
+ throw new Error('Could not convert certificate from PEM; PEM is encrypted.');
+ }
+
+ // convert DER to ASN.1 object
+ var obj = asn1.fromDer(msg.body, strict);
+
+ return pki.certificateFromAsn1(obj, computeHash);
+};
+
+/**
+ * Converts an X.509 certificate to PEM format.
+ *
+ * @param cert the certificate.
+ * @param maxline the maximum characters per line, defaults to 64.
+ *
+ * @return the PEM-formatted certificate.
+ */
+pki.certificateToPem = function(cert, maxline) {
+ // convert to ASN.1, then DER, then PEM-encode
+ var msg = {
+ type: 'CERTIFICATE',
+ body: asn1.toDer(pki.certificateToAsn1(cert)).getBytes()
+ };
+ return forge.pem.encode(msg, {maxline: maxline});
+};
+
+/**
+ * Converts an RSA public key from PEM format.
+ *
+ * @param pem the PEM-formatted public key.
+ *
+ * @return the public key.
+ */
+pki.publicKeyFromPem = function(pem) {
+ var msg = forge.pem.decode(pem)[0];
+
+ if(msg.type !== 'PUBLIC KEY' && msg.type !== 'RSA PUBLIC KEY') {
+ var error = new Error('Could not convert public key from PEM; PEM header ' +
+ 'type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');
+ error.headerType = msg.type;
+ throw error;
+ }
+ if(msg.procType && msg.procType.type === 'ENCRYPTED') {
+ throw new Error('Could not convert public key from PEM; PEM is encrypted.');
+ }
+
+ // convert DER to ASN.1 object
+ var obj = asn1.fromDer(msg.body);
+
+ return pki.publicKeyFromAsn1(obj);
+};
+
+/**
+ * Converts an RSA public key to PEM format (using a SubjectPublicKeyInfo).
+ *
+ * @param key the public key.
+ * @param maxline the maximum characters per line, defaults to 64.
+ *
+ * @return the PEM-formatted public key.
+ */
+pki.publicKeyToPem = function(key, maxline) {
+ // convert to ASN.1, then DER, then PEM-encode
+ var msg = {
+ type: 'PUBLIC KEY',
+ body: asn1.toDer(pki.publicKeyToAsn1(key)).getBytes()
+ };
+ return forge.pem.encode(msg, {maxline: maxline});
+};
+
+/**
+ * Converts an RSA public key to PEM format (using an RSAPublicKey).
+ *
+ * @param key the public key.
+ * @param maxline the maximum characters per line, defaults to 64.
+ *
+ * @return the PEM-formatted public key.
+ */
+pki.publicKeyToRSAPublicKeyPem = function(key, maxline) {
+ // convert to ASN.1, then DER, then PEM-encode
+ var msg = {
+ type: 'RSA PUBLIC KEY',
+ body: asn1.toDer(pki.publicKeyToRSAPublicKey(key)).getBytes()
+ };
+ return forge.pem.encode(msg, {maxline: maxline});
+};
+
+/**
+ * Gets a fingerprint for the given public key.
+ *
+ * @param options the options to use.
+ * [md] the message digest object to use (defaults to forge.md.sha1).
+ * [type] the type of fingerprint, such as 'RSAPublicKey',
+ * 'SubjectPublicKeyInfo' (defaults to 'RSAPublicKey').
+ * [encoding] an alternative output encoding, such as 'hex'
+ * (defaults to none, outputs a byte buffer).
+ * [delimiter] the delimiter to use between bytes for 'hex' encoded
+ * output, eg: ':' (defaults to none).
+ *
+ * @return the fingerprint as a byte buffer or other encoding based on options.
+ */
+pki.getPublicKeyFingerprint = function(key, options) {
+ options = options || {};
+ var md = options.md || forge.md.sha1.create();
+ var type = options.type || 'RSAPublicKey';
+
+ var bytes;
+ switch(type) {
+ case 'RSAPublicKey':
+ bytes = asn1.toDer(pki.publicKeyToRSAPublicKey(key)).getBytes();
+ break;
+ case 'SubjectPublicKeyInfo':
+ bytes = asn1.toDer(pki.publicKeyToAsn1(key)).getBytes();
+ break;
+ default:
+ throw new Error('Unknown fingerprint type "' + options.type + '".');
+ }
+
+ // hash public key bytes
+ md.start();
+ md.update(bytes);
+ var digest = md.digest();
+ if(options.encoding === 'hex') {
+ var hex = digest.toHex();
+ if(options.delimiter) {
+ return hex.match(/.{2}/g).join(options.delimiter);
+ }
+ return hex;
+ } else if(options.encoding === 'binary') {
+ return digest.getBytes();
+ } else if(options.encoding) {
+ throw new Error('Unknown encoding "' + options.encoding + '".');
+ }
+ return digest;
+};
+
+/**
+ * Converts a PKCS#10 certification request (CSR) from PEM format.
+ *
+ * Note: If the certification request is to be verified then compute hash
+ * should be set to true. This will scan the CertificationRequestInfo part of
+ * the ASN.1 object while it is converted so it doesn't need to be converted
+ * back to ASN.1-DER-encoding later.
+ *
+ * @param pem the PEM-formatted certificate.
+ * @param computeHash true to compute the hash for verification.
+ * @param strict true to be strict when checking ASN.1 value lengths, false to
+ * allow truncated values (default: true).
+ *
+ * @return the certification request (CSR).
+ */
+pki.certificationRequestFromPem = function(pem, computeHash, strict) {
+ var msg = forge.pem.decode(pem)[0];
+
+ if(msg.type !== 'CERTIFICATE REQUEST') {
+ var error = new Error('Could not convert certification request from PEM; ' +
+ 'PEM header type is not "CERTIFICATE REQUEST".');
+ error.headerType = msg.type;
+ throw error;
+ }
+ if(msg.procType && msg.procType.type === 'ENCRYPTED') {
+ throw new Error('Could not convert certification request from PEM; ' +
+ 'PEM is encrypted.');
+ }
+
+ // convert DER to ASN.1 object
+ var obj = asn1.fromDer(msg.body, strict);
+
+ return pki.certificationRequestFromAsn1(obj, computeHash);
+};
+
+/**
+ * Converts a PKCS#10 certification request (CSR) to PEM format.
+ *
+ * @param csr the certification request.
+ * @param maxline the maximum characters per line, defaults to 64.
+ *
+ * @return the PEM-formatted certification request.
+ */
+pki.certificationRequestToPem = function(csr, maxline) {
+ // convert to ASN.1, then DER, then PEM-encode
+ var msg = {
+ type: 'CERTIFICATE REQUEST',
+ body: asn1.toDer(pki.certificationRequestToAsn1(csr)).getBytes()
+ };
+ return forge.pem.encode(msg, {maxline: maxline});
+};
+
+/**
+ * Creates an empty X.509v3 RSA certificate.
+ *
+ * @return the certificate.
+ */
+pki.createCertificate = function() {
+ var cert = {};
+ cert.version = 0x02;
+ cert.serialNumber = '00';
+ cert.signatureOid = null;
+ cert.signature = null;
+ cert.siginfo = {};
+ cert.siginfo.algorithmOid = null;
+ cert.validity = {};
+ cert.validity.notBefore = new Date();
+ cert.validity.notAfter = new Date();
+
+ cert.issuer = {};
+ cert.issuer.getField = function(sn) {
+ return _getAttribute(cert.issuer, sn);
+ };
+ cert.issuer.addField = function(attr) {
+ _fillMissingFields([attr]);
+ cert.issuer.attributes.push(attr);
+ };
+ cert.issuer.attributes = [];
+ cert.issuer.hash = null;
+
+ cert.subject = {};
+ cert.subject.getField = function(sn) {
+ return _getAttribute(cert.subject, sn);
+ };
+ cert.subject.addField = function(attr) {
+ _fillMissingFields([attr]);
+ cert.subject.attributes.push(attr);
+ };
+ cert.subject.attributes = [];
+ cert.subject.hash = null;
+
+ cert.extensions = [];
+ cert.publicKey = null;
+ cert.md = null;
+
+ /**
+ * Sets the subject of this certificate.
+ *
+ * @param attrs the array of subject attributes to use.
+ * @param uniqueId an optional a unique ID to use.
+ */
+ cert.setSubject = function(attrs, uniqueId) {
+ // set new attributes, clear hash
+ _fillMissingFields(attrs);
+ cert.subject.attributes = attrs;
+ delete cert.subject.uniqueId;
+ if(uniqueId) {
+ // TODO: support arbitrary bit length ids
+ cert.subject.uniqueId = uniqueId;
+ }
+ cert.subject.hash = null;
+ };
+
+ /**
+ * Sets the issuer of this certificate.
+ *
+ * @param attrs the array of issuer attributes to use.
+ * @param uniqueId an optional a unique ID to use.
+ */
+ cert.setIssuer = function(attrs, uniqueId) {
+ // set new attributes, clear hash
+ _fillMissingFields(attrs);
+ cert.issuer.attributes = attrs;
+ delete cert.issuer.uniqueId;
+ if(uniqueId) {
+ // TODO: support arbitrary bit length ids
+ cert.issuer.uniqueId = uniqueId;
+ }
+ cert.issuer.hash = null;
+ };
+
+ /**
+ * Sets the extensions of this certificate.
+ *
+ * @param exts the array of extensions to use.
+ */
+ cert.setExtensions = function(exts) {
+ for(var i = 0; i < exts.length; ++i) {
+ _fillMissingExtensionFields(exts[i], {cert: cert});
+ }
+ // set new extensions
+ cert.extensions = exts;
+ };
+
+ /**
+ * Gets an extension by its name or id.
+ *
+ * @param options the name to use or an object with:
+ * name the name to use.
+ * id the id to use.
+ *
+ * @return the extension or null if not found.
+ */
+ cert.getExtension = function(options) {
+ if(typeof options === 'string') {
+ options = {name: options};
+ }
+
+ var rval = null;
+ var ext;
+ for(var i = 0; rval === null && i < cert.extensions.length; ++i) {
+ ext = cert.extensions[i];
+ if(options.id && ext.id === options.id) {
+ rval = ext;
+ } else if(options.name && ext.name === options.name) {
+ rval = ext;
+ }
+ }
+ return rval;
+ };
+
+ /**
+ * Signs this certificate using the given private key.
+ *
+ * @param key the private key to sign with.
+ * @param md the message digest object to use (defaults to forge.md.sha1).
+ */
+ cert.sign = function(key, md) {
+ // TODO: get signature OID from private key
+ cert.md = md || forge.md.sha1.create();
+ var algorithmOid = oids[cert.md.algorithm + 'WithRSAEncryption'];
+ if(!algorithmOid) {
+ var error = new Error('Could not compute certificate digest. ' +
+ 'Unknown message digest algorithm OID.');
+ error.algorithm = cert.md.algorithm;
+ throw error;
+ }
+ cert.signatureOid = cert.siginfo.algorithmOid = algorithmOid;
+
+ // get TBSCertificate, convert to DER
+ cert.tbsCertificate = pki.getTBSCertificate(cert);
+ var bytes = asn1.toDer(cert.tbsCertificate);
+
+ // digest and sign
+ cert.md.update(bytes.getBytes());
+ cert.signature = key.sign(cert.md);
+ };
+
+ /**
+ * Attempts verify the signature on the passed certificate using this
+ * certificate's public key.
+ *
+ * @param child the certificate to verify.
+ *
+ * @return true if verified, false if not.
+ */
+ cert.verify = function(child) {
+ var rval = false;
+
+ if(!cert.issued(child)) {
+ var issuer = child.issuer;
+ var subject = cert.subject;
+ var error = new Error('The parent certificate did not issue the given child ' +
+ 'certificate; the child certificate\'s issuer does not match the ' +
+ 'parent\'s subject.');
+ error.expectedIssuer = issuer.attributes;
+ error.actualIssuer = subject.attributes;
+ throw error;
+ }
+
+ var md = child.md;
+ if(md === null) {
+ // check signature OID for supported signature types
+ if(child.signatureOid in oids) {
+ var oid = oids[child.signatureOid];
+ switch(oid) {
+ case 'sha1WithRSAEncryption':
+ md = forge.md.sha1.create();
+ break;
+ case 'md5WithRSAEncryption':
+ md = forge.md.md5.create();
+ break;
+ case 'sha256WithRSAEncryption':
+ md = forge.md.sha256.create();
+ break;
+ case 'sha384WithRSAEncryption':
+ md = forge.md.sha384.create();
+ break;
+ case 'sha512WithRSAEncryption':
+ md = forge.md.sha512.create();
+ break;
+ case 'RSASSA-PSS':
+ md = forge.md.sha256.create();
+ break;
+ }
+ }
+ if(md === null) {
+ var error = new Error('Could not compute certificate digest. ' +
+ 'Unknown signature OID.');
+ error.signatureOid = child.signatureOid;
+ throw error;
+ }
+
+ // produce DER formatted TBSCertificate and digest it
+ var tbsCertificate = child.tbsCertificate || pki.getTBSCertificate(child);
+ var bytes = asn1.toDer(tbsCertificate);
+ md.update(bytes.getBytes());
+ }
+
+ if(md !== null) {
+ var scheme;
+
+ switch(child.signatureOid) {
+ case oids.sha1WithRSAEncryption:
+ scheme = undefined; /* use PKCS#1 v1.5 padding scheme */
+ break;
+ case oids['RSASSA-PSS']:
+ var hash, mgf;
+
+ /* initialize mgf */
+ hash = oids[child.signatureParameters.mgf.hash.algorithmOid];
+ if(hash === undefined || forge.md[hash] === undefined) {
+ var error = new Error('Unsupported MGF hash function.');
+ error.oid = child.signatureParameters.mgf.hash.algorithmOid;
+ error.name = hash;
+ throw error;
+ }
+
+ mgf = oids[child.signatureParameters.mgf.algorithmOid];
+ if(mgf === undefined || forge.mgf[mgf] === undefined) {
+ var error = new Error('Unsupported MGF function.');
+ error.oid = child.signatureParameters.mgf.algorithmOid;
+ error.name = mgf;
+ throw error;
+ }
+
+ mgf = forge.mgf[mgf].create(forge.md[hash].create());
+
+ /* initialize hash function */
+ hash = oids[child.signatureParameters.hash.algorithmOid];
+ if(hash === undefined || forge.md[hash] === undefined) {
+ throw {
+ message: 'Unsupported RSASSA-PSS hash function.',
+ oid: child.signatureParameters.hash.algorithmOid,
+ name: hash
+ };
+ }
+
+ scheme = forge.pss.create(forge.md[hash].create(), mgf,
+ child.signatureParameters.saltLength);
+ break;
+ }
+
+ // verify signature on cert using public key
+ rval = cert.publicKey.verify(
+ md.digest().getBytes(), child.signature, scheme);
+ }
+
+ return rval;
+ };
+
+ /**
+ * Returns true if this certificate's issuer matches the passed
+ * certificate's subject. Note that no signature check is performed.
+ *
+ * @param parent the certificate to check.
+ *
+ * @return true if this certificate's issuer matches the passed certificate's
+ * subject.
+ */
+ cert.isIssuer = function(parent) {
+ var rval = false;
+
+ var i = cert.issuer;
+ var s = parent.subject;
+
+ // compare hashes if present
+ if(i.hash && s.hash) {
+ rval = (i.hash === s.hash);
+ } else if(i.attributes.length === s.attributes.length) {
+ // all attributes are the same so issuer matches subject
+ rval = true;
+ var iattr, sattr;
+ for(var n = 0; rval && n < i.attributes.length; ++n) {
+ iattr = i.attributes[n];
+ sattr = s.attributes[n];
+ if(iattr.type !== sattr.type || iattr.value !== sattr.value) {
+ // attribute mismatch
+ rval = false;
+ }
+ }
+ }
+
+ return rval;
+ };
+
+ /**
+ * Returns true if this certificate's subject matches the issuer of the
+ * given certificate). Note that not signature check is performed.
+ *
+ * @param child the certificate to check.
+ *
+ * @return true if this certificate's subject matches the passed
+ * certificate's issuer.
+ */
+ cert.issued = function(child) {
+ return child.isIssuer(cert);
+ };
+
+ /**
+ * Generates the subjectKeyIdentifier for this certificate as byte buffer.
+ *
+ * @return the subjectKeyIdentifier for this certificate as byte buffer.
+ */
+ cert.generateSubjectKeyIdentifier = function() {
+ /* See: 4.2.1.2 section of the the RFC3280, keyIdentifier is either:
+
+ (1) The keyIdentifier is composed of the 160-bit SHA-1 hash of the
+ value of the BIT STRING subjectPublicKey (excluding the tag,
+ length, and number of unused bits).
+
+ (2) The keyIdentifier is composed of a four bit type field with
+ the value 0100 followed by the least significant 60 bits of the
+ SHA-1 hash of the value of the BIT STRING subjectPublicKey
+ (excluding the tag, length, and number of unused bit string bits).
+ */
+
+ // skipping the tag, length, and number of unused bits is the same
+ // as just using the RSAPublicKey (for RSA keys, which are the
+ // only ones supported)
+ return pki.getPublicKeyFingerprint(cert.publicKey, {type: 'RSAPublicKey'});
+ };
+
+ /**
+ * Verifies the subjectKeyIdentifier extension value for this certificate
+ * against its public key. If no extension is found, false will be
+ * returned.
+ *
+ * @return true if verified, false if not.
+ */
+ cert.verifySubjectKeyIdentifier = function() {
+ var oid = oids['subjectKeyIdentifier'];
+ for(var i = 0; i < cert.extensions.length; ++i) {
+ var ext = cert.extensions[i];
+ if(ext.id === oid) {
+ var ski = cert.generateSubjectKeyIdentifier().getBytes();
+ return (forge.util.hexToBytes(ext.subjectKeyIdentifier) === ski);
+ }
+ }
+ return false;
+ };
+
+ return cert;
+};
+
+/**
+ * Converts an X.509v3 RSA certificate from an ASN.1 object.
+ *
+ * Note: If the certificate is to be verified then compute hash should
+ * be set to true. There is currently no implementation for converting
+ * a certificate back to ASN.1 so the TBSCertificate part of the ASN.1
+ * object needs to be scanned before the cert object is created.
+ *
+ * @param obj the asn1 representation of an X.509v3 RSA certificate.
+ * @param computeHash true to compute the hash for verification.
+ *
+ * @return the certificate.
+ */
+pki.certificateFromAsn1 = function(obj, computeHash) {
+ // validate certificate and capture data
+ var capture = {};
+ var errors = [];
+ if(!asn1.validate(obj, x509CertificateValidator, capture, errors)) {
+ var error = new Error('Cannot read X.509 certificate. ' +
+ 'ASN.1 object is not an X509v3 Certificate.');
+ error.errors = errors;
+ throw error;
+ }
+
+ // get oid
+ var oid = asn1.derToOid(capture.publicKeyOid);
+ if(oid !== pki.oids.rsaEncryption) {
+ throw new Error('Cannot read public key. OID is not RSA.');
+ }
+
+ // create certificate
+ var cert = pki.createCertificate();
+ cert.version = capture.certVersion ?
+ capture.certVersion.charCodeAt(0) : 0;
+ var serial = forge.util.createBuffer(capture.certSerialNumber);
+ cert.serialNumber = serial.toHex();
+ cert.signatureOid = forge.asn1.derToOid(capture.certSignatureOid);
+ cert.signatureParameters = _readSignatureParameters(
+ cert.signatureOid, capture.certSignatureParams, true);
+ cert.siginfo.algorithmOid = forge.asn1.derToOid(capture.certinfoSignatureOid);
+ cert.siginfo.parameters = _readSignatureParameters(cert.siginfo.algorithmOid,
+ capture.certinfoSignatureParams, false);
+ cert.signature = capture.certSignature;
+
+ var validity = [];
+ if(capture.certValidity1UTCTime !== undefined) {
+ validity.push(asn1.utcTimeToDate(capture.certValidity1UTCTime));
+ }
+ if(capture.certValidity2GeneralizedTime !== undefined) {
+ validity.push(asn1.generalizedTimeToDate(
+ capture.certValidity2GeneralizedTime));
+ }
+ if(capture.certValidity3UTCTime !== undefined) {
+ validity.push(asn1.utcTimeToDate(capture.certValidity3UTCTime));
+ }
+ if(capture.certValidity4GeneralizedTime !== undefined) {
+ validity.push(asn1.generalizedTimeToDate(
+ capture.certValidity4GeneralizedTime));
+ }
+ if(validity.length > 2) {
+ throw new Error('Cannot read notBefore/notAfter validity times; more ' +
+ 'than two times were provided in the certificate.');
+ }
+ if(validity.length < 2) {
+ throw new Error('Cannot read notBefore/notAfter validity times; they ' +
+ 'were not provided as either UTCTime or GeneralizedTime.');
+ }
+ cert.validity.notBefore = validity[0];
+ cert.validity.notAfter = validity[1];
+
+ // keep TBSCertificate to preserve signature when exporting
+ cert.tbsCertificate = capture.tbsCertificate;
+
+ if(computeHash) {
+ // check signature OID for supported signature types
+ cert.md = null;
+ if(cert.signatureOid in oids) {
+ var oid = oids[cert.signatureOid];
+ switch(oid) {
+ case 'sha1WithRSAEncryption':
+ cert.md = forge.md.sha1.create();
+ break;
+ case 'md5WithRSAEncryption':
+ cert.md = forge.md.md5.create();
+ break;
+ case 'sha256WithRSAEncryption':
+ cert.md = forge.md.sha256.create();
+ break;
+ case 'sha384WithRSAEncryption':
+ cert.md = forge.md.sha384.create();
+ break;
+ case 'sha512WithRSAEncryption':
+ cert.md = forge.md.sha512.create();
+ break;
+ case 'RSASSA-PSS':
+ cert.md = forge.md.sha256.create();
+ break;
+ }
+ }
+ if(cert.md === null) {
+ var error = new Error('Could not compute certificate digest. ' +
+ 'Unknown signature OID.');
+ error.signatureOid = cert.signatureOid;
+ throw error;
+ }
+
+ // produce DER formatted TBSCertificate and digest it
+ var bytes = asn1.toDer(cert.tbsCertificate);
+ cert.md.update(bytes.getBytes());
+ }
+
+ // handle issuer, build issuer message digest
+ var imd = forge.md.sha1.create();
+ cert.issuer.getField = function(sn) {
+ return _getAttribute(cert.issuer, sn);
+ };
+ cert.issuer.addField = function(attr) {
+ _fillMissingFields([attr]);
+ cert.issuer.attributes.push(attr);
+ };
+ cert.issuer.attributes = pki.RDNAttributesAsArray(capture.certIssuer, imd);
+ if(capture.certIssuerUniqueId) {
+ cert.issuer.uniqueId = capture.certIssuerUniqueId;
+ }
+ cert.issuer.hash = imd.digest().toHex();
+
+ // handle subject, build subject message digest
+ var smd = forge.md.sha1.create();
+ cert.subject.getField = function(sn) {
+ return _getAttribute(cert.subject, sn);
+ };
+ cert.subject.addField = function(attr) {
+ _fillMissingFields([attr]);
+ cert.subject.attributes.push(attr);
+ };
+ cert.subject.attributes = pki.RDNAttributesAsArray(capture.certSubject, smd);
+ if(capture.certSubjectUniqueId) {
+ cert.subject.uniqueId = capture.certSubjectUniqueId;
+ }
+ cert.subject.hash = smd.digest().toHex();
+
+ // handle extensions
+ if(capture.certExtensions) {
+ cert.extensions = pki.certificateExtensionsFromAsn1(capture.certExtensions);
+ } else {
+ cert.extensions = [];
+ }
+
+ // convert RSA public key from ASN.1
+ cert.publicKey = pki.publicKeyFromAsn1(capture.subjectPublicKeyInfo);
+
+ return cert;
+};
+
+/**
+ * Converts an ASN.1 extensions object (with extension sequences as its
+ * values) into an array of extension objects with types and values.
+ *
+ * Supported extensions:
+ *
+ * id-ce-keyUsage OBJECT IDENTIFIER ::= { id-ce 15 }
+ * KeyUsage ::= BIT STRING {
+ * digitalSignature (0),
+ * nonRepudiation (1),
+ * keyEncipherment (2),
+ * dataEncipherment (3),
+ * keyAgreement (4),
+ * keyCertSign (5),
+ * cRLSign (6),
+ * encipherOnly (7),
+ * decipherOnly (8)
+ * }
+ *
+ * id-ce-basicConstraints OBJECT IDENTIFIER ::= { id-ce 19 }
+ * BasicConstraints ::= SEQUENCE {
+ * cA BOOLEAN DEFAULT FALSE,
+ * pathLenConstraint INTEGER (0..MAX) OPTIONAL
+ * }
+ *
+ * subjectAltName EXTENSION ::= {
+ * SYNTAX GeneralNames
+ * IDENTIFIED BY id-ce-subjectAltName
+ * }
+ *
+ * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
+ *
+ * GeneralName ::= CHOICE {
+ * otherName [0] INSTANCE OF OTHER-NAME,
+ * rfc822Name [1] IA5String,
+ * dNSName [2] IA5String,
+ * x400Address [3] ORAddress,
+ * directoryName [4] Name,
+ * ediPartyName [5] EDIPartyName,
+ * uniformResourceIdentifier [6] IA5String,
+ * IPAddress [7] OCTET STRING,
+ * registeredID [8] OBJECT IDENTIFIER
+ * }
+ *
+ * OTHER-NAME ::= TYPE-IDENTIFIER
+ *
+ * EDIPartyName ::= SEQUENCE {
+ * nameAssigner [0] DirectoryString {ub-name} OPTIONAL,
+ * partyName [1] DirectoryString {ub-name}
+ * }
+ *
+ * @param exts the extensions ASN.1 with extension sequences to parse.
+ *
+ * @return the array.
+ */
+pki.certificateExtensionsFromAsn1 = function(exts) {
+ var rval = [];
+ for(var i = 0; i < exts.value.length; ++i) {
+ // get extension sequence
+ var extseq = exts.value[i];
+ for(var ei = 0; ei < extseq.value.length; ++ei) {
+ rval.push(pki.certificateExtensionFromAsn1(extseq.value[ei]));
+ }
+ }
+
+ return rval;
+};
+
+/**
+ * Parses a single certificate extension from ASN.1.
+ *
+ * @param ext the extension in ASN.1 format.
+ *
+ * @return the parsed extension as an object.
+ */
+pki.certificateExtensionFromAsn1 = function(ext) {
+ // an extension has:
+ // [0] extnID OBJECT IDENTIFIER
+ // [1] critical BOOLEAN DEFAULT FALSE
+ // [2] extnValue OCTET STRING
+ var e = {};
+ e.id = asn1.derToOid(ext.value[0].value);
+ e.critical = false;
+ if(ext.value[1].type === asn1.Type.BOOLEAN) {
+ e.critical = (ext.value[1].value.charCodeAt(0) !== 0x00);
+ e.value = ext.value[2].value;
+ } else {
+ e.value = ext.value[1].value;
+ }
+ // if the oid is known, get its name
+ if(e.id in oids) {
+ e.name = oids[e.id];
+
+ // handle key usage
+ if(e.name === 'keyUsage') {
+ // get value as BIT STRING
+ var ev = asn1.fromDer(e.value);
+ var b2 = 0x00;
+ var b3 = 0x00;
+ if(ev.value.length > 1) {
+ // skip first byte, just indicates unused bits which
+ // will be padded with 0s anyway
+ // get bytes with flag bits
+ b2 = ev.value.charCodeAt(1);
+ b3 = ev.value.length > 2 ? ev.value.charCodeAt(2) : 0;
+ }
+ // set flags
+ e.digitalSignature = (b2 & 0x80) === 0x80;
+ e.nonRepudiation = (b2 & 0x40) === 0x40;
+ e.keyEncipherment = (b2 & 0x20) === 0x20;
+ e.dataEncipherment = (b2 & 0x10) === 0x10;
+ e.keyAgreement = (b2 & 0x08) === 0x08;
+ e.keyCertSign = (b2 & 0x04) === 0x04;
+ e.cRLSign = (b2 & 0x02) === 0x02;
+ e.encipherOnly = (b2 & 0x01) === 0x01;
+ e.decipherOnly = (b3 & 0x80) === 0x80;
+ } else if(e.name === 'basicConstraints') {
+ // handle basic constraints
+ // get value as SEQUENCE
+ var ev = asn1.fromDer(e.value);
+ // get cA BOOLEAN flag (defaults to false)
+ if(ev.value.length > 0 && ev.value[0].type === asn1.Type.BOOLEAN) {
+ e.cA = (ev.value[0].value.charCodeAt(0) !== 0x00);
+ } else {
+ e.cA = false;
+ }
+ // get path length constraint
+ var value = null;
+ if(ev.value.length > 0 && ev.value[0].type === asn1.Type.INTEGER) {
+ value = ev.value[0].value;
+ } else if(ev.value.length > 1) {
+ value = ev.value[1].value;
+ }
+ if(value !== null) {
+ e.pathLenConstraint = asn1.derToInteger(value);
+ }
+ } else if(e.name === 'extKeyUsage') {
+ // handle extKeyUsage
+ // value is a SEQUENCE of OIDs
+ var ev = asn1.fromDer(e.value);
+ for(var vi = 0; vi < ev.value.length; ++vi) {
+ var oid = asn1.derToOid(ev.value[vi].value);
+ if(oid in oids) {
+ e[oids[oid]] = true;
+ } else {
+ e[oid] = true;
+ }
+ }
+ } else if(e.name === 'nsCertType') {
+ // handle nsCertType
+ // get value as BIT STRING
+ var ev = asn1.fromDer(e.value);
+ var b2 = 0x00;
+ if(ev.value.length > 1) {
+ // skip first byte, just indicates unused bits which
+ // will be padded with 0s anyway
+ // get bytes with flag bits
+ b2 = ev.value.charCodeAt(1);
+ }
+ // set flags
+ e.client = (b2 & 0x80) === 0x80;
+ e.server = (b2 & 0x40) === 0x40;
+ e.email = (b2 & 0x20) === 0x20;
+ e.objsign = (b2 & 0x10) === 0x10;
+ e.reserved = (b2 & 0x08) === 0x08;
+ e.sslCA = (b2 & 0x04) === 0x04;
+ e.emailCA = (b2 & 0x02) === 0x02;
+ e.objCA = (b2 & 0x01) === 0x01;
+ } else if(
+ e.name === 'subjectAltName' ||
+ e.name === 'issuerAltName') {
+ // handle subjectAltName/issuerAltName
+ e.altNames = [];
+
+ // ev is a SYNTAX SEQUENCE
+ var gn;
+ var ev = asn1.fromDer(e.value);
+ for(var n = 0; n < ev.value.length; ++n) {
+ // get GeneralName
+ gn = ev.value[n];
+
+ var altName = {
+ type: gn.type,
+ value: gn.value
+ };
+ e.altNames.push(altName);
+
+ // Note: Support for types 1,2,6,7,8
+ switch(gn.type) {
+ // rfc822Name
+ case 1:
+ // dNSName
+ case 2:
+ // uniformResourceIdentifier (URI)
+ case 6:
+ break;
+ // IPAddress
+ case 7:
+ // convert to IPv4/IPv6 string representation
+ altName.ip = forge.util.bytesToIP(gn.value);
+ break;
+ // registeredID
+ case 8:
+ altName.oid = asn1.derToOid(gn.value);
+ break;
+ default:
+ // unsupported
+ }
+ }
+ } else if(e.name === 'subjectKeyIdentifier') {
+ // value is an OCTETSTRING w/the hash of the key-type specific
+ // public key structure (eg: RSAPublicKey)
+ var ev = asn1.fromDer(e.value);
+ e.subjectKeyIdentifier = forge.util.bytesToHex(ev.value);
+ }
+ }
+ return e;
+};
+
+/**
+ * Converts a PKCS#10 certification request (CSR) from an ASN.1 object.
+ *
+ * Note: If the certification request is to be verified then compute hash
+ * should be set to true. There is currently no implementation for converting
+ * a certificate back to ASN.1 so the CertificationRequestInfo part of the
+ * ASN.1 object needs to be scanned before the csr object is created.
+ *
+ * @param obj the asn1 representation of a PKCS#10 certification request (CSR).
+ * @param computeHash true to compute the hash for verification.
+ *
+ * @return the certification request (CSR).
+ */
+pki.certificationRequestFromAsn1 = function(obj, computeHash) {
+ // validate certification request and capture data
+ var capture = {};
+ var errors = [];
+ if(!asn1.validate(obj, certificationRequestValidator, capture, errors)) {
+ var error = new Error('Cannot read PKCS#10 certificate request. ' +
+ 'ASN.1 object is not a PKCS#10 CertificationRequest.');
+ error.errors = errors;
+ throw error;
+ }
+
+ // get oid
+ var oid = asn1.derToOid(capture.publicKeyOid);
+ if(oid !== pki.oids.rsaEncryption) {
+ throw new Error('Cannot read public key. OID is not RSA.');
+ }
+
+ // create certification request
+ var csr = pki.createCertificationRequest();
+ csr.version = capture.csrVersion ? capture.csrVersion.charCodeAt(0) : 0;
+ csr.signatureOid = forge.asn1.derToOid(capture.csrSignatureOid);
+ csr.signatureParameters = _readSignatureParameters(
+ csr.signatureOid, capture.csrSignatureParams, true);
+ csr.siginfo.algorithmOid = forge.asn1.derToOid(capture.csrSignatureOid);
+ csr.siginfo.parameters = _readSignatureParameters(
+ csr.siginfo.algorithmOid, capture.csrSignatureParams, false);
+ csr.signature = capture.csrSignature;
+
+ // keep CertificationRequestInfo to preserve signature when exporting
+ csr.certificationRequestInfo = capture.certificationRequestInfo;
+
+ if(computeHash) {
+ // check signature OID for supported signature types
+ csr.md = null;
+ if(csr.signatureOid in oids) {
+ var oid = oids[csr.signatureOid];
+ switch(oid) {
+ case 'sha1WithRSAEncryption':
+ csr.md = forge.md.sha1.create();
+ break;
+ case 'md5WithRSAEncryption':
+ csr.md = forge.md.md5.create();
+ break;
+ case 'sha256WithRSAEncryption':
+ csr.md = forge.md.sha256.create();
+ break;
+ case 'sha384WithRSAEncryption':
+ csr.md = forge.md.sha384.create();
+ break;
+ case 'sha512WithRSAEncryption':
+ csr.md = forge.md.sha512.create();
+ break;
+ case 'RSASSA-PSS':
+ csr.md = forge.md.sha256.create();
+ break;
+ }
+ }
+ if(csr.md === null) {
+ var error = new Error('Could not compute certification request digest. ' +
+ 'Unknown signature OID.');
+ error.signatureOid = csr.signatureOid;
+ throw error;
+ }
+
+ // produce DER formatted CertificationRequestInfo and digest it
+ var bytes = asn1.toDer(csr.certificationRequestInfo);
+ csr.md.update(bytes.getBytes());
+ }
+
+ // handle subject, build subject message digest
+ var smd = forge.md.sha1.create();
+ csr.subject.getField = function(sn) {
+ return _getAttribute(csr.subject, sn);
+ };
+ csr.subject.addField = function(attr) {
+ _fillMissingFields([attr]);
+ csr.subject.attributes.push(attr);
+ };
+ csr.subject.attributes = pki.RDNAttributesAsArray(
+ capture.certificationRequestInfoSubject, smd);
+ csr.subject.hash = smd.digest().toHex();
+
+ // convert RSA public key from ASN.1
+ csr.publicKey = pki.publicKeyFromAsn1(capture.subjectPublicKeyInfo);
+
+ // convert attributes from ASN.1
+ csr.getAttribute = function(sn) {
+ return _getAttribute(csr, sn);
+ };
+ csr.addAttribute = function(attr) {
+ _fillMissingFields([attr]);
+ csr.attributes.push(attr);
+ };
+ csr.attributes = pki.CRIAttributesAsArray(
+ capture.certificationRequestInfoAttributes || []);
+
+ return csr;
+};
+
+/**
+ * Creates an empty certification request (a CSR or certificate signing
+ * request). Once created, its public key and attributes can be set and then
+ * it can be signed.
+ *
+ * @return the empty certification request.
+ */
+pki.createCertificationRequest = function() {
+ var csr = {};
+ csr.version = 0x00;
+ csr.signatureOid = null;
+ csr.signature = null;
+ csr.siginfo = {};
+ csr.siginfo.algorithmOid = null;
+
+ csr.subject = {};
+ csr.subject.getField = function(sn) {
+ return _getAttribute(csr.subject, sn);
+ };
+ csr.subject.addField = function(attr) {
+ _fillMissingFields([attr]);
+ csr.subject.attributes.push(attr);
+ };
+ csr.subject.attributes = [];
+ csr.subject.hash = null;
+
+ csr.publicKey = null;
+ csr.attributes = [];
+ csr.getAttribute = function(sn) {
+ return _getAttribute(csr, sn);
+ };
+ csr.addAttribute = function(attr) {
+ _fillMissingFields([attr]);
+ csr.attributes.push(attr);
+ };
+ csr.md = null;
+
+ /**
+ * Sets the subject of this certification request.
+ *
+ * @param attrs the array of subject attributes to use.
+ */
+ csr.setSubject = function(attrs) {
+ // set new attributes
+ _fillMissingFields(attrs);
+ csr.subject.attributes = attrs;
+ csr.subject.hash = null;
+ };
+
+ /**
+ * Sets the attributes of this certification request.
+ *
+ * @param attrs the array of attributes to use.
+ */
+ csr.setAttributes = function(attrs) {
+ // set new attributes
+ _fillMissingFields(attrs);
+ csr.attributes = attrs;
+ };
+
+ /**
+ * Signs this certification request using the given private key.
+ *
+ * @param key the private key to sign with.
+ * @param md the message digest object to use (defaults to forge.md.sha1).
+ */
+ csr.sign = function(key, md) {
+ // TODO: get signature OID from private key
+ csr.md = md || forge.md.sha1.create();
+ var algorithmOid = oids[csr.md.algorithm + 'WithRSAEncryption'];
+ if(!algorithmOid) {
+ var error = new Error('Could not compute certification request digest. ' +
+ 'Unknown message digest algorithm OID.');
+ error.algorithm = csr.md.algorithm;
+ throw error;
+ }
+ csr.signatureOid = csr.siginfo.algorithmOid = algorithmOid;
+
+ // get CertificationRequestInfo, convert to DER
+ csr.certificationRequestInfo = pki.getCertificationRequestInfo(csr);
+ var bytes = asn1.toDer(csr.certificationRequestInfo);
+
+ // digest and sign
+ csr.md.update(bytes.getBytes());
+ csr.signature = key.sign(csr.md);
+ };
+
+ /**
+ * Attempts verify the signature on the passed certification request using
+ * its public key.
+ *
+ * A CSR that has been exported to a file in PEM format can be verified using
+ * OpenSSL using this command:
+ *
+ * openssl req -in -verify -noout -text
+ *
+ * @return true if verified, false if not.
+ */
+ csr.verify = function() {
+ var rval = false;
+
+ var md = csr.md;
+ if(md === null) {
+ // check signature OID for supported signature types
+ if(csr.signatureOid in oids) {
+ // TODO: create DRY `OID to md` function
+ var oid = oids[csr.signatureOid];
+ switch(oid) {
+ case 'sha1WithRSAEncryption':
+ md = forge.md.sha1.create();
+ break;
+ case 'md5WithRSAEncryption':
+ md = forge.md.md5.create();
+ break;
+ case 'sha256WithRSAEncryption':
+ md = forge.md.sha256.create();
+ break;
+ case 'sha384WithRSAEncryption':
+ md = forge.md.sha384.create();
+ break;
+ case 'sha512WithRSAEncryption':
+ md = forge.md.sha512.create();
+ break;
+ case 'RSASSA-PSS':
+ md = forge.md.sha256.create();
+ break;
+ }
+ }
+ if(md === null) {
+ var error = new Error('Could not compute certification request digest. ' +
+ 'Unknown signature OID.');
+ error.signatureOid = csr.signatureOid;
+ throw error;
+ }
+
+ // produce DER formatted CertificationRequestInfo and digest it
+ var cri = csr.certificationRequestInfo ||
+ pki.getCertificationRequestInfo(csr);
+ var bytes = asn1.toDer(cri);
+ md.update(bytes.getBytes());
+ }
+
+ if(md !== null) {
+ var scheme;
+
+ switch(csr.signatureOid) {
+ case oids.sha1WithRSAEncryption:
+ /* use PKCS#1 v1.5 padding scheme */
+ break;
+ case oids['RSASSA-PSS']:
+ var hash, mgf;
+
+ /* initialize mgf */
+ hash = oids[csr.signatureParameters.mgf.hash.algorithmOid];
+ if(hash === undefined || forge.md[hash] === undefined) {
+ var error = new Error('Unsupported MGF hash function.');
+ error.oid = csr.signatureParameters.mgf.hash.algorithmOid;
+ error.name = hash;
+ throw error;
+ }
+
+ mgf = oids[csr.signatureParameters.mgf.algorithmOid];
+ if(mgf === undefined || forge.mgf[mgf] === undefined) {
+ var error = new Error('Unsupported MGF function.');
+ error.oid = csr.signatureParameters.mgf.algorithmOid;
+ error.name = mgf;
+ throw error;
+ }
+
+ mgf = forge.mgf[mgf].create(forge.md[hash].create());
+
+ /* initialize hash function */
+ hash = oids[csr.signatureParameters.hash.algorithmOid];
+ if(hash === undefined || forge.md[hash] === undefined) {
+ var error = new Error('Unsupported RSASSA-PSS hash function.');
+ error.oid = csr.signatureParameters.hash.algorithmOid;
+ error.name = hash;
+ throw error;
+ }
+
+ scheme = forge.pss.create(forge.md[hash].create(), mgf,
+ csr.signatureParameters.saltLength);
+ break;
+ }
+
+ // verify signature on csr using its public key
+ rval = csr.publicKey.verify(
+ md.digest().getBytes(), csr.signature, scheme);
+ }
+
+ return rval;
+ };
+
+ return csr;
+};
+
+/**
+ * Converts an X.509 subject or issuer to an ASN.1 RDNSequence.
+ *
+ * @param obj the subject or issuer (distinguished name).
+ *
+ * @return the ASN.1 RDNSequence.
+ */
+function _dnToAsn1(obj) {
+ // create an empty RDNSequence
+ var rval = asn1.create(
+ asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);
+
+ // iterate over attributes
+ var attr, set;
+ var attrs = obj.attributes;
+ for(var i = 0; i < attrs.length; ++i) {
+ attr = attrs[i];
+ var value = attr.value;
+
+ // reuse tag class for attribute value if available
+ var valueTagClass = asn1.Type.PRINTABLESTRING;
+ if('valueTagClass' in attr) {
+ valueTagClass = attr.valueTagClass;
+
+ if(valueTagClass === asn1.Type.UTF8) {
+ value = forge.util.encodeUtf8(value);
+ }
+ // FIXME: handle more encodings
+ }
+
+ // create a RelativeDistinguishedName set
+ // each value in the set is an AttributeTypeAndValue first
+ // containing the type (an OID) and second the value
+ set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ // AttributeType
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
+ asn1.oidToDer(attr.type).getBytes()),
+ // AttributeValue
+ asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)
+ ])
+ ]);
+ rval.value.push(set);
+ }
+
+ return rval;
+}
+
+/**
+ * Gets all printable attributes (typically of an issuer or subject) in a
+ * simplified JSON format for display.
+ *
+ * @param attrs the attributes.
+ *
+ * @return the JSON for display.
+ */
+function _getAttributesAsJson(attrs) {
+ var rval = {};
+ for(var i = 0; i < attrs.length; ++i) {
+ var attr = attrs[i];
+ if(attr.shortName && (
+ attr.valueTagClass === asn1.Type.UTF8 ||
+ attr.valueTagClass === asn1.Type.PRINTABLESTRING ||
+ attr.valueTagClass === asn1.Type.IA5STRING)) {
+ var value = attr.value;
+ if(attr.valueTagClass === asn1.Type.UTF8) {
+ value = forge.util.encodeUtf8(attr.value);
+ }
+ if(!(attr.shortName in rval)) {
+ rval[attr.shortName] = value;
+ } else if(forge.util.isArray(rval[attr.shortName])) {
+ rval[attr.shortName].push(value);
+ } else {
+ rval[attr.shortName] = [rval[attr.shortName], value];
+ }
+ }
+ }
+ return rval;
+}
+
+/**
+ * Fills in missing fields in attributes.
+ *
+ * @param attrs the attributes to fill missing fields in.
+ */
+function _fillMissingFields(attrs) {
+ var attr;
+ for(var i = 0; i < attrs.length; ++i) {
+ attr = attrs[i];
+
+ // populate missing name
+ if(typeof attr.name === 'undefined') {
+ if(attr.type && attr.type in pki.oids) {
+ attr.name = pki.oids[attr.type];
+ } else if(attr.shortName && attr.shortName in _shortNames) {
+ attr.name = pki.oids[_shortNames[attr.shortName]];
+ }
+ }
+
+ // populate missing type (OID)
+ if(typeof attr.type === 'undefined') {
+ if(attr.name && attr.name in pki.oids) {
+ attr.type = pki.oids[attr.name];
+ } else {
+ var error = new Error('Attribute type not specified.');
+ error.attribute = attr;
+ throw error;
+ }
+ }
+
+ // populate missing shortname
+ if(typeof attr.shortName === 'undefined') {
+ if(attr.name && attr.name in _shortNames) {
+ attr.shortName = _shortNames[attr.name];
+ }
+ }
+
+ // convert extensions to value
+ if(attr.type === oids.extensionRequest) {
+ attr.valueConstructed = true;
+ attr.valueTagClass = asn1.Type.SEQUENCE;
+ if(!attr.value && attr.extensions) {
+ attr.value = [];
+ for(var ei = 0; ei < attr.extensions.length; ++ei) {
+ attr.value.push(pki.certificateExtensionToAsn1(
+ _fillMissingExtensionFields(attr.extensions[ei])));
+ }
+ }
+ }
+
+ if(typeof attr.value === 'undefined') {
+ var error = new Error('Attribute value not specified.');
+ error.attribute = attr;
+ throw error;
+ }
+ }
+}
+
+/**
+ * Fills in missing fields in certificate extensions.
+ *
+ * @param e the extension.
+ * @param [options] the options to use.
+ * [cert] the certificate the extensions are for.
+ *
+ * @return the extension.
+ */
+function _fillMissingExtensionFields(e, options) {
+ options = options || {};
+
+ // populate missing name
+ if(typeof e.name === 'undefined') {
+ if(e.id && e.id in pki.oids) {
+ e.name = pki.oids[e.id];
+ }
+ }
+
+ // populate missing id
+ if(typeof e.id === 'undefined') {
+ if(e.name && e.name in pki.oids) {
+ e.id = pki.oids[e.name];
+ } else {
+ var error = new Error('Extension ID not specified.');
+ error.extension = e;
+ throw error;
+ }
+ }
+
+ if(typeof e.value !== 'undefined') {
+ return e;
+ }
+
+ // handle missing value:
+
+ // value is a BIT STRING
+ if(e.name === 'keyUsage') {
+ // build flags
+ var unused = 0;
+ var b2 = 0x00;
+ var b3 = 0x00;
+ if(e.digitalSignature) {
+ b2 |= 0x80;
+ unused = 7;
+ }
+ if(e.nonRepudiation) {
+ b2 |= 0x40;
+ unused = 6;
+ }
+ if(e.keyEncipherment) {
+ b2 |= 0x20;
+ unused = 5;
+ }
+ if(e.dataEncipherment) {
+ b2 |= 0x10;
+ unused = 4;
+ }
+ if(e.keyAgreement) {
+ b2 |= 0x08;
+ unused = 3;
+ }
+ if(e.keyCertSign) {
+ b2 |= 0x04;
+ unused = 2;
+ }
+ if(e.cRLSign) {
+ b2 |= 0x02;
+ unused = 1;
+ }
+ if(e.encipherOnly) {
+ b2 |= 0x01;
+ unused = 0;
+ }
+ if(e.decipherOnly) {
+ b3 |= 0x80;
+ unused = 7;
+ }
+
+ // create bit string
+ var value = String.fromCharCode(unused);
+ if(b3 !== 0) {
+ value += String.fromCharCode(b2) + String.fromCharCode(b3);
+ } else if(b2 !== 0) {
+ value += String.fromCharCode(b2);
+ }
+ e.value = asn1.create(
+ asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, value);
+ } else if(e.name === 'basicConstraints') {
+ // basicConstraints is a SEQUENCE
+ e.value = asn1.create(
+ asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);
+ // cA BOOLEAN flag defaults to false
+ if(e.cA) {
+ e.value.value.push(asn1.create(
+ asn1.Class.UNIVERSAL, asn1.Type.BOOLEAN, false,
+ String.fromCharCode(0xFF)));
+ }
+ if('pathLenConstraint' in e) {
+ e.value.value.push(asn1.create(
+ asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,
+ asn1.integerToDer(e.pathLenConstraint).getBytes()));
+ }
+ } else if(e.name === 'extKeyUsage') {
+ // extKeyUsage is a SEQUENCE of OIDs
+ e.value = asn1.create(
+ asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);
+ var seq = e.value.value;
+ for(var key in e) {
+ if(e[key] !== true) {
+ continue;
+ }
+ // key is name in OID map
+ if(key in oids) {
+ seq.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID,
+ false, asn1.oidToDer(oids[key]).getBytes()));
+ } else if(key.indexOf('.') !== -1) {
+ // assume key is an OID
+ seq.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID,
+ false, asn1.oidToDer(key).getBytes()));
+ }
+ }
+ } else if(e.name === 'nsCertType') {
+ // nsCertType is a BIT STRING
+ // build flags
+ var unused = 0;
+ var b2 = 0x00;
+
+ if(e.client) {
+ b2 |= 0x80;
+ unused = 7;
+ }
+ if(e.server) {
+ b2 |= 0x40;
+ unused = 6;
+ }
+ if(e.email) {
+ b2 |= 0x20;
+ unused = 5;
+ }
+ if(e.objsign) {
+ b2 |= 0x10;
+ unused = 4;
+ }
+ if(e.reserved) {
+ b2 |= 0x08;
+ unused = 3;
+ }
+ if(e.sslCA) {
+ b2 |= 0x04;
+ unused = 2;
+ }
+ if(e.emailCA) {
+ b2 |= 0x02;
+ unused = 1;
+ }
+ if(e.objCA) {
+ b2 |= 0x01;
+ unused = 0;
+ }
+
+ // create bit string
+ var value = String.fromCharCode(unused);
+ if(b2 !== 0) {
+ value += String.fromCharCode(b2);
+ }
+ e.value = asn1.create(
+ asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, value);
+ } else if(e.name === 'subjectAltName' || e.name === 'issuerAltName') {
+ // SYNTAX SEQUENCE
+ e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);
+
+ var altName;
+ for(var n = 0; n < e.altNames.length; ++n) {
+ altName = e.altNames[n];
+ var value = altName.value;
+ // handle IP
+ if(altName.type === 7 && altName.ip) {
+ value = forge.util.bytesFromIP(altName.ip);
+ if(value === null) {
+ var error = new Error(
+ 'Extension "ip" value is not a valid IPv4 or IPv6 address.');
+ error.extension = e;
+ throw error;
+ }
+ } else if(altName.type === 8) {
+ // handle OID
+ if(altName.oid) {
+ value = asn1.oidToDer(asn1.oidToDer(altName.oid));
+ } else {
+ // deprecated ... convert value to OID
+ value = asn1.oidToDer(value);
+ }
+ }
+ e.value.value.push(asn1.create(
+ asn1.Class.CONTEXT_SPECIFIC, altName.type, false,
+ value));
+ }
+ } else if(e.name === 'subjectKeyIdentifier' && options.cert) {
+ var ski = options.cert.generateSubjectKeyIdentifier();
+ e.subjectKeyIdentifier = ski.toHex();
+ // OCTETSTRING w/digest
+ e.value = asn1.create(
+ asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, ski.getBytes());
+ } else if(e.name === 'authorityKeyIdentifier' && options.cert) {
+ // SYNTAX SEQUENCE
+ e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);
+ var seq = e.value.value;
+
+ if(e.keyIdentifier) {
+ var keyIdentifier = (e.keyIdentifier === true ?
+ options.cert.generateSubjectKeyIdentifier().getBytes() :
+ e.keyIdentifier);
+ seq.push(
+ asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, false, keyIdentifier));
+ }
+
+ if(e.authorityCertIssuer) {
+ var authorityCertIssuer = [
+ asn1.create(asn1.Class.CONTEXT_SPECIFIC, 4, true, [
+ _dnToAsn1(e.authorityCertIssuer === true ?
+ options.cert.issuer : e.authorityCertIssuer)
+ ])
+ ];
+ seq.push(
+ asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, authorityCertIssuer));
+ }
+
+ if(e.serialNumber) {
+ var serialNumber = forge.util.hexToBytes(e.serialNumber === true ?
+ options.cert.serialNumber : e.serialNumber);
+ seq.push(
+ asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, false, serialNumber));
+ }
+ } else if (e.name === 'cRLDistributionPoints') {
+ e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);
+ var seq = e.value.value;
+
+ // Create sub SEQUENCE of DistributionPointName
+ var subSeq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);
+
+ // Create fullName CHOICE
+ var fullNameGeneralNames = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, []);
+ var altName;
+ for(var n = 0; n < e.altNames.length; ++n) {
+ altName = e.altNames[n];
+ var value = altName.value;
+ // handle IP
+ if(altName.type === 7 && altName.ip) {
+ value = forge.util.bytesFromIP(altName.ip);
+ if(value === null) {
+ var error = new Error(
+ 'Extension "ip" value is not a valid IPv4 or IPv6 address.');
+ error.extension = e;
+ throw error;
+ }
+ } else if(altName.type === 8) {
+ // handle OID
+ if(altName.oid) {
+ value = asn1.oidToDer(asn1.oidToDer(altName.oid));
+ } else {
+ // deprecated ... convert value to OID
+ value = asn1.oidToDer(value);
+ }
+ }
+ fullNameGeneralNames.value.push(asn1.create(
+ asn1.Class.CONTEXT_SPECIFIC, altName.type, false,
+ value));
+ }
+
+ // Add to the parent SEQUENCE
+ subSeq.value.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [fullNameGeneralNames]));
+ seq.push(subSeq);
+ }
+
+ // ensure value has been defined by now
+ if(typeof e.value === 'undefined') {
+ var error = new Error('Extension value not specified.');
+ error.extension = e;
+ throw error;
+ }
+
+ return e;
+}
+
+/**
+ * Convert signature parameters object to ASN.1
+ *
+ * @param {String} oid Signature algorithm OID
+ * @param params The signature parametrs object
+ * @return ASN.1 object representing signature parameters
+ */
+function _signatureParametersToAsn1(oid, params) {
+ switch(oid) {
+ case oids['RSASSA-PSS']:
+ var parts = [];
+
+ if(params.hash.algorithmOid !== undefined) {
+ parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
+ asn1.oidToDer(params.hash.algorithmOid).getBytes()),
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')
+ ])
+ ]));
+ }
+
+ if(params.mgf.algorithmOid !== undefined) {
+ parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, [
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
+ asn1.oidToDer(params.mgf.algorithmOid).getBytes()),
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
+ asn1.oidToDer(params.mgf.hash.algorithmOid).getBytes()),
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')
+ ])
+ ])
+ ]));
+ }
+
+ if(params.saltLength !== undefined) {
+ parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, true, [
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,
+ asn1.integerToDer(params.saltLength).getBytes())
+ ]));
+ }
+
+ return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, parts);
+
+ default:
+ return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '');
+ }
+}
+
+/**
+ * Converts a certification request's attributes to an ASN.1 set of
+ * CRIAttributes.
+ *
+ * @param csr certification request.
+ *
+ * @return the ASN.1 set of CRIAttributes.
+ */
+function _CRIAttributesToAsn1(csr) {
+ // create an empty context-specific container
+ var rval = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, []);
+
+ // no attributes, return empty container
+ if(csr.attributes.length === 0) {
+ return rval;
+ }
+
+ // each attribute has a sequence with a type and a set of values
+ var attrs = csr.attributes;
+ for(var i = 0; i < attrs.length; ++i) {
+ var attr = attrs[i];
+ var value = attr.value;
+
+ // reuse tag class for attribute value if available
+ var valueTagClass = asn1.Type.UTF8;
+ if('valueTagClass' in attr) {
+ valueTagClass = attr.valueTagClass;
+ }
+ if(valueTagClass === asn1.Type.UTF8) {
+ value = forge.util.encodeUtf8(value);
+ }
+ var valueConstructed = false;
+ if('valueConstructed' in attr) {
+ valueConstructed = attr.valueConstructed;
+ }
+ // FIXME: handle more encodings
+
+ // create a RelativeDistinguishedName set
+ // each value in the set is an AttributeTypeAndValue first
+ // containing the type (an OID) and second the value
+ var seq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ // AttributeType
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
+ asn1.oidToDer(attr.type).getBytes()),
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [
+ // AttributeValue
+ asn1.create(
+ asn1.Class.UNIVERSAL, valueTagClass, valueConstructed, value)
+ ])
+ ]);
+ rval.value.push(seq);
+ }
+
+ return rval;
+}
+
+/**
+ * Gets the ASN.1 TBSCertificate part of an X.509v3 certificate.
+ *
+ * @param cert the certificate.
+ *
+ * @return the asn1 TBSCertificate.
+ */
+pki.getTBSCertificate = function(cert) {
+ // TBSCertificate
+ var tbs = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ // version
+ asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [
+ // integer
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,
+ asn1.integerToDer(cert.version).getBytes())
+ ]),
+ // serialNumber
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,
+ forge.util.hexToBytes(cert.serialNumber)),
+ // signature
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ // algorithm
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
+ asn1.oidToDer(cert.siginfo.algorithmOid).getBytes()),
+ // parameters
+ _signatureParametersToAsn1(
+ cert.siginfo.algorithmOid, cert.siginfo.parameters)
+ ]),
+ // issuer
+ _dnToAsn1(cert.issuer),
+ // validity
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ // notBefore
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.UTCTIME, false,
+ asn1.dateToUtcTime(cert.validity.notBefore)),
+ // notAfter
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.UTCTIME, false,
+ asn1.dateToUtcTime(cert.validity.notAfter))
+ ]),
+ // subject
+ _dnToAsn1(cert.subject),
+ // SubjectPublicKeyInfo
+ pki.publicKeyToAsn1(cert.publicKey)
+ ]);
+
+ if(cert.issuer.uniqueId) {
+ // issuerUniqueID (optional)
+ tbs.value.push(
+ asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, [
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false,
+ // TODO: support arbitrary bit length ids
+ String.fromCharCode(0x00) +
+ cert.issuer.uniqueId
+ )
+ ])
+ );
+ }
+ if(cert.subject.uniqueId) {
+ // subjectUniqueID (optional)
+ tbs.value.push(
+ asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, true, [
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false,
+ // TODO: support arbitrary bit length ids
+ String.fromCharCode(0x00) +
+ cert.subject.uniqueId
+ )
+ ])
+ );
+ }
+
+ if(cert.extensions.length > 0) {
+ // extensions (optional)
+ tbs.value.push(pki.certificateExtensionsToAsn1(cert.extensions));
+ }
+
+ return tbs;
+};
+
+/**
+ * Gets the ASN.1 CertificationRequestInfo part of a
+ * PKCS#10 CertificationRequest.
+ *
+ * @param csr the certification request.
+ *
+ * @return the asn1 CertificationRequestInfo.
+ */
+pki.getCertificationRequestInfo = function(csr) {
+ // CertificationRequestInfo
+ var cri = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ // version
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,
+ asn1.integerToDer(csr.version).getBytes()),
+ // subject
+ _dnToAsn1(csr.subject),
+ // SubjectPublicKeyInfo
+ pki.publicKeyToAsn1(csr.publicKey),
+ // attributes
+ _CRIAttributesToAsn1(csr)
+ ]);
+
+ return cri;
+};
+
+/**
+ * Converts a DistinguishedName (subject or issuer) to an ASN.1 object.
+ *
+ * @param dn the DistinguishedName.
+ *
+ * @return the asn1 representation of a DistinguishedName.
+ */
+pki.distinguishedNameToAsn1 = function(dn) {
+ return _dnToAsn1(dn);
+};
+
+/**
+ * Converts an X.509v3 RSA certificate to an ASN.1 object.
+ *
+ * @param cert the certificate.
+ *
+ * @return the asn1 representation of an X.509v3 RSA certificate.
+ */
+pki.certificateToAsn1 = function(cert) {
+ // prefer cached TBSCertificate over generating one
+ var tbsCertificate = cert.tbsCertificate || pki.getTBSCertificate(cert);
+
+ // Certificate
+ return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ // TBSCertificate
+ tbsCertificate,
+ // AlgorithmIdentifier (signature algorithm)
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ // algorithm
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
+ asn1.oidToDer(cert.signatureOid).getBytes()),
+ // parameters
+ _signatureParametersToAsn1(cert.signatureOid, cert.signatureParameters)
+ ]),
+ // SignatureValue
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false,
+ String.fromCharCode(0x00) + cert.signature)
+ ]);
+};
+
+/**
+ * Converts X.509v3 certificate extensions to ASN.1.
+ *
+ * @param exts the extensions to convert.
+ *
+ * @return the extensions in ASN.1 format.
+ */
+pki.certificateExtensionsToAsn1 = function(exts) {
+ // create top-level extension container
+ var rval = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 3, true, []);
+
+ // create extension sequence (stores a sequence for each extension)
+ var seq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);
+ rval.value.push(seq);
+
+ for(var i = 0; i < exts.length; ++i) {
+ seq.value.push(pki.certificateExtensionToAsn1(exts[i]));
+ }
+
+ return rval;
+};
+
+/**
+ * Converts a single certificate extension to ASN.1.
+ *
+ * @param ext the extension to convert.
+ *
+ * @return the extension in ASN.1 format.
+ */
+pki.certificateExtensionToAsn1 = function(ext) {
+ // create a sequence for each extension
+ var extseq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);
+
+ // extnID (OID)
+ extseq.value.push(asn1.create(
+ asn1.Class.UNIVERSAL, asn1.Type.OID, false,
+ asn1.oidToDer(ext.id).getBytes()));
+
+ // critical defaults to false
+ if(ext.critical) {
+ // critical BOOLEAN DEFAULT FALSE
+ extseq.value.push(asn1.create(
+ asn1.Class.UNIVERSAL, asn1.Type.BOOLEAN, false,
+ String.fromCharCode(0xFF)));
+ }
+
+ var value = ext.value;
+ if(typeof ext.value !== 'string') {
+ // value is asn.1
+ value = asn1.toDer(value).getBytes();
+ }
+
+ // extnValue (OCTET STRING)
+ extseq.value.push(asn1.create(
+ asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, value));
+
+ return extseq;
+};
+
+/**
+ * Converts a PKCS#10 certification request to an ASN.1 object.
+ *
+ * @param csr the certification request.
+ *
+ * @return the asn1 representation of a certification request.
+ */
+pki.certificationRequestToAsn1 = function(csr) {
+ // prefer cached CertificationRequestInfo over generating one
+ var cri = csr.certificationRequestInfo ||
+ pki.getCertificationRequestInfo(csr);
+
+ // Certificate
+ return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ // CertificationRequestInfo
+ cri,
+ // AlgorithmIdentifier (signature algorithm)
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ // algorithm
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
+ asn1.oidToDer(csr.signatureOid).getBytes()),
+ // parameters
+ _signatureParametersToAsn1(csr.signatureOid, csr.signatureParameters)
+ ]),
+ // signature
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false,
+ String.fromCharCode(0x00) + csr.signature)
+ ]);
+};
+
+/**
+ * Creates a CA store.
+ *
+ * @param certs an optional array of certificate objects or PEM-formatted
+ * certificate strings to add to the CA store.
+ *
+ * @return the CA store.
+ */
+pki.createCaStore = function(certs) {
+ // create CA store
+ var caStore = {
+ // stored certificates
+ certs: {}
+ };
+
+ /**
+ * Gets the certificate that issued the passed certificate or its
+ * 'parent'.
+ *
+ * @param cert the certificate to get the parent for.
+ *
+ * @return the parent certificate or null if none was found.
+ */
+ caStore.getIssuer = function(cert) {
+ var rval = getBySubject(cert.issuer);
+
+ // see if there are multiple matches
+ /*if(forge.util.isArray(rval)) {
+ // TODO: resolve multiple matches by checking
+ // authorityKey/subjectKey/issuerUniqueID/other identifiers, etc.
+ // FIXME: or alternatively do authority key mapping
+ // if possible (X.509v1 certs can't work?)
+ throw new Error('Resolving multiple issuer matches not implemented yet.');
+ }*/
+
+ return rval;
+ };
+
+ /**
+ * Adds a trusted certificate to the store.
+ *
+ * @param cert the certificate to add as a trusted certificate (either a
+ * pki.certificate object or a PEM-formatted certificate).
+ */
+ caStore.addCertificate = function(cert) {
+ // convert from pem if necessary
+ if(typeof cert === 'string') {
+ cert = forge.pki.certificateFromPem(cert);
+ }
+
+ ensureSubjectHasHash(cert.subject);
+
+ if(!caStore.hasCertificate(cert)) { // avoid duplicate certificates in store
+ if(cert.subject.hash in caStore.certs) {
+ // subject hash already exists, append to array
+ var tmp = caStore.certs[cert.subject.hash];
+ if(!forge.util.isArray(tmp)) {
+ tmp = [tmp];
+ }
+ tmp.push(cert);
+ caStore.certs[cert.subject.hash] = tmp;
+ } else {
+ caStore.certs[cert.subject.hash] = cert;
+ }
+ }
+ };
+
+ /**
+ * Checks to see if the given certificate is in the store.
+ *
+ * @param cert the certificate to check (either a pki.certificate or a
+ * PEM-formatted certificate).
+ *
+ * @return true if the certificate is in the store, false if not.
+ */
+ caStore.hasCertificate = function(cert) {
+ // convert from pem if necessary
+ if(typeof cert === 'string') {
+ cert = forge.pki.certificateFromPem(cert);
+ }
+
+ var match = getBySubject(cert.subject);
+ if(!match) {
+ return false;
+ }
+ if(!forge.util.isArray(match)) {
+ match = [match];
+ }
+ // compare DER-encoding of certificates
+ var der1 = asn1.toDer(pki.certificateToAsn1(cert)).getBytes();
+ for(var i = 0; i < match.length; ++i) {
+ var der2 = asn1.toDer(pki.certificateToAsn1(match[i])).getBytes();
+ if(der1 === der2) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+ /**
+ * Lists all of the certificates kept in the store.
+ *
+ * @return an array of all of the pki.certificate objects in the store.
+ */
+ caStore.listAllCertificates = function() {
+ var certList = [];
+
+ for(var hash in caStore.certs) {
+ if(caStore.certs.hasOwnProperty(hash)) {
+ var value = caStore.certs[hash];
+ if(!forge.util.isArray(value)) {
+ certList.push(value);
+ } else {
+ for(var i = 0; i < value.length; ++i) {
+ certList.push(value[i]);
+ }
+ }
+ }
+ }
+
+ return certList;
+ };
+
+ /**
+ * Removes a certificate from the store.
+ *
+ * @param cert the certificate to remove (either a pki.certificate or a
+ * PEM-formatted certificate).
+ *
+ * @return the certificate that was removed or null if the certificate
+ * wasn't in store.
+ */
+ caStore.removeCertificate = function(cert) {
+ var result;
+
+ // convert from pem if necessary
+ if(typeof cert === 'string') {
+ cert = forge.pki.certificateFromPem(cert);
+ }
+ ensureSubjectHasHash(cert.subject);
+ if(!caStore.hasCertificate(cert)) {
+ return null;
+ }
+
+ var match = getBySubject(cert.subject);
+
+ if(!forge.util.isArray(match)) {
+ result = caStore.certs[cert.subject.hash];
+ delete caStore.certs[cert.subject.hash];
+ return result;
+ }
+
+ // compare DER-encoding of certificates
+ var der1 = asn1.toDer(pki.certificateToAsn1(cert)).getBytes();
+ for(var i = 0; i < match.length; ++i) {
+ var der2 = asn1.toDer(pki.certificateToAsn1(match[i])).getBytes();
+ if(der1 === der2) {
+ result = match[i];
+ match.splice(i, 1);
+ }
+ }
+ if(match.length === 0) {
+ delete caStore.certs[cert.subject.hash];
+ }
+
+ return result;
+ };
+
+ function getBySubject(subject) {
+ ensureSubjectHasHash(subject);
+ return caStore.certs[subject.hash] || null;
+ }
+
+ function ensureSubjectHasHash(subject) {
+ // produce subject hash if it doesn't exist
+ if(!subject.hash) {
+ var md = forge.md.sha1.create();
+ subject.attributes = pki.RDNAttributesAsArray(_dnToAsn1(subject), md);
+ subject.hash = md.digest().toHex();
+ }
+ }
+
+ // auto-add passed in certs
+ if(certs) {
+ // parse PEM-formatted certificates as necessary
+ for(var i = 0; i < certs.length; ++i) {
+ var cert = certs[i];
+ caStore.addCertificate(cert);
+ }
+ }
+
+ return caStore;
+};
+
+/**
+ * Certificate verification errors, based on TLS.
+ */
+pki.certificateError = {
+ bad_certificate: 'forge.pki.BadCertificate',
+ unsupported_certificate: 'forge.pki.UnsupportedCertificate',
+ certificate_revoked: 'forge.pki.CertificateRevoked',
+ certificate_expired: 'forge.pki.CertificateExpired',
+ certificate_unknown: 'forge.pki.CertificateUnknown',
+ unknown_ca: 'forge.pki.UnknownCertificateAuthority'
+};
+
+/**
+ * Verifies a certificate chain against the given Certificate Authority store
+ * with an optional custom verify callback.
+ *
+ * @param caStore a certificate store to verify against.
+ * @param chain the certificate chain to verify, with the root or highest
+ * authority at the end (an array of certificates).
+ * @param verify called for every certificate in the chain.
+ *
+ * The verify callback has the following signature:
+ *
+ * verified - Set to true if certificate was verified, otherwise the
+ * pki.certificateError for why the certificate failed.
+ * depth - The current index in the chain, where 0 is the end point's cert.
+ * certs - The certificate chain, *NOTE* an empty chain indicates an anonymous
+ * end point.
+ *
+ * The function returns true on success and on failure either the appropriate
+ * pki.certificateError or an object with 'error' set to the appropriate
+ * pki.certificateError and 'message' set to a custom error message.
+ *
+ * @return true if successful, error thrown if not.
+ */
+pki.verifyCertificateChain = function(caStore, chain, verify) {
+ /* From: RFC3280 - Internet X.509 Public Key Infrastructure Certificate
+ Section 6: Certification Path Validation
+ See inline parentheticals related to this particular implementation.
+
+ The primary goal of path validation is to verify the binding between
+ a subject distinguished name or a subject alternative name and subject
+ public key, as represented in the end entity certificate, based on the
+ public key of the trust anchor. This requires obtaining a sequence of
+ certificates that support that binding. That sequence should be provided
+ in the passed 'chain'. The trust anchor should be in the given CA
+ store. The 'end entity' certificate is the certificate provided by the
+ end point (typically a server) and is the first in the chain.
+
+ To meet this goal, the path validation process verifies, among other
+ things, that a prospective certification path (a sequence of n
+ certificates or a 'chain') satisfies the following conditions:
+
+ (a) for all x in {1, ..., n-1}, the subject of certificate x is
+ the issuer of certificate x+1;
+
+ (b) certificate 1 is issued by the trust anchor;
+
+ (c) certificate n is the certificate to be validated; and
+
+ (d) for all x in {1, ..., n}, the certificate was valid at the
+ time in question.
+
+ Note that here 'n' is index 0 in the chain and 1 is the last certificate
+ in the chain and it must be signed by a certificate in the connection's
+ CA store.
+
+ The path validation process also determines the set of certificate
+ policies that are valid for this path, based on the certificate policies
+ extension, policy mapping extension, policy constraints extension, and
+ inhibit any-policy extension.
+
+ Note: Policy mapping extension not supported (Not Required).
+
+ Note: If the certificate has an unsupported critical extension, then it
+ must be rejected.
+
+ Note: A certificate is self-issued if the DNs that appear in the subject
+ and issuer fields are identical and are not empty.
+
+ The path validation algorithm assumes the following seven inputs are
+ provided to the path processing logic. What this specific implementation
+ will use is provided parenthetically:
+
+ (a) a prospective certification path of length n (the 'chain')
+ (b) the current date/time: ('now').
+ (c) user-initial-policy-set: A set of certificate policy identifiers
+ naming the policies that are acceptable to the certificate user.
+ The user-initial-policy-set contains the special value any-policy
+ if the user is not concerned about certificate policy
+ (Not implemented. Any policy is accepted).
+ (d) trust anchor information, describing a CA that serves as a trust
+ anchor for the certification path. The trust anchor information
+ includes:
+
+ (1) the trusted issuer name,
+ (2) the trusted public key algorithm,
+ (3) the trusted public key, and
+ (4) optionally, the trusted public key parameters associated
+ with the public key.
+
+ (Trust anchors are provided via certificates in the CA store).
+
+ The trust anchor information may be provided to the path processing
+ procedure in the form of a self-signed certificate. The trusted anchor
+ information is trusted because it was delivered to the path processing
+ procedure by some trustworthy out-of-band procedure. If the trusted
+ public key algorithm requires parameters, then the parameters are
+ provided along with the trusted public key (No parameters used in this
+ implementation).
+
+ (e) initial-policy-mapping-inhibit, which indicates if policy mapping is
+ allowed in the certification path.
+ (Not implemented, no policy checking)
+
+ (f) initial-explicit-policy, which indicates if the path must be valid
+ for at least one of the certificate policies in the user-initial-
+ policy-set.
+ (Not implemented, no policy checking)
+
+ (g) initial-any-policy-inhibit, which indicates whether the
+ anyPolicy OID should be processed if it is included in a
+ certificate.
+ (Not implemented, so any policy is valid provided that it is
+ not marked as critical) */
+
+ /* Basic Path Processing:
+
+ For each certificate in the 'chain', the following is checked:
+
+ 1. The certificate validity period includes the current time.
+ 2. The certificate was signed by its parent (where the parent is either
+ the next in the chain or from the CA store). Allow processing to
+ continue to the next step if no parent is found but the certificate is
+ in the CA store.
+ 3. TODO: The certificate has not been revoked.
+ 4. The certificate issuer name matches the parent's subject name.
+ 5. TODO: If the certificate is self-issued and not the final certificate
+ in the chain, skip this step, otherwise verify that the subject name
+ is within one of the permitted subtrees of X.500 distinguished names
+ and that each of the alternative names in the subjectAltName extension
+ (critical or non-critical) is within one of the permitted subtrees for
+ that name type.
+ 6. TODO: If the certificate is self-issued and not the final certificate
+ in the chain, skip this step, otherwise verify that the subject name
+ is not within one of the excluded subtrees for X.500 distinguished
+ names and none of the subjectAltName extension names are excluded for
+ that name type.
+ 7. The other steps in the algorithm for basic path processing involve
+ handling the policy extension which is not presently supported in this
+ implementation. Instead, if a critical policy extension is found, the
+ certificate is rejected as not supported.
+ 8. If the certificate is not the first or if its the only certificate in
+ the chain (having no parent from the CA store or is self-signed) and it
+ has a critical key usage extension, verify that the keyCertSign bit is
+ set. If the key usage extension exists, verify that the basic
+ constraints extension exists. If the basic constraints extension exists,
+ verify that the cA flag is set. If pathLenConstraint is set, ensure that
+ the number of certificates that precede in the chain (come earlier
+ in the chain as implemented below), excluding the very first in the
+ chain (typically the end-entity one), isn't greater than the
+ pathLenConstraint. This constraint limits the number of intermediate
+ CAs that may appear below a CA before only end-entity certificates
+ may be issued. */
+
+ // copy cert chain references to another array to protect against changes
+ // in verify callback
+ chain = chain.slice(0);
+ var certs = chain.slice(0);
+
+ // get current date
+ var now = new Date();
+
+ // verify each cert in the chain using its parent, where the parent
+ // is either the next in the chain or from the CA store
+ var first = true;
+ var error = null;
+ var depth = 0;
+ do {
+ var cert = chain.shift();
+ var parent = null;
+ var selfSigned = false;
+
+ // 1. check valid time
+ if(now < cert.validity.notBefore || now > cert.validity.notAfter) {
+ error = {
+ message: 'Certificate is not valid yet or has expired.',
+ error: pki.certificateError.certificate_expired,
+ notBefore: cert.validity.notBefore,
+ notAfter: cert.validity.notAfter,
+ now: now
+ };
+ }
+
+ // 2. verify with parent from chain or CA store
+ if(error === null) {
+ parent = chain[0] || caStore.getIssuer(cert);
+ if(parent === null) {
+ // check for self-signed cert
+ if(cert.isIssuer(cert)) {
+ selfSigned = true;
+ parent = cert;
+ }
+ }
+
+ if(parent) {
+ // FIXME: current CA store implementation might have multiple
+ // certificates where the issuer can't be determined from the
+ // certificate (happens rarely with, eg: old certificates) so normalize
+ // by always putting parents into an array
+ // TODO: there's may be an extreme degenerate case currently uncovered
+ // where an old intermediate certificate seems to have a matching parent
+ // but none of the parents actually verify ... but the intermediate
+ // is in the CA and it should pass this check; needs investigation
+ var parents = parent;
+ if(!forge.util.isArray(parents)) {
+ parents = [parents];
+ }
+
+ // try to verify with each possible parent (typically only one)
+ var verified = false;
+ while(!verified && parents.length > 0) {
+ parent = parents.shift();
+ try {
+ verified = parent.verify(cert);
+ } catch(ex) {
+ // failure to verify, don't care why, try next one
+ }
+ }
+
+ if(!verified) {
+ error = {
+ message: 'Certificate signature is invalid.',
+ error: pki.certificateError.bad_certificate
+ };
+ }
+ }
+
+ if(error === null && (!parent || selfSigned) &&
+ !caStore.hasCertificate(cert)) {
+ // no parent issuer and certificate itself is not trusted
+ error = {
+ message: 'Certificate is not trusted.',
+ error: pki.certificateError.unknown_ca
+ };
+ }
+ }
+
+ // TODO: 3. check revoked
+
+ // 4. check for matching issuer/subject
+ if(error === null && parent && !cert.isIssuer(parent)) {
+ // parent is not issuer
+ error = {
+ message: 'Certificate issuer is invalid.',
+ error: pki.certificateError.bad_certificate
+ };
+ }
+
+ // 5. TODO: check names with permitted names tree
+
+ // 6. TODO: check names against excluded names tree
+
+ // 7. check for unsupported critical extensions
+ if(error === null) {
+ // supported extensions
+ var se = {
+ keyUsage: true,
+ basicConstraints: true
+ };
+ for(var i = 0; error === null && i < cert.extensions.length; ++i) {
+ var ext = cert.extensions[i];
+ if(ext.critical && !(ext.name in se)) {
+ error = {
+ message:
+ 'Certificate has an unsupported critical extension.',
+ error: pki.certificateError.unsupported_certificate
+ };
+ }
+ }
+ }
+
+ // 8. check for CA if cert is not first or is the only certificate
+ // remaining in chain with no parent or is self-signed
+ if(error === null &&
+ (!first || (chain.length === 0 && (!parent || selfSigned)))) {
+ // first check keyUsage extension and then basic constraints
+ var bcExt = cert.getExtension('basicConstraints');
+ var keyUsageExt = cert.getExtension('keyUsage');
+ if(keyUsageExt !== null) {
+ // keyCertSign must be true and there must be a basic
+ // constraints extension
+ if(!keyUsageExt.keyCertSign || bcExt === null) {
+ // bad certificate
+ error = {
+ message:
+ 'Certificate keyUsage or basicConstraints conflict ' +
+ 'or indicate that the certificate is not a CA. ' +
+ 'If the certificate is the only one in the chain or ' +
+ 'isn\'t the first then the certificate must be a ' +
+ 'valid CA.',
+ error: pki.certificateError.bad_certificate
+ };
+ }
+ }
+ // basic constraints cA flag must be set
+ if(error === null && bcExt !== null && !bcExt.cA) {
+ // bad certificate
+ error = {
+ message:
+ 'Certificate basicConstraints indicates the certificate ' +
+ 'is not a CA.',
+ error: pki.certificateError.bad_certificate
+ };
+ }
+ // if error is not null and keyUsage is available, then we know it
+ // has keyCertSign and there is a basic constraints extension too,
+ // which means we can check pathLenConstraint (if it exists)
+ if(error === null && keyUsageExt !== null &&
+ 'pathLenConstraint' in bcExt) {
+ // pathLen is the maximum # of intermediate CA certs that can be
+ // found between the current certificate and the end-entity (depth 0)
+ // certificate; this number does not include the end-entity (depth 0,
+ // last in the chain) even if it happens to be a CA certificate itself
+ var pathLen = depth - 1;
+ if(pathLen > bcExt.pathLenConstraint) {
+ // pathLenConstraint violated, bad certificate
+ error = {
+ message:
+ 'Certificate basicConstraints pathLenConstraint violated.',
+ error: pki.certificateError.bad_certificate
+ };
+ }
+ }
+ }
+
+ // call application callback
+ var vfd = (error === null) ? true : error.error;
+ var ret = verify ? verify(vfd, depth, certs) : vfd;
+ if(ret === true) {
+ // clear any set error
+ error = null;
+ } else {
+ // if passed basic tests, set default message and alert
+ if(vfd === true) {
+ error = {
+ message: 'The application rejected the certificate.',
+ error: pki.certificateError.bad_certificate
+ };
+ }
+
+ // check for custom error info
+ if(ret || ret === 0) {
+ // set custom message and error
+ if(typeof ret === 'object' && !forge.util.isArray(ret)) {
+ if(ret.message) {
+ error.message = ret.message;
+ }
+ if(ret.error) {
+ error.error = ret.error;
+ }
+ } else if(typeof ret === 'string') {
+ // set custom error
+ error.error = ret;
+ }
+ }
+
+ // throw error
+ throw error;
+ }
+
+ // no longer first cert in chain
+ first = false;
+ ++depth;
+ } while(chain.length > 0);
+
+ return true;
+};
+
+
+/***/ }),
+/* 187 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/**
+ * Javascript implementation of PKCS#1 PSS signature padding.
+ *
+ * @author Stefan Siegl
+ *
+ * Copyright (c) 2012 Stefan Siegl
+ */
+var forge = __webpack_require__(12);
+__webpack_require__(31);
+__webpack_require__(15);
+
+// shortcut for PSS API
+var pss = module.exports = forge.pss = forge.pss || {};
+
+/**
+ * Creates a PSS signature scheme object.
+ *
+ * There are several ways to provide a salt for encoding:
+ *
+ * 1. Specify the saltLength only and the built-in PRNG will generate it.
+ * 2. Specify the saltLength and a custom PRNG with 'getBytesSync' defined that
+ * will be used.
+ * 3. Specify the salt itself as a forge.util.ByteBuffer.
+ *
+ * @param options the options to use:
+ * md the message digest object to use, a forge md instance.
+ * mgf the mask generation function to use, a forge mgf instance.
+ * [saltLength] the length of the salt in octets.
+ * [prng] the pseudo-random number generator to use to produce a salt.
+ * [salt] the salt to use when encoding.
+ *
+ * @return a signature scheme object.
+ */
+pss.create = function(options) {
+ // backwards compatibility w/legacy args: hash, mgf, sLen
+ if(arguments.length === 3) {
+ options = {
+ md: arguments[0],
+ mgf: arguments[1],
+ saltLength: arguments[2]
+ };
+ }
+
+ var hash = options.md;
+ var mgf = options.mgf;
+ var hLen = hash.digestLength;
+
+ var salt_ = options.salt || null;
+ if(typeof salt_ === 'string') {
+ // assume binary-encoded string
+ salt_ = forge.util.createBuffer(salt_);
+ }
+
+ var sLen;
+ if('saltLength' in options) {
+ sLen = options.saltLength;
+ } else if(salt_ !== null) {
+ sLen = salt_.length();
+ } else {
+ throw new Error('Salt length not specified or specific salt not given.');
+ }
+
+ if(salt_ !== null && salt_.length() !== sLen) {
+ throw new Error('Given salt length does not match length of given salt.');
+ }
+
+ var prng = options.prng || forge.random;
+
+ var pssobj = {};
+
+ /**
+ * Encodes a PSS signature.
+ *
+ * This function implements EMSA-PSS-ENCODE as per RFC 3447, section 9.1.1.
+ *
+ * @param md the message digest object with the hash to sign.
+ * @param modsBits the length of the RSA modulus in bits.
+ *
+ * @return the encoded message as a binary-encoded string of length
+ * ceil((modBits - 1) / 8).
+ */
+ pssobj.encode = function(md, modBits) {
+ var i;
+ var emBits = modBits - 1;
+ var emLen = Math.ceil(emBits / 8);
+
+ /* 2. Let mHash = Hash(M), an octet string of length hLen. */
+ var mHash = md.digest().getBytes();
+
+ /* 3. If emLen < hLen + sLen + 2, output "encoding error" and stop. */
+ if(emLen < hLen + sLen + 2) {
+ throw new Error('Message is too long to encrypt.');
+ }
+
+ /* 4. Generate a random octet string salt of length sLen; if sLen = 0,
+ * then salt is the empty string. */
+ var salt;
+ if(salt_ === null) {
+ salt = prng.getBytesSync(sLen);
+ } else {
+ salt = salt_.bytes();
+ }
+
+ /* 5. Let M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt; */
+ var m_ = new forge.util.ByteBuffer();
+ m_.fillWithByte(0, 8);
+ m_.putBytes(mHash);
+ m_.putBytes(salt);
+
+ /* 6. Let H = Hash(M'), an octet string of length hLen. */
+ hash.start();
+ hash.update(m_.getBytes());
+ var h = hash.digest().getBytes();
+
+ /* 7. Generate an octet string PS consisting of emLen - sLen - hLen - 2
+ * zero octets. The length of PS may be 0. */
+ var ps = new forge.util.ByteBuffer();
+ ps.fillWithByte(0, emLen - sLen - hLen - 2);
+
+ /* 8. Let DB = PS || 0x01 || salt; DB is an octet string of length
+ * emLen - hLen - 1. */
+ ps.putByte(0x01);
+ ps.putBytes(salt);
+ var db = ps.getBytes();
+
+ /* 9. Let dbMask = MGF(H, emLen - hLen - 1). */
+ var maskLen = emLen - hLen - 1;
+ var dbMask = mgf.generate(h, maskLen);
+
+ /* 10. Let maskedDB = DB \xor dbMask. */
+ var maskedDB = '';
+ for(i = 0; i < maskLen; i++) {
+ maskedDB += String.fromCharCode(db.charCodeAt(i) ^ dbMask.charCodeAt(i));
+ }
+
+ /* 11. Set the leftmost 8emLen - emBits bits of the leftmost octet in
+ * maskedDB to zero. */
+ var mask = (0xFF00 >> (8 * emLen - emBits)) & 0xFF;
+ maskedDB = String.fromCharCode(maskedDB.charCodeAt(0) & ~mask) +
+ maskedDB.substr(1);
+
+ /* 12. Let EM = maskedDB || H || 0xbc.
+ * 13. Output EM. */
+ return maskedDB + h + String.fromCharCode(0xbc);
+ };
+
+ /**
+ * Verifies a PSS signature.
+ *
+ * This function implements EMSA-PSS-VERIFY as per RFC 3447, section 9.1.2.
+ *
+ * @param mHash the message digest hash, as a binary-encoded string, to
+ * compare against the signature.
+ * @param em the encoded message, as a binary-encoded string
+ * (RSA decryption result).
+ * @param modsBits the length of the RSA modulus in bits.
+ *
+ * @return true if the signature was verified, false if not.
+ */
+ pssobj.verify = function(mHash, em, modBits) {
+ var i;
+ var emBits = modBits - 1;
+ var emLen = Math.ceil(emBits / 8);
+
+ /* c. Convert the message representative m to an encoded message EM
+ * of length emLen = ceil((modBits - 1) / 8) octets, where modBits
+ * is the length in bits of the RSA modulus n */
+ em = em.substr(-emLen);
+
+ /* 3. If emLen < hLen + sLen + 2, output "inconsistent" and stop. */
+ if(emLen < hLen + sLen + 2) {
+ throw new Error('Inconsistent parameters to PSS signature verification.');
+ }
+
+ /* 4. If the rightmost octet of EM does not have hexadecimal value
+ * 0xbc, output "inconsistent" and stop. */
+ if(em.charCodeAt(emLen - 1) !== 0xbc) {
+ throw new Error('Encoded message does not end in 0xBC.');
+ }
+
+ /* 5. Let maskedDB be the leftmost emLen - hLen - 1 octets of EM, and
+ * let H be the next hLen octets. */
+ var maskLen = emLen - hLen - 1;
+ var maskedDB = em.substr(0, maskLen);
+ var h = em.substr(maskLen, hLen);
+
+ /* 6. If the leftmost 8emLen - emBits bits of the leftmost octet in
+ * maskedDB are not all equal to zero, output "inconsistent" and stop. */
+ var mask = (0xFF00 >> (8 * emLen - emBits)) & 0xFF;
+ if((maskedDB.charCodeAt(0) & mask) !== 0) {
+ throw new Error('Bits beyond keysize not zero as expected.');
+ }
+
+ /* 7. Let dbMask = MGF(H, emLen - hLen - 1). */
+ var dbMask = mgf.generate(h, maskLen);
+
+ /* 8. Let DB = maskedDB \xor dbMask. */
+ var db = '';
+ for(i = 0; i < maskLen; i++) {
+ db += String.fromCharCode(maskedDB.charCodeAt(i) ^ dbMask.charCodeAt(i));
+ }
+
+ /* 9. Set the leftmost 8emLen - emBits bits of the leftmost octet
+ * in DB to zero. */
+ db = String.fromCharCode(db.charCodeAt(0) & ~mask) + db.substr(1);
+
+ /* 10. If the emLen - hLen - sLen - 2 leftmost octets of DB are not zero
+ * or if the octet at position emLen - hLen - sLen - 1 (the leftmost
+ * position is "position 1") does not have hexadecimal value 0x01,
+ * output "inconsistent" and stop. */
+ var checkLen = emLen - hLen - sLen - 2;
+ for(i = 0; i < checkLen; i++) {
+ if(db.charCodeAt(i) !== 0x00) {
+ throw new Error('Leftmost octets not zero as expected');
+ }
+ }
+
+ if(db.charCodeAt(checkLen) !== 0x01) {
+ throw new Error('Inconsistent PSS signature, 0x01 marker not found');
+ }
+
+ /* 11. Let salt be the last sLen octets of DB. */
+ var salt = db.substr(-sLen);
+
+ /* 12. Let M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt */
+ var m_ = new forge.util.ByteBuffer();
+ m_.fillWithByte(0, 8);
+ m_.putBytes(mHash);
+ m_.putBytes(salt);
+
+ /* 13. Let H' = Hash(M'), an octet string of length hLen. */
+ hash.start();
+ hash.update(m_.getBytes());
+ var h_ = hash.digest().getBytes();
+
+ /* 14. If H = H', output "consistent." Otherwise, output "inconsistent." */
+ return h === h_;
+ };
+
+ return pssobj;
+};
+
+
+/***/ }),
+/* 188 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(process) {/**
+ * Copyright (c) 2014-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
+
+
+
+var emptyFunction = __webpack_require__(68);
+
+/**
+ * Similar to invariant but only logs a warning if the condition is not met.
+ * This can be used to log issues in development environments in critical
+ * paths. Removing the logging code for production environments will keep the
+ * same logic and follow the same code paths.
+ */
+
+var warning = emptyFunction;
+
+if (process.env.NODE_ENV !== 'production') {
+ var printWarning = function printWarning(format) {
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
+
+ var argIndex = 0;
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
+ return args[argIndex++];
+ });
+ if (typeof console !== 'undefined') {
+ console.error(message);
+ }
+ try {
+ // --- Welcome to debugging React ---
+ // This error was thrown as a convenience so that you can use this stack
+ // to find the callsite that caused this warning to fire.
+ throw new Error(message);
+ } catch (x) {}
+ };
+
+ warning = function warning(condition, format) {
+ if (format === undefined) {
+ throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
+ }
+
+ if (format.indexOf('Failed Composite propType: ') === 0) {
+ return; // Ignore CompositeComponent proptype check.
+ }
+
+ if (!condition) {
+ for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
+ args[_key2 - 2] = arguments[_key2];
+ }
+
+ printWarning.apply(undefined, [format].concat(args));
+ }
+ };
+}
+
+module.exports = warning;
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
+
+/***/ }),
+/* 189 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
+
+
+
+var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
+
+/**
+ * Simple, lightweight module assisting with the detection and context of
+ * Worker. Helps avoid circular dependencies and allows code to reason about
+ * whether or not they are in a Worker, even if they never include the main
+ * `ReactWorker` dependency.
+ */
+var ExecutionEnvironment = {
+
+ canUseDOM: canUseDOM,
+
+ canUseWorkers: typeof Worker !== 'undefined',
+
+ canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
+
+ canUseViewport: canUseDOM && !!window.screen,
+
+ isInWorker: !canUseDOM // For now, this is true - might change in the future.
+
+};
+
+module.exports = ExecutionEnvironment;
+
+/***/ }),
+/* 190 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @typechecks
+ */
+
+/* eslint-disable fb-www/typeof-undefined */
+
+/**
+ * Same as document.activeElement but wraps in a try-catch block. In IE it is
+ * not safe to call document.activeElement if there is nothing focused.
+ *
+ * The activeElement will be null only if the document or document body is not
+ * yet defined.
+ *
+ * @param {?DOMDocument} doc Defaults to current document.
+ * @return {?DOMElement}
+ */
+function getActiveElement(doc) /*?DOMElement*/{
+ doc = doc || (typeof document !== 'undefined' ? document : undefined);
+ if (typeof doc === 'undefined') {
+ return null;
+ }
+ try {
+ return doc.activeElement || doc.body;
+ } catch (e) {
+ return doc.body;
+ }
+}
+
+module.exports = getActiveElement;
+
+/***/ }),
+/* 191 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @typechecks
+ *
+ */
+
+/*eslint-disable no-self-compare */
+
+
+
+var hasOwnProperty = Object.prototype.hasOwnProperty;
+
+/**
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
+ */
+function is(x, y) {
+ // SameValue algorithm
+ if (x === y) {
+ // Steps 1-5, 7-10
+ // Steps 6.b-6.e: +0 != -0
+ // Added the nonzero y check to make Flow happy, but it is redundant
+ return x !== 0 || y !== 0 || 1 / x === 1 / y;
+ } else {
+ // Step 6.a: NaN == NaN
+ return x !== x && y !== y;
+ }
+}
+
+/**
+ * Performs equality by iterating through keys on an object and returning false
+ * when any key has values which are not strictly equal between the arguments.
+ * Returns true when the values of all keys are strictly equal.
+ */
+function shallowEqual(objA, objB) {
+ if (is(objA, objB)) {
+ return true;
+ }
+
+ if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
+ return false;
+ }
+
+ var keysA = Object.keys(objA);
+ var keysB = Object.keys(objB);
+
+ if (keysA.length !== keysB.length) {
+ return false;
+ }
+
+ // Test for A's keys different from B.
+ for (var i = 0; i < keysA.length; i++) {
+ if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+module.exports = shallowEqual;
+
+/***/ }),
+/* 192 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ *
+ */
+
+var isTextNode = __webpack_require__(341);
+
+/*eslint-disable no-bitwise */
+
+/**
+ * Checks if a given DOM node contains or is another DOM node.
+ */
+function containsNode(outerNode, innerNode) {
+ if (!outerNode || !innerNode) {
+ return false;
+ } else if (outerNode === innerNode) {
+ return true;
+ } else if (isTextNode(outerNode)) {
+ return false;
+ } else if (isTextNode(innerNode)) {
+ return containsNode(outerNode, innerNode.parentNode);
+ } else if ('contains' in outerNode) {
+ return outerNode.contains(innerNode);
+ } else if (outerNode.compareDocumentPosition) {
+ return !!(outerNode.compareDocumentPosition(innerNode) & 16);
+ } else {
+ return false;
+ }
+}
+
+module.exports = containsNode;
+
+/***/ }),
+/* 193 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Accordion__ = __webpack_require__(348);
+/* unused harmony reexport Accordion */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Alert__ = __webpack_require__(389);
+/* unused harmony reexport Alert */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Badge__ = __webpack_require__(392);
+/* unused harmony reexport Badge */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Breadcrumb__ = __webpack_require__(393);
+/* unused harmony reexport Breadcrumb */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__BreadcrumbItem__ = __webpack_require__(209);
+/* unused harmony reexport BreadcrumbItem */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Button__ = __webpack_require__(74);
+/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_5__Button__["a"]; });
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ButtonGroup__ = __webpack_require__(141);
+/* unused harmony reexport ButtonGroup */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ButtonToolbar__ = __webpack_require__(397);
+/* unused harmony reexport ButtonToolbar */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Carousel__ = __webpack_require__(398);
+/* unused harmony reexport Carousel */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__CarouselItem__ = __webpack_require__(210);
+/* unused harmony reexport CarouselItem */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__Checkbox__ = __webpack_require__(408);
+/* unused harmony reexport Checkbox */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__Clearfix__ = __webpack_require__(409);
+/* unused harmony reexport Clearfix */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__CloseButton__ = __webpack_require__(140);
+/* unused harmony reexport CloseButton */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__ControlLabel__ = __webpack_require__(410);
+/* unused harmony reexport ControlLabel */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__Col__ = __webpack_require__(411);
+/* unused harmony reexport Col */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__Collapse__ = __webpack_require__(144);
+/* unused harmony reexport Collapse */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__Dropdown__ = __webpack_require__(99);
+/* unused harmony reexport Dropdown */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__DropdownButton__ = __webpack_require__(424);
+/* unused harmony reexport DropdownButton */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__Fade__ = __webpack_require__(102);
+/* unused harmony reexport Fade */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__Form__ = __webpack_require__(425);
+/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_19__Form__["a"]; });
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__FormControl__ = __webpack_require__(426);
+/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_20__FormControl__["a"]; });
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__FormGroup__ = __webpack_require__(429);
+/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_21__FormGroup__["a"]; });
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__Glyphicon__ = __webpack_require__(143);
+/* unused harmony reexport Glyphicon */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__Grid__ = __webpack_require__(218);
+/* unused harmony reexport Grid */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__HelpBlock__ = __webpack_require__(430);
+/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_24__HelpBlock__["a"]; });
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__Image__ = __webpack_require__(431);
+/* unused harmony reexport Image */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__InputGroup__ = __webpack_require__(432);
+/* unused harmony reexport InputGroup */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__Jumbotron__ = __webpack_require__(435);
+/* unused harmony reexport Jumbotron */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__Label__ = __webpack_require__(436);
+/* unused harmony reexport Label */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__ListGroup__ = __webpack_require__(437);
+/* unused harmony reexport ListGroup */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__ListGroupItem__ = __webpack_require__(219);
+/* unused harmony reexport ListGroupItem */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__Media__ = __webpack_require__(103);
+/* unused harmony reexport Media */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__MenuItem__ = __webpack_require__(444);
+/* unused harmony reexport MenuItem */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__Modal__ = __webpack_require__(445);
+/* unused harmony reexport Modal */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__ModalBody__ = __webpack_require__(224);
+/* unused harmony reexport ModalBody */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__ModalFooter__ = __webpack_require__(225);
+/* unused harmony reexport ModalFooter */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__ModalHeader__ = __webpack_require__(226);
+/* unused harmony reexport ModalHeader */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__ModalTitle__ = __webpack_require__(227);
+/* unused harmony reexport ModalTitle */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__Nav__ = __webpack_require__(228);
+/* unused harmony reexport Nav */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__Navbar__ = __webpack_require__(461);
+/* unused harmony reexport Navbar */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__NavbarBrand__ = __webpack_require__(229);
+/* unused harmony reexport NavbarBrand */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__NavDropdown__ = __webpack_require__(465);
+/* unused harmony reexport NavDropdown */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__NavItem__ = __webpack_require__(230);
+/* unused harmony reexport NavItem */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__Overlay__ = __webpack_require__(231);
+/* unused harmony reexport Overlay */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__OverlayTrigger__ = __webpack_require__(472);
+/* unused harmony reexport OverlayTrigger */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__PageHeader__ = __webpack_require__(473);
+/* unused harmony reexport PageHeader */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__PageItem__ = __webpack_require__(474);
+/* unused harmony reexport PageItem */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__Pager__ = __webpack_require__(476);
+/* unused harmony reexport Pager */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__Pagination__ = __webpack_require__(477);
+/* unused harmony reexport Pagination */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__Panel__ = __webpack_require__(479);
+/* unused harmony reexport Panel */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__PanelGroup__ = __webpack_require__(205);
+/* unused harmony reexport PanelGroup */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__Popover__ = __webpack_require__(485);
+/* unused harmony reexport Popover */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__ProgressBar__ = __webpack_require__(486);
+/* unused harmony reexport ProgressBar */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__Radio__ = __webpack_require__(487);
+/* unused harmony reexport Radio */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__ResponsiveEmbed__ = __webpack_require__(488);
+/* unused harmony reexport ResponsiveEmbed */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__Row__ = __webpack_require__(489);
+/* unused harmony reexport Row */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__SafeAnchor__ = __webpack_require__(27);
+/* unused harmony reexport SafeAnchor */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__SplitButton__ = __webpack_require__(490);
+/* unused harmony reexport SplitButton */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__Tab__ = __webpack_require__(492);
+/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_58__Tab__["a"]; });
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__TabContainer__ = __webpack_require__(149);
+/* unused harmony reexport TabContainer */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__TabContent__ = __webpack_require__(150);
+/* unused harmony reexport TabContent */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__Table__ = __webpack_require__(493);
+/* unused harmony reexport Table */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__TabPane__ = __webpack_require__(237);
+/* unused harmony reexport TabPane */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__Tabs__ = __webpack_require__(494);
+/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_63__Tabs__["a"]; });
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__Thumbnail__ = __webpack_require__(495);
+/* unused harmony reexport Thumbnail */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__ToggleButton__ = __webpack_require__(238);
+/* unused harmony reexport ToggleButton */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__ToggleButtonGroup__ = __webpack_require__(496);
+/* unused harmony reexport ToggleButtonGroup */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__Tooltip__ = __webpack_require__(497);
+/* unused harmony reexport Tooltip */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__Well__ = __webpack_require__(498);
+/* unused harmony reexport Well */
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__utils__ = __webpack_require__(499);
+/* unused harmony reexport utils */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/***/ }),
+/* 194 */
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = { "default": __webpack_require__(349), __esModule: true };
+
+/***/ }),
+/* 195 */
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = !__webpack_require__(56) && !__webpack_require__(69)(function () {
+ return Object.defineProperty(__webpack_require__(196)('div'), 'a', { get: function () { return 7; } }).a != 7;
+});
+
+
+/***/ }),
+/* 196 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isObject = __webpack_require__(55);
+var document = __webpack_require__(38).document;
+// typeof document.createElement is 'object' in old IE
+var is = isObject(document) && isObject(document.createElement);
+module.exports = function (it) {
+ return is ? document.createElement(it) : {};
+};
+
+
+/***/ }),
+/* 197 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var has = __webpack_require__(43);
+var toIObject = __webpack_require__(44);
+var arrayIndexOf = __webpack_require__(353)(false);
+var IE_PROTO = __webpack_require__(130)('IE_PROTO');
+
+module.exports = function (object, names) {
+ var O = toIObject(object);
+ var i = 0;
+ var result = [];
+ var key;
+ for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
+ // Don't enum bug & hidden keys
+ while (names.length > i) if (has(O, key = names[i++])) {
+ ~arrayIndexOf(result, key) || result.push(key);
+ }
+ return result;
+};
+
+
+/***/ }),
+/* 198 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// fallback for non-array-like ES3 and non-enumerable old V8 strings
+var cof = __webpack_require__(127);
+// eslint-disable-next-line no-prototype-builtins
+module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
+ return cof(it) == 'String' ? it.split('') : Object(it);
+};
+
+
+/***/ }),
+/* 199 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// 7.1.15 ToLength
+var toInteger = __webpack_require__(129);
+var min = Math.min;
+module.exports = function (it) {
+ return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
+};
+
+
+/***/ }),
+/* 200 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+var $at = __webpack_require__(357)(true);
+
+// 21.1.3.27 String.prototype[@@iterator]()
+__webpack_require__(201)(String, 'String', function (iterated) {
+ this._t = String(iterated); // target
+ this._i = 0; // next index
+// 21.1.5.2.1 %StringIteratorPrototype%.next()
+}, function () {
+ var O = this._t;
+ var index = this._i;
+ var point;
+ if (index >= O.length) return { value: undefined, done: true };
+ point = $at(O, index);
+ this._i += point.length;
+ return { value: point, done: false };
+});
+
+
+/***/ }),
+/* 201 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+var LIBRARY = __webpack_require__(94);
+var $export = __webpack_require__(37);
+var redefine = __webpack_require__(202);
+var hide = __webpack_require__(53);
+var Iterators = __webpack_require__(73);
+var $iterCreate = __webpack_require__(358);
+var setToStringTag = __webpack_require__(137);
+var getPrototypeOf = __webpack_require__(361);
+var ITERATOR = __webpack_require__(32)('iterator');
+var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
+var FF_ITERATOR = '@@iterator';
+var KEYS = 'keys';
+var VALUES = 'values';
+
+var returnThis = function () { return this; };
+
+module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
+ $iterCreate(Constructor, NAME, next);
+ var getMethod = function (kind) {
+ if (!BUGGY && kind in proto) return proto[kind];
+ switch (kind) {
+ case KEYS: return function keys() { return new Constructor(this, kind); };
+ case VALUES: return function values() { return new Constructor(this, kind); };
+ } return function entries() { return new Constructor(this, kind); };
+ };
+ var TAG = NAME + ' Iterator';
+ var DEF_VALUES = DEFAULT == VALUES;
+ var VALUES_BUG = false;
+ var proto = Base.prototype;
+ var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
+ var $default = $native || getMethod(DEFAULT);
+ var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
+ var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
+ var methods, key, IteratorPrototype;
+ // Fix native
+ if ($anyNative) {
+ IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
+ if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
+ // Set @@toStringTag to native iterators
+ setToStringTag(IteratorPrototype, TAG, true);
+ // fix for some old engines
+ if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
+ }
+ }
+ // fix Array#{values, @@iterator}.name in V8 / FF
+ if (DEF_VALUES && $native && $native.name !== VALUES) {
+ VALUES_BUG = true;
+ $default = function values() { return $native.call(this); };
+ }
+ // Define iterator
+ if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
+ hide(proto, ITERATOR, $default);
+ }
+ // Plug for library
+ Iterators[NAME] = $default;
+ Iterators[TAG] = returnThis;
+ if (DEFAULT) {
+ methods = {
+ values: DEF_VALUES ? $default : getMethod(VALUES),
+ keys: IS_SET ? $default : getMethod(KEYS),
+ entries: $entries
+ };
+ if (FORCED) for (key in methods) {
+ if (!(key in proto)) redefine(proto, key, methods[key]);
+ } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
+ }
+ return methods;
+};
+
+
+/***/ }),
+/* 202 */
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = __webpack_require__(53);
+
+
+/***/ }),
+/* 203 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
+var $keys = __webpack_require__(197);
+var hiddenKeys = __webpack_require__(132).concat('length', 'prototype');
+
+exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
+ return $keys(O, hiddenKeys);
+};
+
+
+/***/ }),
+/* 204 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var pIE = __webpack_require__(72);
+var createDesc = __webpack_require__(70);
+var toIObject = __webpack_require__(44);
+var toPrimitive = __webpack_require__(126);
+var has = __webpack_require__(43);
+var IE8_DOM_DEFINE = __webpack_require__(195);
+var gOPD = Object.getOwnPropertyDescriptor;
+
+exports.f = __webpack_require__(56) ? gOPD : function getOwnPropertyDescriptor(O, P) {
+ O = toIObject(O);
+ P = toPrimitive(P, true);
+ if (IE8_DOM_DEFINE) try {
+ return gOPD(O, P);
+ } catch (e) { /* empty */ }
+ if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
+};
+
+
+/***/ }),
+/* 205 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_uncontrollable__ = __webpack_require__(45);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_uncontrollable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_uncontrollable__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__ = __webpack_require__(9);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils_ValidComponentChildren__ = __webpack_require__(23);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__utils_PropTypes__ = __webpack_require__(208);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ accordion: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
+ /**
+ * When `accordion` is enabled, `activeKey` controls the which child `Panel` is expanded. `activeKey` should
+ * match a child Panel `eventKey` prop exactly.
+ *
+ * @controllable onSelect
+ */
+ activeKey: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any,
+
+ /**
+ * A callback fired when a child Panel collapse state changes. It's called with the next expanded `activeKey`
+ *
+ * @controllable activeKey
+ */
+ onSelect: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
+
+ /**
+ * An HTML role attribute
+ */
+ role: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,
+
+ /**
+ * A function that takes an eventKey and type and returns a
+ * unique id for each Panel heading and Panel Collapse. The function _must_ be a pure function,
+ * meaning it should always return the _same_ id for the same set of inputs. The default
+ * value requires that an `id` to be set for the PanelGroup.
+ *
+ * The `type` argument will either be `"body"` or `"heading"`.
+ *
+ * @defaultValue (eventKey, type) => `${this.props.id}-${type}-${key}`
+ */
+ generateChildId: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
+
+ /**
+ * HTML id attribute, required if no `generateChildId` prop
+ * is specified.
+ */
+ id: Object(__WEBPACK_IMPORTED_MODULE_11__utils_PropTypes__["b" /* generatedId */])('PanelGroup')
+};
+
+var defaultProps = {
+ accordion: false
+};
+
+var childContextTypes = {
+ $bs_panelGroup: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.shape({
+ getId: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
+ headerRole: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,
+ panelRole: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,
+ activeKey: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any,
+ onToggle: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func
+ })
+};
+
+var PanelGroup = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(PanelGroup, _React$Component);
+
+ function PanelGroup() {
+ var _temp, _this, _ret;
+
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, PanelGroup);
+
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ return _ret = (_temp = (_this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleSelect = function (key, expanded, e) {
+ if (expanded) {
+ _this.props.onSelect(key, e);
+ } else if (_this.props.activeKey === key) {
+ _this.props.onSelect(null, e);
+ }
+ }, _temp), __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(_this, _ret);
+ }
+
+ PanelGroup.prototype.getChildContext = function getChildContext() {
+ var _props = this.props,
+ activeKey = _props.activeKey,
+ accordion = _props.accordion,
+ generateChildId = _props.generateChildId,
+ id = _props.id;
+
+ var getId = null;
+
+ if (accordion) {
+ getId = generateChildId || function (key, type) {
+ return id ? id + '-' + type + '-' + key : null;
+ };
+ }
+
+ return {
+ $bs_panelGroup: __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({
+ getId: getId,
+ headerRole: 'tab',
+ panelRole: 'tabpanel'
+ }, accordion && {
+ activeKey: activeKey,
+ onToggle: this.handleSelect
+ })
+ };
+ };
+
+ PanelGroup.prototype.render = function render() {
+ var _props2 = this.props,
+ accordion = _props2.accordion,
+ className = _props2.className,
+ children = _props2.children,
+ props = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default()(_props2, ['accordion', 'className', 'children']);
+
+ var _splitBsPropsAndOmit = Object(__WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__["g" /* splitBsPropsAndOmit */])(props, ['onSelect', 'activeKey']),
+ bsProps = _splitBsPropsAndOmit[0],
+ elementProps = _splitBsPropsAndOmit[1];
+
+ if (accordion) {
+ elementProps.role = elementProps.role || 'tablist';
+ }
+
+ var classes = Object(__WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__["d" /* getClassSet */])(bsProps);
+
+ return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
+ 'div',
+ __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, elementProps, { className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, classes) }),
+ __WEBPACK_IMPORTED_MODULE_10__utils_ValidComponentChildren__["a" /* default */].map(children, function (child) {
+ return Object(__WEBPACK_IMPORTED_MODULE_7_react__["cloneElement"])(child, {
+ bsStyle: child.props.bsStyle || bsProps.bsStyle
+ });
+ })
+ );
+ };
+
+ return PanelGroup;
+}(__WEBPACK_IMPORTED_MODULE_7_react___default.a.Component);
+
+PanelGroup.propTypes = propTypes;
+PanelGroup.defaultProps = defaultProps;
+PanelGroup.childContextTypes = childContextTypes;
+
+/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_8_uncontrollable___default()(Object(__WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__["a" /* bsClass */])('panel-group', PanelGroup), {
+ activeKey: 'onSelect'
+}));
+
+/***/ }),
+/* 206 */
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = { "default": __webpack_require__(387), __esModule: true };
+
+/***/ }),
+/* 207 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getKeys = __webpack_require__(71);
+var toIObject = __webpack_require__(44);
+var isEnum = __webpack_require__(72).f;
+module.exports = function (isEntries) {
+ return function (it) {
+ var O = toIObject(it);
+ var keys = getKeys(O);
+ var length = keys.length;
+ var i = 0;
+ var result = [];
+ var key;
+ while (length > i) if (isEnum.call(O, key = keys[i++])) {
+ result.push(isEntries ? [key, O[key]] : O[key]);
+ } return result;
+ };
+};
+
+
+/***/ }),
+/* 208 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony export (immutable) */ __webpack_exports__["b"] = generatedId;
+/* harmony export (immutable) */ __webpack_exports__["c"] = requiredRoles;
+/* harmony export (immutable) */ __webpack_exports__["a"] = exclusiveRoles;
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types_extra_lib_utils_createChainableTypeChecker__ = __webpack_require__(97);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types_extra_lib_utils_createChainableTypeChecker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types_extra_lib_utils_createChainableTypeChecker__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ValidComponentChildren__ = __webpack_require__(23);
+
+
+
+
+
+var idPropType = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.number]);
+
+function generatedId(name) {
+ return function (props) {
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
+
+ var error = null;
+
+ if (!props.generateChildId) {
+ error = idPropType.apply(undefined, [props].concat(args));
+
+ if (!error && !props.id) {
+ error = new Error('In order to properly initialize the ' + name + ' in a way that is accessible to assistive technologies ' + ('(such as screen readers) an `id` or a `generateChildId` prop to ' + name + ' is required'));
+ }
+ }
+ return error;
+ };
+}
+
+function requiredRoles() {
+ for (var _len2 = arguments.length, roles = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
+ roles[_key2] = arguments[_key2];
+ }
+
+ return __WEBPACK_IMPORTED_MODULE_1_prop_types_extra_lib_utils_createChainableTypeChecker___default()(function (props, propName, component) {
+ var missing = void 0;
+
+ roles.every(function (role) {
+ if (!__WEBPACK_IMPORTED_MODULE_2__ValidComponentChildren__["a" /* default */].some(props.children, function (child) {
+ return child.props.bsRole === role;
+ })) {
+ missing = role;
+ return false;
+ }
+
+ return true;
+ });
+
+ if (missing) {
+ return new Error('(children) ' + component + ' - Missing a required child with bsRole: ' + (missing + '. ' + component + ' must have at least one child of each of ') + ('the following bsRoles: ' + roles.join(', ')));
+ }
+
+ return null;
+ });
+}
+
+function exclusiveRoles() {
+ for (var _len3 = arguments.length, roles = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
+ roles[_key3] = arguments[_key3];
+ }
+
+ return __WEBPACK_IMPORTED_MODULE_1_prop_types_extra_lib_utils_createChainableTypeChecker___default()(function (props, propName, component) {
+ var duplicate = void 0;
+
+ roles.every(function (role) {
+ var childrenWithRole = __WEBPACK_IMPORTED_MODULE_2__ValidComponentChildren__["a" /* default */].filter(props.children, function (child) {
+ return child.props.bsRole === role;
+ });
+
+ if (childrenWithRole.length > 1) {
+ duplicate = role;
+ return false;
+ }
+
+ return true;
+ });
+
+ if (duplicate) {
+ return new Error('(children) ' + component + ' - Duplicate children detected of bsRole: ' + (duplicate + '. Only one child each allowed with the following ') + ('bsRoles: ' + roles.join(', ')));
+ }
+
+ return null;
+ });
+}
+
+/***/ }),
+/* 209 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__SafeAnchor__ = __webpack_require__(27);
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ /**
+ * If set to true, renders `span` instead of `a`
+ */
+ active: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ /**
+ * `href` attribute for the inner `a` element
+ */
+ href: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,
+ /**
+ * `title` attribute for the inner `a` element
+ */
+ title: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.node,
+ /**
+ * `target` attribute for the inner `a` element
+ */
+ target: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string
+};
+
+var defaultProps = {
+ active: false
+};
+
+var BreadcrumbItem = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(BreadcrumbItem, _React$Component);
+
+ function BreadcrumbItem() {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, BreadcrumbItem);
+
+ return __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ BreadcrumbItem.prototype.render = function render() {
+ var _props = this.props,
+ active = _props.active,
+ href = _props.href,
+ title = _props.title,
+ target = _props.target,
+ className = _props.className,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['active', 'href', 'title', 'target', 'className']);
+
+ // Don't try to render these props on non-active .
+
+
+ var linkProps = { href: href, title: title, target: target };
+
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
+ 'li',
+ { className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, { active: active }) },
+ active ? __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('span', props) : __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8__SafeAnchor__["a" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, props, linkProps))
+ );
+ };
+
+ return BreadcrumbItem;
+}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
+
+BreadcrumbItem.propTypes = propTypes;
+BreadcrumbItem.defaultProps = defaultProps;
+
+/* harmony default export */ __webpack_exports__["a"] = (BreadcrumbItem);
+
+/***/ }),
+/* 210 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react_dom__ = __webpack_require__(22);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_react_dom__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_dom_helpers_transition__ = __webpack_require__(400);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_dom_helpers_transition___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_dom_helpers_transition__);
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ direction: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOf(['prev', 'next']),
+ onAnimateOutEnd: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+ active: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ animateIn: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ animateOut: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ index: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.number
+};
+
+var defaultProps = {
+ active: false,
+ animateIn: false,
+ animateOut: false
+};
+
+var CarouselItem = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(CarouselItem, _React$Component);
+
+ function CarouselItem(props, context) {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, CarouselItem);
+
+ var _this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.call(this, props, context));
+
+ _this.handleAnimateOutEnd = _this.handleAnimateOutEnd.bind(_this);
+
+ _this.state = {
+ direction: null
+ };
+
+ _this.isUnmounted = false;
+ return _this;
+ }
+
+ CarouselItem.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
+ if (this.props.active !== nextProps.active) {
+ this.setState({ direction: null });
+ }
+ };
+
+ CarouselItem.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
+ var _this2 = this;
+
+ var active = this.props.active;
+
+ var prevActive = prevProps.active;
+
+ if (!active && prevActive) {
+ __WEBPACK_IMPORTED_MODULE_9_dom_helpers_transition___default.a.end(__WEBPACK_IMPORTED_MODULE_8_react_dom___default.a.findDOMNode(this), this.handleAnimateOutEnd);
+ }
+
+ if (active !== prevActive) {
+ setTimeout(function () {
+ return _this2.startAnimation();
+ }, 20);
+ }
+ };
+
+ CarouselItem.prototype.componentWillUnmount = function componentWillUnmount() {
+ this.isUnmounted = true;
+ };
+
+ CarouselItem.prototype.handleAnimateOutEnd = function handleAnimateOutEnd() {
+ if (this.isUnmounted) {
+ return;
+ }
+
+ if (this.props.onAnimateOutEnd) {
+ this.props.onAnimateOutEnd(this.props.index);
+ }
+ };
+
+ CarouselItem.prototype.startAnimation = function startAnimation() {
+ if (this.isUnmounted) {
+ return;
+ }
+
+ this.setState({
+ direction: this.props.direction === 'prev' ? 'right' : 'left'
+ });
+ };
+
+ CarouselItem.prototype.render = function render() {
+ var _props = this.props,
+ direction = _props.direction,
+ active = _props.active,
+ animateIn = _props.animateIn,
+ animateOut = _props.animateOut,
+ className = _props.className,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['direction', 'active', 'animateIn', 'animateOut', 'className']);
+
+ delete props.onAnimateOutEnd;
+ delete props.index;
+
+ var classes = {
+ item: true,
+ active: active && !animateIn || animateOut
+ };
+ if (direction && active && animateIn) {
+ classes[direction] = true;
+ }
+ if (this.state.direction && (animateIn || animateOut)) {
+ classes[this.state.direction] = true;
+ }
+
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div', __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, props, { className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, classes) }));
+ };
+
+ return CarouselItem;
+}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
+
+CarouselItem.propTypes = propTypes;
+CarouselItem.defaultProps = defaultProps;
+
+/* harmony default export */ __webpack_exports__["a"] = (CarouselItem);
+
+/***/ }),
+/* 211 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = camelizeStyleName;
+
+var _camelize = __webpack_require__(402);
+
+var _camelize2 = _interopRequireDefault(_camelize);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var msPattern = /^-ms-/; /**
+ * Copyright 2014-2015, Facebook, Inc.
+ * All rights reserved.
+ * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/camelizeStyleName.js
+ */
+function camelizeStyleName(string) {
+ return (0, _camelize2.default)(string.replace(msPattern, 'ms-'));
+}
+module.exports = exports['default'];
+
+/***/ }),
+/* 212 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony export (immutable) */ __webpack_exports__["a"] = capitalize;
+function capitalize(string) {
+ return "" + string.charAt(0).toUpperCase() + string.slice(1);
+}
+
+/***/ }),
+/* 213 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(process) {
+
+exports.__esModule = true;
+exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = undefined;
+
+var _propTypes = __webpack_require__(8);
+
+var PropTypes = _interopRequireWildcard(_propTypes);
+
+var _react = __webpack_require__(0);
+
+var _react2 = _interopRequireDefault(_react);
+
+var _reactDom = __webpack_require__(22);
+
+var _reactDom2 = _interopRequireDefault(_reactDom);
+
+var _reactLifecyclesCompat = __webpack_require__(412);
+
+var _PropTypes = __webpack_require__(413);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var UNMOUNTED = exports.UNMOUNTED = 'unmounted';
+var EXITED = exports.EXITED = 'exited';
+var ENTERING = exports.ENTERING = 'entering';
+var ENTERED = exports.ENTERED = 'entered';
+var EXITING = exports.EXITING = 'exiting';
+
+/**
+ * The Transition component lets you describe a transition from one component
+ * state to another _over time_ with a simple declarative API. Most commonly
+ * it's used to animate the mounting and unmounting of a component, but can also
+ * be used to describe in-place transition states as well.
+ *
+ * By default the `Transition` component does not alter the behavior of the
+ * component it renders, it only tracks "enter" and "exit" states for the components.
+ * It's up to you to give meaning and effect to those states. For example we can
+ * add styles to a component when it enters or exits:
+ *
+ * ```jsx
+ * import Transition from 'react-transition-group/Transition';
+ *
+ * const duration = 300;
+ *
+ * const defaultStyle = {
+ * transition: `opacity ${duration}ms ease-in-out`,
+ * opacity: 0,
+ * }
+ *
+ * const transitionStyles = {
+ * entering: { opacity: 0 },
+ * entered: { opacity: 1 },
+ * };
+ *
+ * const Fade = ({ in: inProp }) => (
+ *
+ * {(state) => (
+ *
+ * I'm a fade Transition!
+ *
+ * )}
+ *
+ * );
+ * ```
+ *
+ * As noted the `Transition` component doesn't _do_ anything by itself to its child component.
+ * What it does do is track transition states over time so you can update the
+ * component (such as by adding styles or classes) when it changes states.
+ *
+ * There are 4 main states a Transition can be in:
+ * - `'entering'`
+ * - `'entered'`
+ * - `'exiting'`
+ * - `'exited'`
+ *
+ * Transition state is toggled via the `in` prop. When `true` the component begins the
+ * "Enter" stage. During this stage, the component will shift from its current transition state,
+ * to `'entering'` for the duration of the transition and then to the `'entered'` stage once
+ * it's complete. Let's take the following example:
+ *
+ * ```jsx
+ * state = { in: false };
+ *
+ * toggleEnterState = () => {
+ * this.setState({ in: true });
+ * }
+ *
+ * render() {
+ * return (
+ *
+ *
+ * Click to Enter
+ *
+ * );
+ * }
+ * ```
+ *
+ * When the button is clicked the component will shift to the `'entering'` state and
+ * stay there for 500ms (the value of `timeout`) before it finally switches to `'entered'`.
+ *
+ * When `in` is `false` the same thing happens except the state moves from `'exiting'` to `'exited'`.
+ *
+ * ## Timing
+ *
+ * Timing is often the trickiest part of animation, mistakes can result in slight delays
+ * that are hard to pin down. A common example is when you want to add an exit transition,
+ * you should set the desired final styles when the state is `'exiting'`. That's when the
+ * transition to those styles will start and, if you matched the `timeout` prop with the
+ * CSS Transition duration, it will end exactly when the state changes to `'exited'`.
+ *
+ * > **Note**: For simpler transitions the `Transition` component might be enough, but
+ * > take into account that it's platform-agnostic, while the `CSSTransition` component
+ * > [forces reflows](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
+ * > in order to make more complex transitions more predictable. For example, even though
+ * > classes `example-enter` and `example-enter-active` are applied immediately one after
+ * > another, you can still transition from one to the other because of the forced reflow
+ * > (read [this issue](https://github.com/reactjs/react-transition-group/issues/159#issuecomment-322761171)
+ * > for more info). Take this into account when choosing between `Transition` and
+ * > `CSSTransition`.
+ *
+ * ## Example
+ *
+ *
+ *
+ */
+
+var Transition = function (_React$Component) {
+ _inherits(Transition, _React$Component);
+
+ function Transition(props, context) {
+ _classCallCheck(this, Transition);
+
+ var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
+
+ var parentGroup = context.transitionGroup;
+ // In the context of a TransitionGroup all enters are really appears
+ var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
+
+ var initialStatus = void 0;
+
+ _this.appearStatus = null;
+
+ if (props.in) {
+ if (appear) {
+ initialStatus = EXITED;
+ _this.appearStatus = ENTERING;
+ } else {
+ initialStatus = ENTERED;
+ }
+ } else {
+ if (props.unmountOnExit || props.mountOnEnter) {
+ initialStatus = UNMOUNTED;
+ } else {
+ initialStatus = EXITED;
+ }
+ }
+
+ _this.state = { status: initialStatus };
+
+ _this.nextCallback = null;
+ return _this;
+ }
+
+ Transition.prototype.getChildContext = function getChildContext() {
+ return { transitionGroup: null // allows for nested Transitions
+ };
+ };
+
+ Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
+ var nextIn = _ref.in;
+
+ if (nextIn && prevState.status === UNMOUNTED) {
+ return { status: EXITED };
+ }
+ return null;
+ };
+
+ // getSnapshotBeforeUpdate(prevProps) {
+ // let nextStatus = null
+
+ // if (prevProps !== this.props) {
+ // const { status } = this.state
+
+ // if (this.props.in) {
+ // if (status !== ENTERING && status !== ENTERED) {
+ // nextStatus = ENTERING
+ // }
+ // } else {
+ // if (status === ENTERING || status === ENTERED) {
+ // nextStatus = EXITING
+ // }
+ // }
+ // }
+
+ // return { nextStatus }
+ // }
+
+ Transition.prototype.componentDidMount = function componentDidMount() {
+ this.updateStatus(true, this.appearStatus);
+ };
+
+ Transition.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
+ var nextStatus = null;
+ if (prevProps !== this.props) {
+ var status = this.state.status;
+
+
+ if (this.props.in) {
+ if (status !== ENTERING && status !== ENTERED) {
+ nextStatus = ENTERING;
+ }
+ } else {
+ if (status === ENTERING || status === ENTERED) {
+ nextStatus = EXITING;
+ }
+ }
+ }
+ this.updateStatus(false, nextStatus);
+ };
+
+ Transition.prototype.componentWillUnmount = function componentWillUnmount() {
+ this.cancelNextCallback();
+ };
+
+ Transition.prototype.getTimeouts = function getTimeouts() {
+ var timeout = this.props.timeout;
+
+ var exit = void 0,
+ enter = void 0,
+ appear = void 0;
+
+ exit = enter = appear = timeout;
+
+ if (timeout != null && typeof timeout !== 'number') {
+ exit = timeout.exit;
+ enter = timeout.enter;
+ appear = timeout.appear;
+ }
+ return { exit: exit, enter: enter, appear: appear };
+ };
+
+ Transition.prototype.updateStatus = function updateStatus() {
+ var mounting = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
+ var nextStatus = arguments[1];
+
+ if (nextStatus !== null) {
+ // nextStatus will always be ENTERING or EXITING.
+ this.cancelNextCallback();
+ var node = _reactDom2.default.findDOMNode(this);
+
+ if (nextStatus === ENTERING) {
+ this.performEnter(node, mounting);
+ } else {
+ this.performExit(node);
+ }
+ } else if (this.props.unmountOnExit && this.state.status === EXITED) {
+ this.setState({ status: UNMOUNTED });
+ }
+ };
+
+ Transition.prototype.performEnter = function performEnter(node, mounting) {
+ var _this2 = this;
+
+ var enter = this.props.enter;
+
+ var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting;
+
+ var timeouts = this.getTimeouts();
+
+ // no enter animation skip right to ENTERED
+ // if we are mounting and running this it means appear _must_ be set
+ if (!mounting && !enter) {
+ this.safeSetState({ status: ENTERED }, function () {
+ _this2.props.onEntered(node);
+ });
+ return;
+ }
+
+ this.props.onEnter(node, appearing);
+
+ this.safeSetState({ status: ENTERING }, function () {
+ _this2.props.onEntering(node, appearing);
+
+ // FIXME: appear timeout?
+ _this2.onTransitionEnd(node, timeouts.enter, function () {
+ _this2.safeSetState({ status: ENTERED }, function () {
+ _this2.props.onEntered(node, appearing);
+ });
+ });
+ });
+ };
+
+ Transition.prototype.performExit = function performExit(node) {
+ var _this3 = this;
+
+ var exit = this.props.exit;
+
+ var timeouts = this.getTimeouts();
+
+ // no exit animation skip right to EXITED
+ if (!exit) {
+ this.safeSetState({ status: EXITED }, function () {
+ _this3.props.onExited(node);
+ });
+ return;
+ }
+ this.props.onExit(node);
+
+ this.safeSetState({ status: EXITING }, function () {
+ _this3.props.onExiting(node);
+
+ _this3.onTransitionEnd(node, timeouts.exit, function () {
+ _this3.safeSetState({ status: EXITED }, function () {
+ _this3.props.onExited(node);
+ });
+ });
+ });
+ };
+
+ Transition.prototype.cancelNextCallback = function cancelNextCallback() {
+ if (this.nextCallback !== null) {
+ this.nextCallback.cancel();
+ this.nextCallback = null;
+ }
+ };
+
+ Transition.prototype.safeSetState = function safeSetState(nextState, callback) {
+ // This shouldn't be necessary, but there are weird race conditions with
+ // setState callbacks and unmounting in testing, so always make sure that
+ // we can cancel any pending setState callbacks after we unmount.
+ callback = this.setNextCallback(callback);
+ this.setState(nextState, callback);
+ };
+
+ Transition.prototype.setNextCallback = function setNextCallback(callback) {
+ var _this4 = this;
+
+ var active = true;
+
+ this.nextCallback = function (event) {
+ if (active) {
+ active = false;
+ _this4.nextCallback = null;
+
+ callback(event);
+ }
+ };
+
+ this.nextCallback.cancel = function () {
+ active = false;
+ };
+
+ return this.nextCallback;
+ };
+
+ Transition.prototype.onTransitionEnd = function onTransitionEnd(node, timeout, handler) {
+ this.setNextCallback(handler);
+
+ if (node) {
+ if (this.props.addEndListener) {
+ this.props.addEndListener(node, this.nextCallback);
+ }
+ if (timeout != null) {
+ setTimeout(this.nextCallback, timeout);
+ }
+ } else {
+ setTimeout(this.nextCallback, 0);
+ }
+ };
+
+ Transition.prototype.render = function render() {
+ var status = this.state.status;
+ if (status === UNMOUNTED) {
+ return null;
+ }
+
+ var _props = this.props,
+ children = _props.children,
+ childProps = _objectWithoutProperties(_props, ['children']);
+ // filter props for Transtition
+
+
+ delete childProps.in;
+ delete childProps.mountOnEnter;
+ delete childProps.unmountOnExit;
+ delete childProps.appear;
+ delete childProps.enter;
+ delete childProps.exit;
+ delete childProps.timeout;
+ delete childProps.addEndListener;
+ delete childProps.onEnter;
+ delete childProps.onEntering;
+ delete childProps.onEntered;
+ delete childProps.onExit;
+ delete childProps.onExiting;
+ delete childProps.onExited;
+
+ if (typeof children === 'function') {
+ return children(status, childProps);
+ }
+
+ var child = _react2.default.Children.only(children);
+ return _react2.default.cloneElement(child, childProps);
+ };
+
+ return Transition;
+}(_react2.default.Component);
+
+Transition.contextTypes = {
+ transitionGroup: PropTypes.object
+};
+Transition.childContextTypes = {
+ transitionGroup: function transitionGroup() {}
+};
+
+
+Transition.propTypes = process.env.NODE_ENV !== "production" ? {
+ /**
+ * A `function` child can be used instead of a React element.
+ * This function is called with the current transition status
+ * ('entering', 'entered', 'exiting', 'exited', 'unmounted'), which can be used
+ * to apply context specific props to a component.
+ *
+ * ```jsx
+ *
+ * {(status) => (
+ *
+ * )}
+ *
+ * ```
+ */
+ children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,
+
+ /**
+ * Show the component; triggers the enter or exit states
+ */
+ in: PropTypes.bool,
+
+ /**
+ * By default the child component is mounted immediately along with
+ * the parent `Transition` component. If you want to "lazy mount" the component on the
+ * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
+ * mounted, even on "exited", unless you also specify `unmountOnExit`.
+ */
+ mountOnEnter: PropTypes.bool,
+
+ /**
+ * By default the child component stays mounted after it reaches the `'exited'` state.
+ * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
+ */
+ unmountOnExit: PropTypes.bool,
+
+ /**
+ * Normally a component is not transitioned if it is shown when the `` component mounts.
+ * If you want to transition on the first mount set `appear` to `true`, and the
+ * component will transition in as soon as the `` mounts.
+ *
+ * > Note: there are no specific "appear" states. `appear` only adds an additional `enter` transition.
+ */
+ appear: PropTypes.bool,
+
+ /**
+ * Enable or disable enter transitions.
+ */
+ enter: PropTypes.bool,
+
+ /**
+ * Enable or disable exit transitions.
+ */
+ exit: PropTypes.bool,
+
+ /**
+ * The duration of the transition, in milliseconds.
+ * Required unless `addEndListener` is provided
+ *
+ * You may specify a single timeout for all transitions like: `timeout={500}`,
+ * or individually like:
+ *
+ * ```jsx
+ * timeout={{
+ * enter: 300,
+ * exit: 500,
+ * }}
+ * ```
+ *
+ * @type {number | { enter?: number, exit?: number }}
+ */
+ timeout: function timeout(props) {
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
+
+ var pt = _PropTypes.timeoutsShape;
+ if (!props.addEndListener) pt = pt.isRequired;
+ return pt.apply(undefined, [props].concat(args));
+ },
+
+ /**
+ * Add a custom transition end trigger. Called with the transitioning
+ * DOM node and a `done` callback. Allows for more fine grained transition end
+ * logic. **Note:** Timeouts are still used as a fallback if provided.
+ *
+ * ```jsx
+ * addEndListener={(node, done) => {
+ * // use the css transitionend event to mark the finish of a transition
+ * node.addEventListener('transitionend', done, false);
+ * }}
+ * ```
+ */
+ addEndListener: PropTypes.func,
+
+ /**
+ * Callback fired before the "entering" status is applied. An extra parameter
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
+ *
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
+ */
+ onEnter: PropTypes.func,
+
+ /**
+ * Callback fired after the "entering" status is applied. An extra parameter
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
+ *
+ * @type Function(node: HtmlElement, isAppearing: bool)
+ */
+ onEntering: PropTypes.func,
+
+ /**
+ * Callback fired after the "entered" status is applied. An extra parameter
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
+ *
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
+ */
+ onEntered: PropTypes.func,
+
+ /**
+ * Callback fired before the "exiting" status is applied.
+ *
+ * @type Function(node: HtmlElement) -> void
+ */
+ onExit: PropTypes.func,
+
+ /**
+ * Callback fired after the "exiting" status is applied.
+ *
+ * @type Function(node: HtmlElement) -> void
+ */
+ onExiting: PropTypes.func,
+
+ /**
+ * Callback fired after the "exited" status is applied.
+ *
+ * @type Function(node: HtmlElement) -> void
+ */
+ onExited: PropTypes.func
+
+ // Name the function so it is clearer in the documentation
+} : {};function noop() {}
+
+Transition.defaultProps = {
+ in: false,
+ mountOnEnter: false,
+ unmountOnExit: false,
+ appear: false,
+ enter: true,
+ exit: true,
+
+ onEnter: noop,
+ onEntering: noop,
+ onEntered: noop,
+
+ onExit: noop,
+ onExiting: noop,
+ onExited: noop
+};
+
+Transition.UNMOUNTED = 0;
+Transition.EXITED = 1;
+Transition.ENTERING = 2;
+Transition.ENTERED = 3;
+Transition.EXITING = 4;
+
+exports.default = (0, _reactLifecyclesCompat.polyfill)(Transition);
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
+
+/***/ }),
+/* 214 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = activeElement;
+
+var _ownerDocument = __webpack_require__(58);
+
+var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function activeElement() {
+ var doc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _ownerDocument2.default)();
+
+ try {
+ return doc.activeElement;
+ } catch (e) {/* ie throws if no active element */}
+}
+module.exports = exports['default'];
+
+/***/ }),
+/* 215 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+
+var _contains = __webpack_require__(59);
+
+var _contains2 = _interopRequireDefault(_contains);
+
+var _propTypes = __webpack_require__(8);
+
+var _propTypes2 = _interopRequireDefault(_propTypes);
+
+var _react = __webpack_require__(0);
+
+var _react2 = _interopRequireDefault(_react);
+
+var _reactDom = __webpack_require__(22);
+
+var _reactDom2 = _interopRequireDefault(_reactDom);
+
+var _addEventListener = __webpack_require__(216);
+
+var _addEventListener2 = _interopRequireDefault(_addEventListener);
+
+var _ownerDocument = __webpack_require__(60);
+
+var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var escapeKeyCode = 27;
+
+function isLeftClickEvent(event) {
+ return event.button === 0;
+}
+
+function isModifiedEvent(event) {
+ return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
+}
+
+/**
+ * The ` ` component registers your callback on the document
+ * when rendered. Powers the ` ` component. This is used achieve modal
+ * style behavior where your callback is triggered when the user tries to
+ * interact with the rest of the document or hits the `esc` key.
+ */
+
+var RootCloseWrapper = function (_React$Component) {
+ _inherits(RootCloseWrapper, _React$Component);
+
+ function RootCloseWrapper(props, context) {
+ _classCallCheck(this, RootCloseWrapper);
+
+ var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
+
+ _this.addEventListeners = function () {
+ var event = _this.props.event;
+
+ var doc = (0, _ownerDocument2.default)(_this);
+
+ // Use capture for this listener so it fires before React's listener, to
+ // avoid false positives in the contains() check below if the target DOM
+ // element is removed in the React mouse callback.
+ _this.documentMouseCaptureListener = (0, _addEventListener2.default)(doc, event, _this.handleMouseCapture, true);
+
+ _this.documentMouseListener = (0, _addEventListener2.default)(doc, event, _this.handleMouse);
+
+ _this.documentKeyupListener = (0, _addEventListener2.default)(doc, 'keyup', _this.handleKeyUp);
+ };
+
+ _this.removeEventListeners = function () {
+ if (_this.documentMouseCaptureListener) {
+ _this.documentMouseCaptureListener.remove();
+ }
+
+ if (_this.documentMouseListener) {
+ _this.documentMouseListener.remove();
+ }
+
+ if (_this.documentKeyupListener) {
+ _this.documentKeyupListener.remove();
+ }
+ };
+
+ _this.handleMouseCapture = function (e) {
+ _this.preventMouseRootClose = isModifiedEvent(e) || !isLeftClickEvent(e) || (0, _contains2.default)(_reactDom2.default.findDOMNode(_this), e.target);
+ };
+
+ _this.handleMouse = function (e) {
+ if (!_this.preventMouseRootClose && _this.props.onRootClose) {
+ _this.props.onRootClose(e);
+ }
+ };
+
+ _this.handleKeyUp = function (e) {
+ if (e.keyCode === escapeKeyCode && _this.props.onRootClose) {
+ _this.props.onRootClose(e);
+ }
+ };
+
+ _this.preventMouseRootClose = false;
+ return _this;
+ }
+
+ RootCloseWrapper.prototype.componentDidMount = function componentDidMount() {
+ if (!this.props.disabled) {
+ this.addEventListeners();
+ }
+ };
+
+ RootCloseWrapper.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
+ if (!this.props.disabled && prevProps.disabled) {
+ this.addEventListeners();
+ } else if (this.props.disabled && !prevProps.disabled) {
+ this.removeEventListeners();
+ }
+ };
+
+ RootCloseWrapper.prototype.componentWillUnmount = function componentWillUnmount() {
+ if (!this.props.disabled) {
+ this.removeEventListeners();
+ }
+ };
+
+ RootCloseWrapper.prototype.render = function render() {
+ return this.props.children;
+ };
+
+ return RootCloseWrapper;
+}(_react2.default.Component);
+
+RootCloseWrapper.displayName = 'RootCloseWrapper';
+
+RootCloseWrapper.propTypes = {
+ /**
+ * Callback fired after click or mousedown. Also triggers when user hits `esc`.
+ */
+ onRootClose: _propTypes2.default.func,
+ /**
+ * Children to render.
+ */
+ children: _propTypes2.default.element,
+ /**
+ * Disable the the RootCloseWrapper, preventing it from triggering `onRootClose`.
+ */
+ disabled: _propTypes2.default.bool,
+ /**
+ * Choose which document mouse event to bind to.
+ */
+ event: _propTypes2.default.oneOf(['click', 'mousedown'])
+};
+
+RootCloseWrapper.defaultProps = {
+ event: 'click'
+};
+
+exports.default = RootCloseWrapper;
+module.exports = exports['default'];
+
+/***/ }),
+/* 216 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+
+exports.default = function (node, event, handler, capture) {
+ (0, _on2.default)(node, event, handler, capture);
+
+ return {
+ remove: function remove() {
+ (0, _off2.default)(node, event, handler, capture);
+ }
+ };
+};
+
+var _on = __webpack_require__(146);
+
+var _on2 = _interopRequireDefault(_on);
+
+var _off = __webpack_require__(147);
+
+var _off2 = _interopRequireDefault(_off);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+module.exports = exports['default'];
+
+/***/ }),
+/* 217 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Button__ = __webpack_require__(74);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__SafeAnchor__ = __webpack_require__(27);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils_bootstrapUtils__ = __webpack_require__(9);
+
+
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ noCaret: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
+ open: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
+ title: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,
+ useAnchor: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool
+};
+
+var defaultProps = {
+ open: false,
+ useAnchor: false,
+ bsRole: 'toggle'
+};
+
+var DropdownToggle = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(DropdownToggle, _React$Component);
+
+ function DropdownToggle() {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, DropdownToggle);
+
+ return __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ DropdownToggle.prototype.render = function render() {
+ var _props = this.props,
+ noCaret = _props.noCaret,
+ open = _props.open,
+ useAnchor = _props.useAnchor,
+ bsClass = _props.bsClass,
+ className = _props.className,
+ children = _props.children,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['noCaret', 'open', 'useAnchor', 'bsClass', 'className', 'children']);
+
+ delete props.bsRole;
+
+ var Component = useAnchor ? __WEBPACK_IMPORTED_MODULE_9__SafeAnchor__["a" /* default */] : __WEBPACK_IMPORTED_MODULE_8__Button__["a" /* default */];
+ var useCaret = !noCaret;
+
+ // This intentionally forwards bsSize and bsStyle (if set) to the
+ // underlying component, to allow it to render size and style variants.
+
+ // FIXME: Should this really fall back to `title` as children?
+
+ return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(
+ Component,
+ __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, props, {
+ role: 'button',
+ className: __WEBPACK_IMPORTED_MODULE_7_classnames___default()(className, bsClass),
+ 'aria-haspopup': true,
+ 'aria-expanded': open
+ }),
+ children || props.title,
+ useCaret && ' ',
+ useCaret && __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement('span', { className: 'caret' })
+ );
+ };
+
+ return DropdownToggle;
+}(__WEBPACK_IMPORTED_MODULE_5_react___default.a.Component);
+
+DropdownToggle.propTypes = propTypes;
+DropdownToggle.defaultProps = defaultProps;
+
+/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_10__utils_bootstrapUtils__["a" /* bsClass */])('dropdown-toggle', DropdownToggle));
+
+/***/ }),
+/* 218 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_elementType__ = __webpack_require__(17);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_elementType___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_elementType__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__ = __webpack_require__(9);
+
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ /**
+ * Turn any fixed-width grid layout into a full-width layout by this property.
+ *
+ * Adds `container-fluid` class.
+ */
+ fluid: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ /**
+ * You can use a custom element for this component
+ */
+ componentClass: __WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_elementType___default.a
+};
+
+var defaultProps = {
+ componentClass: 'div',
+ fluid: false
+};
+
+var Grid = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(Grid, _React$Component);
+
+ function Grid() {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, Grid);
+
+ return __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ Grid.prototype.render = function render() {
+ var _props = this.props,
+ fluid = _props.fluid,
+ Component = _props.componentClass,
+ className = _props.className,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['fluid', 'componentClass', 'className']);
+
+ var _splitBsProps = Object(__WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__["f" /* splitBsProps */])(props),
+ bsProps = _splitBsProps[0],
+ elementProps = _splitBsProps[1];
+
+ var classes = Object(__WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__["e" /* prefix */])(bsProps, fluid && 'fluid');
+
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(Component, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, elementProps, { className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, classes) }));
+ };
+
+ return Grid;
+}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
+
+Grid.propTypes = propTypes;
+Grid.defaultProps = defaultProps;
+
+/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__["a" /* bsClass */])('container', Grid));
+
+/***/ }),
+/* 219 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_values__ = __webpack_require__(57);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_values___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_values__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__ = __webpack_require__(9);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils_StyleConfig__ = __webpack_require__(21);
+
+
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ active: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.any,
+ disabled: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.any,
+ header: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.node,
+ listItem: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
+ onClick: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
+ href: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string,
+ type: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string
+};
+
+var defaultProps = {
+ listItem: false
+};
+
+var ListGroupItem = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits___default()(ListGroupItem, _React$Component);
+
+ function ListGroupItem() {
+ __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default()(this, ListGroupItem);
+
+ return __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ ListGroupItem.prototype.renderHeader = function renderHeader(header, headingClassName) {
+ if (__WEBPACK_IMPORTED_MODULE_7_react___default.a.isValidElement(header)) {
+ return Object(__WEBPACK_IMPORTED_MODULE_7_react__["cloneElement"])(header, {
+ className: __WEBPACK_IMPORTED_MODULE_6_classnames___default()(header.props.className, headingClassName)
+ });
+ }
+
+ return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
+ 'h4',
+ { className: headingClassName },
+ header
+ );
+ };
+
+ ListGroupItem.prototype.render = function render() {
+ var _props = this.props,
+ active = _props.active,
+ disabled = _props.disabled,
+ className = _props.className,
+ header = _props.header,
+ listItem = _props.listItem,
+ children = _props.children,
+ props = __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['active', 'disabled', 'className', 'header', 'listItem', 'children']);
+
+ var _splitBsProps = Object(__WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__["f" /* splitBsProps */])(props),
+ bsProps = _splitBsProps[0],
+ elementProps = _splitBsProps[1];
+
+ var classes = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, Object(__WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__["d" /* getClassSet */])(bsProps), {
+ active: active,
+ disabled: disabled
+ });
+
+ var Component = void 0;
+
+ if (elementProps.href) {
+ Component = 'a';
+ } else if (elementProps.onClick) {
+ Component = 'button';
+ elementProps.type = elementProps.type || 'button';
+ } else if (listItem) {
+ Component = 'li';
+ } else {
+ Component = 'span';
+ }
+
+ elementProps.className = __WEBPACK_IMPORTED_MODULE_6_classnames___default()(className, classes);
+
+ // TODO: Deprecate `header` prop.
+ if (header) {
+ return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
+ Component,
+ elementProps,
+ this.renderHeader(header, Object(__WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__["e" /* prefix */])(bsProps, 'heading')),
+ __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
+ 'p',
+ { className: Object(__WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__["e" /* prefix */])(bsProps, 'text') },
+ children
+ )
+ );
+ }
+
+ return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
+ Component,
+ elementProps,
+ children
+ );
+ };
+
+ return ListGroupItem;
+}(__WEBPACK_IMPORTED_MODULE_7_react___default.a.Component);
+
+ListGroupItem.propTypes = propTypes;
+ListGroupItem.defaultProps = defaultProps;
+
+/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__["a" /* bsClass */])('list-group-item', Object(__WEBPACK_IMPORTED_MODULE_9__utils_bootstrapUtils__["c" /* bsStyles */])(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_values___default()(__WEBPACK_IMPORTED_MODULE_10__utils_StyleConfig__["d" /* State */]), ListGroupItem)));
+
+/***/ }),
+/* 220 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+exports.default = function (recalc) {
+ if (!size && size !== 0 || recalc) {
+ if (_inDOM2.default) {
+ var scrollDiv = document.createElement('div');
+
+ scrollDiv.style.position = 'absolute';
+ scrollDiv.style.top = '-9999px';
+ scrollDiv.style.width = '50px';
+ scrollDiv.style.height = '50px';
+ scrollDiv.style.overflow = 'scroll';
+
+ document.body.appendChild(scrollDiv);
+ size = scrollDiv.offsetWidth - scrollDiv.clientWidth;
+ document.body.removeChild(scrollDiv);
+ }
+ }
+
+ return size;
+};
+
+var _inDOM = __webpack_require__(39);
+
+var _inDOM2 = _interopRequireDefault(_inDOM);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var size = void 0;
+
+module.exports = exports['default'];
+
+/***/ }),
+/* 221 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = hasClass;
+function hasClass(element, className) {
+ if (element.classList) return !!className && element.classList.contains(className);else return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
+}
+module.exports = exports["default"];
+
+/***/ }),
+/* 222 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+exports.default = isOverflowing;
+
+var _isWindow = __webpack_require__(105);
+
+var _isWindow2 = _interopRequireDefault(_isWindow);
+
+var _ownerDocument = __webpack_require__(58);
+
+var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function isBody(node) {
+ return node && node.tagName.toLowerCase() === 'body';
+}
+
+function bodyIsOverflowing(node) {
+ var doc = (0, _ownerDocument2.default)(node);
+ var win = (0, _isWindow2.default)(doc);
+ var fullWidth = win.innerWidth;
+
+ // Support: ie8, no innerWidth
+ if (!fullWidth) {
+ var documentElementRect = doc.documentElement.getBoundingClientRect();
+ fullWidth = documentElementRect.right - Math.abs(documentElementRect.left);
+ }
+
+ return doc.body.clientWidth < fullWidth;
+}
+
+function isOverflowing(container) {
+ var win = (0, _isWindow2.default)(container);
+
+ return win || isBody(container) ? bodyIsOverflowing(container) : container.scrollHeight > container.clientHeight;
+}
+module.exports = exports['default'];
+
+/***/ }),
+/* 223 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+
+var _propTypes = __webpack_require__(8);
+
+var _propTypes2 = _interopRequireDefault(_propTypes);
+
+var _componentOrElement = __webpack_require__(104);
+
+var _componentOrElement2 = _interopRequireDefault(_componentOrElement);
+
+var _react = __webpack_require__(0);
+
+var _react2 = _interopRequireDefault(_react);
+
+var _reactDom = __webpack_require__(22);
+
+var _reactDom2 = _interopRequireDefault(_reactDom);
+
+var _getContainer = __webpack_require__(106);
+
+var _getContainer2 = _interopRequireDefault(_getContainer);
+
+var _ownerDocument = __webpack_require__(60);
+
+var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
+
+var _LegacyPortal = __webpack_require__(457);
+
+var _LegacyPortal2 = _interopRequireDefault(_LegacyPortal);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+/**
+ * The ` ` component renders its children into a new "subtree" outside of current component hierarchy.
+ * You can think of it as a declarative `appendChild()`, or jQuery's `$.fn.appendTo()`.
+ * The children of ` ` component will be appended to the `container` specified.
+ */
+var Portal = function (_React$Component) {
+ _inherits(Portal, _React$Component);
+
+ function Portal() {
+ var _temp, _this, _ret;
+
+ _classCallCheck(this, Portal);
+
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.setContainer = function () {
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props;
+
+ _this._portalContainerNode = (0, _getContainer2.default)(props.container, (0, _ownerDocument2.default)(_this).body);
+ }, _this.getMountNode = function () {
+ return _this._portalContainerNode;
+ }, _temp), _possibleConstructorReturn(_this, _ret);
+ }
+
+ Portal.prototype.componentDidMount = function componentDidMount() {
+ this.setContainer();
+ this.forceUpdate(this.props.onRendered);
+ };
+
+ Portal.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
+ if (nextProps.container !== this.props.container) {
+ this.setContainer(nextProps);
+ }
+ };
+
+ Portal.prototype.componentWillUnmount = function componentWillUnmount() {
+ this._portalContainerNode = null;
+ };
+
+ Portal.prototype.render = function render() {
+ return this.props.children && this._portalContainerNode ? _reactDom2.default.createPortal(this.props.children, this._portalContainerNode) : null;
+ };
+
+ return Portal;
+}(_react2.default.Component);
+
+Portal.displayName = 'Portal';
+Portal.propTypes = {
+ /**
+ * A Node, Component instance, or function that returns either. The `container` will have the Portal children
+ * appended to it.
+ */
+ container: _propTypes2.default.oneOfType([_componentOrElement2.default, _propTypes2.default.func]),
+
+ onRendered: _propTypes2.default.func
+};
+exports.default = _reactDom2.default.createPortal ? Portal : _LegacyPortal2.default;
+module.exports = exports['default'];
+
+/***/ }),
+/* 224 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types_extra_lib_elementType__ = __webpack_require__(17);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types_extra_lib_elementType___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types_extra_lib_elementType__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__ = __webpack_require__(9);
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ componentClass: __WEBPACK_IMPORTED_MODULE_7_prop_types_extra_lib_elementType___default.a
+};
+
+var defaultProps = {
+ componentClass: 'div'
+};
+
+var ModalBody = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(ModalBody, _React$Component);
+
+ function ModalBody() {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, ModalBody);
+
+ return __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ ModalBody.prototype.render = function render() {
+ var _props = this.props,
+ Component = _props.componentClass,
+ className = _props.className,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['componentClass', 'className']);
+
+ var _splitBsProps = Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["f" /* splitBsProps */])(props),
+ bsProps = _splitBsProps[0],
+ elementProps = _splitBsProps[1];
+
+ var classes = Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["d" /* getClassSet */])(bsProps);
+
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(Component, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, elementProps, { className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, classes) }));
+ };
+
+ return ModalBody;
+}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
+
+ModalBody.propTypes = propTypes;
+ModalBody.defaultProps = defaultProps;
+
+/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["a" /* bsClass */])('modal-body', ModalBody));
+
+/***/ }),
+/* 225 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types_extra_lib_elementType__ = __webpack_require__(17);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types_extra_lib_elementType___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types_extra_lib_elementType__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__ = __webpack_require__(9);
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ componentClass: __WEBPACK_IMPORTED_MODULE_7_prop_types_extra_lib_elementType___default.a
+};
+
+var defaultProps = {
+ componentClass: 'div'
+};
+
+var ModalFooter = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(ModalFooter, _React$Component);
+
+ function ModalFooter() {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, ModalFooter);
+
+ return __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ ModalFooter.prototype.render = function render() {
+ var _props = this.props,
+ Component = _props.componentClass,
+ className = _props.className,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['componentClass', 'className']);
+
+ var _splitBsProps = Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["f" /* splitBsProps */])(props),
+ bsProps = _splitBsProps[0],
+ elementProps = _splitBsProps[1];
+
+ var classes = Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["d" /* getClassSet */])(bsProps);
+
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(Component, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, elementProps, { className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, classes) }));
+ };
+
+ return ModalFooter;
+}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
+
+ModalFooter.propTypes = propTypes;
+ModalFooter.defaultProps = defaultProps;
+
+/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["a" /* bsClass */])('modal-footer', ModalFooter));
+
+/***/ }),
+/* 226 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__ = __webpack_require__(9);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_createChainedFunction__ = __webpack_require__(19);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__CloseButton__ = __webpack_require__(140);
+
+
+
+
+
+
+
+
+
+
+
+
+
+// TODO: `aria-label` should be `closeLabel`.
+
+var propTypes = {
+ /**
+ * Provides an accessible label for the close
+ * button. It is used for Assistive Technology when the label text is not
+ * readable.
+ */
+ closeLabel: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,
+
+ /**
+ * Specify whether the Component should contain a close button
+ */
+ closeButton: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
+
+ /**
+ * A Callback fired when the close button is clicked. If used directly inside
+ * a Modal component, the onHide will automatically be propagated up to the
+ * parent Modal `onHide`.
+ */
+ onHide: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func
+};
+
+var defaultProps = {
+ closeLabel: 'Close',
+ closeButton: false
+};
+
+var contextTypes = {
+ $bs_modal: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.shape({
+ onHide: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func
+ })
+};
+
+var ModalHeader = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(ModalHeader, _React$Component);
+
+ function ModalHeader() {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, ModalHeader);
+
+ return __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ ModalHeader.prototype.render = function render() {
+ var _props = this.props,
+ closeLabel = _props.closeLabel,
+ closeButton = _props.closeButton,
+ onHide = _props.onHide,
+ className = _props.className,
+ children = _props.children,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['closeLabel', 'closeButton', 'onHide', 'className', 'children']);
+
+ var modal = this.context.$bs_modal;
+
+ var _splitBsProps = Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["f" /* splitBsProps */])(props),
+ bsProps = _splitBsProps[0],
+ elementProps = _splitBsProps[1];
+
+ var classes = Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["d" /* getClassSet */])(bsProps);
+
+ return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
+ 'div',
+ __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, elementProps, { className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, classes) }),
+ closeButton && __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_10__CloseButton__["a" /* default */], {
+ label: closeLabel,
+ onClick: Object(__WEBPACK_IMPORTED_MODULE_9__utils_createChainedFunction__["a" /* default */])(modal && modal.onHide, onHide)
+ }),
+ children
+ );
+ };
+
+ return ModalHeader;
+}(__WEBPACK_IMPORTED_MODULE_7_react___default.a.Component);
+
+ModalHeader.propTypes = propTypes;
+ModalHeader.defaultProps = defaultProps;
+ModalHeader.contextTypes = contextTypes;
+
+/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["a" /* bsClass */])('modal-header', ModalHeader));
+
+/***/ }),
+/* 227 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types_extra_lib_elementType__ = __webpack_require__(17);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types_extra_lib_elementType___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types_extra_lib_elementType__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__ = __webpack_require__(9);
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ componentClass: __WEBPACK_IMPORTED_MODULE_7_prop_types_extra_lib_elementType___default.a
+};
+
+var defaultProps = {
+ componentClass: 'h4'
+};
+
+var ModalTitle = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(ModalTitle, _React$Component);
+
+ function ModalTitle() {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, ModalTitle);
+
+ return __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ ModalTitle.prototype.render = function render() {
+ var _props = this.props,
+ Component = _props.componentClass,
+ className = _props.className,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['componentClass', 'className']);
+
+ var _splitBsProps = Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["f" /* splitBsProps */])(props),
+ bsProps = _splitBsProps[0],
+ elementProps = _splitBsProps[1];
+
+ var classes = Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["d" /* getClassSet */])(bsProps);
+
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(Component, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, elementProps, { className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, classes) }));
+ };
+
+ return ModalTitle;
+}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
+
+ModalTitle.propTypes = propTypes;
+ModalTitle.defaultProps = defaultProps;
+
+/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["a" /* bsClass */])('modal-title', ModalTitle));
+
+/***/ }),
+/* 228 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_keycode__ = __webpack_require__(145);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_keycode___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_keycode__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_react_dom__ = __webpack_require__(22);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_react_dom__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_prop_types_extra_lib_all__ = __webpack_require__(98);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_prop_types_extra_lib_all___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_prop_types_extra_lib_all__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_warning__ = __webpack_require__(24);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_warning__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__utils_bootstrapUtils__ = __webpack_require__(9);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__utils_createChainedFunction__ = __webpack_require__(19);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__utils_ValidComponentChildren__ = __webpack_require__(23);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// TODO: Should we expose `` as ``?
+
+// TODO: This `bsStyle` is very unlike the others. Should we rename it?
+
+// TODO: `pullRight` and `pullLeft` don't render right outside of `navbar`.
+// Consider renaming or replacing them.
+
+var propTypes = {
+ /**
+ * Marks the NavItem with a matching `eventKey` as active. Has a
+ * higher precedence over `activeHref`.
+ */
+ activeKey: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.any,
+
+ /**
+ * Marks the child NavItem with a matching `href` prop as active.
+ */
+ activeHref: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string,
+
+ /**
+ * NavItems are be positioned vertically.
+ */
+ stacked: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
+
+ justified: __WEBPACK_IMPORTED_MODULE_10_prop_types_extra_lib_all___default()(__WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool, function (_ref) {
+ var justified = _ref.justified,
+ navbar = _ref.navbar;
+ return justified && navbar ? Error('justified navbar `Nav`s are not supported') : null;
+ }),
+
+ /**
+ * A callback fired when a NavItem is selected.
+ *
+ * ```js
+ * function (
+ * Any eventKey,
+ * SyntheticEvent event?
+ * )
+ * ```
+ */
+ onSelect: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
+
+ /**
+ * ARIA role for the Nav, in the context of a TabContainer, the default will
+ * be set to "tablist", but can be overridden by the Nav when set explicitly.
+ *
+ * When the role is set to "tablist" NavItem focus is managed according to
+ * the ARIA authoring practices for tabs:
+ * https://www.w3.org/TR/2013/WD-wai-aria-practices-20130307/#tabpanel
+ */
+ role: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string,
+
+ /**
+ * Apply styling an alignment for use in a Navbar. This prop will be set
+ * automatically when the Nav is used inside a Navbar.
+ */
+ navbar: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
+
+ /**
+ * Float the Nav to the right. When `navbar` is `true` the appropriate
+ * contextual classes are added as well.
+ */
+ pullRight: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
+
+ /**
+ * Float the Nav to the left. When `navbar` is `true` the appropriate
+ * contextual classes are added as well.
+ */
+ pullLeft: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool
+};
+
+var defaultProps = {
+ justified: false,
+ pullRight: false,
+ pullLeft: false,
+ stacked: false
+};
+
+var contextTypes = {
+ $bs_navbar: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.shape({
+ bsClass: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string,
+ onSelect: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func
+ }),
+
+ $bs_tabContainer: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.shape({
+ activeKey: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.any,
+ onSelect: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func.isRequired,
+ getTabId: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func.isRequired,
+ getPaneId: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func.isRequired
+ })
+};
+
+var Nav = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(Nav, _React$Component);
+
+ function Nav() {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, Nav);
+
+ return __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ Nav.prototype.componentDidUpdate = function componentDidUpdate() {
+ var _this2 = this;
+
+ if (!this._needsRefocus) {
+ return;
+ }
+
+ this._needsRefocus = false;
+
+ var children = this.props.children;
+
+ var _getActiveProps = this.getActiveProps(),
+ activeKey = _getActiveProps.activeKey,
+ activeHref = _getActiveProps.activeHref;
+
+ var activeChild = __WEBPACK_IMPORTED_MODULE_14__utils_ValidComponentChildren__["a" /* default */].find(children, function (child) {
+ return _this2.isActive(child, activeKey, activeHref);
+ });
+
+ var childrenArray = __WEBPACK_IMPORTED_MODULE_14__utils_ValidComponentChildren__["a" /* default */].toArray(children);
+ var activeChildIndex = childrenArray.indexOf(activeChild);
+
+ var childNodes = __WEBPACK_IMPORTED_MODULE_9_react_dom___default.a.findDOMNode(this).children;
+ var activeNode = childNodes && childNodes[activeChildIndex];
+
+ if (!activeNode || !activeNode.firstChild) {
+ return;
+ }
+
+ activeNode.firstChild.focus();
+ };
+
+ Nav.prototype.getActiveProps = function getActiveProps() {
+ var tabContainer = this.context.$bs_tabContainer;
+
+ if (tabContainer) {
+ process.env.NODE_ENV !== 'production' ? __WEBPACK_IMPORTED_MODULE_11_warning___default()(this.props.activeKey == null && !this.props.activeHref, 'Specifying a `` `activeKey` or `activeHref` in the context of ' + 'a `` is not supported. Instead use ` `.')) : void 0;
+
+ return tabContainer;
+ }
+
+ return this.props;
+ };
+
+ Nav.prototype.getNextActiveChild = function getNextActiveChild(offset) {
+ var _this3 = this;
+
+ var children = this.props.children;
+
+ var validChildren = children.filter(function (child) {
+ return child.props.eventKey != null && !child.props.disabled;
+ });
+
+ var _getActiveProps2 = this.getActiveProps(),
+ activeKey = _getActiveProps2.activeKey,
+ activeHref = _getActiveProps2.activeHref;
+
+ var activeChild = __WEBPACK_IMPORTED_MODULE_14__utils_ValidComponentChildren__["a" /* default */].find(children, function (child) {
+ return _this3.isActive(child, activeKey, activeHref);
+ });
+
+ // This assumes the active child is not disabled.
+ var activeChildIndex = validChildren.indexOf(activeChild);
+ if (activeChildIndex === -1) {
+ // Something has gone wrong. Select the first valid child we can find.
+ return validChildren[0];
+ }
+
+ var nextIndex = activeChildIndex + offset;
+ var numValidChildren = validChildren.length;
+
+ if (nextIndex >= numValidChildren) {
+ nextIndex = 0;
+ } else if (nextIndex < 0) {
+ nextIndex = numValidChildren - 1;
+ }
+
+ return validChildren[nextIndex];
+ };
+
+ Nav.prototype.getTabProps = function getTabProps(child, tabContainer, navRole, active, onSelect) {
+ var _this4 = this;
+
+ if (!tabContainer && navRole !== 'tablist') {
+ // No tab props here.
+ return null;
+ }
+
+ var _child$props = child.props,
+ id = _child$props.id,
+ controls = _child$props['aria-controls'],
+ eventKey = _child$props.eventKey,
+ role = _child$props.role,
+ onKeyDown = _child$props.onKeyDown,
+ tabIndex = _child$props.tabIndex;
+
+
+ if (tabContainer) {
+ process.env.NODE_ENV !== 'production' ? __WEBPACK_IMPORTED_MODULE_11_warning___default()(!id && !controls, 'In the context of a ``, ``s are given ' + 'generated `id` and `aria-controls` attributes for the sake of ' + 'proper component accessibility. Any provided ones will be ignored. ' + 'To control these attributes directly, provide a `generateChildId` ' + 'prop to the parent ``.') : void 0;
+
+ id = tabContainer.getTabId(eventKey);
+ controls = tabContainer.getPaneId(eventKey);
+ }
+
+ if (navRole === 'tablist') {
+ role = role || 'tab';
+ onKeyDown = Object(__WEBPACK_IMPORTED_MODULE_13__utils_createChainedFunction__["a" /* default */])(function (event) {
+ return _this4.handleTabKeyDown(onSelect, event);
+ }, onKeyDown);
+ tabIndex = active ? tabIndex : -1;
+ }
+
+ return {
+ id: id,
+ role: role,
+ onKeyDown: onKeyDown,
+ 'aria-controls': controls,
+ tabIndex: tabIndex
+ };
+ };
+
+ Nav.prototype.handleTabKeyDown = function handleTabKeyDown(onSelect, event) {
+ var nextActiveChild = void 0;
+
+ switch (event.keyCode) {
+ case __WEBPACK_IMPORTED_MODULE_6_keycode___default.a.codes.left:
+ case __WEBPACK_IMPORTED_MODULE_6_keycode___default.a.codes.up:
+ nextActiveChild = this.getNextActiveChild(-1);
+ break;
+ case __WEBPACK_IMPORTED_MODULE_6_keycode___default.a.codes.right:
+ case __WEBPACK_IMPORTED_MODULE_6_keycode___default.a.codes.down:
+ nextActiveChild = this.getNextActiveChild(1);
+ break;
+ default:
+ // It was a different key; don't handle this keypress.
+ return;
+ }
+
+ event.preventDefault();
+
+ if (onSelect && nextActiveChild && nextActiveChild.props.eventKey != null) {
+ onSelect(nextActiveChild.props.eventKey);
+ }
+
+ this._needsRefocus = true;
+ };
+
+ Nav.prototype.isActive = function isActive(_ref2, activeKey, activeHref) {
+ var props = _ref2.props;
+
+ if (props.active || activeKey != null && props.eventKey === activeKey || activeHref && props.href === activeHref) {
+ return true;
+ }
+
+ return props.active;
+ };
+
+ Nav.prototype.render = function render() {
+ var _extends2,
+ _this5 = this;
+
+ var _props = this.props,
+ stacked = _props.stacked,
+ justified = _props.justified,
+ onSelect = _props.onSelect,
+ propsRole = _props.role,
+ propsNavbar = _props.navbar,
+ pullRight = _props.pullRight,
+ pullLeft = _props.pullLeft,
+ className = _props.className,
+ children = _props.children,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['stacked', 'justified', 'onSelect', 'role', 'navbar', 'pullRight', 'pullLeft', 'className', 'children']);
+
+ var tabContainer = this.context.$bs_tabContainer;
+ var role = propsRole || (tabContainer ? 'tablist' : null);
+
+ var _getActiveProps3 = this.getActiveProps(),
+ activeKey = _getActiveProps3.activeKey,
+ activeHref = _getActiveProps3.activeHref;
+
+ delete props.activeKey; // Accessed via this.getActiveProps().
+ delete props.activeHref; // Accessed via this.getActiveProps().
+
+ var _splitBsProps = Object(__WEBPACK_IMPORTED_MODULE_12__utils_bootstrapUtils__["f" /* splitBsProps */])(props),
+ bsProps = _splitBsProps[0],
+ elementProps = _splitBsProps[1];
+
+ var classes = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, Object(__WEBPACK_IMPORTED_MODULE_12__utils_bootstrapUtils__["d" /* getClassSet */])(bsProps), (_extends2 = {}, _extends2[Object(__WEBPACK_IMPORTED_MODULE_12__utils_bootstrapUtils__["e" /* prefix */])(bsProps, 'stacked')] = stacked, _extends2[Object(__WEBPACK_IMPORTED_MODULE_12__utils_bootstrapUtils__["e" /* prefix */])(bsProps, 'justified')] = justified, _extends2));
+
+ var navbar = propsNavbar != null ? propsNavbar : this.context.$bs_navbar;
+ var pullLeftClassName = void 0;
+ var pullRightClassName = void 0;
+
+ if (navbar) {
+ var navbarProps = this.context.$bs_navbar || { bsClass: 'navbar' };
+
+ classes[Object(__WEBPACK_IMPORTED_MODULE_12__utils_bootstrapUtils__["e" /* prefix */])(navbarProps, 'nav')] = true;
+
+ pullRightClassName = Object(__WEBPACK_IMPORTED_MODULE_12__utils_bootstrapUtils__["e" /* prefix */])(navbarProps, 'right');
+ pullLeftClassName = Object(__WEBPACK_IMPORTED_MODULE_12__utils_bootstrapUtils__["e" /* prefix */])(navbarProps, 'left');
+ } else {
+ pullRightClassName = 'pull-right';
+ pullLeftClassName = 'pull-left';
+ }
+
+ classes[pullRightClassName] = pullRight;
+ classes[pullLeftClassName] = pullLeft;
+
+ return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
+ 'ul',
+ __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, elementProps, {
+ role: role,
+ className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, classes)
+ }),
+ __WEBPACK_IMPORTED_MODULE_14__utils_ValidComponentChildren__["a" /* default */].map(children, function (child) {
+ var active = _this5.isActive(child, activeKey, activeHref);
+ var childOnSelect = Object(__WEBPACK_IMPORTED_MODULE_13__utils_createChainedFunction__["a" /* default */])(child.props.onSelect, onSelect, navbar && navbar.onSelect, tabContainer && tabContainer.onSelect);
+
+ return Object(__WEBPACK_IMPORTED_MODULE_7_react__["cloneElement"])(child, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, _this5.getTabProps(child, tabContainer, role, active, childOnSelect), {
+ active: active,
+ activeKey: activeKey,
+ activeHref: activeHref,
+ onSelect: childOnSelect
+ }));
+ })
+ );
+ };
+
+ return Nav;
+}(__WEBPACK_IMPORTED_MODULE_7_react___default.a.Component);
+
+Nav.propTypes = propTypes;
+Nav.defaultProps = defaultProps;
+Nav.contextTypes = contextTypes;
+
+/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_12__utils_bootstrapUtils__["a" /* bsClass */])('nav', Object(__WEBPACK_IMPORTED_MODULE_12__utils_bootstrapUtils__["c" /* bsStyles */])(['tabs', 'pills'], Nav)));
+/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(11)))
+
+/***/ }),
+/* 229 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__ = __webpack_require__(9);
+
+
+
+
+
+
+
+
+
+
+
+var contextTypes = {
+ $bs_navbar: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.shape({
+ bsClass: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string
+ })
+};
+
+var NavbarBrand = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(NavbarBrand, _React$Component);
+
+ function NavbarBrand() {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, NavbarBrand);
+
+ return __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ NavbarBrand.prototype.render = function render() {
+ var _props = this.props,
+ className = _props.className,
+ children = _props.children,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['className', 'children']);
+
+ var navbarProps = this.context.$bs_navbar || { bsClass: 'navbar' };
+
+ var bsClassName = Object(__WEBPACK_IMPORTED_MODULE_8__utils_bootstrapUtils__["e" /* prefix */])(navbarProps, 'brand');
+
+ if (__WEBPACK_IMPORTED_MODULE_6_react___default.a.isValidElement(children)) {
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.cloneElement(children, {
+ className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(children.props.className, className, bsClassName)
+ });
+ }
+
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
+ 'span',
+ __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, props, { className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, bsClassName) }),
+ children
+ );
+ };
+
+ return NavbarBrand;
+}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
+
+NavbarBrand.contextTypes = contextTypes;
+
+/* harmony default export */ __webpack_exports__["a"] = (NavbarBrand);
+
+/***/ }),
+/* 230 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__SafeAnchor__ = __webpack_require__(27);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_createChainedFunction__ = __webpack_require__(19);
+
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ active: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ disabled: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ role: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,
+ href: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,
+ onClick: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+ onSelect: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+ eventKey: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.any
+};
+
+var defaultProps = {
+ active: false,
+ disabled: false
+};
+
+var NavItem = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(NavItem, _React$Component);
+
+ function NavItem(props, context) {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, NavItem);
+
+ var _this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.call(this, props, context));
+
+ _this.handleClick = _this.handleClick.bind(_this);
+ return _this;
+ }
+
+ NavItem.prototype.handleClick = function handleClick(e) {
+ if (this.props.disabled) {
+ e.preventDefault();
+ return;
+ }
+
+ if (this.props.onSelect) {
+ this.props.onSelect(this.props.eventKey, e);
+ }
+ };
+
+ NavItem.prototype.render = function render() {
+ var _props = this.props,
+ active = _props.active,
+ disabled = _props.disabled,
+ onClick = _props.onClick,
+ className = _props.className,
+ style = _props.style,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['active', 'disabled', 'onClick', 'className', 'style']);
+
+ delete props.onSelect;
+ delete props.eventKey;
+
+ // These are injected down by `` for building ``s.
+ delete props.activeKey;
+ delete props.activeHref;
+
+ if (!props.role) {
+ if (props.href === '#') {
+ props.role = 'button';
+ }
+ } else if (props.role === 'tab') {
+ props['aria-selected'] = active;
+ }
+
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
+ 'li',
+ {
+ role: 'presentation',
+ className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, { active: active, disabled: disabled }),
+ style: style
+ },
+ __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8__SafeAnchor__["a" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, props, {
+ disabled: disabled,
+ onClick: Object(__WEBPACK_IMPORTED_MODULE_9__utils_createChainedFunction__["a" /* default */])(onClick, this.handleClick)
+ }))
+ );
+ };
+
+ return NavItem;
+}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
+
+NavItem.propTypes = propTypes;
+NavItem.defaultProps = defaultProps;
+
+/* harmony default export */ __webpack_exports__["a"] = (NavItem);
+
+/***/ }),
+/* 231 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react_overlays_lib_Overlay__ = __webpack_require__(466);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react_overlays_lib_Overlay___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_react_overlays_lib_Overlay__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_prop_types_extra_lib_elementType__ = __webpack_require__(17);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_prop_types_extra_lib_elementType___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_prop_types_extra_lib_elementType__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__Fade__ = __webpack_require__(102);
+
+
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends___default()({}, __WEBPACK_IMPORTED_MODULE_8_react_overlays_lib_Overlay___default.a.propTypes, {
+
+ /**
+ * Set the visibility of the Overlay
+ */
+ show: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ /**
+ * Specify whether the overlay should trigger onHide when the user clicks outside the overlay
+ */
+ rootClose: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ /**
+ * A callback invoked by the overlay when it wishes to be hidden. Required if
+ * `rootClose` is specified.
+ */
+ onHide: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+
+ /**
+ * Use animation
+ */
+ animation: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_9_prop_types_extra_lib_elementType___default.a]),
+
+ /**
+ * Callback fired before the Overlay transitions in
+ */
+ onEnter: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+
+ /**
+ * Callback fired as the Overlay begins to transition in
+ */
+ onEntering: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+
+ /**
+ * Callback fired after the Overlay finishes transitioning in
+ */
+ onEntered: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+
+ /**
+ * Callback fired right before the Overlay transitions out
+ */
+ onExit: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+
+ /**
+ * Callback fired as the Overlay begins to transition out
+ */
+ onExiting: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+
+ /**
+ * Callback fired after the Overlay finishes transitioning out
+ */
+ onExited: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+
+ /**
+ * Sets the direction of the Overlay.
+ */
+ placement: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOf(['top', 'right', 'bottom', 'left'])
+});
+
+var defaultProps = {
+ animation: __WEBPACK_IMPORTED_MODULE_10__Fade__["a" /* default */],
+ rootClose: false,
+ show: false,
+ placement: 'right'
+};
+
+var Overlay = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(Overlay, _React$Component);
+
+ function Overlay() {
+ __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, Overlay);
+
+ return __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ Overlay.prototype.render = function render() {
+ var _props = this.props,
+ animation = _props.animation,
+ children = _props.children,
+ props = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['animation', 'children']);
+
+ var transition = animation === true ? __WEBPACK_IMPORTED_MODULE_10__Fade__["a" /* default */] : animation || null;
+
+ var child = void 0;
+
+ if (!transition) {
+ child = Object(__WEBPACK_IMPORTED_MODULE_6_react__["cloneElement"])(children, {
+ className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(children.props.className, 'in')
+ });
+ } else {
+ child = children;
+ }
+
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
+ __WEBPACK_IMPORTED_MODULE_8_react_overlays_lib_Overlay___default.a,
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends___default()({}, props, { transition: transition }),
+ child
+ );
+ };
+
+ return Overlay;
+}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
+
+Overlay.propTypes = propTypes;
+Overlay.defaultProps = defaultProps;
+
+/* harmony default export */ __webpack_exports__["a"] = (Overlay);
+
+/***/ }),
+/* 232 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = offset;
+
+var _contains = __webpack_require__(59);
+
+var _contains2 = _interopRequireDefault(_contains);
+
+var _isWindow = __webpack_require__(105);
+
+var _isWindow2 = _interopRequireDefault(_isWindow);
+
+var _ownerDocument = __webpack_require__(58);
+
+var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function offset(node) {
+ var doc = (0, _ownerDocument2.default)(node),
+ win = (0, _isWindow2.default)(doc),
+ docElem = doc && doc.documentElement,
+ box = { top: 0, left: 0, height: 0, width: 0 };
+
+ if (!doc) return;
+
+ // Make sure it's not a disconnected DOM node
+ if (!(0, _contains2.default)(docElem, node)) return box;
+
+ if (node.getBoundingClientRect !== undefined) box = node.getBoundingClientRect();
+
+ // IE8 getBoundingClientRect doesn't support width & height
+ box = {
+ top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0),
+ left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0),
+ width: (box.width == null ? node.offsetWidth : box.width) || 0,
+ height: (box.height == null ? node.offsetHeight : box.height) || 0
+ };
+
+ return box;
+}
+module.exports = exports['default'];
+
+/***/ }),
+/* 233 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = scrollTop;
+
+var _isWindow = __webpack_require__(105);
+
+var _isWindow2 = _interopRequireDefault(_isWindow);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function scrollTop(node, val) {
+ var win = (0, _isWindow2.default)(node);
+
+ if (val === undefined) return win ? 'pageYOffset' in win ? win.pageYOffset : win.document.documentElement.scrollTop : node.scrollTop;
+
+ if (win) win.scrollTo('pageXOffset' in win ? win.pageXOffset : win.document.documentElement.scrollLeft, val);else node.scrollTop = val;
+}
+module.exports = exports['default'];
+
+/***/ }),
+/* 234 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__SafeAnchor__ = __webpack_require__(27);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_createChainedFunction__ = __webpack_require__(19);
+
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ disabled: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ previous: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ next: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ onClick: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+ onSelect: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+ eventKey: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.any
+};
+
+var defaultProps = {
+ disabled: false,
+ previous: false,
+ next: false
+};
+
+var PagerItem = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(PagerItem, _React$Component);
+
+ function PagerItem(props, context) {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, PagerItem);
+
+ var _this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.call(this, props, context));
+
+ _this.handleSelect = _this.handleSelect.bind(_this);
+ return _this;
+ }
+
+ PagerItem.prototype.handleSelect = function handleSelect(e) {
+ var _props = this.props,
+ disabled = _props.disabled,
+ onSelect = _props.onSelect,
+ eventKey = _props.eventKey;
+
+
+ if (disabled) {
+ e.preventDefault();
+ return;
+ }
+
+ if (onSelect) {
+ onSelect(eventKey, e);
+ }
+ };
+
+ PagerItem.prototype.render = function render() {
+ var _props2 = this.props,
+ disabled = _props2.disabled,
+ previous = _props2.previous,
+ next = _props2.next,
+ onClick = _props2.onClick,
+ className = _props2.className,
+ style = _props2.style,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props2, ['disabled', 'previous', 'next', 'onClick', 'className', 'style']);
+
+ delete props.onSelect;
+ delete props.eventKey;
+
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
+ 'li',
+ {
+ className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, { disabled: disabled, previous: previous, next: next }),
+ style: style
+ },
+ __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8__SafeAnchor__["a" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, props, {
+ disabled: disabled,
+ onClick: Object(__WEBPACK_IMPORTED_MODULE_9__utils_createChainedFunction__["a" /* default */])(onClick, this.handleSelect)
+ }))
+ );
+ };
+
+ return PagerItem;
+}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
+
+PagerItem.propTypes = propTypes;
+PagerItem.defaultProps = defaultProps;
+
+/* harmony default export */ __webpack_exports__["a"] = (PagerItem);
+
+/***/ }),
+/* 235 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__utils_bootstrapUtils__ = __webpack_require__(9);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Collapse__ = __webpack_require__(144);
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ /**
+ * Callback fired before the component expands
+ */
+ onEnter: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
+ /**
+ * Callback fired after the component starts to expand
+ */
+ onEntering: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
+ /**
+ * Callback fired after the component has expanded
+ */
+ onEntered: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
+ /**
+ * Callback fired before the component collapses
+ */
+ onExit: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
+ /**
+ * Callback fired after the component starts to collapse
+ */
+ onExiting: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
+ /**
+ * Callback fired after the component has collapsed
+ */
+ onExited: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func
+};
+
+var contextTypes = {
+ $bs_panel: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.shape({
+ headingId: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
+ bodyId: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
+ bsClass: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
+ expanded: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool
+ })
+};
+
+var PanelCollapse = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(PanelCollapse, _React$Component);
+
+ function PanelCollapse() {
+ __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, PanelCollapse);
+
+ return __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ PanelCollapse.prototype.render = function render() {
+ var children = this.props.children;
+
+ var _ref = this.context.$bs_panel || {},
+ headingId = _ref.headingId,
+ bodyId = _ref.bodyId,
+ _bsClass = _ref.bsClass,
+ expanded = _ref.expanded;
+
+ var _splitBsProps = Object(__WEBPACK_IMPORTED_MODULE_6__utils_bootstrapUtils__["f" /* splitBsProps */])(this.props),
+ bsProps = _splitBsProps[0],
+ props = _splitBsProps[1];
+
+ bsProps.bsClass = _bsClass || bsProps.bsClass;
+
+ if (headingId && bodyId) {
+ props.id = bodyId;
+ props.role = props.role || 'tabpanel';
+ props['aria-labelledby'] = headingId;
+ }
+
+ return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(
+ __WEBPACK_IMPORTED_MODULE_7__Collapse__["a" /* default */],
+ __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({ 'in': expanded }, props),
+ __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(
+ 'div',
+ { className: Object(__WEBPACK_IMPORTED_MODULE_6__utils_bootstrapUtils__["e" /* prefix */])(bsProps, 'collapse') },
+ children
+ )
+ );
+ };
+
+ return PanelCollapse;
+}(__WEBPACK_IMPORTED_MODULE_5_react___default.a.Component);
+
+PanelCollapse.propTypes = propTypes;
+PanelCollapse.contextTypes = contextTypes;
+
+/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_6__utils_bootstrapUtils__["a" /* bsClass */])('panel', PanelCollapse));
+
+/***/ }),
+/* 236 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react_prop_types_lib_elementType__ = __webpack_require__(148);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react_prop_types_lib_elementType___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react_prop_types_lib_elementType__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__SafeAnchor__ = __webpack_require__(27);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_createChainedFunction__ = __webpack_require__(19);
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ /**
+ * only here to satisfy linting, just the html onClick handler.
+ *
+ * @private
+ */
+ onClick: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
+ /**
+ * You can use a custom element for this component
+ */
+ componentClass: __WEBPACK_IMPORTED_MODULE_7_react_prop_types_lib_elementType___default.a
+};
+
+var defaultProps = {
+ componentClass: __WEBPACK_IMPORTED_MODULE_8__SafeAnchor__["a" /* default */]
+};
+
+var contextTypes = {
+ $bs_panel: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.shape({
+ bodyId: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
+ onToggle: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
+ expanded: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool
+ })
+};
+
+var PanelToggle = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(PanelToggle, _React$Component);
+
+ function PanelToggle() {
+ __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, PanelToggle);
+
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ var _this = __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.call.apply(_React$Component, [this].concat(args)));
+
+ _this.handleToggle = _this.handleToggle.bind(_this);
+ return _this;
+ }
+
+ PanelToggle.prototype.handleToggle = function handleToggle(event) {
+ var _ref = this.context.$bs_panel || {},
+ onToggle = _ref.onToggle;
+
+ if (onToggle) {
+ onToggle(event);
+ }
+ };
+
+ PanelToggle.prototype.render = function render() {
+ var _props = this.props,
+ onClick = _props.onClick,
+ className = _props.className,
+ componentClass = _props.componentClass,
+ props = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['onClick', 'className', 'componentClass']);
+
+ var _ref2 = this.context.$bs_panel || {},
+ expanded = _ref2.expanded,
+ bodyId = _ref2.bodyId;
+
+ var Component = componentClass;
+
+ props.onClick = Object(__WEBPACK_IMPORTED_MODULE_9__utils_createChainedFunction__["a" /* default */])(onClick, this.handleToggle);
+
+ props['aria-expanded'] = expanded;
+ props.className = __WEBPACK_IMPORTED_MODULE_6_classnames___default()(className, !expanded && 'collapsed');
+
+ if (bodyId) {
+ props['aria-controls'] = bodyId;
+ }
+
+ return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(Component, props);
+ };
+
+ return PanelToggle;
+}(__WEBPACK_IMPORTED_MODULE_5_react___default.a.Component);
+
+PanelToggle.propTypes = propTypes;
+PanelToggle.defaultProps = defaultProps;
+PanelToggle.contextTypes = contextTypes;
+
+/* harmony default export */ __webpack_exports__["a"] = (PanelToggle);
+
+/***/ }),
+/* 237 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_elementType__ = __webpack_require__(17);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_elementType___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_elementType__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_warning__ = __webpack_require__(24);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_warning__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils_bootstrapUtils__ = __webpack_require__(9);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__utils_createChainedFunction__ = __webpack_require__(19);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__Fade__ = __webpack_require__(102);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ /**
+ * Uniquely identify the `` among its siblings.
+ */
+ eventKey: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.any,
+
+ /**
+ * Use animation when showing or hiding ``s. Use `false` to disable,
+ * `true` to enable the default `` animation or
+ * a react-transition-group v2 ` ` component.
+ */
+ animation: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_elementType___default.a]),
+
+ /** @private * */
+ id: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,
+
+ /** @private * */
+ 'aria-labelledby': __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,
+
+ /**
+ * If not explicitly specified and rendered in the context of a
+ * ``, the `bsClass` of the `` suffixed by `-pane`.
+ * If otherwise not explicitly specified, `tab-pane`.
+ */
+ bsClass: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,
+
+ /**
+ * Transition onEnter callback when animation is not `false`
+ */
+ onEnter: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+
+ /**
+ * Transition onEntering callback when animation is not `false`
+ */
+ onEntering: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+
+ /**
+ * Transition onEntered callback when animation is not `false`
+ */
+ onEntered: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+
+ /**
+ * Transition onExit callback when animation is not `false`
+ */
+ onExit: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+
+ /**
+ * Transition onExiting callback when animation is not `false`
+ */
+ onExiting: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+
+ /**
+ * Transition onExited callback when animation is not `false`
+ */
+ onExited: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+
+ /**
+ * Wait until the first "enter" transition to mount the tab (add it to the DOM)
+ */
+ mountOnEnter: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+
+ /**
+ * Unmount the tab (remove it from the DOM) when it is no longer visible
+ */
+ unmountOnExit: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool
+};
+
+var contextTypes = {
+ $bs_tabContainer: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.shape({
+ getTabId: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
+ getPaneId: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func
+ }),
+ $bs_tabContent: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.shape({
+ bsClass: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,
+ animation: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_8_prop_types_extra_lib_elementType___default.a]),
+ activeKey: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.any,
+ mountOnEnter: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ unmountOnExit: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
+ onPaneEnter: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func.isRequired,
+ onPaneExited: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func.isRequired,
+ exiting: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool.isRequired
+ })
+};
+
+/**
+ * We override the `` context so ``s in ``s don't
+ * conflict with the top level one.
+ */
+var childContextTypes = {
+ $bs_tabContainer: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOf([null])
+};
+
+var TabPane = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(TabPane, _React$Component);
+
+ function TabPane(props, context) {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, TabPane);
+
+ var _this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.call(this, props, context));
+
+ _this.handleEnter = _this.handleEnter.bind(_this);
+ _this.handleExited = _this.handleExited.bind(_this);
+
+ _this.in = false;
+ return _this;
+ }
+
+ TabPane.prototype.getChildContext = function getChildContext() {
+ return {
+ $bs_tabContainer: null
+ };
+ };
+
+ TabPane.prototype.componentDidMount = function componentDidMount() {
+ if (this.shouldBeIn()) {
+ // In lieu of the action event firing.
+ this.handleEnter();
+ }
+ };
+
+ TabPane.prototype.componentDidUpdate = function componentDidUpdate() {
+ if (this.in) {
+ if (!this.shouldBeIn()) {
+ // We shouldn't be active any more. Notify the parent.
+ this.handleExited();
+ }
+ } else if (this.shouldBeIn()) {
+ // We are the active child. Notify the parent.
+ this.handleEnter();
+ }
+ };
+
+ TabPane.prototype.componentWillUnmount = function componentWillUnmount() {
+ if (this.in) {
+ // In lieu of the action event firing.
+ this.handleExited();
+ }
+ };
+
+ TabPane.prototype.getAnimation = function getAnimation() {
+ if (this.props.animation != null) {
+ return this.props.animation;
+ }
+
+ var tabContent = this.context.$bs_tabContent;
+ return tabContent && tabContent.animation;
+ };
+
+ TabPane.prototype.handleEnter = function handleEnter() {
+ var tabContent = this.context.$bs_tabContent;
+ if (!tabContent) {
+ return;
+ }
+
+ this.in = tabContent.onPaneEnter(this, this.props.eventKey);
+ };
+
+ TabPane.prototype.handleExited = function handleExited() {
+ var tabContent = this.context.$bs_tabContent;
+ if (!tabContent) {
+ return;
+ }
+
+ tabContent.onPaneExited(this);
+ this.in = false;
+ };
+
+ TabPane.prototype.isActive = function isActive() {
+ var tabContent = this.context.$bs_tabContent;
+ var activeKey = tabContent && tabContent.activeKey;
+
+ return this.props.eventKey === activeKey;
+ };
+
+ TabPane.prototype.shouldBeIn = function shouldBeIn() {
+ return this.getAnimation() && this.isActive();
+ };
+
+ TabPane.prototype.render = function render() {
+ var _props = this.props,
+ eventKey = _props.eventKey,
+ className = _props.className,
+ onEnter = _props.onEnter,
+ onEntering = _props.onEntering,
+ onEntered = _props.onEntered,
+ onExit = _props.onExit,
+ onExiting = _props.onExiting,
+ onExited = _props.onExited,
+ propsMountOnEnter = _props.mountOnEnter,
+ propsUnmountOnExit = _props.unmountOnExit,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['eventKey', 'className', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited', 'mountOnEnter', 'unmountOnExit']);
+
+ var _context = this.context,
+ tabContent = _context.$bs_tabContent,
+ tabContainer = _context.$bs_tabContainer;
+
+ var _splitBsPropsAndOmit = Object(__WEBPACK_IMPORTED_MODULE_10__utils_bootstrapUtils__["g" /* splitBsPropsAndOmit */])(props, ['animation']),
+ bsProps = _splitBsPropsAndOmit[0],
+ elementProps = _splitBsPropsAndOmit[1];
+
+ var active = this.isActive();
+ var animation = this.getAnimation();
+
+ var mountOnEnter = propsMountOnEnter != null ? propsMountOnEnter : tabContent && tabContent.mountOnEnter;
+ var unmountOnExit = propsUnmountOnExit != null ? propsUnmountOnExit : tabContent && tabContent.unmountOnExit;
+
+ if (!active && !animation && unmountOnExit) {
+ return null;
+ }
+
+ var Transition = animation === true ? __WEBPACK_IMPORTED_MODULE_12__Fade__["a" /* default */] : animation || null;
+
+ if (tabContent) {
+ bsProps.bsClass = Object(__WEBPACK_IMPORTED_MODULE_10__utils_bootstrapUtils__["e" /* prefix */])(tabContent, 'pane');
+ }
+
+ var classes = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, Object(__WEBPACK_IMPORTED_MODULE_10__utils_bootstrapUtils__["d" /* getClassSet */])(bsProps), {
+ active: active
+ });
+
+ if (tabContainer) {
+ process.env.NODE_ENV !== 'production' ? __WEBPACK_IMPORTED_MODULE_9_warning___default()(!elementProps.id && !elementProps['aria-labelledby'], 'In the context of a ``, `` are given ' + 'generated `id` and `aria-labelledby` attributes for the sake of ' + 'proper component accessibility. Any provided ones will be ignored. ' + 'To control these attributes directly provide a `generateChildId` ' + 'prop to the parent ``.') : void 0;
+
+ elementProps.id = tabContainer.getPaneId(eventKey);
+ elementProps['aria-labelledby'] = tabContainer.getTabId(eventKey);
+ }
+
+ var pane = __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('div', __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, elementProps, {
+ role: 'tabpanel',
+ 'aria-hidden': !active,
+ className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className, classes)
+ }));
+
+ if (Transition) {
+ var exiting = tabContent && tabContent.exiting;
+
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
+ Transition,
+ {
+ 'in': active && !exiting,
+ onEnter: Object(__WEBPACK_IMPORTED_MODULE_11__utils_createChainedFunction__["a" /* default */])(this.handleEnter, onEnter),
+ onEntering: onEntering,
+ onEntered: onEntered,
+ onExit: onExit,
+ onExiting: onExiting,
+ onExited: Object(__WEBPACK_IMPORTED_MODULE_11__utils_createChainedFunction__["a" /* default */])(this.handleExited, onExited),
+ mountOnEnter: mountOnEnter,
+ unmountOnExit: unmountOnExit
+ },
+ pane
+ );
+ }
+
+ return pane;
+ };
+
+ return TabPane;
+}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
+
+TabPane.propTypes = propTypes;
+TabPane.contextTypes = contextTypes;
+TabPane.childContextTypes = childContextTypes;
+
+/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_10__utils_bootstrapUtils__["a" /* bsClass */])('tab-pane', TabPane));
+/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(11)))
+
+/***/ }),
+/* 238 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(4);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(8);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_prop_types__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Button__ = __webpack_require__(74);
+
+
+
+
+
+
+
+
+
+
+var propTypes = {
+ /**
+ * The ` ` `type`
+ * @type {[type]}
+ */
+ type: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.oneOf(['checkbox', 'radio']),
+
+ /**
+ * The HTML input name, used to group like checkboxes or radio buttons together
+ * semantically
+ */
+ name: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
+
+ /**
+ * The checked state of the input, managed by ``` automatically
+ */
+ checked: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool,
+
+ /**
+ * The disabled state of both the label and input
+ */
+ disabled: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool,
+
+ /**
+ * [onChange description]
+ */
+ onChange: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
+ /**
+ * The value of the input, and unique identifier in the ToggleButtonGroup
+ */
+ value: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.any.isRequired
+};
+
+var ToggleButton = function (_React$Component) {
+ __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(ToggleButton, _React$Component);
+
+ function ToggleButton() {
+ __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, ToggleButton);
+
+ return __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
+ }
+
+ ToggleButton.prototype.render = function render() {
+ var _props = this.props,
+ children = _props.children,
+ name = _props.name,
+ checked = _props.checked,
+ type = _props.type,
+ onChange = _props.onChange,
+ value = _props.value,
+ props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['children', 'name', 'checked', 'type', 'onChange', 'value']);
+
+ var disabled = props.disabled;
+
+ return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
+ __WEBPACK_IMPORTED_MODULE_7__Button__["a" /* default */],
+ __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, props, { active: !!checked, componentClass: 'label' }),
+ __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('input', {
+ name: name,
+ type: type,
+ autoComplete: 'off',
+ value: value,
+ checked: !!checked,
+ disabled: !!disabled,
+ onChange: onChange
+ }),
+ children
+ );
+ };
+
+ return ToggleButton;
+}(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
+
+ToggleButton.propTypes = propTypes;
+
+/* harmony default export */ __webpack_exports__["a"] = (ToggleButton);
+
+/***/ }),
+/* 239 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(global, setImmediate) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var require;var require;var _typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};!function(e){if("object"===( false?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=e();else if(true)!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (e),
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
+ (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Web3=e()}}(function(){var define,module,exports;return function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return require(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return r(n||e)},l,l.exports,e,t,n,i)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a>6],r=0==(32&n);if(31==(31&n)){var o=n;for(n=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;n<<=7,n|=127&o}}else n&=31;return{cls:i,primitive:r,tag:n,tagStr:f.tag[n]}}function a(e,t,n){var i=e.readUInt8(n);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var r=127&i;if(r>4)return e.error("length octect is too long");i=0;for(var o=0;o=31?i.error("Multi-octet tag encoding unsupported"):(t||(r|=32),r|=f.tagClassByName[n||"universal"]<<6)}var s=e("inherits"),c=e("buffer").Buffer,u=e("../../asn1"),l=u.base,f=u.constants.der;t.exports=i,i.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},s(r,l.Node),r.prototype._encodeComposite=function(e,t,n,i){var r=a(e,t,n,this.reporter);if(i.length<128)return(u=new c(2))[0]=r,u[1]=i.length,this._createEncoderBuffer([u,i]);for(var o=1,s=i.length;s>=256;s>>=8)o++;var u=new c(2+o);u[0]=r,u[1]=128|o;for(var s=1+o,l=i.length;l>0;s--,l>>=8)u[s]=255&l;return this._createEncoderBuffer([u,i])},r.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var n=new c(2*e.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}for(var i=0,r=0;r=128;s>>=7)i++}for(var o=new c(i),a=o.length-1,r=e.length-1;r>=0;r--){var s=e[r];for(o[a--]=127&s;(s>>=7)>0;)o[a--]=128|127&s}return this._createEncoderBuffer(o)},r.prototype._encodeTime=function(e,t){var n,i=new Date(e);return"gentime"===t?n=[o(i.getFullYear()),o(i.getUTCMonth()+1),o(i.getUTCDate()),o(i.getUTCHours()),o(i.getUTCMinutes()),o(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?n=[o(i.getFullYear()%100),o(i.getUTCMonth()+1),o(i.getUTCDate()),o(i.getUTCHours()),o(i.getUTCMinutes()),o(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")},r.prototype._encodeNull=function(){return this._createEncoderBuffer("")},r.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!c.isBuffer(e)){var n=e.toArray();!e.sign&&128&n[0]&&n.unshift(0),e=new c(n)}if(c.isBuffer(e)){r=e.length;0===e.length&&r++;var i=new c(r);return e.copy(i),0===e.length&&(i[0]=0),this._createEncoderBuffer(i)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);for(var r=1,o=e;o>=256;o>>=8)r++;for(o=(i=new Array(r)).length-1;o>=0;o--)i[o]=255&e,e>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(new c(i))},r.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},r.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},r.prototype._skipDefault=function(e,t,n){var i,r=this._baseState;if(null===r.default)return!1;var o=e.join();if(void 0===r.defaultBuffer&&(r.defaultBuffer=this._encodeValue(r.default,t,n).join()),o.length!==r.defaultBuffer.length)return!1;for(i=0;i0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function r(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}function o(e,t,n){for(var i,o=[],a=t;a0?u-4:u;var l=0;for(t=0;t>16&255,a[l++]=r>>8&255,a[l++]=255&r;return 2===o?(r=s[e.charCodeAt(t)]<<2|s[e.charCodeAt(t+1)]>>4,a[l++]=255&r):1===o&&(r=s[e.charCodeAt(t)]<<10|s[e.charCodeAt(t+1)]<<4|s[e.charCodeAt(t+2)]>>2,a[l++]=r>>8&255,a[l++]=255&r),a},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,r="",s=[],c=0,u=n-i;cu?u:c+16383));return 1===i?(t=e[n-1],r+=a[t>>2],r+=a[t<<4&63],r+="=="):2===i&&(t=(e[n-2]<<8)+e[n-1],r+=a[t>>10],r+=a[t>>4&63],r+=a[t<<2&63],r+="="),s.push(r),s.join("")};for(var a=[],s=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,f=u.length;l>>24]^l[h>>>16&255]^f[m>>>8&255]^p[255&v]^t[b++],a=u[h>>>24]^l[m>>>16&255]^f[v>>>8&255]^p[255&d]^t[b++],s=u[m>>>24]^l[v>>>16&255]^f[d>>>8&255]^p[255&h]^t[b++],c=u[v>>>24]^l[d>>>16&255]^f[h>>>8&255]^p[255&m]^t[b++],d=o,h=a,m=s,v=c;return o=(i[d>>>24]<<24|i[h>>>16&255]<<16|i[m>>>8&255]<<8|i[255&v])^t[b++],a=(i[h>>>24]<<24|i[m>>>16&255]<<16|i[v>>>8&255]<<8|i[255&d])^t[b++],s=(i[m>>>24]<<24|i[v>>>16&255]<<16|i[d>>>8&255]<<8|i[255&h])^t[b++],c=(i[v>>>24]<<24|i[d>>>16&255]<<16|i[h>>>8&255]<<8|i[255&m])^t[b++],o>>>=0,a>>>=0,s>>>=0,c>>>=0,[o,a,s,c]}function a(e){this._key=i(e),this._reset()}var s=e("safe-buffer").Buffer,c=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=[],i=[],r=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,c=0;c<256;++c){var u=s^s<<1^s<<2^s<<3^s<<4;u=u>>>8^255&u^99,n[a]=u,i[u]=a;var l=e[a],f=e[l],p=e[f],d=257*e[u]^16843008*u;r[0][a]=d<<24|d>>>8,r[1][a]=d<<16|d>>>16,r[2][a]=d<<8|d>>>24,r[3][a]=d,d=16843009*p^65537*f^257*l^16843008*a,o[0][u]=d<<24|d>>>8,o[1][u]=d<<16|d>>>16,o[2][u]=d<<8|d>>>24,o[3][u]=d,0===a?a=s=1:(a=l^e[e[e[p^l]]],s^=e[e[s]])}return{SBOX:n,INV_SBOX:i,SUB_MIX:r,INV_SUB_MIX:o}}();a.blockSize=16,a.keySize=32,a.prototype.blockSize=a.blockSize,a.prototype.keySize=a.keySize,a.prototype._reset=function(){for(var e=this._key,t=e.length,n=t+6,i=4*(n+1),r=[],o=0;o>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=c[o/t|0]<<24):t>6&&o%t==4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),r[o]=r[o-t]^a}for(var s=[],l=0;l>>24]]^u.INV_SUB_MIX[1][u.SBOX[p>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[p>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&p]]}this._nRounds=n,this._keySchedule=r,this._invKeySchedule=s},a.prototype.encryptBlockRaw=function(e){return e=i(e),o(e,this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},a.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),n=s.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[1],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[3],12),n},a.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var n=o(e,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),r=s.allocUnsafe(16);return r.writeUInt32BE(n[0],0),r.writeUInt32BE(n[3],4),r.writeUInt32BE(n[2],8),r.writeUInt32BE(n[1],12),r},a.prototype.scrub=function(){r(this._keySchedule),r(this._invKeySchedule),r(this._key)},t.exports.AES=a},{"safe-buffer":144}],19:[function(e,t,n){function i(e,t){var n=0;e.length!==t.length&&n++;for(var i=Math.min(e.length,t.length),r=0;r16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},r.prototype.flush=function(){if(this.cache.length)return this.cache},n.createDecipher=function(e,t){var n=u[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var i=d(t,!1,n.key,n.iv);return a(e,i.key,i.iv)},n.createDecipheriv=a},{"./aes":18,"./authCipher":19,"./modes":30,"./streamCipher":33,"cipher-base":48,evp_bytestokey:84,inherits:101,"safe-buffer":144}],22:[function(e,t,n){function i(e,t,n){l.call(this),this._cache=new r,this._cipher=new f.AES(t),this._prev=c.from(n),this._mode=e,this._autopadding=!0}function r(){this.cache=c.allocUnsafe(0)}function o(e,t,n){var r=a[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=c.from(t)),t.length!==r.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof n&&(n=c.from(n)),n.length!==r.iv)throw new TypeError("invalid iv length "+n.length);return"stream"===r.type?new u(r.module,t,n):"auth"===r.type?new s(r.module,t,n):new i(r.module,t,n)}var a=e("./modes"),s=e("./authCipher"),c=e("safe-buffer").Buffer,u=e("./streamCipher"),l=e("cipher-base"),f=e("./aes"),p=e("evp_bytestokey");e("inherits")(i,l),i.prototype._update=function(e){this._cache.add(e);for(var t,n,i=[];t=this._cache.get();)n=this._mode.encrypt(this,t),i.push(n);return c.concat(i)};var d=c.alloc(16,16);i.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(d))throw this._cipher.scrub(),new Error("data not multiple of block length")},i.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},r.prototype.add=function(e){this.cache=c.concat([this.cache,e])},r.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},r.prototype.flush=function(){for(var e=16-this.cache.length,t=c.allocUnsafe(e),n=-1;++n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function o(e){this.h=e,this.state=a.alloc(16,0),this.cache=a.allocUnsafe(0)}var a=e("safe-buffer").Buffer,s=a.alloc(16,0);o.prototype.ghash=function(e){for(var t=-1;++t0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,t&&(n[0]=n[0]^225<<24)}this.state=r(o)},o.prototype.update=function(e){this.cache=a.concat([this.cache,e]);for(var t;this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},o.prototype.final=function(e,t){return this.cache.length&&this.ghash(a.concat([this.cache,s],16)),this.ghash(r([0,e,0,t])),this.state},t.exports=o},{"safe-buffer":144}],24:[function(e,t,n){var i=e("buffer-xor");n.encrypt=function(e,t){var n=i(t,e._prev);return e._prev=e._cipher.encryptBlock(n),e._prev},n.decrypt=function(e,t){var n=e._prev;e._prev=t;var r=e._cipher.decryptBlock(t);return i(r,n)}},{"buffer-xor":46}],25:[function(e,t,n){function i(e,t,n){var i=t.length,a=o(t,e._cache);return e._cache=e._cache.slice(i),e._prev=r.concat([e._prev,n?t:a]),a}var r=e("safe-buffer").Buffer,o=e("buffer-xor");n.encrypt=function(e,t,n){for(var o,a=r.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=r.allocUnsafe(0)),!(e._cache.length<=t.length)){a=r.concat([a,i(e,t,n)]);break}o=e._cache.length,a=r.concat([a,i(e,t.slice(0,o),n)]),t=t.slice(o)}return a}},{"buffer-xor":46,"safe-buffer":144}],26:[function(e,t,n){function i(e,t,n){for(var i,o,a,s=-1,c=0;++s<8;)i=e._cipher.encryptBlock(e._prev),o=t&1<<7-s?128:0,c+=(128&(a=i[0]^o))>>s%8,e._prev=r(e._prev,n?o:a);return c}function r(e,t){var n=e.length,i=-1,r=o.allocUnsafe(e.length);for(e=o.concat([e,o.from([t])]);++i>7;return r}var o=e("safe-buffer").Buffer;n.encrypt=function(e,t,n){for(var r=t.length,a=o.allocUnsafe(r),s=-1;++s=0||!n.umod(e.prime1)||!n.umod(e.prime2);)n=new a(s(t));return n}var a=e("bn.js"),s=e("randombytes");t.exports=r,r.getr=o}).call(this,e("buffer").Buffer)},{"bn.js":"BN",buffer:47,randombytes:127}],38:[function(e,t,n){t.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":39}],39:[function(e,t,n){t.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],40:[function(e,t,n){t.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],41:[function(e,t,n){(function(n){function i(e){c.Writable.call(this);var t=p[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=s(t.hash),this._tag=t.id,this._signType=t.sign}function r(e){c.Writable.call(this);var t=p[e];if(!t)throw new Error("Unknown message digest");this._hash=s(t.hash),this._tag=t.id,this._signType=t.sign}function o(e){return new i(e)}function a(e){return new r(e)}var s=e("create-hash"),c=e("stream"),u=e("inherits"),l=e("./sign"),f=e("./verify"),p=e("./algorithms.json");Object.keys(p).forEach(function(e){p[e].id=new n(p[e].id,"hex"),p[e.toLowerCase()]=p[e]}),u(i,c.Writable),i.prototype._write=function(e,t,n){this._hash.update(e),n()},i.prototype.update=function(e,t){return"string"==typeof e&&(e=new n(e,t)),this._hash.update(e),this},i.prototype.sign=function(e,t){this.end();var n=this._hash.digest(),i=l(n,e,this._hashType,this._signType,this._tag);return t?i.toString(t):i},u(r,c.Writable),r.prototype._write=function(e,t,n){this._hash.update(e),n()},r.prototype.update=function(e,t){return"string"==typeof e&&(e=new n(e,t)),this._hash.update(e),this},r.prototype.verify=function(e,t,i){"string"==typeof t&&(t=new n(t,i)),this.end();var r=this._hash.digest();return f(t,r,e,this._signType,this._tag)},t.exports={Sign:o,Verify:a,createSign:o,createVerify:a}}).call(this,e("buffer").Buffer)},{"./algorithms.json":39,"./sign":42,"./verify":43,buffer:47,"create-hash":51,inherits:101,stream:155}],42:[function(e,t,n){(function(n){function i(e,t){var i=v[t.curve.join(".")];if(!i)throw new Error("unknown curve "+t.curve.join("."));var r=new d(i).keyFromPrivate(t.privateKey).sign(e);return new n(r.toDER())}function r(e,t,n){for(var i,r=t.params.priv_key,c=t.params.p,f=t.params.q,p=t.params.g,d=new h(0),m=s(e,f).mod(f),v=!1,b=a(r,f,e,n);!1===v;)d=l(p,i=u(f,b,n),c,f),0===(v=i.invm(f).imul(m.add(r.mul(d))).mod(f)).cmpn(0)&&(v=!1,d=new h(0));return o(d,v)}function o(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e)),128&t[0]&&(t=[0].concat(t));var i=[48,e.length+t.length+4,2,e.length];return i=i.concat(e,[2,t.length],t),new n(i)}function a(e,t,i,r){if((e=new n(e.toArray())).length0&&n.ishrn(i),n}function c(e,t){e=(e=s(e,t)).mod(t);var i=new n(e.toArray());if(i.length=t)throw new Error("invalid sig")}var a=e("bn.js"),s=e("elliptic").ec,c=e("parse-asn1"),u=e("./curves.json");t.exports=function(e,t,o,s,u){var l=c(o);if("ec"===l.type){if("ecdsa"!==s&&"ecdsa/rsa"!==s)throw new Error("wrong public key type");return i(e,t,l)}if("dsa"===l.type){if("dsa"!==s)throw new Error("wrong public key type");return r(e,t,l)}if("rsa"!==s&&"ecdsa/rsa"!==s)throw new Error("wrong public key type");t=n.concat([u,t]);for(var f=l.modulus.byteLength(),p=[1],d=0;t.length+p.length+2>5==6?2:e>>4==14?3:e>>3==30?4:-1}function s(e,t,n){var i=t.length-1;if(i=0?(r>0&&(e.lastNeed=r-1),r):--i=0?(r>0&&(e.lastNeed=r-2),r):--i=0?(r>0&&(2===r?r=0:e.lastNeed=r-3),r):0}function c(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�".repeat(n);if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�".repeat(n+1);if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�".repeat(n+2)}}function u(e){var t=this.lastTotal-this.lastNeed,n=c(this,e,t);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function f(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function p(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function m(e){return e&&e.length?this.write(e):""}var v=e("safe-buffer").Buffer,b=v.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};n.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n$)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=r.prototype,t}function r(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return c(e)}return o(e,t,n)}function o(e,t,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return V(e)?f(e,t,n):"string"==typeof e?u(e,t):p(e)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function s(e,t,n){return a(e),e<=0?i(e):void 0!==t?"string"==typeof n?i(e).fill(t,n):i(e).fill(t):i(e)}function c(e){return a(e),i(e<0?0:0|d(e))}function u(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!r.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(e,t),o=i(n),a=o.write(e,t);return a!==n&&(o=o.slice(0,a)),o}function l(e){for(var t=e.length<0?0:0|d(e.length),n=i(t),r=0;r=$)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$.toString(16)+" bytes");return 0|e}function h(e,t){if(r.isBuffer(e))return e.length;if(K(e)||V(e))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(i)return L(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return M(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function v(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function b(e,t,n,i,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,W(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=r.from(t,i)),r.isBuffer(t))return 0===t.length?-1:y(e,t,n,i,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,i,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,i,r){function o(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,s=e.length,c=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}var u;if(r){var l=-1;for(u=n;us&&(n=s-c),u=n;u>=0;u--){for(var f=!0,p=0;pr&&(i=r):i=r;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(r+s<=n){var c,u,l,f;switch(s){case 1:o<128&&(a=o);break;case 2:128==(192&(c=e[r+1]))&&(f=(31&o)<<6|63&c)>127&&(a=f);break;case 3:c=e[r+1],u=e[r+2],128==(192&c)&&128==(192&u)&&(f=(15&o)<<12|(63&c)<<6|63&u)>2047&&(f<55296||f>57343)&&(a=f);break;case 4:c=e[r+1],u=e[r+2],l=e[r+3],128==(192&c)&&128==(192&u)&&128==(192&l)&&(f=(15&o)<<18|(63&c)<<12|(63&u)<<6|63&l)>65535&&f<1114112&&(a=f)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|1023&a),i.push(a),r+=s}return A(i)}function A(e){var t=e.length;if(t<=J)return String.fromCharCode.apply(String,e);for(var n="",i=0;ii)&&(n=i);for(var r="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,n,i,o,a){if(!r.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function B(e,t,n,i,r,o){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function R(e,t,n,i,r){return t=+t,n>>>=0,r||B(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),G.write(e,t,n,i,23,4),n+4}function O(e,t,n,i,r){return t=+t,n>>>=0,r||B(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),G.write(e,t,n,i,52,8),n+8}function N(e){if((e=e.trim().replace(Q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function D(e){return e<16?"0"+e.toString(16):e.toString(16)}function L(e,t){t=t||1/0;for(var n,i=e.length,r=null,o=[],a=0;a55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(e){for(var t=[],n=0;n>8,r=n%256,o.push(r),o.push(i);return o}function U(e){return X.toByteArray(N(e))}function H(e,t,n,i){for(var r=0;r=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function V(e){return e instanceof ArrayBuffer||null!=e&&null!=e.constructor&&"ArrayBuffer"===e.constructor.name&&"number"==typeof e.byteLength}function K(e){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(e)}function W(e){return e!==e}var X=e("base64-js"),G=e("ieee754");n.Buffer=r,n.SlowBuffer=function(e){return+e!=e&&(e=0),r.alloc(+e)},n.INSPECT_MAX_BYTES=50;var $=2147483647;n.kMaxLength=$,r.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),r.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&r[Symbol.species]===r&&Object.defineProperty(r,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),r.poolSize=8192,r.from=function(e,t,n){return o(e,t,n)},r.prototype.__proto__=Uint8Array.prototype,r.__proto__=Uint8Array,r.alloc=function(e,t,n){return s(e,t,n)},r.allocUnsafe=function(e){return c(e)},r.allocUnsafeSlow=function(e){return c(e)},r.isBuffer=function(e){return null!=e&&!0===e._isBuffer},r.compare=function(e,t){if(!r.isBuffer(e)||!r.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,o=0,a=Math.min(n,i);o0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},r.prototype.compare=function(e,t,n,i,o){if(!r.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),t<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var a=o-i,s=n-t,c=Math.min(a,s),u=this.slice(i,o),l=e.slice(t,n),f=0;f>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return x(this,e,t,n);case"latin1":case"binary":return w(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var J=4096;r.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||F(e,t,this.length);for(var i=this[e],r=1,o=0;++o>>=0,t>>>=0,n||F(e,t,this.length);for(var i=this[e+--t],r=1;t>0&&(r*=256);)i+=this[e+--t]*r;return i},r.prototype.readUInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),this[e]},r.prototype.readUInt16LE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]|this[e+1]<<8},r.prototype.readUInt16BE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]<<8|this[e+1]},r.prototype.readUInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},r.prototype.readUInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},r.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||F(e,t,this.length);for(var i=this[e],r=1,o=0;++o=r&&(i-=Math.pow(2,8*t)),i},r.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||F(e,t,this.length);for(var i=t,r=1,o=this[e+--i];i>0&&(r*=256);)o+=this[e+--i]*r;return r*=128,o>=r&&(o-=Math.pow(2,8*t)),o},r.prototype.readInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},r.prototype.readInt16LE=function(e,t){e>>>=0,t||F(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt16BE=function(e,t){e>>>=0,t||F(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},r.prototype.readInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},r.prototype.readFloatLE=function(e,t){return e>>>=0,t||F(e,4,this.length),G.read(this,e,!0,23,4)},r.prototype.readFloatBE=function(e,t){return e>>>=0,t||F(e,4,this.length),G.read(this,e,!1,23,4)},r.prototype.readDoubleLE=function(e,t){return e>>>=0,t||F(e,8,this.length),G.read(this,e,!0,52,8)},r.prototype.readDoubleBE=function(e,t){return e>>>=0,t||F(e,8,this.length),G.read(this,e,!1,52,8)},r.prototype.writeUIntLE=function(e,t,n,i){e=+e,t>>>=0,n>>>=0,i||I(this,e,t,n,Math.pow(2,8*n)-1,0);var r=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,i||I(this,e,t,n,Math.pow(2,8*n)-1,0);var r=n-1,o=1;for(this[t+r]=255&e;--r>=0&&(o*=256);)this[t+r]=e/o&255;return t+n},r.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,1,255,0),this[t]=255&e,t+1},r.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},r.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},r.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},r.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},r.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var r=Math.pow(2,8*n-1);I(this,e,t,n,r-1,-r)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},r.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var r=Math.pow(2,8*n-1);I(this,e,t,n,r-1,-r)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},r.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},r.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},r.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},r.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},r.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},r.prototype.writeFloatLE=function(e,t,n){return R(this,e,t,!0,n)},r.prototype.writeFloatBE=function(e,t,n){return R(this,e,t,!1,n)},r.prototype.writeDoubleLE=function(e,t,n){return O(this,e,t,!0,n)},r.prototype.writeDoubleBE=function(e,t,n){return O(this,e,t,!1,n)},r.prototype.copy=function(e,t,n,i){if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--r)e[r+t]=this[r+n];else if(o<1e3)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;a>>2),a=0,s=0;a>5]|=128<>>9<<4)]=t;for(var n=1732584193,i=-271733879,r=-1732584194,l=271733878,f=0;f>16)+(t>>16)+(n>>16)<<16|65535&n}function l(e,t){return e<>>32-t}var f=e("./make-hash");t.exports=function(e){return f(e,i)}},{"./make-hash":52}],54:[function(e,t,n){function i(e,t){a.call(this,"digest"),"string"==typeof t&&(t=s.from(t));var n="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=t,t.length>n?t=("rmd160"===e?new u:l(e)).update(t).digest():t.lengthc?t=e(t):t.length0;i--)t+=this._buffer(e,t),n+=this._flushBuffer(r,n);return t+=this._buffer(e,t),r},i.prototype.final=function(e){var t;e&&(t=this.update(e));var n;return n="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(n):n},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t>>1];n=c.r28shl(n,a),i=c.r28shl(i,a),c.pc2(n,i,e.keys,r)}},r.prototype._update=function(e,t,n,i){var r=this._desState,o=c.readUInt32BE(e,t),a=c.readUInt32BE(e,t+4);c.ip(o,a,r.tmp,0),o=r.tmp[0],a=r.tmp[1],"encrypt"===this.type?this._encrypt(r,o,a,r.tmp,0):this._decrypt(r,o,a,r.tmp,0),o=r.tmp[0],a=r.tmp[1],c.writeUInt32BE(n,o,i),c.writeUInt32BE(n,a,i+4)},r.prototype._pad=function(e,t){for(var n=e.length-t,i=t;i>>0,o=p}c.rip(a,o,i,r)},r.prototype._decrypt=function(e,t,n,i,r){for(var o=n,a=t,s=e.keys.length-2;s>=0;s-=2){var u=e.keys[s],l=e.keys[s+1];c.expand(o,e.tmp,0),u^=e.tmp[0],l^=e.tmp[1];var f=c.substitute(u,l),p=o;o=(a^c.permute(f))>>>0,a=p}c.rip(o,a,i,r)}},{"../des":57,inherits:101,"minimalistic-assert":106}],61:[function(e,t,n){function i(e,t){o.equal(t.length,24,"Invalid key length");var n=t.slice(0,8),i=t.slice(8,16),r=t.slice(16,24);this.ciphers="encrypt"===e?[u.create({type:"encrypt",key:n}),u.create({type:"decrypt",key:i}),u.create({type:"encrypt",key:r})]:[u.create({type:"decrypt",key:r}),u.create({type:"encrypt",key:i}),u.create({type:"decrypt",key:n})]}function r(e){c.call(this,e);var t=new i(this.type,this.options.key);this._edeState=t}var o=e("minimalistic-assert"),a=e("inherits"),s=e("../des"),c=s.Cipher,u=s.DES;a(r,c),t.exports=r,r.create=function(e){return new r(e)},r.prototype._update=function(e,t,n,i){var r=this._edeState;r.ciphers[0]._update(e,t,n,i),r.ciphers[1]._update(n,i,n,i),r.ciphers[2]._update(n,i,n,i)},r.prototype._pad=u.prototype._pad,r.prototype._unpad=u.prototype._unpad},{"../des":57,inherits:101,"minimalistic-assert":106}],62:[function(e,t,n){n.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},n.writeUInt32BE=function(e,t,n){e[0+n]=t>>>24,e[1+n]=t>>>16&255,e[2+n]=t>>>8&255,e[3+n]=255&t},n.ip=function(e,t,n,i){for(var r=0,o=0,a=6;a>=0;a-=2){for(s=0;s<=24;s+=8)r<<=1,r|=t>>>s+a&1;for(s=0;s<=24;s+=8)r<<=1,r|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(var s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}n[i+0]=r>>>0,n[i+1]=o>>>0},n.rip=function(e,t,n,i){for(var r=0,o=0,a=0;a<4;a++)for(s=24;s>=0;s-=8)r<<=1,r|=t>>>s+a&1,r<<=1,r|=e>>>s+a&1;for(a=4;a<8;a++)for(var s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;n[i+0]=r>>>0,n[i+1]=o>>>0},n.pc1=function(e,t,n,i){for(var r=0,o=0,a=7;a>=5;a--){for(s=0;s<=24;s+=8)r<<=1,r|=t>>s+a&1;for(s=0;s<=24;s+=8)r<<=1,r|=e>>s+a&1}for(s=0;s<=24;s+=8)r<<=1,r|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(var s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;n[i+0]=r>>>0,n[i+1]=o>>>0},n.r28shl=function(e,t){return e<>>28-t};var i=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];n.pc2=function(e,t,n,r){for(var o=0,a=0,s=i.length>>>1,c=0;c>>i[c]&1;for(c=s;c>>i[c]&1;n[r+0]=o>>>0,n[r+1]=a>>>0},n.expand=function(e,t,n){var i=0,r=0;i=(1&e)<<5|e>>>27;for(o=23;o>=15;o-=4)i<<=6,i|=e>>>o&63;for(var o=11;o>=3;o-=4)r|=e>>>o&63,r<<=6;r|=(31&e)<<1|e>>>31,t[n+0]=i>>>0,t[n+1]=r>>>0};var r=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];n.substitute=function(e,t){for(var n=0,i=0;i<4;i++)n<<=4,n|=a=r[64*i+(o=e>>>18-6*i&63)];for(i=0;i<4;i++){var o=t>>>18-6*i&63,a=r[256+64*i+o];n<<=4,n|=a}return n>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];n.permute=function(e){for(var t=0,n=0;n>>o[n]&1;return t>>>0},n.padSplit=function(e,t,n){for(var i=e.toString(2);i.lengthe;)n.ishrn(1);if(n.isEven()&&n.iadd(f),n.testn(1)||n.iadd(p),t.cmp(p)){if(!t.cmp(d))for(;n.mod(h).cmp(m);)n.iadd(b)}else for(;n.mod(u).cmp(v);)n.iadd(b);if(i=n.shrn(1),r(i)&&r(n)&&o(i)&&o(n)&&l.test(i)&&l.test(n))return n}}var s=e("randombytes");t.exports=a,a.simpleSieve=r,a.fermatTest=o;var c=e("bn.js"),u=new c(24),l=new(e("miller-rabin")),f=new c(1),p=new c(2),d=new c(5),h=(new c(16),new c(8),new c(10)),m=new c(3),v=(new c(7),new c(11)),b=new c(4),y=(new c(12),null)},{"bn.js":"BN","miller-rabin":105,randombytes:127}],66:[function(e,t,n){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],67:[function(e,t,n){var i=n;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":82,"./elliptic/curve":70,"./elliptic/curves":73,"./elliptic/ec":74,"./elliptic/eddsa":77,"./elliptic/utils":81,brorand:16}],68:[function(e,t,n){function i(e,t){this.type=e,this.p=new o(t.p,16),this.red=t.prime?o.red(t.prime):o.mont(this.p),this.zero=new o(0).toRed(this.red),this.one=new o(1).toRed(this.red),this.two=new o(2).toRed(this.red),this.n=t.n&&new o(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function r(e,t){this.curve=e,this.type=t,this.precomputed=null}var o=e("bn.js"),a=e("../../elliptic").utils,s=a.getNAF,c=a.getJSF,u=a.assert;t.exports=i,i.prototype.point=function(){throw new Error("Not implemented")},i.prototype.validate=function(){throw new Error("Not implemented")},i.prototype._fixedNafMul=function(e,t){u(e.precomputed);var n=e._getDoubles(),i=s(t,1),r=(1<=a;t--)c=(c<<1)+i[t];o.push(c)}for(var l=this.jpoint(null,null,null),f=this.jpoint(null,null,null),p=r;p>0;p--){for(a=0;a=0;c--){for(var t=0;c>=0&&0===o[c];c--)t++;if(c>=0&&t++,a=a.dblp(t),c<0)break;var l=o[c];u(0!==l),a="affine"===e.type?l>0?a.mixedAdd(r[l-1>>1]):a.mixedAdd(r[-l-1>>1].neg()):l>0?a.add(r[l-1>>1]):a.add(r[-l-1>>1].neg())}return"affine"===e.type?a.toP():a},i.prototype._wnafMulAdd=function(e,t,n,i,r){for(var o=this._wnafT1,a=this._wnafT2,u=this._wnafT3,l=0,f=0;f=1;f-=2){var d=f-1,h=f;if(1===o[d]&&1===o[h]){var m=[t[d],null,null,t[h]];0===t[d].y.cmp(t[h].y)?(m[1]=t[d].add(t[h]),m[2]=t[d].toJ().mixedAdd(t[h].neg())):0===t[d].y.cmp(t[h].y.redNeg())?(m[1]=t[d].toJ().mixedAdd(t[h]),m[2]=t[d].add(t[h].neg())):(m[1]=t[d].toJ().mixedAdd(t[h]),m[2]=t[d].toJ().mixedAdd(t[h].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=c(n[d],n[h]);l=Math.max(b[0].length,l),u[d]=new Array(l),u[h]=new Array(l);for(j=0;j=0;f--){for(var w=0;f>=0;){for(var k=!0,j=0;j=0&&w++,_=_.dblp(w),f<0)break;for(j=0;j0?S=a[j][E-1>>1]:E<0&&(S=a[j][-E-1>>1].neg()),_="affine"===S.type?_.mixedAdd(S):_.add(S))}}for(f=0;f=Math.ceil((e.bitLength()+1)/t.step)},r.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,r=0;r":""},r.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},r.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),r=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=i.redAdd(t),a=o.redSub(n),s=i.redSub(t),c=r.redMul(a),u=o.redMul(s),l=r.redMul(s),f=a.redMul(o);return this.curve.point(c,u,f,l)},r.prototype._projDbl=function(){var e,t,n,i=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(u=this.curve._mulA(r)).redAdd(o);if(this.zOne)e=i.redSub(r).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(u.redSub(o)),n=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),c=a.redSub(s).redISub(s);e=i.redSub(r).redISub(o).redMul(c),t=a.redMul(u.redSub(o)),n=a.redMul(c)}}else{var u=r.redAdd(o),s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(r.redISub(o)),n=u.redMul(c)}return this.curve.point(e,t,n)},r.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},r.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),r=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(t),a=r.redSub(i),s=r.redAdd(i),c=n.redAdd(t),u=o.redMul(a),l=s.redMul(c),f=o.redMul(c),p=a.redMul(s);return this.curve.point(u,l,p,f)},r.prototype._projAdd=function(e){var t,n,i=this.z.redMul(e.z),r=i.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),c=r.redSub(s),u=r.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=i.redMul(c).redMul(l);return this.curve.twisted?(t=i.redMul(u).redMul(a.redSub(this.curve._mulA(o))),n=c.redMul(u)):(t=i.redMul(u).redMul(a.redSub(o)),n=this.curve._mulC(c).redMul(u)),this.curve.point(f,t,n)},r.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},r.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},r.prototype.mulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},r.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},r.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},r.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},r.prototype.getX=function(){return this.normalize(),this.x.fromRed()},r.prototype.getY=function(){return this.normalize(),this.y.fromRed()},r.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},r.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}return!1},r.prototype.toP=r.prototype.normalize,r.prototype.mixedAdd=r.prototype.add},{"../../elliptic":67,"../curve":70,"bn.js":"BN",inherits:101}],70:[function(e,t,n){var i=n;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":68,"./edwards":69,"./mont":71,"./short":72}],71:[function(e,t,n){function i(e){c.call(this,"mont",e),this.a=new a(e.a,16).toRed(this.red),this.b=new a(e.b,16).toRed(this.red),this.i4=new a(4).toRed(this.red).redInvm(),this.two=new a(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function r(e,t,n){c.BasePoint.call(this,e,"projective"),null===t&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new a(t,16),this.z=new a(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var o=e("../curve"),a=e("bn.js"),s=e("inherits"),c=o.base,u=e("../../elliptic").utils;s(i,c),t.exports=i,i.prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),i=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},s(r,c.BasePoint),i.prototype.decodePoint=function(e,t){return this.point(u.toArray(e,t),1)},i.prototype.point=function(e,t){return new r(this,e,t)},i.prototype.pointFromJSON=function(e){return r.fromJSON(this,e)},r.prototype.precompute=function(){},r.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},r.fromJSON=function(e,t){return new r(e,t[0],t[1]||e.one)},r.prototype.inspect=function(){return this.isInfinity()?"":""},r.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},r.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),n=e.redSub(t),i=e.redMul(t),r=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(i,r)},r.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),r=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(n),a=r.redMul(i),s=t.z.redMul(o.redAdd(a).redSqr()),c=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},r.prototype.mul=function(e){for(var t=e.clone(),n=this,i=this.curve.point(null,null),r=this,o=[];0!==t.cmpn(0);t.iushrn(1))o.push(t.andln(1));for(var a=o.length-1;a>=0;a--)0===o[a]?(n=n.diffAdd(i,r),i=i.dbl()):(i=n.diffAdd(i,r),n=n.dbl());return i},r.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},r.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},r.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":67,"../curve":70,"bn.js":"BN",inherits:101}],72:[function(e,t,n){function i(e){l.call(this,"short",e),this.a=new c(e.a,16).toRed(this.red),this.b=new c(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function r(e,t,n,i){l.BasePoint.call(this,e,"affine"),null===t&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new c(t,16),this.y=new c(n,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function o(e,t,n,i){l.BasePoint.call(this,e,"jacobian"),null===t&&null===n&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new c(0)):(this.x=new c(t,16),this.y=new c(n,16),this.z=new c(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var a=e("../curve"),s=e("../../elliptic"),c=e("bn.js"),u=e("inherits"),l=a.base,f=s.utils.assert;u(i,l),t.exports=i,i.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,n;if(e.beta)t=new c(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)n=new c(e.lambda,16);else{var r=this._getEndoRoots(this.n);0===this.g.mul(r[0]).x.cmp(this.g.x.redMul(t))?n=r[0]:(n=r[1],f(0===this.g.mul(n).x.cmp(this.g.x.redMul(t))))}var o;return o=e.basis?e.basis.map(function(e){return{a:new c(e.a,16),b:new c(e.b,16)}}):this._getEndoBasis(n),{beta:t,lambda:n,basis:o}}},i.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:c.mont(e),n=new c(2).toRed(t).redInvm(),i=n.redNeg(),r=new c(3).toRed(t).redNeg().redSqrt().redMul(n);return[i.redAdd(r).fromRed(),i.redSub(r).fromRed()]},i.prototype._getEndoBasis=function(e){for(var t,n,i,r,o,a,s,u,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=e,d=this.n.clone(),h=new c(1),m=new c(0),v=new c(0),b=new c(1),y=0;0!==p.cmpn(0);){var g=d.div(p);u=d.sub(g.mul(p)),l=v.sub(g.mul(h));var _=b.sub(g.mul(m));if(!i&&u.cmp(f)<0)t=s.neg(),n=h,i=u.neg(),r=l;else if(i&&2==++y)break;s=u,d=p,p=u,v=h,h=l,b=m,m=_}o=u.neg(),a=l;var x=i.sqr().add(r.sqr());return o.sqr().add(a.sqr()).cmp(x)>=0&&(o=t,a=n),i.negative&&(i=i.neg(),r=r.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:r},{a:o,b:a}]},i.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],i=t[1],r=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=r.mul(n.a),s=o.mul(i.a),c=r.mul(n.b),u=o.mul(i.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},i.prototype.pointFromX=function(e,t){(e=new c(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(0!==i.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var r=i.fromRed().isOdd();return(t&&!r||!t&&r)&&(i=i.redNeg()),this.point(e,i)},i.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,i=this.a.redMul(t),r=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===n.redSqr().redISub(r).cmpn(0)},i.prototype._endoWnafMulAdd=function(e,t,n){for(var i=this._endoWnafT1,r=this._endoWnafT2,o=0;o":""},r.prototype.isInfinity=function(){return this.inf},r.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)},r.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),r=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(i),o=r.redSqr().redISub(this.x.redAdd(this.x)),a=r.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},r.prototype.getX=function(){return this.x.fromRed()},r.prototype.getY=function(){return this.y.fromRed()},r.prototype.mul=function(e){return e=new c(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},r.prototype.mulAdd=function(e,t,n){var i=[this,t],r=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,r):this.curve._wnafMulAdd(1,i,r,2)},r.prototype.jmulAdd=function(e,t,n){var i=[this,t],r=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,r,!0):this.curve._wnafMulAdd(1,i,r,2,!0)},r.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},r.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return t},r.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},u(o,l.BasePoint),i.prototype.jpoint=function(e,t,n){return new o(this,e,t,n)},o.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(n,i)},o.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},o.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(t),r=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),s=i.redSub(r),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),f=i.redMul(u),p=c.redSqr().redIAdd(l).redISub(f).redISub(f),d=c.redMul(f.redISub(p)).redISub(o.redMul(l)),h=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(p,d,h)},o.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,i=e.x.redMul(t),r=this.y,o=e.y.redMul(t).redMul(this.z),a=n.redSub(i),s=r.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),l=n.redMul(c),f=s.redSqr().redIAdd(u).redISub(l).redISub(l),p=s.redMul(l.redISub(f)).redISub(r.redMul(u)),d=this.z.redMul(a);return this.curve.jpoint(f,p,d)},o.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,n=0;n=0)return!1;if(n.redIAdd(r),0===this.x.cmp(n))return!0}return!1},o.prototype.inspect=function(){return this.isInfinity()?"":""},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":67,"../curve":70,"bn.js":"BN",inherits:101}],73:[function(e,t,n){function i(e){"short"===e.type?this.curve=new s.curve.short(e):"edwards"===e.type?this.curve=new s.curve.edwards(e):this.curve=new s.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,c(this.g.validate(),"Invalid curve"),c(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function r(e,t){Object.defineProperty(o,e,{configurable:!0,enumerable:!0,get:function(){var n=new i(t);return Object.defineProperty(o,e,{configurable:!0,enumerable:!0,value:n}),n}})}var o=n,a=e("hash.js"),s=e("../elliptic"),c=s.utils.assert;o.PresetCurve=i,r("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),r("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),r("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),r("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),r("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),r("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),r("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var u;try{u=e("./precomputed/secp256k1")}catch(e){u=void 0}r("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",u]})},{"../elliptic":67,"./precomputed/secp256k1":80,"hash.js":86}],74:[function(e,t,n){function i(e){if(!(this instanceof i))return new i(e);"string"==typeof e&&(s(a.curves.hasOwnProperty(e),"Unknown curve "+e),e=a.curves[e]),e instanceof a.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var r=e("bn.js"),o=e("hmac-drbg"),a=e("../../elliptic"),s=a.utils.assert,c=e("./key"),u=e("./signature");t.exports=i,i.prototype.keyPair=function(e){return new c(this,e)},i.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},i.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},i.prototype.genKeyPair=function(e){e||(e={});for(var t=new o({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new r(2));;){var s=new r(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},i.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},i.prototype.sign=function(e,t,n,i){"object"===(void 0===n?"undefined":_typeof(n))&&(i=n,n=null),i||(i={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new r(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),c=e.toArray("be",a),l=new o({hash:this.hash,entropy:s,nonce:c,pers:i.pers,persEnc:i.persEnc||"utf8"}),f=this.n.sub(new r(1)),p=0;!0;p++){var d=i.k?i.k(p):new r(l.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(f)>=0)){var h=this.g.mul(d);if(!h.isInfinity()){var m=h.getX(),v=m.umod(this.n);if(0!==v.cmpn(0)){var b=d.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));if(0!==(b=b.umod(this.n)).cmpn(0)){var y=(h.getY().isOdd()?1:0)|(0!==m.cmp(v)?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),y^=1),new u({r:v,s:b,recoveryParam:y})}}}}}},i.prototype.verify=function(e,t,n,i){e=this._truncateToN(new r(e,16)),n=this.keyFromPublic(n,i);var o=(t=new u(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s=a.invm(this.n),c=s.mul(e).umod(this.n),l=s.mul(o).umod(this.n);if(!this.curve._maxwellTrick)return!(f=this.g.mulAdd(c,n.getPublic(),l)).isInfinity()&&0===f.getX().umod(this.n).cmp(o);var f=this.g.jmulAdd(c,n.getPublic(),l);return!f.isInfinity()&&f.eqXToP(o)},i.prototype.recoverPubKey=function(e,t,n,i){s((3&n)===n,"The recovery param is more than two bits"),t=new u(t,i);var o=this.n,a=new r(e),c=t.r,l=t.s,f=1&n,p=n>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&p)throw new Error("Unable to find sencond key candinate");c=p?this.curve.pointFromX(c.add(this.curve.n),f):this.curve.pointFromX(c,f);var d=t.r.invm(o),h=o.sub(a).mul(d).umod(o),m=l.mul(d).umod(o);return this.g.mulAdd(h,c,m)},i.prototype.getKeyRecoveryParam=function(e,t,n,i){if(null!==(t=new u(t,i)).recoveryParam)return t.recoveryParam;for(var r=0;r<4;r++){var o;try{o=this.recoverPubKey(e,t,r)}catch(e){continue}if(o.eq(n))return r}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":67,"./key":75,"./signature":76,"bn.js":"BN","hmac-drbg":98}],75:[function(e,t,n){function i(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var r=e("bn.js"),o=e("../../elliptic").utils.assert;t.exports=i,i.fromPublic=function(e,t,n){return t instanceof i?t:new i(e,{pub:t,pubEnc:n})},i.fromPrivate=function(e,t,n){return t instanceof i?t:new i(e,{priv:t,privEnc:n})},i.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},i.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},i.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(e,t){this.priv=new r(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?o(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||o(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},i.prototype.derive=function(e){return e.mul(this.priv).getX()},i.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)},i.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},i.prototype.inspect=function(){return""}},{"../../elliptic":67,"bn.js":"BN"}],76:[function(e,t,n){function i(e,t){if(e instanceof i)return e;this._importDER(e,t)||(l(e.r&&e.s,"Signature without r or s"),this.r=new c(e.r,16),this.s=new c(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function r(){this.place=0}function o(e,t){var n=e[t.place++];if(!(128&n))return n;for(var i=15&n,r=0,o=0,a=t.place;o>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}var c=e("bn.js"),u=e("../../elliptic").utils,l=u.assert;t.exports=i,i.prototype._importDER=function(e,t){e=u.toArray(e,t);var n=new r;if(48!==e[n.place++])return!1;if(o(e,n)+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var i=o(e,n),a=e.slice(n.place,i+n.place);if(n.place+=i,2!==e[n.place++])return!1;var s=o(e,n);if(e.length!==s+n.place)return!1;var l=e.slice(n.place,s+n.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===l[0]&&128&l[1]&&(l=l.slice(1)),this.r=new c(a),this.s=new c(l),this.recoveryParam=null,!0},i.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=a(t),n=a(n);!(n[0]||128&n[1]);)n=n.slice(1);var i=[2];s(i,t.length),(i=i.concat(t)).push(2),s(i,n.length);var r=i.concat(n),o=[48];return s(o,r.length),o=o.concat(r),u.encode(o,e)}},{"../../elliptic":67,"bn.js":"BN"}],77:[function(e,t,n){function i(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof i))return new i(e);var e=o.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}var r=e("hash.js"),o=e("../../elliptic"),a=o.utils,s=a.assert,c=a.parseBytes,u=e("./key"),l=e("./signature");t.exports=i,i.prototype.sign=function(e,t){e=c(e);var n=this.keyFromSecret(t),i=this.hashInt(n.messagePrefix(),e),r=this.g.mul(i),o=this.encodePoint(r),a=this.hashInt(o,n.pubBytes(),e).mul(n.priv()),s=i.add(a).umod(this.curve.n);return this.makeSignature({R:r,S:s,Rencoded:o})},i.prototype.verify=function(e,t,n){e=c(e),t=this.makeSignature(t);var i=this.keyFromPublic(n),r=this.hashInt(t.Rencoded(),i.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(i.pub().mul(r)).eq(o)},i.prototype.hashInt=function(){for(var e=this.hash(),t=0;t=0;){var o;if(r.isOdd()){var a=r.andln(i-1);o=a>(i>>1)-1?(i>>1)-a:a,r.isubn(o)}else o=0;n.push(o);for(var s=0!==r.cmpn(0)&&0===r.andln(i-1)?t+1:1,c=1;c0||t.cmpn(-r)>0;){var o=e.andln(3)+i&3,a=t.andln(3)+r&3;3===o&&(o=-1),3===a&&(a=-1);var s;s=0==(1&o)?0:3!=(u=e.andln(7)+i&7)&&5!==u||2!==a?o:-o,n[0].push(s);var c;if(0==(1&a))c=0;else{var u=t.andln(7)+r&7;c=3!==u&&5!==u||2!==o?a:-a}n[1].push(c),2*i===s+1&&(i=1-i),2*r===c+1&&(r=1-r),e.iushrn(1),t.iushrn(1)}return n},i.cachedProperty=function(e,t,n){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=n.call(this)}},i.parseBytes=function(e){return"string"==typeof e?i.toArray(e,"hex"):e},i.intFromLE=function(e){return new r(e,"hex","le")}},{"bn.js":"BN","minimalistic-assert":106,"minimalistic-crypto-utils":107}],82:[function(e,t,n){t.exports={name:"elliptic",version:"6.4.0",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny ",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"}}},{}],83:[function(e,t,n){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function o(e){return"number"==typeof e}function a(e){return"object"===(void 0===e?"undefined":_typeof(e))&&null!==e}function s(e){return void 0===e}t.exports=i,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if(!o(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},i.prototype.emit=function(e){var t,n,i,o,c,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}if(n=this._events[e],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),n.apply(this,o)}else if(a(n))for(o=Array.prototype.slice.call(arguments,1),i=(u=n.slice()).length,c=0;c0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},i.prototype.removeListener=function(e,t){var n,i,o,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],o=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(n)){for(s=o;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},i.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},i.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},i.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},i.listenerCount=function(e,t){return e.listenerCount(t)}},{}],84:[function(e,t,n){var i=e("safe-buffer").Buffer,r=e("md5.js");t.exports=function(e,t,n,o){if(i.isBuffer(e)||(e=i.from(e,"binary")),t&&(i.isBuffer(t)||(t=i.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=n/8,s=i.alloc(a),c=i.alloc(o||0),u=i.alloc(0);a>0||o>0;){var l=new r;l.update(u),l.update(e),t&&l.update(t),u=l.digest();var f=0;if(a>0){var p=s.length-a;f=Math.min(a,u.length),u.copy(s,p,0,f),a-=f}if(f0){var d=c.length-o,h=Math.min(o,u.length-f);u.copy(c,d,f,f+h),o-=h}}return u.fill(0),{key:s,iv:c}}},{"md5.js":103,"safe-buffer":144}],85:[function(e,t,n){(function(n){function i(e){r.call(this),this._block=new n(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var r=e("stream").Transform;e("inherits")(i,r),i.prototype._transform=function(e,t,i){var r=null;try{"buffer"!==t&&(e=new n(e,t)),this.update(e)}catch(e){r=e}i(r)},i.prototype._flush=function(e){var t=null;try{this.push(this._digest())}catch(e){t=e}e(t)},i.prototype.update=function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=new n(e,t||"binary"));for(var i=this._block,r=0;this._blockOffset+e.length-r>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},i.prototype._update=function(e){throw new Error("_update is not implemented")},i.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();return void 0!==e&&(t=t.toString(e)),t},i.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=i}).call(this,e("buffer").Buffer)},{buffer:47,inherits:101,stream:155}],86:[function(e,t,n){var i=n;i.utils=e("./hash/utils"),i.common=e("./hash/common"),i.sha=e("./hash/sha"),i.ripemd=e("./hash/ripemd"),i.hmac=e("./hash/hmac"),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},{"./hash/common":87,"./hash/hmac":88,"./hash/ripemd":89,"./hash/sha":90,"./hash/utils":97}],87:[function(e,t,n){function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var r=e("./utils"),o=e("minimalistic-assert");n.BlockHash=i,i.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[r++]=e>>>16&255,i[r++]=e>>>8&255,i[r++]=255&e}else for(i[r++]=255&e,i[r++]=e>>>8&255,i[r++]=e>>>16&255,i[r++]=e>>>24&255,i[r++]=0,i[r++]=0,i[r++]=0,i[r++]=0,o=8;othis.blockSize&&(e=(new this.Hash).update(e).digest()),o(e.length<=this.blockSize);for(var t=e.length;t>>3},n.g1_256=function(e){return a(e,17)^a(e,19)^e>>>10}},{"../utils":97}],97:[function(e,t,n){function i(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function r(e){return 1===e.length?"0"+e:e}function o(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var a=e("minimalistic-assert"),s=e("inherits");n.inherits=s,n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>8,a=255&r;o?n.push(o,a):n.push(a)}else for(i=0;i>>0}return o},n.split32=function(e,t){for(var n=new Array(4*e.length),i=0,r=0;i>>24,n[r+1]=o>>>16&255,n[r+2]=o>>>8&255,n[r+3]=255&o):(n[r+3]=o>>>24,n[r+2]=o>>>16&255,n[r+1]=o>>>8&255,n[r]=255&o)}return n},n.rotr32=function(e,t){return e>>>t|e<<32-t},n.rotl32=function(e,t){return e<>>32-t},n.sum32=function(e,t){return e+t>>>0},n.sum32_3=function(e,t,n){return e+t+n>>>0},n.sum32_4=function(e,t,n,i){return e+t+n+i>>>0},n.sum32_5=function(e,t,n,i,r){return e+t+n+i+r>>>0},n.sum64=function(e,t,n,i){var r=e[t],o=i+e[t+1]>>>0,a=(o>>0,e[t+1]=o},n.sum64_hi=function(e,t,n,i){return(t+i>>>0>>0},n.sum64_lo=function(e,t,n,i){return t+i>>>0},n.sum64_4_hi=function(e,t,n,i,r,o,a,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},n.sum64_4_lo=function(e,t,n,i,r,o,a,s){return t+i+o+s>>>0},n.sum64_5_hi=function(e,t,n,i,r,o,a,s,c,u){var l=0,f=t;return l+=(f=f+i>>>0)>>0)>>0)>>0)>>0},n.sum64_5_lo=function(e,t,n,i,r,o,a,s,c,u){return t+i+o+s+u>>>0},n.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},n.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},n.shr64_hi=function(e,t,n){return e>>>n},n.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},{inherits:101,"minimalistic-assert":106}],98:[function(e,t,n){function i(e){if(!(this instanceof i))return new i(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),n=o.toArray(e.nonce,e.nonceEnc||"hex"),r=o.toArray(e.pers,e.persEnc||"hex");a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}var r=e("hash.js"),o=e("minimalistic-crypto-utils"),a=e("minimalistic-assert");t.exports=i,i.prototype._init=function(e,t,n){var i=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var r=0;r=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},i.prototype.generate=function(e,t,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=n,n=t,t=null),n&&(n=o.toArray(n,i||"hex"),this._update(n));for(var r=[];r.length>1,l=-7,f=n?r-1:0,p=n?-1:1,d=e[t+f];for(f+=p,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+e[t+f],f+=p,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=i;l>0;a=256*a+e[t+f],f+=p,l-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,i),o-=u}return(d?-1:1)*a*Math.pow(2,o-i)},n.write=function(e,t,n,i,r,o){var a,s,c,u=8*o-r-1,l=(1<>1,p=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,h=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*c-1)*Math.pow(2,r),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,r),a=0));r>=8;e[n+d]=255&s,d+=h,s/=256,r-=8);for(a=a<0;e[n+d]=255&a,d+=h,a/=256,u-=8);e[n+d-h]|=128*m}},{}],100:[function(e,t,n){var i=[].indexOf;t.exports=function(e,t){if(i)return e.indexOf(t);for(var n=0;n>>32-t}function o(e,t,n,i,o,a,s){return r(e+(t&n|~t&i)+o+a|0,s)+t|0}function a(e,t,n,i,o,a,s){return r(e+(t&i|n&~i)+o+a|0,s)+t|0}function s(e,t,n,i,o,a,s){return r(e+(t^n^i)+o+a|0,s)+t|0}function c(e,t,n,i,o,a,s){return r(e+(n^(t|~i))+o+a|0,s)+t|0}var u=e("inherits"),l=e("hash-base"),f=new Array(16);u(i,l),i.prototype._update=function(){for(var e=f,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,i=this._b,r=this._c,u=this._d;i=c(i=c(i=c(i=c(i=s(i=s(i=s(i=s(i=a(i=a(i=a(i=a(i=o(i=o(i=o(i=o(i,r=o(r,u=o(u,n=o(n,i,r,u,e[0],3614090360,7),i,r,e[1],3905402710,12),n,i,e[2],606105819,17),u,n,e[3],3250441966,22),r=o(r,u=o(u,n=o(n,i,r,u,e[4],4118548399,7),i,r,e[5],1200080426,12),n,i,e[6],2821735955,17),u,n,e[7],4249261313,22),r=o(r,u=o(u,n=o(n,i,r,u,e[8],1770035416,7),i,r,e[9],2336552879,12),n,i,e[10],4294925233,17),u,n,e[11],2304563134,22),r=o(r,u=o(u,n=o(n,i,r,u,e[12],1804603682,7),i,r,e[13],4254626195,12),n,i,e[14],2792965006,17),u,n,e[15],1236535329,22),r=a(r,u=a(u,n=a(n,i,r,u,e[1],4129170786,5),i,r,e[6],3225465664,9),n,i,e[11],643717713,14),u,n,e[0],3921069994,20),r=a(r,u=a(u,n=a(n,i,r,u,e[5],3593408605,5),i,r,e[10],38016083,9),n,i,e[15],3634488961,14),u,n,e[4],3889429448,20),r=a(r,u=a(u,n=a(n,i,r,u,e[9],568446438,5),i,r,e[14],3275163606,9),n,i,e[3],4107603335,14),u,n,e[8],1163531501,20),r=a(r,u=a(u,n=a(n,i,r,u,e[13],2850285829,5),i,r,e[2],4243563512,9),n,i,e[7],1735328473,14),u,n,e[12],2368359562,20),r=s(r,u=s(u,n=s(n,i,r,u,e[5],4294588738,4),i,r,e[8],2272392833,11),n,i,e[11],1839030562,16),u,n,e[14],4259657740,23),r=s(r,u=s(u,n=s(n,i,r,u,e[1],2763975236,4),i,r,e[4],1272893353,11),n,i,e[7],4139469664,16),u,n,e[10],3200236656,23),r=s(r,u=s(u,n=s(n,i,r,u,e[13],681279174,4),i,r,e[0],3936430074,11),n,i,e[3],3572445317,16),u,n,e[6],76029189,23),r=s(r,u=s(u,n=s(n,i,r,u,e[9],3654602809,4),i,r,e[12],3873151461,11),n,i,e[15],530742520,16),u,n,e[2],3299628645,23),r=c(r,u=c(u,n=c(n,i,r,u,e[0],4096336452,6),i,r,e[7],1126891415,10),n,i,e[14],2878612391,15),u,n,e[5],4237533241,21),r=c(r,u=c(u,n=c(n,i,r,u,e[12],1700485571,6),i,r,e[3],2399980690,10),n,i,e[10],4293915773,15),u,n,e[1],2240044497,21),r=c(r,u=c(u,n=c(n,i,r,u,e[8],1873313359,6),i,r,e[15],4264355552,10),n,i,e[6],2734768916,15),u,n,e[13],1309151649,21),r=c(r,u=c(u,n=c(n,i,r,u,e[4],4149444226,6),i,r,e[11],3174756917,10),n,i,e[2],718787259,15),u,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+i|0,this._c=this._c+r|0,this._d=this._d+u|0},i.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=new n(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},t.exports=i}).call(this,e("buffer").Buffer)},{buffer:47,"hash-base":104,inherits:101}],104:[function(e,t,n){function i(e,t){if(!o.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}function r(e){a.call(this),this._block=o.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var o=e("safe-buffer").Buffer,a=e("stream").Transform;e("inherits")(r,a),r.prototype._transform=function(e,t,n){var i=null;try{this.update(e,t)}catch(e){i=e}n(i)},r.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},r.prototype.update=function(e,t){if(i(e,"Data"),this._finalized)throw new Error("Digest already called");o.isBuffer(e)||(e=o.from(e,t));for(var n=this._block,r=0;this._blockOffset+e.length-r>=this._blockSize;){for(var a=this._blockOffset;a0;++s)this._length[s]+=c,(c=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*c);return this},r.prototype._update=function(){throw new Error("_update is not implemented")},r.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},r.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=r},{inherits:101,"safe-buffer":144,stream:155}],105:[function(e,t,n){function i(e){this.rand=e||new o.Rand}var r=e("bn.js"),o=e("brorand");t.exports=i,i.create=function(e){return new i(e)},i.prototype._randbelow=function(e){var t=e.bitLength(),n=Math.ceil(t/8);do{var i=new r(this.rand.generate(n))}while(i.cmp(e)>=0);return i},i.prototype._randrange=function(e,t){var n=t.sub(e);return e.add(this._randbelow(n))},i.prototype.test=function(e,t,n){var i=e.bitLength(),o=r.mont(e),a=new r(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),c=0;!s.testn(c);c++);for(var u=e.shrn(c),l=s.toRed(o);t>0;t--){var f=this._randrange(new r(2),s);n&&n(f);var p=f.toRed(o).redPow(u);if(0!==p.cmp(a)&&0!==p.cmp(l)){for(var d=1;d0;t--){var l=this._randrange(new r(2),a),f=e.gcd(l);if(0!==f.cmpn(1))return f;var p=l.toRed(i).redPow(c);if(0!==p.cmp(o)&&0!==p.cmp(u)){for(var d=1;d>8,a=255&r;o?n.push(o,a):n.push(a)}return n},o.zero2=i,o.toHex=r,o.encode=function(e,t){return"hex"===t?r(e):e}},{}],108:[function(e,t,n){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],109:[function(e,t,n){var i=e("asn1.js");n.certificate=e("./certificate");var r=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});n.RSAPrivateKey=r;var o=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});n.RSAPublicKey=o;var a=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});n.PublicKey=a;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});n.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});n.EncryptedPrivateKey=u;var l=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});n.DSAPrivateKey=l,n.DSAparam=i.define("DSAparam",function(){this.int()});var f=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(p),this.key("publicKey").optional().explicit(1).bitstr())});n.ECPrivateKey=f;var p=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});n.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":110,"asn1.js":1}],110:[function(e,t,n){var i=e("asn1.js"),r=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(o)}),u=i.define("RDNSequence",function(){this.seqof(c)}),l=i.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),f=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(r),this.key("notAfter").use(r))}),p=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(l),this.key("validity").use(f),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(p).optional())}),h=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});t.exports=h},{"asn1.js":1}],111:[function(e,t,n){(function(n){var i=/Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m,r=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m,o=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m,a=e("evp_bytestokey"),s=e("browserify-aes");t.exports=function(e,t){var c,u=e.toString(),l=u.match(i);if(l){var f="aes"+l[1],p=new n(l[2],"hex"),d=new n(l[3].replace(/\r?\n/g,""),"base64"),h=a(t,p.slice(0,8),parseInt(l[1],10)).key,m=[],v=s.createDecipheriv(f,h,p);m.push(v.update(d)),m.push(v.final()),c=n.concat(m)}else{var b=u.match(o);c=new n(b[2].replace(/\r?\n/g,""),"base64")}return{tag:u.match(r)[1],data:c}}}).call(this,e("buffer").Buffer)},{"browserify-aes":20,buffer:47,evp_bytestokey:84}],112:[function(e,t,n){(function(n){function i(e){var t;"object"!==(void 0===e?"undefined":_typeof(e))||n.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new n(e));var i,a,c=s(e,t),u=c.tag,l=c.data;switch(u){case"CERTIFICATE":a=o.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(a||(a=o.PublicKey.decode(l,"der")),i=a.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return o.RSAPublicKey.decode(a.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return a.subjectPrivateKey=a.subjectPublicKey,{type:"ec",data:a};case"1.2.840.10040.4.1":return a.algorithm.params.pub_key=o.DSAparam.decode(a.subjectPublicKey.data,"der"),{type:"dsa",data:a.algorithm.params};default:throw new Error("unknown key id "+i)}throw new Error("unknown key type "+u);case"ENCRYPTED PRIVATE KEY":l=r(l=o.EncryptedPrivateKey.decode(l,"der"),t);case"PRIVATE KEY":switch(a=o.PrivateKey.decode(l,"der"),i=a.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return o.RSAPrivateKey.decode(a.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:a.algorithm.curve,privateKey:o.ECPrivateKey.decode(a.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return a.algorithm.params.priv_key=o.DSAparam.decode(a.subjectPrivateKey,"der"),{type:"dsa",params:a.algorithm.params};default:throw new Error("unknown key id "+i)}throw new Error("unknown key type "+u);case"RSA PUBLIC KEY":return o.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return o.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:o.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return l=o.ECPrivateKey.decode(l,"der"),{curve:l.parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+u)}}function r(e,t){var i=e.algorithm.decrypt.kde.kdeparams.salt,r=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=a[e.algorithm.decrypt.cipher.algo.join(".")],s=e.algorithm.decrypt.cipher.iv,l=e.subjectPrivateKey,f=parseInt(o.split("-")[1],10)/8,p=u.pbkdf2Sync(t,i,r,f),d=c.createDecipheriv(o,p,s),h=[];return h.push(d.update(l)),h.push(d.final()),n.concat(h)}var o=e("./asn1"),a=e("./aesid.json"),s=e("./fixProc"),c=e("browserify-aes"),u=e("pbkdf2");t.exports=i,i.signature=o.signature}).call(this,e("buffer").Buffer)},{"./aesid.json":108,"./asn1":109,"./fixProc":111,"browserify-aes":20,buffer:47,pbkdf2:114}],113:[function(e,t,n){(function(e){function t(e,t){for(var n=0,i=e.length-1;i>=0;i--){var r=e[i];"."===r?e.splice(i,1):".."===r?(e.splice(i,1),n++):n&&(e.splice(i,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function i(e,t){if(e.filter)return e.filter(t);for(var n=[],i=0;i=-1&&!r;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(n=a+"/"+n,r="/"===a.charAt(0))}return n=t(i(n.split("/"),function(e){return!!e}),!r).join("/"),(r?"/":"")+n||"."},n.normalize=function(e){var r=n.isAbsolute(e),o="/"===a(e,-1);return(e=t(i(e.split("/"),function(e){return!!e}),!r).join("/"))||r||(e="."),e&&o&&(e+="/"),(r?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(i(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},n.relative=function(e,t){function i(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var r=i(e.split("/")),o=i(t.split("/")),a=Math.min(r.length,o.length),s=a,c=0;c=6?"utf-8":"binary",t.exports=n}).call(this,e("_process"))},{_process:120}],117:[function(e,t,n){var i=Math.pow(2,30)-1;t.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>i||t!==t)throw new TypeError("Bad key length")}},{}],118:[function(e,t,n){function i(e,t,n){var i=r(e),o="sha512"===e||"sha384"===e?128:64;t.length>o?t=i(t):t.length1)for(var n=1;n=t.length){o++;break}var a=t.slice(2,r-1);t.slice(r-1,r);if(("0002"!==i.toString("hex")&&!n||"0001"!==i.toString("hex")&&n)&&o++,a.length<8&&o++,o)throw new Error("decryption error");return t.slice(r)}function o(e,t){e=new n(e),t=new n(t);var i=0,r=e.length;e.length!==t.length&&(i++,r=Math.min(e.length,t.length));for(var o=-1;++of||new u(t).cmp(c.modulus)>=0)throw new Error("decryption error");var d;d=o?p(new u(t),c):l(t,c);var h=new n(f-d.length);if(h.fill(0),d=n.concat([h,d],f),4===s)return i(c,d);if(1===s)return r(0,d,o);if(3===s)return d;throw new Error("unknown padding")}}).call(this,e("buffer").Buffer)},{"./mgf":122,"./withPublic":125,"./xor":126,"bn.js":"BN","browserify-rsa":37,buffer:47,"create-hash":51,"parse-asn1":112}],124:[function(e,t,n){(function(n){function i(e,t){var i=e.modulus.byteLength(),r=t.length,o=c("sha1").update(new n("")).digest(),a=o.length,p=2*a;if(r>i-p-2)throw new Error("message too long");var d=new n(i-r-p-2);d.fill(0);var h=i-a-1,m=s(a),v=l(n.concat([o,d,new n([1]),t],h),u(m,h)),b=l(m,u(v,a));return new f(n.concat([new n([0]),b,v],i))}function r(e,t,i){var r=t.length,a=e.modulus.byteLength();if(r>a-11)throw new Error("message too long");var s;return i?(s=new n(a-r-3)).fill(255):s=o(a-r-3),new f(n.concat([new n([0,i?1:2]),s,new n([0]),t],a))}function o(e,t){for(var i,r=new n(e),o=0,a=s(2*e),c=0;o=0)throw new Error("data too long for modulus")}return n?d(s,c):p(s,c)}}).call(this,e("buffer").Buffer)},{"./mgf":122,"./withPublic":125,"./xor":126,"bn.js":"BN","browserify-rsa":37,buffer:47,"create-hash":51,"parse-asn1":112,randombytes:127}],125:[function(e,t,n){(function(n){var i=e("bn.js");t.exports=function(e,t){return new n(e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed().toArray())}}).call(this,e("buffer").Buffer)},{"bn.js":"BN",buffer:47}],126:[function(e,t,n){t.exports=function(e,t){for(var n=e.length,i=-1;++i65536)throw new Error("requested too many random bytes");var a=new i.Uint8Array(e);e>0&&o.getRandomValues(a);var s=r.from(a.buffer);return"function"==typeof t?n.nextTick(function(){t(null,s)}):s}:t.exports=function(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:120,"safe-buffer":144}],128:[function(e,t,n){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":129}],129:[function(e,t,n){function i(e){if(!(this instanceof i))return new i(e);u.call(this,e),l.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",r)}function r(){this.allowHalfOpen||this._writableState.ended||a(o,this)}function o(e){e.end()}var a=e("process-nextick-args"),s=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=i;var c=e("core-util-is");c.inherits=e("inherits");var u=e("./_stream_readable"),l=e("./_stream_writable");c.inherits(i,u);for(var f=s(l.prototype),p=0;p0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===N.prototype||(t=r(t)),i?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):l(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?l(e,a,t,!1):y(e,a)):l(e,a,t,!1))):i||(a.reading=!1)}return p(a)}function l(e,t,n,i){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&v(e)),y(e,t)}function f(e,t){var n;return o(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function p(e){return!e.ended&&(e.needReadable||e.length=W?e=W:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function h(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=d(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function m(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,v(e)}}function v(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(z("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?F(b,e):b(e))}function b(e){z("emit readable"),e.emit("readable"),j(e)}function y(e,t){t.readingMore||(t.readingMore=!0,F(g,e,t))}function g(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=E(e,t.buffer,t.decoder),n}function E(e,t,n){var i;return eo.length?o.length:e;if(a===o.length?r+=o:r+=o.slice(0,e),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}function C(e,t){var n=N.allocUnsafe(e),i=t.head,r=1;for(i.data.copy(n),e-=i.data.length;i=i.next;){var o=i.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0===(e-=a)){a===o.length?(++r,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=o.slice(a));break}++r}return t.length-=r,n}function M(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,F(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function P(e,t){for(var n=0,i=e.length;n=t.highWaterMark||t.ended))return z("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?M(this):v(this),null;if(0===(e=h(e,t))&&t.ended)return 0===t.length&&M(this),null;var i=t.needReadable;z("need readable",i),(0===t.length||t.length-e0?S(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&M(this)),null!==r&&this.emit("data",r),r},c.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},c.prototype.pipe=function(e,t){function i(e,t){z("onunpipe"),e===p&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,o())}function r(){z("onend"),e.end()}function o(){z("cleanup"),e.removeListener("close",u),e.removeListener("finish",l),e.removeListener("drain",m),e.removeListener("error",c),e.removeListener("unpipe",i),p.removeListener("end",r),p.removeListener("end",f),p.removeListener("data",s),v=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||m()}function s(t){z("ondata"),b=!1,!1!==e.write(t)||b||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&-1!==P(d.pipes,e))&&!v&&(z("false write response, pause",p._readableState.awaitDrain),p._readableState.awaitDrain++,b=!0),p.pause())}function c(t){z("onerror",t),f(),e.removeListener("error",c),0===R(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",l),f()}function l(){z("onfinish"),e.removeListener("close",u),f()}function f(){z("unpipe"),p.unpipe(e)}var p=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,z("pipe count=%d opts=%j",d.pipesCount,t);var h=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?r:f;d.endEmitted?F(h):p.once("end",h),e.on("unpipe",i);var m=_(p);e.on("drain",m);var v=!1,b=!1;return p.on("data",s),a(e,"error",c),e.once("close",u),e.once("finish",l),e.emit("pipe",p),d.flowing||(z("pipe resume"),p.resume()),e},c.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var i=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o-1?setImmediate:A;u.WritableState=c;var T=e("core-util-is");T.inherits=e("inherits");var P={deprecate:e("util-deprecate")},F=e("./internal/streams/stream"),I=e("safe-buffer").Buffer,B=i.Uint8Array||function(){},R=e("./internal/streams/destroy");T.inherits(u,F),c.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(c.prototype,"buffer",{get:P.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}();var O;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(O=Function.prototype[Symbol.hasInstance],Object.defineProperty(u,Symbol.hasInstance,{value:function(e){return!!O.call(this,e)||e&&e._writableState instanceof c}})):O=function(e){return e instanceof this},u.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},u.prototype.write=function(e,t,n){var i=this._writableState,r=!1,c=a(e)&&!i.objectMode;return c&&!I.isBuffer(e)&&(e=o(e)),"function"==typeof t&&(n=t,t=null),c?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=s),i.ended?l(this,n):(c||f(this,i,e,n))&&(i.pendingcb++,r=d(this,i,c,e,t,n)),r},u.prototype.cork=function(){this._writableState.corked++},u.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_(this,e))},u.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},u.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},u.prototype._writev=null,u.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||S(this,i,n)},Object.defineProperty(u.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),u.prototype.destroy=R.destroy,u.prototype._undestroy=R.undestroy,u.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":129,"./internal/streams/destroy":135,"./internal/streams/stream":136,_process:120,"core-util-is":49,inherits:101,"process-nextick-args":119,"safe-buffer":144,"util-deprecate":156}],134:[function(e,t,n){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t,n){e.copy(t,n)}var o=e("safe-buffer").Buffer;t.exports=function(){function e(){i(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return o.alloc(0);if(1===this.length)return this.head.data;for(var t=o.allocUnsafe(e>>>0),n=this.head,i=0;n;)r(n.data,t,i),i+=n.data.length,n=n.next;return t},e}()},{"safe-buffer":144}],135:[function(e,t,n){function i(e,t){e.emit("error",t)}var r=e("process-nextick-args");t.exports={destroy:function(e,t){var n=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;o||a?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r(i,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(r(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}))},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":119}],136:[function(e,t,n){t.exports=e("events").EventEmitter},{events:83}],137:[function(e,t,n){var i={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},{}],138:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,"safe-buffer":144}],139:[function(e,t,n){t.exports=e("./readable").PassThrough},{"./readable":140}],140:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":129,"./lib/_stream_passthrough.js":130,"./lib/_stream_readable.js":131,"./lib/_stream_transform.js":132,"./lib/_stream_writable.js":133}],141:[function(e,t,n){t.exports=e("./readable").Transform},{"./readable":140}],142:[function(e,t,n){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":133}],143:[function(e,t,n){(function(n){function i(){f.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function r(e,t){return e<>>32-t}function o(e,t,n,i,o,a,s,c){return r(e+(t^n^i)+a+s|0,c)+o|0}function a(e,t,n,i,o,a,s,c){return r(e+(t&n|~t&i)+a+s|0,c)+o|0}function s(e,t,n,i,o,a,s,c){return r(e+((t|~n)^i)+a+s|0,c)+o|0}function c(e,t,n,i,o,a,s,c){return r(e+(t&i|n&~i)+a+s|0,c)+o|0}function u(e,t,n,i,o,a,s,c){return r(e+(t^(n|~i))+a+s|0,c)+o|0}var l=e("inherits"),f=e("hash-base");l(i,f),i.prototype._update=function(){for(var e=new Array(16),t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,i=this._b,l=this._c,f=this._d,p=this._e;p=o(p,n=o(n,i,l,f,p,e[0],0,11),i,l=r(l,10),f,e[1],0,14),i=o(i=r(i,10),l=o(l,f=o(f,p,n,i,l,e[2],0,15),p,n=r(n,10),i,e[3],0,12),f,p=r(p,10),n,e[4],0,5),f=o(f=r(f,10),p=o(p,n=o(n,i,l,f,p,e[5],0,8),i,l=r(l,10),f,e[6],0,7),n,i=r(i,10),l,e[7],0,9),n=o(n=r(n,10),i=o(i,l=o(l,f,p,n,i,e[8],0,11),f,p=r(p,10),n,e[9],0,13),l,f=r(f,10),p,e[10],0,14),l=o(l=r(l,10),f=o(f,p=o(p,n,i,l,f,e[11],0,15),n,i=r(i,10),l,e[12],0,6),p,n=r(n,10),i,e[13],0,7),p=a(p=r(p,10),n=o(n,i=o(i,l,f,p,n,e[14],0,9),l,f=r(f,10),p,e[15],0,8),i,l=r(l,10),f,e[7],1518500249,7),i=a(i=r(i,10),l=a(l,f=a(f,p,n,i,l,e[4],1518500249,6),p,n=r(n,10),i,e[13],1518500249,8),f,p=r(p,10),n,e[1],1518500249,13),f=a(f=r(f,10),p=a(p,n=a(n,i,l,f,p,e[10],1518500249,11),i,l=r(l,10),f,e[6],1518500249,9),n,i=r(i,10),l,e[15],1518500249,7),n=a(n=r(n,10),i=a(i,l=a(l,f,p,n,i,e[3],1518500249,15),f,p=r(p,10),n,e[12],1518500249,7),l,f=r(f,10),p,e[0],1518500249,12),l=a(l=r(l,10),f=a(f,p=a(p,n,i,l,f,e[9],1518500249,15),n,i=r(i,10),l,e[5],1518500249,9),p,n=r(n,10),i,e[2],1518500249,11),p=a(p=r(p,10),n=a(n,i=a(i,l,f,p,n,e[14],1518500249,7),l,f=r(f,10),p,e[11],1518500249,13),i,l=r(l,10),f,e[8],1518500249,12),i=s(i=r(i,10),l=s(l,f=s(f,p,n,i,l,e[3],1859775393,11),p,n=r(n,10),i,e[10],1859775393,13),f,p=r(p,10),n,e[14],1859775393,6),f=s(f=r(f,10),p=s(p,n=s(n,i,l,f,p,e[4],1859775393,7),i,l=r(l,10),f,e[9],1859775393,14),n,i=r(i,10),l,e[15],1859775393,9),n=s(n=r(n,10),i=s(i,l=s(l,f,p,n,i,e[8],1859775393,13),f,p=r(p,10),n,e[1],1859775393,15),l,f=r(f,10),p,e[2],1859775393,14),l=s(l=r(l,10),f=s(f,p=s(p,n,i,l,f,e[7],1859775393,8),n,i=r(i,10),l,e[0],1859775393,13),p,n=r(n,10),i,e[6],1859775393,6),p=s(p=r(p,10),n=s(n,i=s(i,l,f,p,n,e[13],1859775393,5),l,f=r(f,10),p,e[11],1859775393,12),i,l=r(l,10),f,e[5],1859775393,7),i=c(i=r(i,10),l=c(l,f=s(f,p,n,i,l,e[12],1859775393,5),p,n=r(n,10),i,e[1],2400959708,11),f,p=r(p,10),n,e[9],2400959708,12),f=c(f=r(f,10),p=c(p,n=c(n,i,l,f,p,e[11],2400959708,14),i,l=r(l,10),f,e[10],2400959708,15),n,i=r(i,10),l,e[0],2400959708,14),n=c(n=r(n,10),i=c(i,l=c(l,f,p,n,i,e[8],2400959708,15),f,p=r(p,10),n,e[12],2400959708,9),l,f=r(f,10),p,e[4],2400959708,8),l=c(l=r(l,10),f=c(f,p=c(p,n,i,l,f,e[13],2400959708,9),n,i=r(i,10),l,e[3],2400959708,14),p,n=r(n,10),i,e[7],2400959708,5),p=c(p=r(p,10),n=c(n,i=c(i,l,f,p,n,e[15],2400959708,6),l,f=r(f,10),p,e[14],2400959708,8),i,l=r(l,10),f,e[5],2400959708,6),i=u(i=r(i,10),l=c(l,f=c(f,p,n,i,l,e[6],2400959708,5),p,n=r(n,10),i,e[2],2400959708,12),f,p=r(p,10),n,e[4],2840853838,9),f=u(f=r(f,10),p=u(p,n=u(n,i,l,f,p,e[0],2840853838,15),i,l=r(l,10),f,e[5],2840853838,5),n,i=r(i,10),l,e[9],2840853838,11),n=u(n=r(n,10),i=u(i,l=u(l,f,p,n,i,e[7],2840853838,6),f,p=r(p,10),n,e[12],2840853838,8),l,f=r(f,10),p,e[2],2840853838,13),l=u(l=r(l,10),f=u(f,p=u(p,n,i,l,f,e[10],2840853838,12),n,i=r(i,10),l,e[14],2840853838,5),p,n=r(n,10),i,e[1],2840853838,12),p=u(p=r(p,10),n=u(n,i=u(i,l,f,p,n,e[3],2840853838,13),l,f=r(f,10),p,e[8],2840853838,14),i,l=r(l,10),f,e[11],2840853838,11),i=u(i=r(i,10),l=u(l,f=u(f,p,n,i,l,e[6],2840853838,8),p,n=r(n,10),i,e[15],2840853838,5),f,p=r(p,10),n,e[13],2840853838,6),f=r(f,10);var d=this._a,h=this._b,m=this._c,v=this._d,b=this._e;b=u(b,d=u(d,h,m,v,b,e[5],1352829926,8),h,m=r(m,10),v,e[14],1352829926,9),h=u(h=r(h,10),m=u(m,v=u(v,b,d,h,m,e[7],1352829926,9),b,d=r(d,10),h,e[0],1352829926,11),v,b=r(b,10),d,e[9],1352829926,13),v=u(v=r(v,10),b=u(b,d=u(d,h,m,v,b,e[2],1352829926,15),h,m=r(m,10),v,e[11],1352829926,15),d,h=r(h,10),m,e[4],1352829926,5),d=u(d=r(d,10),h=u(h,m=u(m,v,b,d,h,e[13],1352829926,7),v,b=r(b,10),d,e[6],1352829926,7),m,v=r(v,10),b,e[15],1352829926,8),m=u(m=r(m,10),v=u(v,b=u(b,d,h,m,v,e[8],1352829926,11),d,h=r(h,10),m,e[1],1352829926,14),b,d=r(d,10),h,e[10],1352829926,14),b=c(b=r(b,10),d=u(d,h=u(h,m,v,b,d,e[3],1352829926,12),m,v=r(v,10),b,e[12],1352829926,6),h,m=r(m,10),v,e[6],1548603684,9),h=c(h=r(h,10),m=c(m,v=c(v,b,d,h,m,e[11],1548603684,13),b,d=r(d,10),h,e[3],1548603684,15),v,b=r(b,10),d,e[7],1548603684,7),v=c(v=r(v,10),b=c(b,d=c(d,h,m,v,b,e[0],1548603684,12),h,m=r(m,10),v,e[13],1548603684,8),d,h=r(h,10),m,e[5],1548603684,9),d=c(d=r(d,10),h=c(h,m=c(m,v,b,d,h,e[10],1548603684,11),v,b=r(b,10),d,e[14],1548603684,7),m,v=r(v,10),b,e[15],1548603684,7),m=c(m=r(m,10),v=c(v,b=c(b,d,h,m,v,e[8],1548603684,12),d,h=r(h,10),m,e[12],1548603684,7),b,d=r(d,10),h,e[4],1548603684,6),b=c(b=r(b,10),d=c(d,h=c(h,m,v,b,d,e[9],1548603684,15),m,v=r(v,10),b,e[1],1548603684,13),h,m=r(m,10),v,e[2],1548603684,11),h=s(h=r(h,10),m=s(m,v=s(v,b,d,h,m,e[15],1836072691,9),b,d=r(d,10),h,e[5],1836072691,7),v,b=r(b,10),d,e[1],1836072691,15),v=s(v=r(v,10),b=s(b,d=s(d,h,m,v,b,e[3],1836072691,11),h,m=r(m,10),v,e[7],1836072691,8),d,h=r(h,10),m,e[14],1836072691,6),d=s(d=r(d,10),h=s(h,m=s(m,v,b,d,h,e[6],1836072691,6),v,b=r(b,10),d,e[9],1836072691,14),m,v=r(v,10),b,e[11],1836072691,12),m=s(m=r(m,10),v=s(v,b=s(b,d,h,m,v,e[8],1836072691,13),d,h=r(h,10),m,e[12],1836072691,5),b,d=r(d,10),h,e[2],1836072691,14),b=s(b=r(b,10),d=s(d,h=s(h,m,v,b,d,e[10],1836072691,13),m,v=r(v,10),b,e[0],1836072691,13),h,m=r(m,10),v,e[4],1836072691,7),h=a(h=r(h,10),m=a(m,v=s(v,b,d,h,m,e[13],1836072691,5),b,d=r(d,10),h,e[8],2053994217,15),v,b=r(b,10),d,e[6],2053994217,5),v=a(v=r(v,10),b=a(b,d=a(d,h,m,v,b,e[4],2053994217,8),h,m=r(m,10),v,e[1],2053994217,11),d,h=r(h,10),m,e[3],2053994217,14),d=a(d=r(d,10),h=a(h,m=a(m,v,b,d,h,e[11],2053994217,14),v,b=r(b,10),d,e[15],2053994217,6),m,v=r(v,10),b,e[0],2053994217,14),m=a(m=r(m,10),v=a(v,b=a(b,d,h,m,v,e[5],2053994217,6),d,h=r(h,10),m,e[12],2053994217,9),b,d=r(d,10),h,e[2],2053994217,12),b=a(b=r(b,10),d=a(d,h=a(h,m,v,b,d,e[13],2053994217,9),m,v=r(v,10),b,e[9],2053994217,12),h,m=r(m,10),v,e[7],2053994217,5),h=o(h=r(h,10),m=a(m,v=a(v,b,d,h,m,e[10],2053994217,15),b,d=r(d,10),h,e[14],2053994217,8),v,b=r(b,10),d,e[12],0,8),v=o(v=r(v,10),b=o(b,d=o(d,h,m,v,b,e[15],0,5),h,m=r(m,10),v,e[10],0,12),d,h=r(h,10),m,e[4],0,9),d=o(d=r(d,10),h=o(h,m=o(m,v,b,d,h,e[1],0,12),v,b=r(b,10),d,e[5],0,5),m,v=r(v,10),b,e[8],0,14),m=o(m=r(m,10),v=o(v,b=o(b,d,h,m,v,e[7],0,6),d,h=r(h,10),m,e[6],0,8),b,d=r(d,10),h,e[2],0,13),b=o(b=r(b,10),d=o(d,h=o(h,m,v,b,d,e[13],0,6),m,v=r(v,10),b,e[14],0,5),h,m=r(m,10),v,e[0],0,15),h=o(h=r(h,10),m=o(m,v=o(v,b,d,h,m,e[3],0,13),b,d=r(d,10),h,e[9],0,11),v,b=r(b,10),d,e[11],0,11),v=r(v,10);var y=this._b+l+v|0;this._b=this._c+f+b|0,this._c=this._d+p+d|0,this._d=this._e+n+h|0,this._e=this._a+i+m|0,this._a=y},i.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},t.exports=i}).call(this,e("buffer").Buffer)},{buffer:47,"hash-base":85,inherits:101}],144:[function(e,t,n){function i(e,t){for(var n in e)t[n]=e[n]}function r(e,t,n){return a(e,t,n)}var o=e("buffer"),a=o.Buffer;a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?t.exports=o:(i(o,n),n.Buffer=r),i(a,r),r.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,n)},r.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=a(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},r.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},r.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o.SlowBuffer(e)}},{buffer:47}],145:[function(e,t,n){t.exports=e("scryptsy")},{scryptsy:146}],146:[function(e,t,n){(function(n){function i(e,t,i,r,o){if(n.isBuffer(e)&&n.isBuffer(i))e.copy(i,r,t,t+o);else for(;o--;)i[r++]=e[t++]}var r=e("pbkdf2").pbkdf2Sync,o=2147483647;t.exports=function(e,t,a,s,c,u,l){function f(e,t,n,r){var o;for(i(e,t+64*(2*r-1),_,0,64),o=0;o<2*r;o++)h(e,64*o,_,0,64),d(_),i(_,0,e,n+64*o,64);for(o=0;o>>32-t}function d(e){var t;for(t=0;t<16;t++)y[t]=(255&e[4*t+0])<<0,y[t]|=(255&e[4*t+1])<<8,y[t]|=(255&e[4*t+2])<<16,y[t]|=(255&e[4*t+3])<<24;for(i(y,0,g,0,16),t=8;t>0;t-=2)g[4]^=p(g[0]+g[12],7),g[8]^=p(g[4]+g[0],9),g[12]^=p(g[8]+g[4],13),g[0]^=p(g[12]+g[8],18),g[9]^=p(g[5]+g[1],7),g[13]^=p(g[9]+g[5],9),g[1]^=p(g[13]+g[9],13),g[5]^=p(g[1]+g[13],18),g[14]^=p(g[10]+g[6],7),g[2]^=p(g[14]+g[10],9),g[6]^=p(g[2]+g[14],13),g[10]^=p(g[6]+g[2],18),g[3]^=p(g[15]+g[11],7),g[7]^=p(g[3]+g[15],9),g[11]^=p(g[7]+g[3],13),g[15]^=p(g[11]+g[7],18),g[1]^=p(g[0]+g[3],7),g[2]^=p(g[1]+g[0],9),g[3]^=p(g[2]+g[1],13),g[0]^=p(g[3]+g[2],18),g[6]^=p(g[5]+g[4],7),g[7]^=p(g[6]+g[5],9),g[4]^=p(g[7]+g[6],13),g[5]^=p(g[4]+g[7],18),g[11]^=p(g[10]+g[9],7),g[8]^=p(g[11]+g[10],9),g[9]^=p(g[8]+g[11],13),g[10]^=p(g[9]+g[8],18),g[12]^=p(g[15]+g[14],7),g[13]^=p(g[12]+g[15],9),g[14]^=p(g[13]+g[12],13),g[15]^=p(g[14]+g[13],18);for(t=0;t<16;++t)y[t]=g[t]+y[t];for(t=0;t<16;t++){var n=4*t;e[n+0]=y[t]>>0&255,e[n+1]=y[t]>>8&255,e[n+2]=y[t]>>16&255,e[n+3]=y[t]>>24&255}}function h(e,t,n,i,r){for(var o=0;o 0 and a power of 2");if(a>o/128/s)throw Error("Parameter N is too large");if(s>o/128/c)throw Error("Parameter r is too large");var m,v=new n(256*s),b=new n(128*s*a),y=new Int32Array(16),g=new Int32Array(16),_=new n(64),x=r(e,t,1,128*c*s,"sha256");if(l){var w=c*a*2,k=0;m=function(){++k%1e3==0&&l({current:k,total:w,percent:k/w*100})}}for(var j=0;j=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var i=4294967295&n,r=(n-i)/4294967296;this._block.writeUInt32BE(r,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":144}],148:[function(e,t,n){(n=t.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),n.sha1=e("./sha1"),n.sha224=e("./sha224"),n.sha256=e("./sha256"),n.sha384=e("./sha384"),n.sha512=e("./sha512")},{"./sha":149,"./sha1":150,"./sha224":151,"./sha256":152,"./sha384":153,"./sha512":154}],149:[function(e,t,n){function i(){this.init(),this._w=f,c.call(this,64,56)}function r(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function a(e,t,n,i){return 0===e?t&n|~t&i:2===e?t&n|t&i|n&i:t^n^i}var s=e("inherits"),c=e("./hash"),u=e("safe-buffer").Buffer,l=[1518500249,1859775393,-1894007588,-899497514],f=new Array(80);s(i,c),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(e){for(var t=this._w,n=0|this._a,i=0|this._b,s=0|this._c,c=0|this._d,u=0|this._e,f=0;f<16;++f)t[f]=e.readInt32BE(4*f);for(;f<80;++f)t[f]=t[f-3]^t[f-8]^t[f-14]^t[f-16];for(var p=0;p<80;++p){var d=~~(p/20),h=r(n)+a(d,i,s,c)+u+t[p]+l[d]|0;u=c,c=s,s=o(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=c+this._d|0,this._e=u+this._e|0},i.prototype._hash=function(){var e=u.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=i},{"./hash":147,inherits:101,"safe-buffer":144}],150:[function(e,t,n){function i(){this.init(),this._w=p,u.call(this,64,56)}function r(e){return e<<1|e>>>31}function o(e){return e<<5|e>>>27}function a(e){return e<<30|e>>>2}function s(e,t,n,i){return 0===e?t&n|~t&i:2===e?t&n|t&i|n&i:t^n^i}var c=e("inherits"),u=e("./hash"),l=e("safe-buffer").Buffer,f=[1518500249,1859775393,-1894007588,-899497514],p=new Array(80);c(i,u),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(e){for(var t=this._w,n=0|this._a,i=0|this._b,c=0|this._c,u=0|this._d,l=0|this._e,p=0;p<16;++p)t[p]=e.readInt32BE(4*p);for(;p<80;++p)t[p]=r(t[p-3]^t[p-8]^t[p-14]^t[p-16]);for(var d=0;d<80;++d){var h=~~(d/20),m=o(n)+s(h,i,c,u)+l+t[d]+f[h]|0;l=u,u=c,c=a(i),i=n,n=m}this._a=n+this._a|0,this._b=i+this._b|0,this._c=c+this._c|0,this._d=u+this._d|0,this._e=l+this._e|0},i.prototype._hash=function(){var e=l.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=i},{"./hash":147,inherits:101,"safe-buffer":144}],151:[function(e,t,n){function i(){this.init(),this._w=c,a.call(this,64,56)}var r=e("inherits"),o=e("./sha256"),a=e("./hash"),s=e("safe-buffer").Buffer,c=new Array(64);r(i,o),i.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},i.prototype._hash=function(){var e=s.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=i},{"./hash":147,"./sha256":152,inherits:101,"safe-buffer":144}],152:[function(e,t,n){function i(){this.init(),this._w=h,f.call(this,64,56)}function r(e,t,n){return n^e&(t^n)}function o(e,t,n){return e&t|n&(e|t)}function a(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function s(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function c(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function u(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var l=e("inherits"),f=e("./hash"),p=e("safe-buffer").Buffer,d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],h=new Array(64);l(i,f),i.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},i.prototype._update=function(e){for(var t=this._w,n=0|this._a,i=0|this._b,l=0|this._c,f=0|this._d,p=0|this._e,h=0|this._f,m=0|this._g,v=0|this._h,b=0;b<16;++b)t[b]=e.readInt32BE(4*b);for(;b<64;++b)t[b]=u(t[b-2])+t[b-7]+c(t[b-15])+t[b-16]|0;for(var y=0;y<64;++y){var g=v+s(p)+r(p,h,m)+d[y]+t[y]|0,_=a(n)+o(n,i,l)|0;v=m,m=h,h=p,p=f+g|0,f=l,l=i,i=n,n=g+_|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=l+this._c|0,this._d=f+this._d|0,this._e=p+this._e|0,this._f=h+this._f|0,this._g=m+this._g|0,this._h=v+this._h|0},i.prototype._hash=function(){var e=p.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=i},{"./hash":147,inherits:101,"safe-buffer":144}],153:[function(e,t,n){function i(){this.init(),this._w=c,a.call(this,128,112)}var r=e("inherits"),o=e("./sha512"),a=e("./hash"),s=e("safe-buffer").Buffer,c=new Array(160);r(i,o),i.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},i.prototype._hash=function(){function e(e,n,i){t.writeInt32BE(e,i),t.writeInt32BE(n,i+4)}var t=s.allocUnsafe(48);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=i},{"./hash":147,"./sha512":154,inherits:101,"safe-buffer":144}],154:[function(e,t,n){function i(){this.init(),this._w=b,h.call(this,128,112)}function r(e,t,n){return n^e&(t^n)}function o(e,t,n){return e&t|n&(e|t)}function a(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function s(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function c(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function u(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function l(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function f(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function p(e,t){return e>>>0>>0?1:0}var d=e("inherits"),h=e("./hash"),m=e("safe-buffer").Buffer,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],b=new Array(160);d(i,h),i.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},i.prototype._update=function(e){for(var t=this._w,n=0|this._ah,i=0|this._bh,d=0|this._ch,h=0|this._dh,m=0|this._eh,b=0|this._fh,y=0|this._gh,g=0|this._hh,_=0|this._al,x=0|this._bl,w=0|this._cl,k=0|this._dl,j=0|this._el,S=0|this._fl,E=0|this._gl,A=0|this._hl,C=0;C<32;C+=2)t[C]=e.readInt32BE(4*C),t[C+1]=e.readInt32BE(4*C+4);for(;C<160;C+=2){var M=t[C-30],T=t[C-30+1],P=c(M,T),F=u(T,M),I=l(M=t[C-4],T=t[C-4+1]),B=f(T,M),R=t[C-14],O=t[C-14+1],N=t[C-32],D=t[C-32+1],L=F+O|0,q=P+R+p(L,F)|0;q=(q=q+I+p(L=L+B|0,B)|0)+N+p(L=L+D|0,D)|0,t[C]=q,t[C+1]=L}for(var z=0;z<160;z+=2){q=t[z],L=t[z+1];var U=o(n,i,d),H=o(_,x,w),V=a(n,_),K=a(_,n),W=s(m,j),X=s(j,m),G=v[z],$=v[z+1],J=r(m,b,y),Q=r(j,S,E),Y=A+X|0,Z=g+W+p(Y,A)|0;Z=(Z=(Z=Z+J+p(Y=Y+Q|0,Q)|0)+G+p(Y=Y+$|0,$)|0)+q+p(Y=Y+L|0,L)|0;var ee=K+H|0,te=V+U+p(ee,K)|0;g=y,A=E,y=b,E=S,b=m,S=j,m=h+Z+p(j=k+Y|0,k)|0,h=d,k=w,d=i,w=x,i=n,x=_,n=Z+te+p(_=Y+ee|0,Y)|0}this._al=this._al+_|0,this._bl=this._bl+x|0,this._cl=this._cl+w|0,this._dl=this._dl+k|0,this._el=this._el+j|0,this._fl=this._fl+S|0,this._gl=this._gl+E|0,this._hl=this._hl+A|0,this._ah=this._ah+n+p(this._al,_)|0,this._bh=this._bh+i+p(this._bl,x)|0,this._ch=this._ch+d+p(this._cl,w)|0,this._dh=this._dh+h+p(this._dl,k)|0,this._eh=this._eh+m+p(this._el,j)|0,this._fh=this._fh+b+p(this._fl,S)|0,this._gh=this._gh+y+p(this._gl,E)|0,this._hh=this._hh+g+p(this._hl,A)|0},i.prototype._hash=function(){function e(e,n,i){t.writeInt32BE(e,i),t.writeInt32BE(n,i+4)}var t=m.allocUnsafe(64);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=i},{"./hash":147,inherits:101,"safe-buffer":144}],155:[function(e,t,n){function i(){r.call(this)}t.exports=i;var r=e("events").EventEmitter;e("inherits")(i,r),i.Readable=e("readable-stream/readable.js"),i.Writable=e("readable-stream/writable.js"),i.Duplex=e("readable-stream/duplex.js"),i.Transform=e("readable-stream/transform.js"),i.PassThrough=e("readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&u.pause&&u.pause()}function i(){u.readable&&u.resume&&u.resume()}function o(){l||(l=!0,e.end())}function a(){l||(l=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){u.removeListener("data",n),e.removeListener("drain",i),u.removeListener("end",o),u.removeListener("close",a),u.removeListener("error",s),e.removeListener("error",s),u.removeListener("end",c),u.removeListener("close",c),e.removeListener("close",c)}var u=this;u.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(u.on("end",o),u.on("close",a));var l=!1;return u.on("error",s),e.on("error",s),u.on("end",c),u.on("close",c),e.on("close",c),e.emit("pipe",u),e}},{events:83,inherits:101,"readable-stream/duplex.js":128,"readable-stream/passthrough.js":139,"readable-stream/readable.js":140,"readable-stream/transform.js":141,"readable-stream/writable.js":142}],156:[function(e,t,n){(function(e){function n(t){try{if(!e.localStorage)return!1}catch(e){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],157:[function(require,module,exports){function Context(){}var indexOf=require("indexof"),Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var n in e)t.push(n);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;nl||u===l&&"application/"===t[c].substr(0,12)))continue}t[c]=i}}})}(n.extensions,n.types)},{"mime-db":162,path:113}],164:[function(e,t,n){var i=e("trim"),r=e("for-each"),o=function(e){return"[object Array]"===Object.prototype.toString.call(e)};t.exports=function(e){if(!e)return{};var t={};return r(i(e).split("\n"),function(e){var n=e.indexOf(":"),r=i(e.slice(0,n)).toLowerCase(),a=i(e.slice(n+1));void 0===t[r]?t[r]=a:o(t[r])?t[r].push(a):t[r]=[t[r],a]}),t}},{"for-each":158,trim:171}],165:[function(e,t,n){var i=e("strict-uri-encode");n.extract=function(e){return e.split("?")[1]||""},n.parse=function(e){return"string"!=typeof e?{}:(e=e.trim().replace(/^(\?|#|&)/,""))?e.split("&").reduce(function(e,t){var n=t.replace(/\+/g," ").split("="),i=n.shift(),r=n.length>0?n.join("="):void 0;return i=decodeURIComponent(i),r=void 0===r?null:decodeURIComponent(r),e.hasOwnProperty(i)?Array.isArray(e[i])?e[i].push(r):e[i]=[e[i],r]:e[i]=r,e},{}):{}},n.stringify=function(e){return e?Object.keys(e).sort().map(function(t){var n=e[t];return Array.isArray(n)?n.sort().map(function(e){return i(t)+"="+i(e)}).join("&"):i(t)+"="+i(n)}).filter(function(e){return e.length>0}).join("&"):""}},{"strict-uri-encode":166}],166:[function(e,t,n){t.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}},{}],167:[function(e,t,n){t.exports={"windows-amd64":{archive:"swarm-windows-amd64-1.6.7.exe",binaryMD5:"c2d827dc4553d9b91a7d6c1d5a6140fd",archiveMD5:"059196d21548060a18a12e17cc0ee59a"},"linux-amd64":{archive:"swarm-linux-amd64-1.6.7",binaryMD5:"85002d79b8ebc2d2f2f10fb198636a81",archiveMD5:"3e8874299ab8c0e3043d70ebb6673879"},"linux-386":{archive:"swarm-linux-386-1.6.7",binaryMD5:"35bc2ab976f60f96a2cede117e0df19d",archiveMD5:"7868a86c9cbdf8ac7ac2e5682b4ce40f"},"darwin-amd64":{archive:"swarm-darwin-amd64-1.6.7",binaryMD5:"c499b186645229260dd6ab685dd58f07",archiveMD5:"0794d111e5018eac3b657bcb29851121"},"linux-arm5":{archive:"swarm-linux-arm5-1.6.7",binaryMD5:"516fcd85246c905529442cd9b689c12f",archiveMD5:"47312708d417cb196b07ba0af1d3abb4"},"linux-arm6":{archive:"swarm-linux-arm6-1.6.7",binaryMD5:"82ff7bdbe388b4a190f4101c5150d3b4",archiveMD5:"350276de7bb175a15c314cfc4cb7f8fd"},"linux-mips":{archive:"swarm-linux-mips-1.6.7",binaryMD5:"e1e95280441c0ca35633927792ef5317",archiveMD5:"8fb4b64e94cd73aa718db787b9d4c53e"},"linux-arm7":{archive:"swarm-linux-arm7-1.6.7",binaryMD5:"bfc0b4d1c86d8a975af052fc7854bdd3",archiveMD5:"4378641d8e1e1fbb947f941c8fca8613"},"linux-arm64":{archive:"swarm-linux-arm64-1.6.7",binaryMD5:"bbac21a6c6fa8208f67ca4123d3f948a",archiveMD5:"4e503160327c5fbcca0414f17c54e5ee"},"linux-mipsle":{archive:"swarm-linux-mipsle-1.6.7",binaryMD5:"a82f191b2f9d2c470d0273219c820657",archiveMD5:"3016bdb6d237ae654c0cdf36fe85dc7c"},"windows-386":{archive:"swarm-windows-386-1.6.7.exe",binaryMD5:"ce0b34640642e58068ae5a359faef102",archiveMD5:"640aede4da08a3a9d8a6ac0434ba7c0f"},"linux-mips64":{archive:"swarm-linux-mips64-1.6.7",binaryMD5:"9da967664f384817adb5083fd1ffe8f1",archiveMD5:"357a33be470f8f89ba2619957a08deff"},"linux-mips64le":{archive:"swarm-linux-mips64le-1.6.7",binaryMD5:"ec1abcf7b216e87645ec83954d8344cd",archiveMD5:"a81fd0158190d99813c738ffa4f87627"}}},{}],168:[function(e,t,n){var i=function(){throw"This swarm.js function isn't available on the browser."},r={readFile:i},o={download:i,safeDownloadArchived:i,directoryTree:i},a={platform:i,arch:i},s={join:i,slice:i},c={spawn:i},u=e("./swarm");t.exports=u({fsp:r,files:o,os:a,path:s,child_process:c})},{"./swarm":170}],169:[function(e,t,n){(function(e){var n=function(t){return function(){return new Promise(function(n,i){var r=function(i){var r={},o=i.target.files.length,a=0;[].map.call(i.target.files,function(i){var s=new FileReader;s.onload=function(s){var c=new e(s.target.result);if("directory"===t){var u=i.webkitRelativePath;r[u.slice(u.indexOf("/")+1)]={type:"text/plain",data:c},++a===o&&n(r)}else if("file"===t){var l=i.webkitRelativePath;n({type:mimetype.lookup(l),data:c})}else n(c)},s.readAsArrayBuffer(i)})},o=void 0;"directory"===t?((o=document.createElement("input")).addEventListener("change",r),o.type="file",o.webkitdirectory=!0,o.mozdirectory=!0,o.msdirectory=!0,o.odirectory=!0,o.directory=!0):((o=document.createElement("input")).addEventListener("change",r),o.type="file");var a=document.createEvent("MouseEvents");a.initEvent("click",!0,!1),o.dispatchEvent(a)})}};t.exports={data:n("data"),file:n("file"),directory:n("directory")}}).call(this,e("buffer").Buffer)},{buffer:47}],170:[function(e,t,n){var i=e("mime-types"),r=e("./pick.js"),o=e("xhr-request-promise"),a=e("./../archives/archives.json"),s=e("buffer").Buffer;t.exports=function(e){var t=e.fsp,n=e.files,c=e.os,u=e.path,l=e.child_process,f=function(e){return function(t){return function(n){return n[e]=t,n}}},p=function(e){return function(t){for(var n={},i=0,r=e.length;i0){var o=u.join(n,r);i.push(g(e)(t[r])(o))}return Promise.all(i).then(function(){return n})})}}},x=function(e){return function(t){return o(e+"/bzzr:/",{body:"string"==typeof t?new s(t):t,method:"POST"})}},w=function(e){return function(t){return function(n){return function(i){return function r(a){var s="/"===n[0]?n:"/"+n,c=e+"/bzz:/"+t+s,u={method:"PUT",headers:{"Content-Type":i.type},body:i.data};return o(c,u).catch(function(e){return a>0&&r(a-1)})}(3)}}}},k=function(e){return function(t){return S(e)({"":t})}},j=function(e){return function(n){return t.readFile(n).then(function(t){return k(e)({type:i.lookup(n),data:t})})}},S=function(e){return function(t){return x(e)("{}").then(function(n){var i=function(n){return function(i){return w(e)(i)(n)(t[n])}};return Object.keys(t).reduce(function(e,t){return e.then(i(t))},Promise.resolve(n))})}},E=function(e){return function(n){return t.readFile(n).then(x(e))}},A=function(e){return function(r){return function(o){return n.directoryTree(o).then(function(e){return Promise.all(e.map(function(e){return t.readFile(e)})).then(function(t){var n=e.map(function(e){return e.slice(o.length)}),r=e.map(function(e){return i.lookup(e)||"text/plain"});return p(n)(t.map(function(e,t){return{type:r[t],data:e}}))})}).then(function(e){return d(r?{"":e[r]}:{})(e)}).then(S(e))}}},C=function(e){return function(t){if("data"===t.pick)return r.data().then(x(e));if("file"===t.pick)return r.file().then(k(e));if("directory"===t.pick)return r.directory().then(S(e));if(t.path)switch(t.kind){case"data":return E(e)(t.path);case"file":return j(e)(t.path);case"directory":return A(e)(t.defaultFile)(t.path)}else{if("string"==typeof t)return x(e)(new s(t));if(t.length)return x(e)(t);if(t instanceof Object)return S(e)(t)}return Promise.reject(new Error("Bad arguments"))}},M=function(e){return function(t){return function(n){return B(e)(t).then(function(i){return i?n?_(e)(t)(n):y(e)(t):n?g(e)(t)(n):m(e)(t)})}}},T=function(e,t){var i=c.platform().replace("win32","windows")+"-"+("x64"===c.arch()?"amd64":"386"),r=(t||a)[i],o="http://ethereum-mist.s3.amazonaws.com/swarm/"+r.archive+".tar.gz",s=r.archiveMD5,u=r.binaryMD5;return n.safeDownloadArchived(o)(s)(u)(e)},P=function(e){return new Promise(function(t,n){var i=l.spawn,r=function(e){return function(t){return-1!==(""+t).indexOf(e)}},o=e.account,a=e.password,s=e.dataDir,c=e.ensApi,u=e.privateKey,f=0,p=i(e.binPath,["--bzzaccount",o||u,"--datadir",s,"--ens-api",c]),d=function(e){0===f&&r("Passphrase")(e)?setTimeout(function(){f=1,p.stdin.write(a+"\n")},500):r("Swarm http proxy started")(e)&&(f=2,clearTimeout(h),t(p))};p.stdout.on("data",d),p.stderr.on("data",d);var h=setTimeout(function(){return n(new Error("Couldn't start swarm process."))},2e4)})},F=function(e){return new Promise(function(t,n){e.stderr.removeAllListeners("data"),e.stdout.removeAllListeners("data"),e.stdin.removeAllListeners("error"),e.removeAllListeners("error"),e.removeAllListeners("exit"),e.kill("SIGINT");var i=setTimeout(function(){return e.kill("SIGKILL")},8e3);e.once("close",function(){clearTimeout(i),t()})})},I=function(e){return x(e)("test").then(function(e){return"c9a99c7d326dcc6316f32fe2625b311f6dc49a175e6877681ded93137d3569e7"===e}).catch(function(){return!1})},B=function(e){return function(t){return m(e)(t).then(function(e){return!!JSON.parse(e.toString()).entries}).catch(function(){return!1})}},R=function(e){return function(t,n,i,r,o){return void 0!==t&&(e=e(t)),void 0!==n&&(e=e(n)),void 0!==i&&(e=e(i)),void 0!==r&&(e=e(r)),void 0!==o&&(e=e(o)),e}},O=function(e){return{download:function(t,n){return M(e)(t)(n)},downloadData:R(m(e)),downloadDataToDisk:R(g(e)),downloadDirectory:R(y(e)),downloadDirectoryToDisk:R(_(e)),downloadEntries:R(v(e)),downloadRoutes:R(b(e)),isAvailable:function(){return I(e)},upload:function(t){return C(e)(t)},uploadData:R(x(e)),uploadFile:R(k(e)),uploadFileFromDisk:R(k(e)),uploadDataFromDisk:R(E(e)),uploadDirectory:R(S(e)),uploadDirectoryFromDisk:R(A(e)),uploadToManifest:R(w(e)),pick:r}};return{at:O,local:function(e){return function(t){return I("http://localhost:8500").then(function(n){return n?t(O("http://localhost:8500")).then(function(){}):T(e.binPath,e.archives).onData(function(t){return(e.onProgress||function(){})(t.length)}).then(function(){return P(e)}).then(function(e){return t(O("http://localhost:8500")).then(function(){return e})}).then(F)})}},download:M,downloadBinary:T,downloadData:m,downloadDataToDisk:g,downloadDirectory:y,downloadDirectoryToDisk:_,downloadEntries:v,downloadRoutes:b,isAvailable:I,startProcess:P,stopProcess:F,upload:C,uploadData:x,uploadDataFromDisk:E,uploadFile:k,uploadFileFromDisk:j,uploadDirectory:S,uploadDirectoryFromDisk:A,uploadToManifest:w,pick:r}}},{"./../archives/archives.json":167,"./pick.js":169,buffer:47,"mime-types":163,"xhr-request-promise":174}],171:[function(e,t,n){(n=t.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},n.right=function(e){return e.replace(/\s*$/,"")}},{}],172:[function(e,t,n){(function(){function e(e){function t(t,n,i,r,o,a){for(;o>=0&&o