Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Arcfour() {
- this.i = 0;
- this.j = 0;
- this.S = []
- }
- function ARC4init(n) {
- for (var i, r, t = 0; t < 256; ++t) this.S[t] = t;
- for (i = 0, t = 0; t < 256; ++t) i = i + this.S[t] + n[t % n.length] & 255, r = this.S[t], this.S[t] = this.S[i], this.S[i] = r;
- this.i = 0;
- this.j = 0
- }
- function ARC4next() {
- var n;
- return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, n = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = n, this.S[n + this.S[this.i] & 255]
- }
- function prng_newstate() {
- return new Arcfour
- }
- function rng_get_byte() {
- var r, t, n, i;
- if (rng_state == null) {
- for (rng_state = prng_newstate(); rng_pptr < rng_psize;) r = Math.floor(65536 * Math.random()), rng_pool[rng_pptr++] = r & 255;
- if (!secure_browser)
- for (t = Crypto.util.hexToBytes($("#server-seed").text()), n = 0; n < t.length; ++n) rng_pool[n] ^= t[n];
- for (rng_state.init(rng_pool), rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) rng_pool[rng_pptr] = 0;
- for (rng_pptr = 0, i = 0; i < 256; i++) rng_state.next()
- }
- return rng_state.next()
- }
- function rng_get_bytes(n) {
- for (var t = 0; t < n.length; ++t) n[t] = rng_get_byte()
- }
- function SecureRandom() {}
- function BigInteger(n, t, i) {
- n != null && ("number" == typeof n ? this.fromNumber(n, t, i) : t == null && "string" != typeof n ? this.fromString(n, 256) : this.fromString(n, t))
- }
- function nbi() {
- return new BigInteger(null)
- }
- function am1(n, t, i, r, u, f) {
- while (--f >= 0) {
- var e = t * this[n++] + i[r] + u;
- u = Math.floor(e / 67108864);
- i[r++] = e & 67108863
- }
- return u
- }
- function am2(n, t, i, r, u, f) {
- for (var o = t & 32767, s = t >> 15; --f >= 0;) {
- var e = this[n] & 32767,
- h = this[n++] >> 15,
- c = s * e + h * o;
- e = o * e + ((c & 32767) << 15) + i[r] + (u & 1073741823);
- u = (e >>> 30) + (c >>> 15) + s * h + (u >>> 30);
- i[r++] = e & 1073741823
- }
- return u
- }
- function am3(n, t, i, r, u, f) {
- for (var o = t & 16383, s = t >> 14; --f >= 0;) {
- var e = this[n] & 16383,
- h = this[n++] >> 14,
- c = s * e + h * o;
- e = o * e + ((c & 16383) << 14) + i[r] + u;
- u = (e >> 28) + (c >> 14) + s * h;
- i[r++] = e & 268435455
- }
- return u
- }
- function int2char(n) {
- return BI_RM.charAt(n)
- }
- function intAt(n, t) {
- var i = BI_RC[n.charCodeAt(t)];
- return i == null ? -1 : i
- }
- function bnpCopyTo(n) {
- for (var t = this.t - 1; t >= 0; --t) n[t] = this[t];
- n.t = this.t;
- n.s = this.s
- }
- function bnpFromInt(n) {
- this.t = 1;
- this.s = n < 0 ? -1 : 0;
- n > 0 ? this[0] = n : n < -1 ? this[0] = n + DV : this.t = 0
- }
- function nbv(n) {
- var t = nbi();
- return t.fromInt(n), t
- }
- function bnpFromString(n, t) {
- var r, u;
- if (t == 16) r = 4;
- else if (t == 8) r = 3;
- else if (t == 256) r = 8;
- else if (t == 2) r = 1;
- else if (t == 32) r = 5;
- else if (t == 4) r = 2;
- else {
- this.fromRadix(n, t);
- return
- }
- this.t = 0;
- this.s = 0;
- for (var f = n.length, e = !1, i = 0; --f >= 0;) {
- if (u = r == 8 ? n[f] & 255 : intAt(n, f), u < 0) {
- n.charAt(f) == "-" && (e = !0);
- continue
- }
- e = !1;
- i == 0 ? this[this.t++] = u : i + r > this.DB ? (this[this.t - 1] |= (u & (1 << this.DB - i) - 1) << i, this[this.t++] = u >> this.DB - i) : this[this.t - 1] |= u << i;
- i += r;
- i >= this.DB && (i -= this.DB)
- }
- r == 8 && (n[0] & 128) != 0 && (this.s = -1, i > 0 && (this[this.t - 1] |= (1 << this.DB - i) - 1 << i));
- this.clamp();
- e && BigInteger.ZERO.subTo(this, this)
- }
- function bnpClamp() {
- for (var n = this.s & this.DM; this.t > 0 && this[this.t - 1] == n;) --this.t
- }
- function bnToString(n) {
- var t;
- if (this.s < 0) return "-" + this.negate().toString(n);
- if (n == 16) t = 4;
- else if (n == 8) t = 3;
- else if (n == 2) t = 1;
- else if (n == 32) t = 5;
- else if (n == 4) t = 2;
- else return this.toRadix(n);
- var o = (1 << t) - 1,
- u, f = !1,
- e = "",
- r = this.t,
- i = this.DB - r * this.DB % t;
- if (r-- > 0)
- for (i < this.DB && (u = this[r] >> i) > 0 && (f = !0, e = int2char(u)); r >= 0;) i < t ? u = (this[r] & (1 << i) - 1) << t - i | this[--r] >> (i += this.DB - t) : (u = this[r] >> (i -= t) & o, i <= 0 && (i += this.DB, --r)), u > 0 && (f = !0), f && (e += int2char(u));
- return f ? e : "0"
- }
- function bnNegate() {
- var n = nbi();
- return BigInteger.ZERO.subTo(this, n), n
- }
- function bnAbs() {
- return this.s < 0 ? this.negate() : this
- }
- function bnCompareTo(n) {
- var t = this.s - n.s,
- i;
- if (t != 0) return t;
- if (i = this.t, t = i - n.t, t != 0) return this.s < 0 ? -t : t;
- while (--i >= 0)
- if ((t = this[i] - n[i]) != 0) return t;
- return 0
- }
- function nbits(n) {
- var i = 1,
- t;
- return (t = n >>> 16) != 0 && (n = t, i += 16), (t = n >> 8) != 0 && (n = t, i += 8), (t = n >> 4) != 0 && (n = t, i += 4), (t = n >> 2) != 0 && (n = t, i += 2), (t = n >> 1) != 0 && (n = t, i += 1), i
- }
- function bnBitLength() {
- return this.t <= 0 ? 0 : this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM)
- }
- function bnpDLShiftTo(n, t) {
- for (var i = this.t - 1; i >= 0; --i) t[i + n] = this[i];
- for (i = n - 1; i >= 0; --i) t[i] = 0;
- t.t = this.t + n;
- t.s = this.s
- }
- function bnpDRShiftTo(n, t) {
- for (var i = n; i < this.t; ++i) t[i - n] = this[i];
- t.t = Math.max(this.t - n, 0);
- t.s = this.s
- }
- function bnpLShiftTo(n, t) {
- for (var u = n % this.DB, e = this.DB - u, o = (1 << e) - 1, r = Math.floor(n / this.DB), f = this.s << u & this.DM, i = this.t - 1; i >= 0; --i) t[i + r + 1] = this[i] >> e | f, f = (this[i] & o) << u;
- for (i = r - 1; i >= 0; --i) t[i] = 0;
- t[r] = f;
- t.t = this.t + r + 1;
- t.s = this.s;
- t.clamp()
- }
- function bnpRShiftTo(n, t) {
- var i, r;
- if (t.s = this.s, i = Math.floor(n / this.DB), i >= this.t) {
- t.t = 0;
- return
- }
- var u = n % this.DB,
- f = this.DB - u,
- e = (1 << u) - 1;
- for (t[0] = this[i] >> u, r = i + 1; r < this.t; ++r) t[r - i - 1] |= (this[r] & e) << f, t[r - i] = this[r] >> u;
- u > 0 && (t[this.t - i - 1] |= (this.s & e) << f);
- t.t = this.t - i;
- t.clamp()
- }
- function bnpSubTo(n, t) {
- for (var r = 0, i = 0, u = Math.min(n.t, this.t); r < u;) i += this[r] - n[r], t[r++] = i & this.DM, i >>= this.DB;
- if (n.t < this.t) {
- for (i -= n.s; r < this.t;) i += this[r], t[r++] = i & this.DM, i >>= this.DB;
- i += this.s
- } else {
- for (i += this.s; r < n.t;) i -= n[r], t[r++] = i & this.DM, i >>= this.DB;
- i -= n.s
- }
- t.s = i < 0 ? -1 : 0;
- i < -1 ? t[r++] = this.DV + i : i > 0 && (t[r++] = i);
- t.t = r;
- t.clamp()
- }
- function bnpMultiplyTo(n, t) {
- var r = this.abs(),
- u = n.abs(),
- i = r.t;
- for (t.t = i + u.t; --i >= 0;) t[i] = 0;
- for (i = 0; i < u.t; ++i) t[i + r.t] = r.am(0, u[i], t, i, 0, r.t);
- t.s = 0;
- t.clamp();
- this.s != n.s && BigInteger.ZERO.subTo(t, t)
- }
- function bnpSquareTo(n) {
- for (var i = this.abs(), t = n.t = 2 * i.t, r; --t >= 0;) n[t] = 0;
- for (t = 0; t < i.t - 1; ++t) r = i.am(t, i[t], n, 2 * t, 0, 1), (n[t + i.t] += i.am(t + 1, 2 * i[t], n, 2 * t + 1, r, i.t - t - 1)) >= i.DV && (n[t + i.t] -= i.DV, n[t + i.t + 1] = 1);
- n.t > 0 && (n[n.t - 1] += i.am(t, i[t], n, 2 * t, 0, 1));
- n.s = 0;
- n.clamp()
- }
- function bnpDivRemTo(n, t, i) {
- var e = n.abs(),
- h, u, c, a;
- if (!(e.t <= 0)) {
- if (h = this.abs(), h.t < e.t) {
- t != null && t.fromInt(0);
- i != null && this.copyTo(i);
- return
- }
- i == null && (i = nbi());
- var r = nbi(),
- v = this.s,
- p = n.s,
- s = this.DB - nbits(e[e.t - 1]);
- if (s > 0 ? (e.lShiftTo(s, r), h.lShiftTo(s, i)) : (e.copyTo(r), h.copyTo(i)), u = r.t, c = r[u - 1], c != 0) {
- var y = c * (1 << this.F1) + (u > 1 ? r[u - 2] >> this.F2 : 0),
- w = this.FV / y,
- b = (1 << this.F1) / y,
- k = 1 << this.F2,
- o = i.t,
- l = o - u,
- f = t == null ? nbi() : t;
- for (r.dlShiftTo(l, f), i.compareTo(f) >= 0 && (i[i.t++] = 1, i.subTo(f, i)), BigInteger.ONE.dlShiftTo(u, f), f.subTo(r, r); r.t < u;) r[r.t++] = 0;
- while (--l >= 0)
- if (a = i[--o] == c ? this.DM : Math.floor(i[o] * w + (i[o - 1] + k) * b), (i[o] += r.am(0, a, i, l, 0, u)) < a)
- for (r.dlShiftTo(l, f), i.subTo(f, i); i[o] < --a;) i.subTo(f, i);
- t != null && (i.drShiftTo(u, t), v != p && BigInteger.ZERO.subTo(t, t));
- i.t = u;
- i.clamp();
- s > 0 && i.rShiftTo(s, i);
- v < 0 && BigInteger.ZERO.subTo(i, i)
- }
- }
- }
- function bnMod(n) {
- var t = nbi();
- return this.abs().divRemTo(n, null, t), this.s < 0 && t.compareTo(BigInteger.ZERO) > 0 && n.subTo(t, t), t
- }
- function Classic(n) {
- this.m = n
- }
- function cConvert(n) {
- return n.s < 0 || n.compareTo(this.m) >= 0 ? n.mod(this.m) : n
- }
- function cRevert(n) {
- return n
- }
- function cReduce(n) {
- n.divRemTo(this.m, null, n)
- }
- function cMulTo(n, t, i) {
- n.multiplyTo(t, i);
- this.reduce(i)
- }
- function cSqrTo(n, t) {
- n.squareTo(t);
- this.reduce(t)
- }
- function bnpInvDigit() {
- var t, n;
- return this.t < 1 ? 0 : (t = this[0], (t & 1) == 0) ? 0 : (n = t & 3, n = n * (2 - (t & 15) * n) & 15, n = n * (2 - (t & 255) * n) & 255, n = n * (2 - ((t & 65535) * n & 65535)) & 65535, n = n * (2 - t * n % this.DV) % this.DV, n > 0 ? this.DV - n : -n)
- }
- function Montgomery(n) {
- this.m = n;
- this.mp = n.invDigit();
- this.mpl = this.mp & 32767;
- this.mph = this.mp >> 15;
- this.um = (1 << n.DB - 15) - 1;
- this.mt2 = 2 * n.t
- }
- function montConvert(n) {
- var t = nbi();
- return n.abs().dlShiftTo(this.m.t, t), t.divRemTo(this.m, null, t), n.s < 0 && t.compareTo(BigInteger.ZERO) > 0 && this.m.subTo(t, t), t
- }
- function montRevert(n) {
- var t = nbi();
- return n.copyTo(t), this.reduce(t), t
- }
- function montReduce(n) {
- for (var i, t, r; n.t <= this.mt2;) n[n.t++] = 0;
- for (i = 0; i < this.m.t; ++i)
- for (t = n[i] & 32767, r = t * this.mpl + ((t * this.mph + (n[i] >> 15) * this.mpl & this.um) << 15) & n.DM, t = i + this.m.t, n[t] += this.m.am(0, r, n, i, 0, this.m.t); n[t] >= n.DV;) n[t] -= n.DV, n[++t] ++;
- n.clamp();
- n.drShiftTo(this.m.t, n);
- n.compareTo(this.m) >= 0 && n.subTo(this.m, n)
- }
- function montSqrTo(n, t) {
- n.squareTo(t);
- this.reduce(t)
- }
- function montMulTo(n, t, i) {
- n.multiplyTo(t, i);
- this.reduce(i)
- }
- function bnpIsEven() {
- return (this.t > 0 ? this[0] & 1 : this.s) == 0
- }
- function bnpExp(n, t) {
- var e;
- if (n > 4294967295 || n < 1) return BigInteger.ONE;
- var i = nbi(),
- r = nbi(),
- u = t.convert(this),
- f = nbits(n) - 1;
- for (u.copyTo(i); --f >= 0;) t.sqrTo(i, r), (n & 1 << f) > 0 ? t.mulTo(r, u, i) : (e = i, i = r, r = e);
- return t.revert(i)
- }
- function bnModPowInt(n, t) {
- var i;
- return i = n < 256 || t.isEven() ? new Classic(t) : new Montgomery(t), this.exp(n, i)
- }
- function bnClone() {
- var n = nbi();
- return this.copyTo(n), n
- }
- function bnIntValue() {
- if (this.s < 0) {
- if (this.t == 1) return this[0] - this.DV;
- if (this.t == 0) return -1
- } else {
- if (this.t == 1) return this[0];
- if (this.t == 0) return 0
- }
- return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0]
- }
- function bnByteValue() {
- return this.t == 0 ? this.s : this[0] << 24 >> 24
- }
- function bnShortValue() {
- return this.t == 0 ? this.s : this[0] << 16 >> 16
- }
- function bnpChunkSize(n) {
- return Math.floor(Math.LN2 * this.DB / Math.log(n))
- }
- function bnSigNum() {
- return this.s < 0 ? -1 : this.t <= 0 || this.t == 1 && this[0] <= 0 ? 0 : 1
- }
- function bnpToRadix(n) {
- if (n == null && (n = 10), this.signum() == 0 || n < 2 || n > 36) return "0";
- var e = this.chunkSize(n),
- u = Math.pow(n, e),
- f = nbv(u),
- t = nbi(),
- i = nbi(),
- r = "";
- for (this.divRemTo(f, t, i); t.signum() > 0;) r = (u + i.intValue()).toString(n).substr(1) + r, t.divRemTo(f, t, i);
- return i.intValue().toString(n) + r
- }
- function bnpFromRadix(n, t) {
- var r, f;
- this.fromInt(0);
- t == null && (t = 10);
- var e = this.chunkSize(t),
- s = Math.pow(t, e),
- o = !1,
- u = 0,
- i = 0;
- for (r = 0; r < n.length; ++r) {
- if (f = intAt(n, r), f < 0) {
- n.charAt(r) == "-" && this.signum() == 0 && (o = !0);
- continue
- }
- i = t * i + f;
- ++u >= e && (this.dMultiply(s), this.dAddOffset(i, 0), u = 0, i = 0)
- }
- u > 0 && (this.dMultiply(Math.pow(t, u)), this.dAddOffset(i, 0));
- o && BigInteger.ZERO.subTo(this, this)
- }
- function bnpFromNumber(n, t, i) {
- if ("number" == typeof t)
- if (n < 2) this.fromInt(1);
- else
- for (this.fromNumber(n, i), this.testBit(n - 1) || this.bitwiseTo(BigInteger.ONE.shiftLeft(n - 1), op_or, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(t);) this.dAddOffset(2, 0), this.bitLength() > n && this.subTo(BigInteger.ONE.shiftLeft(n - 1), this);
- else {
- var r = [],
- u = n & 7;
- r.length = (n >> 3) + 1;
- t.nextBytes(r);
- u > 0 ? r[0] &= (1 << u) - 1 : r[0] = 0;
- this.fromString(r, 256)
- }
- }
- function bnToByteArray() {
- var i = this.t,
- u = [],
- n, t, r;
- if (u[0] = this.s, n = this.DB - i * this.DB % 8, r = 0, i-- > 0)
- for (n < this.DB && (t = this[i] >> n) != (this.s & this.DM) >> n && (u[r++] = t | this.s << this.DB - n); i >= 0;) n < 8 ? t = (this[i] & (1 << n) - 1) << 8 - n | this[--i] >> (n += this.DB - 8) : (t = this[i] >> (n -= 8) & 255, n <= 0 && (n += this.DB, --i)), (t & 128) != 0 && (t |= -256), r == 0 && (this.s & 128) != (t & 128) && ++r, (r > 0 || t != this.s) && (u[r++] = t);
- return u
- }
- function bnEquals(n) {
- return this.compareTo(n) == 0
- }
- function bnMin(n) {
- return this.compareTo(n) < 0 ? this : n
- }
- function bnMax(n) {
- return this.compareTo(n) > 0 ? this : n
- }
- function bnpBitwiseTo(n, t, i) {
- for (var u, f = Math.min(n.t, this.t), r = 0; r < f; ++r) i[r] = t(this[r], n[r]);
- if (n.t < this.t) {
- for (u = n.s & this.DM, r = f; r < this.t; ++r) i[r] = t(this[r], u);
- i.t = this.t
- } else {
- for (u = this.s & this.DM, r = f; r < n.t; ++r) i[r] = t(u, n[r]);
- i.t = n.t
- }
- i.s = t(this.s, n.s);
- i.clamp()
- }
- function op_and(n, t) {
- return n & t
- }
- function bnAnd(n) {
- var t = nbi();
- return this.bitwiseTo(n, op_and, t), t
- }
- function op_or(n, t) {
- return n | t
- }
- function bnOr(n) {
- var t = nbi();
- return this.bitwiseTo(n, op_or, t), t
- }
- function op_xor(n, t) {
- return n ^ t
- }
- function bnXor(n) {
- var t = nbi();
- return this.bitwiseTo(n, op_xor, t), t
- }
- function op_andnot(n, t) {
- return n & ~t
- }
- function bnAndNot(n) {
- var t = nbi();
- return this.bitwiseTo(n, op_andnot, t), t
- }
- function bnNot() {
- for (var n = nbi(), t = 0; t < this.t; ++t) n[t] = this.DM & ~this[t];
- return n.t = this.t, n.s = ~this.s, n
- }
- function bnShiftLeft(n) {
- var t = nbi();
- return n < 0 ? this.rShiftTo(-n, t) : this.lShiftTo(n, t), t
- }
- function bnShiftRight(n) {
- var t = nbi();
- return n < 0 ? this.lShiftTo(-n, t) : this.rShiftTo(n, t), t
- }
- function lbit(n) {
- if (n == 0) return -1;
- var t = 0;
- return (n & 65535) == 0 && (n >>= 16, t += 16), (n & 255) == 0 && (n >>= 8, t += 8), (n & 15) == 0 && (n >>= 4, t += 4), (n & 3) == 0 && (n >>= 2, t += 2), (n & 1) == 0 && ++t, t
- }
- function bnGetLowestSetBit() {
- for (var n = 0; n < this.t; ++n)
- if (this[n] != 0) return n * this.DB + lbit(this[n]);
- return this.s < 0 ? this.t * this.DB : -1
- }
- function cbit(n) {
- for (var t = 0; n != 0;) n &= n - 1, ++t;
- return t
- }
- function bnBitCount() {
- for (var t = 0, i = this.s & this.DM, n = 0; n < this.t; ++n) t += cbit(this[n] ^ i);
- return t
- }
- function bnTestBit(n) {
- var t = Math.floor(n / this.DB);
- return t >= this.t ? this.s != 0 : (this[t] & 1 << n % this.DB) != 0
- }
- function bnpChangeBit(n, t) {
- var i = BigInteger.ONE.shiftLeft(n);
- return this.bitwiseTo(i, t, i), i
- }
- function bnSetBit(n) {
- return this.changeBit(n, op_or)
- }
- function bnClearBit(n) {
- return this.changeBit(n, op_andnot)
- }
- function bnFlipBit(n) {
- return this.changeBit(n, op_xor)
- }
- function bnpAddTo(n, t) {
- for (var r = 0, i = 0, u = Math.min(n.t, this.t); r < u;) i += this[r] + n[r], t[r++] = i & this.DM, i >>= this.DB;
- if (n.t < this.t) {
- for (i += n.s; r < this.t;) i += this[r], t[r++] = i & this.DM, i >>= this.DB;
- i += this.s
- } else {
- for (i += this.s; r < n.t;) i += n[r], t[r++] = i & this.DM, i >>= this.DB;
- i += n.s
- }
- t.s = i < 0 ? -1 : 0;
- i > 0 ? t[r++] = i : i < -1 && (t[r++] = this.DV + i);
- t.t = r;
- t.clamp()
- }
- function bnAdd(n) {
- var t = nbi();
- return this.addTo(n, t), t
- }
- function bnSubtract(n) {
- var t = nbi();
- return this.subTo(n, t), t
- }
- function bnMultiply(n) {
- var t = nbi();
- return this.multiplyTo(n, t), t
- }
- function bnSquare() {
- var n = nbi();
- return this.squareTo(n), n
- }
- function bnDivide(n) {
- var t = nbi();
- return this.divRemTo(n, t, null), t
- }
- function bnRemainder(n) {
- var t = nbi();
- return this.divRemTo(n, null, t), t
- }
- function bnDivideAndRemainder(n) {
- var t = nbi(),
- i = nbi();
- return this.divRemTo(n, t, i), [t, i]
- }
- function bnpDMultiply(n) {
- this[this.t] = this.am(0, n - 1, this, 0, 0, this.t);
- ++this.t;
- this.clamp()
- }
- function bnpDAddOffset(n, t) {
- if (n != 0) {
- while (this.t <= t) this[this.t++] = 0;
- for (this[t] += n; this[t] >= this.DV;) this[t] -= this.DV, ++t >= this.t && (this[this.t++] = 0), ++this[t]
- }
- }
- function NullExp() {}
- function nNop(n) {
- return n
- }
- function nMulTo(n, t, i) {
- n.multiplyTo(t, i)
- }
- function nSqrTo(n, t) {
- n.squareTo(t)
- }
- function bnPow(n) {
- return this.exp(n, new NullExp)
- }
- function bnpMultiplyLowerTo(n, t, i) {
- var r = Math.min(this.t + n.t, t),
- u;
- for (i.s = 0, i.t = r; r > 0;) i[--r] = 0;
- for (u = i.t - this.t; r < u; ++r) i[r + this.t] = this.am(0, n[r], i, r, 0, this.t);
- for (u = Math.min(n.t, t); r < u; ++r) this.am(0, n[r], i, r, 0, t - r);
- i.clamp()
- }
- function bnpMultiplyUpperTo(n, t, i) {
- --t;
- var r = i.t = this.t + n.t - t;
- for (i.s = 0; --r >= 0;) i[r] = 0;
- for (r = Math.max(t - this.t, 0); r < n.t; ++r) i[this.t + r - t] = this.am(t - r, n[r], i, 0, 0, this.t + r - t);
- i.clamp();
- i.drShiftTo(1, i)
- }
- function Barrett(n) {
- this.r2 = nbi();
- this.q3 = nbi();
- BigInteger.ONE.dlShiftTo(2 * n.t, this.r2);
- this.mu = this.r2.divide(n);
- this.m = n
- }
- function barrettConvert(n) {
- if (n.s < 0 || n.t > 2 * this.m.t) return n.mod(this.m);
- if (n.compareTo(this.m) < 0) return n;
- var t = nbi();
- return n.copyTo(t), this.reduce(t), t
- }
- function barrettRevert(n) {
- return n
- }
- function barrettReduce(n) {
- for (n.drShiftTo(this.m.t - 1, this.r2), n.t > this.m.t + 1 && (n.t = this.m.t + 1, n.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); n.compareTo(this.r2) < 0;) n.dAddOffset(1, this.m.t + 1);
- for (n.subTo(this.r2, n); n.compareTo(this.m) >= 0;) n.subTo(this.m, n)
- }
- function barrettSqrTo(n, t) {
- n.squareTo(t);
- this.reduce(t)
- }
- function barrettMulTo(n, t, i) {
- n.multiplyTo(t, i);
- this.reduce(i)
- }
- function bnModPow(n, t) {
- var i = n.bitLength(),
- c, r = nbv(1),
- f, v;
- if (i <= 0) return r;
- c = i < 18 ? 1 : i < 48 ? 3 : i < 144 ? 4 : i < 768 ? 5 : 6;
- f = i < 8 ? new Classic(t) : t.isEven() ? new Barrett(t) : new Montgomery(t);
- var s = [],
- u = 3,
- l = c - 1,
- y = (1 << c) - 1;
- if (s[1] = f.convert(this), c > 1)
- for (v = nbi(), f.sqrTo(s[1], v); u <= y;) s[u] = nbi(), f.mulTo(v, s[u - 2], s[u]), u += 2;
- var e = n.t - 1,
- h, p = !0,
- o = nbi(),
- a;
- for (i = nbits(n[e]) - 1; e >= 0;) {
- for (i >= l ? h = n[e] >> i - l & y : (h = (n[e] & (1 << i + 1) - 1) << l - i, e > 0 && (h |= n[e - 1] >> this.DB + i - l)), u = c;
- (h & 1) == 0;) h >>= 1, --u;
- if ((i -= u) < 0 && (i += this.DB, --e), p) s[h].copyTo(r), p = !1;
- else {
- while (u > 1) f.sqrTo(r, o), f.sqrTo(o, r), u -= 2;
- u > 0 ? f.sqrTo(r, o) : (a = r, r = o, o = a);
- f.mulTo(o, s[h], r)
- }
- while (e >= 0 && (n[e] & 1 << i) == 0) f.sqrTo(r, o), a = r, r = o, o = a, --i < 0 && (i = this.DB - 1, --e)
- }
- return f.revert(r)
- }
- function bnGCD(n) {
- var i = this.s < 0 ? this.negate() : this.clone(),
- t = n.s < 0 ? n.negate() : n.clone(),
- f, u, r;
- if (i.compareTo(t) < 0 && (f = i, i = t, t = f), u = i.getLowestSetBit(), r = t.getLowestSetBit(), r < 0) return i;
- for (u < r && (r = u), r > 0 && (i.rShiftTo(r, i), t.rShiftTo(r, t)); i.signum() > 0;)(u = i.getLowestSetBit()) > 0 && i.rShiftTo(u, i), (u = t.getLowestSetBit()) > 0 && t.rShiftTo(u, t), i.compareTo(t) >= 0 ? (i.subTo(t, i), i.rShiftTo(1, i)) : (t.subTo(i, t), t.rShiftTo(1, t));
- return r > 0 && t.lShiftTo(r, t), t
- }
- function bnpModInt(n) {
- var r, t, i;
- if (n <= 0) return 0;
- if (r = this.DV % n, t = this.s < 0 ? n - 1 : 0, this.t > 0)
- if (r == 0) t = this[0] % n;
- else
- for (i = this.t - 1; i >= 0; --i) t = (r * t + this[i]) % n;
- return t
- }
- function bnModInverse(n) {
- var o = n.isEven();
- if (this.isEven() && o || n.signum() == 0) return BigInteger.ZERO;
- for (var r = n.clone(), u = this.clone(), f = nbv(1), i = nbv(0), e = nbv(0), t = nbv(1); r.signum() != 0;) {
- while (r.isEven()) r.rShiftTo(1, r), o ? (f.isEven() && i.isEven() || (f.addTo(this, f), i.subTo(n, i)), f.rShiftTo(1, f)) : i.isEven() || i.subTo(n, i), i.rShiftTo(1, i);
- while (u.isEven()) u.rShiftTo(1, u), o ? (e.isEven() && t.isEven() || (e.addTo(this, e), t.subTo(n, t)), e.rShiftTo(1, e)) : t.isEven() || t.subTo(n, t), t.rShiftTo(1, t);
- r.compareTo(u) >= 0 ? (r.subTo(u, r), o && f.subTo(e, f), i.subTo(t, i)) : (u.subTo(r, u), o && e.subTo(f, e), t.subTo(i, t))
- }
- if (u.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
- if (t.compareTo(n) >= 0) return t.subtract(n);
- if (t.signum() < 0) t.addTo(n, t);
- else return t;
- return t.signum() < 0 ? t.add(n) : t
- }
- function bnIsProbablePrime(n) {
- var t, i = this.abs(),
- r, u;
- if (i.t == 1 && i[0] <= lowprimes[lowprimes.length - 1]) {
- for (t = 0; t < lowprimes.length; ++t)
- if (i[0] == lowprimes[t]) return !0;
- return !1
- }
- if (i.isEven()) return !1;
- for (t = 1; t < lowprimes.length;) {
- for (r = lowprimes[t], u = t + 1; u < lowprimes.length && r < lplim;) r *= lowprimes[u++];
- for (r = i.modInt(r); t < u;)
- if (r % lowprimes[t++] == 0) return !1
- }
- return i.millerRabin(n)
- }
- function bnpMillerRabin(n) {
- var i = this.subtract(BigInteger.ONE),
- r = i.getLowestSetBit(),
- e, u, f, t, o;
- if (r <= 0) return !1;
- for (e = i.shiftRight(r), n = n + 1 >> 1, n > lowprimes.length && (n = lowprimes.length), u = nbi(), f = 0; f < n; ++f)
- if (u.fromInt(lowprimes[Math.floor(Math.random() * lowprimes.length)]), t = u.modPow(e, this), t.compareTo(BigInteger.ONE) != 0 && t.compareTo(i) != 0) {
- for (o = 1; o++ < r && t.compareTo(i) != 0;)
- if (t = t.modPowInt(2, this), t.compareTo(BigInteger.ONE) == 0) return !1;
- if (t.compareTo(i) != 0) return !1
- }
- return !0
- }
- function ECFieldElementFp(n, t) {
- this.x = t;
- this.q = n
- }
- function feFpEquals(n) {
- return n == this ? !0 : this.q.equals(n.q) && this.x.equals(n.x)
- }
- function feFpToBigInteger() {
- return this.x
- }
- function feFpNegate() {
- return new ECFieldElementFp(this.q, this.x.negate().mod(this.q))
- }
- function feFpAdd(n) {
- return new ECFieldElementFp(this.q, this.x.add(n.toBigInteger()).mod(this.q))
- }
- function feFpSubtract(n) {
- return new ECFieldElementFp(this.q, this.x.subtract(n.toBigInteger()).mod(this.q))
- }
- function feFpMultiply(n) {
- return new ECFieldElementFp(this.q, this.x.multiply(n.toBigInteger()).mod(this.q))
- }
- function feFpSquare() {
- return new ECFieldElementFp(this.q, this.x.square().mod(this.q))
- }
- function feFpDivide(n) {
- return new ECFieldElementFp(this.q, this.x.multiply(n.toBigInteger().modInverse(this.q)).mod(this.q))
- }
- function ECPointFp(n, t, i, r) {
- this.curve = n;
- this.x = t;
- this.y = i;
- this.z = r == null ? BigInteger.ONE : r;
- this.zinv = null
- }
- function pointFpGetX() {
- return this.zinv == null && (this.zinv = this.z.modInverse(this.curve.q)), this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))
- }
- function pointFpGetY() {
- return this.zinv == null && (this.zinv = this.z.modInverse(this.curve.q)), this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))
- }
- function pointFpEquals(n) {
- if (n == this) return !0;
- if (this.isInfinity()) return n.isInfinity();
- if (n.isInfinity()) return this.isInfinity();
- var t, i;
- return (t = n.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(n.z)).mod(this.curve.q), !t.equals(BigInteger.ZERO)) ? !1 : (i = n.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(n.z)).mod(this.curve.q), i.equals(BigInteger.ZERO))
- }
- function pointFpIsInfinity() {
- return this.x == null && this.y == null ? !0 : this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO)
- }
- function pointFpNegate() {
- return new ECPointFp(this.curve, this.x, this.y.negate(), this.z)
- }
- function pointFpAdd(n) {
- var t, i;
- if (this.isInfinity()) return n;
- if (n.isInfinity()) return this;
- if (t = n.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(n.z)).mod(this.curve.q), i = n.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(n.z)).mod(this.curve.q), BigInteger.ZERO.equals(i)) return BigInteger.ZERO.equals(t) ? this.twice() : this.curve.getInfinity();
- var o = new BigInteger("3"),
- s = this.x.toBigInteger(),
- h = this.y.toBigInteger(),
- v = n.x.toBigInteger(),
- y = n.y.toBigInteger(),
- u = i.square(),
- r = u.multiply(i),
- f = s.multiply(u),
- e = t.square().multiply(this.z),
- c = e.subtract(f.shiftLeft(1)).multiply(n.z).subtract(r).multiply(i).mod(this.curve.q),
- l = f.multiply(o).multiply(t).subtract(h.multiply(r)).subtract(e.multiply(t)).multiply(n.z).add(t.multiply(r)).mod(this.curve.q),
- a = r.multiply(this.z).multiply(n.z).mod(this.curve.q);
- return new ECPointFp(this.curve, this.curve.fromBigInteger(c), this.curve.fromBigInteger(l), a)
- }
- function pointFpTwice() {
- if (this.isInfinity()) return this;
- if (this.y.toBigInteger().signum() == 0) return this.curve.getInfinity();
- var u = new BigInteger("3"),
- i = this.x.toBigInteger(),
- f = this.y.toBigInteger(),
- t = f.multiply(this.z),
- r = t.multiply(f).mod(this.curve.q),
- e = this.curve.a.toBigInteger(),
- n = i.square().multiply(u);
- BigInteger.ZERO.equals(e) || (n = n.add(this.z.square().multiply(e)));
- n = n.mod(this.curve.q);
- var o = n.square().subtract(i.shiftLeft(3).multiply(r)).shiftLeft(1).multiply(t).mod(this.curve.q),
- s = n.multiply(u).multiply(i).subtract(r.shiftLeft(1)).shiftLeft(2).multiply(r).subtract(n.square().multiply(n)).mod(this.curve.q),
- h = t.square().multiply(t).shiftLeft(3).mod(this.curve.q);
- return new ECPointFp(this.curve, this.curve.fromBigInteger(o), this.curve.fromBigInteger(s), h)
- }
- function pointFpMultiply(n) {
- var r, e;
- if (this.isInfinity()) return this;
- if (n.signum() == 0) return this.curve.getInfinity();
- for (var u = n, f = u.multiply(new BigInteger("3")), o = this.negate(), t = this, i = f.bitLength() - 2; i > 0; --i) t = t.twice(), r = f.testBit(i), e = u.testBit(i), r != e && (t = t.add(r ? this : o));
- return t
- }
- function pointFpMultiplyTwo(n, t, i) {
- var u, r, f;
- for (u = n.bitLength() > i.bitLength() ? n.bitLength() - 1 : i.bitLength() - 1, r = this.curve.getInfinity(), f = this.add(t); u >= 0;) r = r.twice(), n.testBit(u) ? r = i.testBit(u) ? r.add(f) : r.add(this) : i.testBit(u) && (r = r.add(t)), --u;
- return r
- }
- function ECCurveFp(n, t, i) {
- this.q = n;
- this.a = this.fromBigInteger(t);
- this.b = this.fromBigInteger(i);
- this.infinity = new ECPointFp(this, null, null)
- }
- function curveFpGetQ() {
- return this.q
- }
- function curveFpGetA() {
- return this.a
- }
- function curveFpGetB() {
- return this.b
- }
- function curveFpEquals(n) {
- return n == this ? !0 : this.q.equals(n.q) && this.a.equals(n.a) && this.b.equals(n.b)
- }
- function curveFpGetInfinity() {
- return this.infinity
- }
- function curveFpFromBigInteger(n) {
- return new ECFieldElementFp(this.q, n)
- }
- function curveFpDecodePointHex(n) {
- switch (parseInt(n.substr(0, 2), 16)) {
- case 0:
- return this.infinity;
- case 2:
- case 3:
- return null;
- case 4:
- case 6:
- case 7:
- var t = (n.length - 2) / 2,
- i = n.substr(2, t),
- r = n.substr(t + 2, t);
- return new ECPointFp(this, this.fromBigInteger(new BigInteger(i, 16)), this.fromBigInteger(new BigInteger(r, 16)));
- default:
- return null
- }
- }
- function X9ECParameters(n, t, i, r) {
- this.curve = n;
- this.g = t;
- this.n = i;
- this.h = r
- }
- function x9getCurve() {
- return this.curve
- }
- function x9getG() {
- return this.g
- }
- function x9getN() {
- return this.n
- }
- function x9getH() {
- return this.h
- }
- function fromHex(n) {
- return new BigInteger(n, 16)
- }
- function secp128r1() {
- var t = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),
- i = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),
- r = fromHex("E87579C11079F43DD824993C2CEE5ED3"),
- u = fromHex("FFFFFFFE0000000075A30D1B9038A115"),
- f = BigInteger.ONE,
- n = new ECCurveFp(t, i, r),
- e = n.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83");
- return new X9ECParameters(n, e, u, f)
- }
- function secp160k1() {
- var t = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),
- i = BigInteger.ZERO,
- r = fromHex("7"),
- u = fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3"),
- f = BigInteger.ONE,
- n = new ECCurveFp(t, i, r),
- e = n.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE");
- return new X9ECParameters(n, e, u, f)
- }
- function secp160r1() {
- var t = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),
- i = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),
- r = fromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),
- u = fromHex("0100000000000000000001F4C8F927AED3CA752257"),
- f = BigInteger.ONE,
- n = new ECCurveFp(t, i, r),
- e = n.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32");
- return new X9ECParameters(n, e, u, f)
- }
- function secp192k1() {
- var t = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),
- i = BigInteger.ZERO,
- r = fromHex("3"),
- u = fromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),
- f = BigInteger.ONE,
- n = new ECCurveFp(t, i, r),
- e = n.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D");
- return new X9ECParameters(n, e, u, f)
- }
- function secp192r1() {
- var t = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),
- i = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),
- r = fromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),
- u = fromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),
- f = BigInteger.ONE,
- n = new ECCurveFp(t, i, r),
- e = n.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811");
- return new X9ECParameters(n, e, u, f)
- }
- function secp224r1() {
- var t = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),
- i = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),
- r = fromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),
- u = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),
- f = BigInteger.ONE,
- n = new ECCurveFp(t, i, r),
- e = n.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34");
- return new X9ECParameters(n, e, u, f)
- }
- function secp256k1() {
- var t = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"),
- i = BigInteger.ZERO,
- r = fromHex("7"),
- u = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"),
- f = BigInteger.ONE,
- n = new ECCurveFp(t, i, r),
- e = n.decodePointHex("0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8");
- return new X9ECParameters(n, e, u, f)
- }
- function secp256r1() {
- var t = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),
- i = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),
- r = fromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),
- u = fromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),
- f = BigInteger.ONE,
- n = new ECCurveFp(t, i, r),
- e = n.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5");
- return new X9ECParameters(n, e, u, f)
- }
- function getSECCurveByName(n) {
- return n == "secp128r1" ? secp128r1() : n == "secp160k1" ? secp160k1() : n == "secp160r1" ? secp160r1() : n == "secp192k1" ? secp192k1() : n == "secp192r1" ? secp192r1() : n == "secp224r1" ? secp224r1() : n == "secp256k1" ? secp256k1() : n == "secp256r1" ? secp256r1() : null
- }
- function integerToBytes(n, t) {
- var i = n.toByteArrayUnsigned();
- if (t < i.length) i = i.slice(i.length - t);
- else
- while (t > i.length) i.unshift(0);
- return i
- }
- function dmp(n) {
- return n instanceof BigInteger || (n = n.toBigInteger()), Crypto.util.bytesToHex(n.toByteArrayUnsigned())
- }
- function setupAssetPopup(n) {
- $(".color-popover", n).popover({
- content: function() {
- return $($(this).attr("contents")).html()
- }
- }).on("click", function(n) {
- return $(this).focus(), n.preventDefault(), !0
- })
- }
- function refreshQuote() {
- function n(n) {
- $(".bid-price").text(n.usdbtc_bid);
- $(".ask-price").text(n.usdbtc_ask)
- }
- $.ajax({
- type: "POST",
- url: "/quote",
- data: {},
- success: n,
- dataType: "json"
- })
- }
- var rng_psize, rng_state, rng_pool, rng_pptr, secure_browser, t, windowCrypto, z, onMouseMoveListener, dbits, canary, j_lm, BI_FP, BI_RM, BI_RC, rr, vv, lowprimes, lplim, EventEmitter, names, i, TransactionDatabase, saveAs, startup, _gaq;
- if (function(n, t) {
- typeof module == "object" && typeof module.exports == "object" ? module.exports = n.document ? t(n, !0) : function(n) {
- if (!n.document) throw new Error("jQuery requires a window with a document");
- return t(n)
- } : t(n)
- }(typeof window != "undefined" ? window : this, function(n, t) {
- function ri(n) {
- var t = n.length,
- r = i.type(n);
- return r === "function" || i.isWindow(n) ? !1 : n.nodeType === 1 && t ? !0 : r === "array" || t === 0 || typeof t == "number" && t > 0 && t - 1 in n
- }
- function ui(n, t, r) {
- if (i.isFunction(t)) return i.grep(n, function(n, i) {
- return !!t.call(n, i, n) !== r
- });
- if (t.nodeType) return i.grep(n, function(n) {
- return n === t !== r
- });
- if (typeof t == "string") {
- if (ue.test(t)) return i.filter(t, n, r);
- t = i.filter(t, n)
- }
- return i.grep(n, function(n) {
- return i.inArray(n, t) >= 0 !== r
- })
- }
- function hr(n, t) {
- do n = n[t]; while (n && n.nodeType !== 1);
- return n
- }
- function oe(n) {
- var t = fi[n] = {};
- return i.each(n.match(h) || [], function(n, i) {
- t[i] = !0
- }), t
- }
- function cr() {
- u.addEventListener ? (u.removeEventListener("DOMContentLoaded", a, !1), n.removeEventListener("load", a, !1)) : (u.detachEvent("onreadystatechange", a), n.detachEvent("onload", a))
- }
- function a() {
- (u.addEventListener || event.type === "load" || u.readyState === "complete") && (cr(), i.ready())
- }
- function yr(n, t, r) {
- if (r === undefined && n.nodeType === 1) {
- var u = "data-" + t.replace(vr, "-$1").toLowerCase();
- if (r = n.getAttribute(u), typeof r == "string") {
- try {
- r = r === "true" ? !0 : r === "false" ? !1 : r === "null" ? null : +r + "" === r ? +r : ar.test(r) ? i.parseJSON(r) : r
- } catch (f) {}
- i.data(n, t, r)
- } else r = undefined
- }
- return r
- }
- function ei(n) {
- for (var t in n)
- if ((t !== "data" || !i.isEmptyObject(n[t])) && t !== "toJSON") return !1;
- return !0
- }
- function pr(n, t, r, u) {
- if (i.acceptData(n)) {
- var s, e, h = i.expando,
- l = n.nodeType,
- o = l ? i.cache : n,
- f = l ? n[h] : n[h] && h;
- if (f && o[f] && (u || o[f].data) || r !== undefined || typeof t != "string") return f || (f = l ? n[h] = c.pop() || i.guid++ : h), o[f] || (o[f] = l ? {} : {
- toJSON: i.noop
- }), (typeof t == "object" || typeof t == "function") && (u ? o[f] = i.extend(o[f], t) : o[f].data = i.extend(o[f].data, t)), e = o[f], u || (e.data || (e.data = {}), e = e.data), r !== undefined && (e[i.camelCase(t)] = r), typeof t == "string" ? (s = e[t], s == null && (s = e[i.camelCase(t)])) : s = e, s
- }
- }
- function wr(n, t, u) {
- if (i.acceptData(n)) {
- var e, s, h = n.nodeType,
- f = h ? i.cache : n,
- o = h ? n[i.expando] : i.expando;
- if (f[o]) {
- if (t && (e = u ? f[o] : f[o].data, e)) {
- for (i.isArray(t) ? t = t.concat(i.map(t, i.camelCase)) : (t in e) ? t = [t] : (t = i.camelCase(t), t = t in e ? [t] : t.split(" ")), s = t.length; s--;) delete e[t[s]];
- if (u ? !ei(e) : !i.isEmptyObject(e)) return
- }(u || (delete f[o].data, ei(f[o]))) && (h ? i.cleanData([n], !0) : r.deleteExpando || f != f.window ? delete f[o] : f[o] = null)
- }
- }
- }
- function vt() {
- return !0
- }
- function it() {
- return !1
- }
- function dr() {
- try {
- return u.activeElement
- } catch (n) {}
- }
- function gr(n) {
- var i = nu.split("|"),
- t = n.createDocumentFragment();
- if (t.createElement)
- while (i.length) t.createElement(i.pop());
- return t
- }
- function f(n, t) {
- var e, u, s = 0,
- r = typeof n.getElementsByTagName !== o ? n.getElementsByTagName(t || "*") : typeof n.querySelectorAll !== o ? n.querySelectorAll(t || "*") : undefined;
- if (!r)
- for (r = [], e = n.childNodes || n;
- (u = e[s]) != null; s++) !t || i.nodeName(u, t) ? r.push(u) : i.merge(r, f(u, t));
- return t === undefined || t && i.nodeName(n, t) ? i.merge([n], r) : r
- }
- function be(n) {
- oi.test(n.type) && (n.defaultChecked = n.checked)
- }
- function eu(n, t) {
- return i.nodeName(n, "table") && i.nodeName(t.nodeType !== 11 ? t : t.firstChild, "tr") ? n.getElementsByTagName("tbody")[0] || n.appendChild(n.ownerDocument.createElement("tbody")) : n
- }
- function ou(n) {
- return n.type = (i.find.attr(n, "type") !== null) + "/" + n.type, n
- }
- function su(n) {
- var t = ye.exec(n.type);
- return t ? n.type = t[1] : n.removeAttribute("type"), n
- }
- function li(n, t) {
- for (var u, r = 0;
- (u = n[r]) != null; r++) i._data(u, "globalEval", !t || i._data(t[r], "globalEval"))
- }
- function hu(n, t) {
- if (t.nodeType === 1 && i.hasData(n)) {
- var u, f, o, s = i._data(n),
- r = i._data(t, s),
- e = s.events;
- if (e) {
- delete r.handle;
- r.events = {};
- for (u in e)
- for (f = 0, o = e[u].length; f < o; f++) i.event.add(t, u, e[u][f])
- }
- r.data && (r.data = i.extend({}, r.data))
- }
- }
- function ke(n, t) {
- var u, e, f;
- if (t.nodeType === 1) {
- if (u = t.nodeName.toLowerCase(), !r.noCloneEvent && t[i.expando]) {
- f = i._data(t);
- for (e in f.events) i.removeEvent(t, e, f.handle);
- t.removeAttribute(i.expando)
- }
- u === "script" && t.text !== n.text ? (ou(t).text = n.text, su(t)) : u === "object" ? (t.parentNode && (t.outerHTML = n.outerHTML), r.html5Clone && n.innerHTML && !i.trim(t.innerHTML) && (t.innerHTML = n.innerHTML)) : u === "input" && oi.test(n.type) ? (t.defaultChecked = t.checked = n.checked, t.value !== n.value && (t.value = n.value)) : u === "option" ? t.defaultSelected = t.selected = n.defaultSelected : (u === "input" || u === "textarea") && (t.defaultValue = n.defaultValue)
- }
- }
- function cu(t, r) {
- var u = i(r.createElement(t)).appendTo(r.body),
- f = n.getDefaultComputedStyle ? n.getDefaultComputedStyle(u[0]).display : i.css(u[0], "display");
- return u.detach(), f
- }
- function lu(n) {
- var r = u,
- t = ai[n];
- return t || (t = cu(n, r), t !== "none" && t || (ot = (ot || i("<iframe frameborder='0' width='0' height='0'/>")).appendTo(r.documentElement), r = (ot[0].contentWindow || ot[0].contentDocument).document, r.write(), r.close(), t = cu(n, r), ot.detach()), ai[n] = t), t
- }
- function vu(n, t) {
- return {
- get: function() {
- var i = n();
- if (i != null) {
- if (i) {
- delete this.get;
- return
- }
- return (this.get = t).apply(this, arguments)
- }
- }
- }
- }
- function wu(n, t) {
- if (t in n) return t;
- for (var r = t.charAt(0).toUpperCase() + t.slice(1), u = t, i = pu.length; i--;)
- if (t = pu[i] + r, t in n) return t;
- return u
- }
- function bu(n, t) {
- for (var f, r, o, e = [], u = 0, s = n.length; u < s; u++)(r = n[u], r.style) && (e[u] = i._data(r, "olddisplay"), f = r.style.display, t ? (e[u] || f !== "none" || (r.style.display = ""), r.style.display === "" && et(r) && (e[u] = i._data(r, "olddisplay", lu(r.nodeName)))) : e[u] || (o = et(r), (f && f !== "none" || !o) && i._data(r, "olddisplay", o ? f : i.css(r, "display"))));
- for (u = 0; u < s; u++)(r = n[u], r.style) && (t && r.style.display !== "none" && r.style.display !== "" || (r.style.display = t ? e[u] || "" : "none"));
- return n
- }
- function ku(n, t, i) {
- var r = to.exec(t);
- return r ? Math.max(0, r[1] - (i || 0)) + (r[2] || "px") : t
- }
- function du(n, t, r, u, f) {
- for (var e = r === (u ? "border" : "content") ? 4 : t === "width" ? 1 : 0, o = 0; e < 4; e += 2) r === "margin" && (o += i.css(n, r + w[e], !0, f)), u ? (r === "content" && (o -= i.css(n, "padding" + w[e], !0, f)), r !== "margin" && (o -= i.css(n, "border" + w[e] + "Width", !0, f))) : (o += i.css(n, "padding" + w[e], !0, f), r !== "padding" && (o += i.css(n, "border" + w[e] + "Width", !0, f)));
- return o
- }
- function gu(n, t, u) {
- var o = !0,
- f = t === "width" ? n.offsetWidth : n.offsetHeight,
- e = k(n),
- s = r.boxSizing() && i.css(n, "boxSizing", !1, e) === "border-box";
- if (f <= 0 || f == null) {
- if (f = d(n, t, e), (f < 0 || f == null) && (f = n.style[t]), yt.test(f)) return f;
- o = s && (r.boxSizingReliable() || f === n.style[t]);
- f = parseFloat(f) || 0
- }
- return f + du(n, t, u || (s ? "border" : "content"), o, e) + "px"
- }
- function e(n, t, i, r, u) {
- return new e.prototype.init(n, t, i, r, u)
- }
- function tf() {
- return setTimeout(function() {
- rt = undefined
- }), rt = i.now()
- }
- function bt(n, t) {
- var r, i = {
- height: n
- },
- u = 0;
- for (t = t ? 1 : 0; u < 4; u += 2 - t) r = w[u], i["margin" + r] = i["padding" + r] = n;
- return t && (i.opacity = i.width = n), i
- }
- function rf(n, t, i) {
- for (var u, f = (st[t] || []).concat(st["*"]), r = 0, e = f.length; r < e; r++)
- if (u = f[r].call(i, t, n)) return u
- }
- function eo(n, t, u) {
- var f, l, p, a, o, b, y, w, c = this,
- v = {},
- s = n.style,
- h = n.nodeType && et(n),
- e = i._data(n, "fxshow");
- u.queue || (o = i._queueHooks(n, "fx"), o.unqueued == null && (o.unqueued = 0, b = o.empty.fire, o.empty.fire = function() {
- o.unqueued || b()
- }), o.unqueued++, c.always(function() {
- c.always(function() {
- o.unqueued--;
- i.queue(n, "fx").length || o.empty.fire()
- })
- }));
- n.nodeType === 1 && ("height" in t || "width" in t) && (u.overflow = [s.overflow, s.overflowX, s.overflowY], y = i.css(n, "display"), w = lu(n.nodeName), y === "none" && (y = w), y === "inline" && i.css(n, "float") === "none" && (r.inlineBlockNeedsLayout && w !== "inline" ? s.zoom = 1 : s.display = "inline-block"));
- u.overflow && (s.overflow = "hidden", r.shrinkWrapBlocks() || c.always(function() {
- s.overflow = u.overflow[0];
- s.overflowX = u.overflow[1];
- s.overflowY = u.overflow[2]
- }));
- for (f in t)
- if (l = t[f], uo.exec(l)) {
- if (delete t[f], p = p || l === "toggle", l === (h ? "hide" : "show"))
- if (l === "show" && e && e[f] !== undefined) h = !0;
- else continue;
- v[f] = e && e[f] || i.style(n, f)
- }
- if (!i.isEmptyObject(v)) {
- e ? "hidden" in e && (h = e.hidden) : e = i._data(n, "fxshow", {});
- p && (e.hidden = !h);
- h ? i(n).show() : c.done(function() {
- i(n).hide()
- });
- c.done(function() {
- var t;
- i._removeData(n, "fxshow");
- for (t in v) i.style(n, t, v[t])
- });
- for (f in v) a = rf(h ? e[f] : 0, f, c), f in e || (e[f] = a.start, h && (a.end = a.start, a.start = f === "width" || f === "height" ? 1 : 0))
- }
- }
- function oo(n, t) {
- var r, f, e, u, o;
- for (r in n)
- if (f = i.camelCase(r), e = t[f], u = n[r], i.isArray(u) && (e = u[1], u = n[r] = u[0]), r !== f && (n[f] = u, delete n[r]), o = i.cssHooks[f], o && "expand" in o) {
- u = o.expand(u);
- delete n[f];
- for (r in u) r in n || (n[r] = u[r], t[r] = e)
- } else t[f] = e
- }
- function uf(n, t, r) {
- var e, o, s = 0,
- l = wt.length,
- f = i.Deferred().always(function() {
- delete c.elem
- }),
- c = function() {
- if (o) return !1;
- for (var s = rt || tf(), t = Math.max(0, u.startTime + u.duration - s), h = t / u.duration || 0, i = 1 - h, r = 0, e = u.tweens.length; r < e; r++) u.tweens[r].run(i);
- return f.notifyWith(n, [u, i, t]), i < 1 && e ? t : (f.resolveWith(n, [u]), !1)
- },
- u = f.promise({
- elem: n,
- props: i.extend({}, t),
- opts: i.extend(!0, {
- specialEasing: {}
- }, r),
- originalProperties: t,
- originalOptions: r,
- startTime: rt || tf(),
- duration: r.duration,
- tweens: [],
- createTween: function(t, r) {
- var f = i.Tween(n, u.opts, t, r, u.opts.specialEasing[t] || u.opts.easing);
- return u.tweens.push(f), f
- },
- stop: function(t) {
- var i = 0,
- r = t ? u.tweens.length : 0;
- if (o) return this;
- for (o = !0; i < r; i++) u.tweens[i].run(1);
- return t ? f.resolveWith(n, [u, t]) : f.rejectWith(n, [u, t]), this
- }
- }),
- h = u.props;
- for (oo(h, u.opts.specialEasing); s < l; s++)
- if (e = wt[s].call(u, n, h, u.opts), e) return e;
- return i.map(h, rf, u), i.isFunction(u.opts.start) && u.opts.start.call(n, u), i.fx.timer(i.extend(c, {
- elem: n,
- anim: u,
- queue: u.opts.queue
- })), u.progress(u.opts.progress).done(u.opts.done, u.opts.complete).fail(u.opts.fail).always(u.opts.always)
- }
- function vf(n) {
- return function(t, r) {
- typeof t != "string" && (r = t, t = "*");
- var u, f = 0,
- e = t.toLowerCase().match(h) || [];
- if (i.isFunction(r))
- while (u = e[f++]) u.charAt(0) === "+" ? (u = u.slice(1) || "*", (n[u] = n[u] || []).unshift(r)) : (n[u] = n[u] || []).push(r)
- }
- }
- function yf(n, t, r, u) {
- function e(s) {
- var h;
- return f[s] = !0, i.each(n[s] || [], function(n, i) {
- var s = i(t, r, u);
- if (typeof s != "string" || o || f[s]) {
- if (o) return !(h = s)
- } else return t.dataTypes.unshift(s), e(s), !1
- }), h
- }
- var f = {},
- o = n === bi;
- return e(t.dataTypes[0]) || !f["*"] && e("*")
- }
- function ki(n, t) {
- var u, r, f = i.ajaxSettings.flatOptions || {};
- for (r in t) t[r] !== undefined && ((f[r] ? n : u || (u = {}))[r] = t[r]);
- return u && i.extend(!0, n, u), n
- }
- function vo(n, t, i) {
- for (var o, e, u, f, s = n.contents, r = n.dataTypes; r[0] === "*";) r.shift(), e === undefined && (e = n.mimeType || t.getResponseHeader("Content-Type"));
- if (e)
- for (f in s)
- if (s[f] && s[f].test(e)) {
- r.unshift(f);
- break
- }
- if (r[0] in i) u = r[0];
- else {
- for (f in i) {
- if (!r[0] || n.converters[f + " " + r[0]]) {
- u = f;
- break
- }
- o || (o = f)
- }
- u = u || o
- }
- if (u) return u !== r[0] && r.unshift(u), i[u]
- }
- function yo(n, t, i, r) {
- var h, u, f, s, e, o = {},
- c = n.dataTypes.slice();
- if (c[1])
- for (f in n.converters) o[f.toLowerCase()] = n.converters[f];
- for (u = c.shift(); u;)
- if (n.responseFields[u] && (i[n.responseFields[u]] = t), !e && r && n.dataFilter && (t = n.dataFilter(t, n.dataType)), e = u, u = c.shift(), u)
- if (u === "*") u = e;
- else if (e !== "*" && e !== u) {
- if (f = o[e + " " + u] || o["* " + u], !f)
- for (h in o)
- if (s = h.split(" "), s[1] === u && (f = o[e + " " + s[0]] || o["* " + s[0]], f)) {
- f === !0 ? f = o[h] : o[h] !== !0 && (u = s[0], c.unshift(s[1]));
- break
- }
- if (f !== !0)
- if (f && n.throws) t = f(t);
- else try {
- t = f(t)
- } catch (l) {
- return {
- state: "parsererror",
- error: f ? l : "No conversion from " + e + " to " + u
- }
- }
- }
- return {
- state: "success",
- data: t
- }
- }
- function di(n, t, r, u) {
- var f;
- if (i.isArray(t)) i.each(t, function(t, i) {
- r || wo.test(n) ? u(n, i) : di(n + "[" + (typeof i == "object" ? t : "") + "]", i, r, u)
- });
- else if (r || i.type(t) !== "object") u(n, t);
- else
- for (f in t) di(n + "[" + f + "]", t[f], r, u)
- }
- function wf() {
- try {
- return new n.XMLHttpRequest
- } catch (t) {}
- }
- function ns() {
- try {
- return new n.ActiveXObject("Microsoft.XMLHTTP")
- } catch (t) {}
- }
- function bf(n) {
- return i.isWindow(n) ? n : n.nodeType === 9 ? n.defaultView || n.parentWindow : !1
- }
- var c = [],
- l = c.slice,
- ir = c.concat,
- ti = c.push,
- rr = c.indexOf,
- ct = {},
- gf = ct.toString,
- tt = ct.hasOwnProperty,
- ii = "".trim,
- r = {},
- ur = "1.11.0",
- i = function(n, t) {
- return new i.fn.init(n, t)
- },
- ne = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
- te = /^-ms-/,
- ie = /-([\da-z])/gi,
- re = function(n, t) {
- return t.toUpperCase()
- },
- p, or, sr, h, fi, lt, o, lr, ar, vr, ot, ai, ff, of, sf, dt, gi, ni, nr, tr, kf, df;
- i.fn = i.prototype = {
- jquery: ur,
- constructor: i,
- selector: "",
- length: 0,
- toArray: function() {
- return l.call(this)
- },
- get: function(n) {
- return n != null ? n < 0 ? this[n + this.length] : this[n] : l.call(this)
- },
- pushStack: function(n) {
- var t = i.merge(this.constructor(), n);
- return t.prevObject = this, t.context = this.context, t
- },
- each: function(n, t) {
- return i.each(this, n, t)
- },
- map: function(n) {
- return this.pushStack(i.map(this, function(t, i) {
- return n.call(t, i, t)
- }))
- },
- slice: function() {
- return this.pushStack(l.apply(this, arguments))
- },
- first: function() {
- return this.eq(0)
- },
- last: function() {
- return this.eq(-1)
- },
- eq: function(n) {
- var i = this.length,
- t = +n + (n < 0 ? i : 0);
- return this.pushStack(t >= 0 && t < i ? [this[t]] : [])
- },
- end: function() {
- return this.prevObject || this.constructor(null)
- },
- push: ti,
- sort: c.sort,
- splice: c.splice
- };
- i.extend = i.fn.extend = function() {
- var r, e, t, f, o, s, n = arguments[0] || {},
- u = 1,
- c = arguments.length,
- h = !1;
- for (typeof n == "boolean" && (h = n, n = arguments[u] || {}, u++), typeof n == "object" || i.isFunction(n) || (n = {}), u === c && (n = this, u--); u < c; u++)
- if ((o = arguments[u]) != null)
- for (f in o)(r = n[f], t = o[f], n !== t) && (h && t && (i.isPlainObject(t) || (e = i.isArray(t))) ? (e ? (e = !1, s = r && i.isArray(r) ? r : []) : s = r && i.isPlainObject(r) ? r : {}, n[f] = i.extend(h, s, t)) : t !== undefined && (n[f] = t));
- return n
- };
- i.extend({
- expando: "jQuery" + (ur + Math.random()).replace(/\D/g, ""),
- isReady: !0,
- error: function(n) {
- throw new Error(n);
- },
- noop: function() {},
- isFunction: function(n) {
- return i.type(n) === "function"
- },
- isArray: Array.isArray || function(n) {
- return i.type(n) === "array"
- },
- isWindow: function(n) {
- return n != null && n == n.window
- },
- isNumeric: function(n) {
- return n - parseFloat(n) >= 0
- },
- isEmptyObject: function(n) {
- for (var t in n) return !1;
- return !0
- },
- isPlainObject: function(n) {
- var t;
- if (!n || i.type(n) !== "object" || n.nodeType || i.isWindow(n)) return !1;
- try {
- if (n.constructor && !tt.call(n, "constructor") && !tt.call(n.constructor.prototype, "isPrototypeOf")) return !1
- } catch (u) {
- return !1
- }
- if (r.ownLast)
- for (t in n) return tt.call(n, t);
- for (t in n);
- return t === undefined || tt.call(n, t)
- },
- type: function(n) {
- return n == null ? n + "" : typeof n == "object" || typeof n == "function" ? ct[gf.call(n)] || "object" : typeof n
- },
- globalEval: function(t) {
- t && i.trim(t) && (n.execScript || function(t) {
- n.eval.call(n, t)
- })(t)
- },
- camelCase: function(n) {
- return n.replace(te, "ms-").replace(ie, re)
- },
- nodeName: function(n, t) {
- return n.nodeName && n.nodeName.toLowerCase() === t.toLowerCase()
- },
- each: function(n, t, i) {
- var u, r = 0,
- f = n.length,
- e = ri(n);
- if (i) {
- if (e) {
- for (; r < f; r++)
- if (u = t.apply(n[r], i), u === !1) break
- } else
- for (r in n)
- if (u = t.apply(n[r], i), u === !1) break
- } else if (e) {
- for (; r < f; r++)
- if (u = t.call(n[r], r, n[r]), u === !1) break
- } else
- for (r in n)
- if (u = t.call(n[r], r, n[r]), u === !1) break; return n
- },
- trim: ii && !ii.call(" ") ? function(n) {
- return n == null ? "" : ii.call(n)
- } : function(n) {
- return n == null ? "" : (n + "").replace(ne, "")
- },
- makeArray: function(n, t) {
- var r = t || [];
- return n != null && (ri(Object(n)) ? i.merge(r, typeof n == "string" ? [n] : n) : ti.call(r, n)), r
- },
- inArray: function(n, t, i) {
- var r;
- if (t) {
- if (rr) return rr.call(t, n, i);
- for (r = t.length, i = i ? i < 0 ? Math.max(0, r + i) : i : 0; i < r; i++)
- if (i in t && t[i] === n) return i
- }
- return -1
- },
- merge: function(n, t) {
- for (var r = +t.length, i = 0, u = n.length; i < r;) n[u++] = t[i++];
- if (r !== r)
- while (t[i] !== undefined) n[u++] = t[i++];
- return n.length = u, n
- },
- grep: function(n, t, i) {
- for (var u, f = [], r = 0, e = n.length, o = !i; r < e; r++) u = !t(n[r], r), u !== o && f.push(n[r]);
- return f
- },
- map: function(n, t, i) {
- var u, r = 0,
- e = n.length,
- o = ri(n),
- f = [];
- if (o)
- for (; r < e; r++) u = t(n[r], r, i), u != null && f.push(u);
- else
- for (r in n) u = t(n[r], r, i), u != null && f.push(u);
- return ir.apply([], f)
- },
- guid: 1,
- proxy: function(n, t) {
- var u, r, f;
- return (typeof t == "string" && (f = n[t], t = n, n = f), !i.isFunction(n)) ? undefined : (u = l.call(arguments, 2), r = function() {
- return n.apply(t || this, u.concat(l.call(arguments)))
- }, r.guid = n.guid = n.guid || i.guid++, r)
- },
- now: function() {
- return +new Date
- },
- support: r
- });
- i.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(n, t) {
- ct["[object " + t + "]"] = t.toLowerCase()
- });
- p = function(n) {
- function u(n, t, i, u) {
- var w, h, c, v, k, y, d, a, nt, g;
- if ((t ? t.ownerDocument || t : s) !== e && p(t), t = t || e, i = i || [], !n || typeof n != "string") return i;
- if ((v = t.nodeType) !== 1 && v !== 9) return [];
- if (l && !u) {
- if (w = or.exec(n))
- if (c = w[1]) {
- if (v === 9)
- if (h = t.getElementById(c), h && h.parentNode) {
- if (h.id === c) return i.push(h), i
- } else return i;
- else if (t.ownerDocument && (h = t.ownerDocument.getElementById(c)) && et(t, h) && h.id === c) return i.push(h), i
- } else {
- if (w[2]) return b.apply(i, t.getElementsByTagName(n)), i;
- if ((c = w[3]) && r.getElementsByClassName && t.getElementsByClassName) return b.apply(i, t.getElementsByClassName(c)), i
- }
- if (r.qsa && (!o || !o.test(n))) {
- if (a = d = f, nt = t, g = v === 9 && n, v === 1 && t.nodeName.toLowerCase() !== "object") {
- for (y = vt(n), (d = t.getAttribute("id")) ? a = d.replace(sr, "\\$&") : t.setAttribute("id", a), a = "[id='" + a + "'] ", k = y.length; k--;) y[k] = a + yt(y[k]);
- nt = gt.test(n) && ii(t.parentNode) || t;
- g = y.join(",")
- }
- if (g) try {
- return b.apply(i, nt.querySelectorAll(g)), i
- } catch (tt) {} finally {
- d || t.removeAttribute("id")
- }
- }
- }
- return vr(n.replace(lt, "$1"), t, i, u)
- }
- function ni() {
- function n(r, u) {
- return i.push(r + " ") > t.cacheLength && delete n[i.shift()], n[r + " "] = u
- }
- var i = [];
- return n
- }
- function h(n) {
- return n[f] = !0, n
- }
- function c(n) {
- var t = e.createElement("div");
- try {
- return !!n(t)
- } catch (i) {
- return !1
- } finally {
- t.parentNode && t.parentNode.removeChild(t);
- t = null
- }
- }
- function ti(n, i) {
- for (var u = n.split("|"), r = n.length; r--;) t.attrHandle[u[r]] = i
- }
- function pi(n, t) {
- var i = t && n,
- r = i && n.nodeType === 1 && t.nodeType === 1 && (~t.sourceIndex || li) - (~n.sourceIndex || li);
- if (r) return r;
- if (i)
- while (i = i.nextSibling)
- if (i === t) return -1;
- return n ? 1 : -1
- }
- function hr(n) {
- return function(t) {
- var i = t.nodeName.toLowerCase();
- return i === "input" && t.type === n
- }
- }
- function cr(n) {
- return function(t) {
- var i = t.nodeName.toLowerCase();
- return (i === "input" || i === "button") && t.type === n
- }
- }
- function tt(n) {
- return h(function(t) {
- return t = +t, h(function(i, r) {
- for (var u, f = n([], i.length, t), e = f.length; e--;) i[u = f[e]] && (i[u] = !(r[u] = i[u]))
- })
- })
- }
- function ii(n) {
- return n && typeof n.getElementsByTagName !== ut && n
- }
- function wi() {}
- function vt(n, i) {
- var e, f, s, o, r, h, c, l = hi[n + " "];
- if (l) return i ? 0 : l.slice(0);
- for (r = n, h = [], c = t.preFilter; r;) {
- (!e || (f = nr.exec(r))) && (f && (r = r.slice(f[0].length) || r), h.push(s = []));
- e = !1;
- (f = tr.exec(r)) && (e = f.shift(), s.push({
- value: e,
- type: f[0].replace(lt, " ")
- }), r = r.slice(e.length));
- for (o in t.filter)(f = at[o].exec(r)) && (!c[o] || (f = c[o](f))) && (e = f.shift(), s.push({
- value: e,
- type: o,
- matches: f
- }), r = r.slice(e.length));
- if (!e) break
- }
- return i ? r.length : r ? u.error(n) : hi(n, h).slice(0)
- }
- function yt(n) {
- for (var t = 0, r = n.length, i = ""; t < r; t++) i += n[t].value;
- return i
- }
- function ri(n, t, i) {
- var r = t.dir,
- u = i && r === "parentNode",
- e = bi++;
- return t.first ? function(t, i, f) {
- while (t = t[r])
- if (t.nodeType === 1 || u) return n(t, i, f)
- } : function(t, i, o) {
- var s, h, c = [a, e];
- if (o) {
- while (t = t[r])
- if ((t.nodeType === 1 || u) && n(t, i, o)) return !0
- } else
- while (t = t[r])
- if (t.nodeType === 1 || u) {
- if (h = t[f] || (t[f] = {}), (s = h[r]) && s[0] === a && s[1] === e) return c[2] = s[2];
- if (h[r] = c, c[2] = n(t, i, o)) return !0
- }
- }
- }
- function ui(n) {
- return n.length > 1 ? function(t, i, r) {
- for (var u = n.length; u--;)
- if (!n[u](t, i, r)) return !1;
- return !0
- } : n[0]
- }
- function pt(n, t, i, r, u) {
- for (var e, o = [], f = 0, s = n.length, h = t != null; f < s; f++)(e = n[f]) && (!i || i(e, r, u)) && (o.push(e), h && t.push(f));
- return o
- }
- function fi(n, t, i, r, u, e) {
- return r && !r[f] && (r = fi(r)), u && !u[f] && (u = fi(u, e)), h(function(f, e, o, s) {
- var l, c, a, p = [],
- y = [],
- w = e.length,
- k = f || ar(t || "*", o.nodeType ? [o] : o, []),
- v = n && (f || !t) ? pt(k, p, n, o, s) : k,
- h = i ? u || (f ? n : w || r) ? [] : e : v;
- if (i && i(v, h, o, s), r)
- for (l = pt(h, y), r(l, [], o, s), c = l.length; c--;)(a = l[c]) && (h[y[c]] = !(v[y[c]] = a));
- if (f) {
- if (u || n) {
- if (u) {
- for (l = [], c = h.length; c--;)(a = h[c]) && l.push(v[c] = a);
- u(null, h = [], l, s)
- }
- for (c = h.length; c--;)(a = h[c]) && (l = u ? nt.call(f, a) : p[c]) > -1 && (f[l] = !(e[l] = a))
- }
- } else h = pt(h === e ? h.splice(w, h.length) : h), u ? u(null, e, h, s) : b.apply(e, h)
- })
- }
- function ei(n) {
- for (var s, u, r, o = n.length, h = t.relative[n[0].type], c = h || t.relative[" "], i = h ? 1 : 0, l = ri(function(n) {
- return n === s
- }, c, !0), a = ri(function(n) {
- return nt.call(s, n) > -1
- }, c, !0), e = [function(n, t, i) {
- return !h && (i || t !== ht) || ((s = t).nodeType ? l(n, t, i) : a(n, t, i))
- }]; i < o; i++)
- if (u = t.relative[n[i].type]) e = [ri(ui(e), u)];
- else {
- if (u = t.filter[n[i].type].apply(null, n[i].matches), u[f]) {
- for (r = ++i; r < o; r++)
- if (t.relative[n[r].type]) break;
- return fi(i > 1 && ui(e), i > 1 && yt(n.slice(0, i - 1).concat({
- value: n[i - 2].type === " " ? "*" : ""
- })).replace(lt, "$1"), u, i < r && ei(n.slice(i, r)), r < o && ei(n = n.slice(r)), r < o && yt(n))
- }
- e.push(u)
- }
- return ui(e)
- }
- function lr(n, i) {
- var r = i.length > 0,
- f = n.length > 0,
- o = function(o, s, h, c, l) {
- var y, d, w, k = 0,
- v = "0",
- g = o && [],
- p = [],
- nt = ht,
- tt = o || f && t.find.TAG("*", l),
- it = a += nt == null ? 1 : Math.random() || .1,
- rt = tt.length;
- for (l && (ht = s !== e && s); v !== rt && (y = tt[v]) != null; v++) {
- if (f && y) {
- for (d = 0; w = n[d++];)
- if (w(y, s, h)) {
- c.push(y);
- break
- }
- l && (a = it)
- }
- r && ((y = !w && y) && k--, o && g.push(y))
- }
- if (k += v, r && v !== k) {
- for (d = 0; w = i[d++];) w(g, p, s, h);
- if (o) {
- if (k > 0)
- while (v--) g[v] || p[v] || (p[v] = di.call(c));
- p = pt(p)
- }
- b.apply(c, p);
- l && !o && p.length > 0 && k + i.length > 1 && u.uniqueSort(c)
- }
- return l && (a = it, ht = nt), g
- };
- return r ? h(o) : o
- }
- function ar(n, t, i) {
- for (var r = 0, f = t.length; r < f; r++) u(n, t[r], i);
- return i
- }
- function vr(n, i, u, f) {
- var s, e, o, c, a, h = vt(n);
- if (!f && h.length === 1) {
- if (e = h[0] = h[0].slice(0), e.length > 2 && (o = e[0]).type === "ID" && r.getById && i.nodeType === 9 && l && t.relative[e[1].type]) {
- if (i = (t.find.ID(o.matches[0].replace(k, d), i) || [])[0], !i) return u;
- n = n.slice(e.shift().value.length)
- }
- for (s = at.needsContext.test(n) ? 0 : e.length; s--;) {
- if (o = e[s], t.relative[c = o.type]) break;
- if ((a = t.find[c]) && (f = a(o.matches[0].replace(k, d), gt.test(e[0].type) && ii(i.parentNode) || i))) {
- if (e.splice(s, 1), n = f.length && yt(e), !n) return b.apply(u, f), u;
- break
- }
- }
- }
- return wt(n, h)(f, i, !l, u, gt.test(n) && ii(i.parentNode) || i), u
- }
- var it, r, t, st, oi, wt, ht, y, rt, p, e, v, l, o, g, ct, et, f = "sizzle" + -new Date,
- s = n.document,
- a = 0,
- bi = 0,
- si = ni(),
- hi = ni(),
- ci = ni(),
- bt = function(n, t) {
- return n === t && (rt = !0), 0
- },
- ut = typeof undefined,
- li = -2147483648,
- ki = {}.hasOwnProperty,
- w = [],
- di = w.pop,
- gi = w.push,
- b = w.push,
- ai = w.slice,
- nt = w.indexOf || function(n) {
- for (var t = 0, i = this.length; t < i; t++)
- if (this[t] === n) return t;
- return -1
- },
- kt = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
- i = "[\\x20\\t\\r\\n\\f]",
- ft = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
- vi = ft.replace("w", "w#"),
- yi = "\\[" + i + "*(" + ft + ")" + i + "*(?:([*^$|!~]?=)" + i + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + vi + ")|)|)" + i + "*\\]",
- dt = ":(" + ft + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + yi.replace(3, 8) + ")*)|.*)\\)|)",
- lt = new RegExp("^" + i + "+|((?:^|[^\\\\])(?:\\\\.)*)" + i + "+$", "g"),
- nr = new RegExp("^" + i + "*," + i + "*"),
- tr = new RegExp("^" + i + "*([>+~]|" + i + ")" + i + "*"),
- ir = new RegExp("=" + i + "*([^\\]'\"]*?)" + i + "*\\]", "g"),
- rr = new RegExp(dt),
- ur = new RegExp("^" + vi + "$"),
- at = {
- ID: new RegExp("^#(" + ft + ")"),
- CLASS: new RegExp("^\\.(" + ft + ")"),
- TAG: new RegExp("^(" + ft.replace("w", "w*") + ")"),
- ATTR: new RegExp("^" + yi),
- PSEUDO: new RegExp("^" + dt),
- CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + i + "*(even|odd|(([+-]|)(\\d*)n|)" + i + "*(?:([+-]|)" + i + "*(\\d+)|))" + i + "*\\)|)", "i"),
- bool: new RegExp("^(?:" + kt + ")$", "i"),
- needsContext: new RegExp("^" + i + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + i + "*((?:-\\d)?\\d*)" + i + "*\\)|)(?=[^-]|$)", "i")
- },
- fr = /^(?:input|select|textarea|button)$/i,
- er = /^h\d$/i,
- ot = /^[^{]+\{\s*\[native \w/,
- or = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
- gt = /[+~]/,
- sr = /'|\\/g,
- k = new RegExp("\\\\([\\da-f]{1,6}" + i + "?|(" + i + ")|.)", "ig"),
- d = function(n, t, i) {
- var r = "0x" + t - 65536;
- return r !== r || i ? t : r < 0 ? String.fromCharCode(r + 65536) : String.fromCharCode(r >> 10 | 55296, r & 1023 | 56320)
- };
- try {
- b.apply(w = ai.call(s.childNodes), s.childNodes);
- w[s.childNodes.length].nodeType
- } catch (yr) {
- b = {
- apply: w.length ? function(n, t) {
- gi.apply(n, ai.call(t))
- } : function(n, t) {
- for (var i = n.length, r = 0; n[i++] = t[r++];);
- n.length = i - 1
- }
- }
- }
- r = u.support = {};
- oi = u.isXML = function(n) {
- var t = n && (n.ownerDocument || n).documentElement;
- return t ? t.nodeName !== "HTML" : !1
- };
- p = u.setDocument = function(n) {
- var a, u = n ? n.ownerDocument || n : s,
- h = u.defaultView;
- return u === e || u.nodeType !== 9 || !u.documentElement ? e : (e = u, v = u.documentElement, l = !oi(u), h && h !== h.top && (h.addEventListener ? h.addEventListener("unload", function() {
- p()
- }, !1) : h.attachEvent && h.attachEvent("onunload", function() {
- p()
- })), r.attributes = c(function(n) {
- return n.className = "i", !n.getAttribute("className")
- }), r.getElementsByTagName = c(function(n) {
- return n.appendChild(u.createComment("")), !n.getElementsByTagName("*").length
- }), r.getElementsByClassName = ot.test(u.getElementsByClassName) && c(function(n) {
- return n.innerHTML = "<div class='a'><\/div><div class='a i'><\/div>", n.firstChild.className = "i", n.getElementsByClassName("i").length === 2
- }), r.getById = c(function(n) {
- return v.appendChild(n).id = f, !u.getElementsByName || !u.getElementsByName(f).length
- }), r.getById ? (t.find.ID = function(n, t) {
- if (typeof t.getElementById !== ut && l) {
- var i = t.getElementById(n);
- return i && i.parentNode ? [i] : []
- }
- }, t.filter.ID = function(n) {
- var t = n.replace(k, d);
- return function(n) {
- return n.getAttribute("id") === t
- }
- }) : (delete t.find.ID, t.filter.ID = function(n) {
- var t = n.replace(k, d);
- return function(n) {
- var i = typeof n.getAttributeNode !== ut && n.getAttributeNode("id");
- return i && i.value === t
- }
- }), t.find.TAG = r.getElementsByTagName ? function(n, t) {
- if (typeof t.getElementsByTagName !== ut) return t.getElementsByTagName(n)
- } : function(n, t) {
- var i, r = [],
- f = 0,
- u = t.getElementsByTagName(n);
- if (n === "*") {
- while (i = u[f++]) i.nodeType === 1 && r.push(i);
- return r
- }
- return u
- }, t.find.CLASS = r.getElementsByClassName && function(n, t) {
- if (typeof t.getElementsByClassName !== ut && l) return t.getElementsByClassName(n)
- }, g = [], o = [], (r.qsa = ot.test(u.querySelectorAll)) && (c(function(n) {
- n.innerHTML = "<select t=''><option selected=''><\/option><\/select>";
- n.querySelectorAll("[t^='']").length && o.push("[*^$]=" + i + "*(?:''|\"\")");
- n.querySelectorAll("[selected]").length || o.push("\\[" + i + "*(?:value|" + kt + ")");
- n.querySelectorAll(":checked").length || o.push(":checked")
- }), c(function(n) {
- var t = u.createElement("input");
- t.setAttribute("type", "hidden");
- n.appendChild(t).setAttribute("name", "D");
- n.querySelectorAll("[name=d]").length && o.push("name" + i + "*[*^$|!~]?=");
- n.querySelectorAll(":enabled").length || o.push(":enabled", ":disabled");
- n.querySelectorAll("*,:x");
- o.push(",.*:")
- })), (r.matchesSelector = ot.test(ct = v.webkitMatchesSelector || v.mozMatchesSelector || v.oMatchesSelector || v.msMatchesSelector)) && c(function(n) {
- r.disconnectedMatch = ct.call(n, "div");
- ct.call(n, "[s!='']:x");
- g.push("!=", dt)
- }), o = o.length && new RegExp(o.join("|")), g = g.length && new RegExp(g.join("|")), a = ot.test(v.compareDocumentPosition), et = a || ot.test(v.contains) ? function(n, t) {
- var r = n.nodeType === 9 ? n.documentElement : n,
- i = t && t.parentNode;
- return n === i || !!(i && i.nodeType === 1 && (r.contains ? r.contains(i) : n.compareDocumentPosition && n.compareDocumentPosition(i) & 16))
- } : function(n, t) {
- if (t)
- while (t = t.parentNode)
- if (t === n) return !0;
- return !1
- }, bt = a ? function(n, t) {
- if (n === t) return rt = !0, 0;
- var i = !n.compareDocumentPosition - !t.compareDocumentPosition;
- return i ? i : (i = (n.ownerDocument || n) === (t.ownerDocument || t) ? n.compareDocumentPosition(t) : 1, i & 1 || !r.sortDetached && t.compareDocumentPosition(n) === i) ? n === u || n.ownerDocument === s && et(s, n) ? -1 : t === u || t.ownerDocument === s && et(s, t) ? 1 : y ? nt.call(y, n) - nt.call(y, t) : 0 : i & 4 ? -1 : 1
- } : function(n, t) {
- if (n === t) return rt = !0, 0;
- var i, r = 0,
- o = n.parentNode,
- h = t.parentNode,
- f = [n],
- e = [t];
- if (o && h) {
- if (o === h) return pi(n, t)
- } else return n === u ? -1 : t === u ? 1 : o ? -1 : h ? 1 : y ? nt.call(y, n) - nt.call(y, t) : 0;
- for (i = n; i = i.parentNode;) f.unshift(i);
- for (i = t; i = i.parentNode;) e.unshift(i);
- while (f[r] === e[r]) r++;
- return r ? pi(f[r], e[r]) : f[r] === s ? -1 : e[r] === s ? 1 : 0
- }, u)
- };
- u.matches = function(n, t) {
- return u(n, null, null, t)
- };
- u.matchesSelector = function(n, t) {
- if ((n.ownerDocument || n) !== e && p(n), t = t.replace(ir, "='$1']"), r.matchesSelector && l && (!g || !g.test(t)) && (!o || !o.test(t))) try {
- var i = ct.call(n, t);
- if (i || r.disconnectedMatch || n.document && n.document.nodeType !== 11) return i
- } catch (f) {}
- return u(t, e, null, [n]).length > 0
- };
- u.contains = function(n, t) {
- return (n.ownerDocument || n) !== e && p(n), et(n, t)
- };
- u.attr = function(n, i) {
- (n.ownerDocument || n) !== e && p(n);
- var f = t.attrHandle[i.toLowerCase()],
- u = f && ki.call(t.attrHandle, i.toLowerCase()) ? f(n, i, !l) : undefined;
- return u !== undefined ? u : r.attributes || !l ? n.getAttribute(i) : (u = n.getAttributeNode(i)) && u.specified ? u.value : null
- };
- u.error = function(n) {
- throw new Error("Syntax error, unrecognized expression: " + n);
- };
- u.uniqueSort = function(n) {
- var u, f = [],
- t = 0,
- i = 0;
- if (rt = !r.detectDuplicates, y = !r.sortStable && n.slice(0), n.sort(bt), rt) {
- while (u = n[i++]) u === n[i] && (t = f.push(i));
- while (t--) n.splice(f[t], 1)
- }
- return y = null, n
- };
- st = u.getText = function(n) {
- var r, i = "",
- u = 0,
- t = n.nodeType;
- if (t) {
- if (t === 1 || t === 9 || t === 11) {
- if (typeof n.textContent == "string") return n.textContent;
- for (n = n.firstChild; n; n = n.nextSibling) i += st(n)
- } else if (t === 3 || t === 4) return n.nodeValue
- } else
- while (r = n[u++]) i += st(r);
- return i
- };
- t = u.selectors = {
- cacheLength: 50,
- createPseudo: h,
- match: at,
- attrHandle: {},
- find: {},
- relative: {
- ">": {
- dir: "parentNode",
- first: !0
- },
- " ": {
- dir: "parentNode"
- },
- "+": {
- dir: "previousSibling",
- first: !0
- },
- "~": {
- dir: "previousSibling"
- }
- },
- preFilter: {
- ATTR: function(n) {
- return n[1] = n[1].replace(k, d), n[3] = (n[4] || n[5] || "").replace(k, d), n[2] === "~=" && (n[3] = " " + n[3] + " "), n.slice(0, 4)
- },
- CHILD: function(n) {
- return n[1] = n[1].toLowerCase(), n[1].slice(0, 3) === "nth" ? (n[3] || u.error(n[0]), n[4] = +(n[4] ? n[5] + (n[6] || 1) : 2 * (n[3] === "even" || n[3] === "odd")), n[5] = +(n[7] + n[8] || n[3] === "odd")) : n[3] && u.error(n[0]), n
- },
- PSEUDO: function(n) {
- var i, t = !n[5] && n[2];
- return at.CHILD.test(n[0]) ? null : (n[3] && n[4] !== undefined ? n[2] = n[4] : t && rr.test(t) && (i = vt(t, !0)) && (i = t.indexOf(")", t.length - i) - t.length) && (n[0] = n[0].slice(0, i), n[2] = t.slice(0, i)), n.slice(0, 3))
- }
- },
- filter: {
- TAG: function(n) {
- var t = n.replace(k, d).toLowerCase();
- return n === "*" ? function() {
- return !0
- } : function(n) {
- return n.nodeName && n.nodeName.toLowerCase() === t
- }
- },
- CLASS: function(n) {
- var t = si[n + " "];
- return t || (t = new RegExp("(^|" + i + ")" + n + "(" + i + "|$)")) && si(n, function(n) {
- return t.test(typeof n.className == "string" && n.className || typeof n.getAttribute !== ut && n.getAttribute("class") || "")
- })
- },
- ATTR: function(n, t, i) {
- return function(r) {
- var f = u.attr(r, n);
- return f == null ? t === "!=" : t ? (f += "", t === "=" ? f === i : t === "!=" ? f !== i : t === "^=" ? i && f.indexOf(i) === 0 : t === "*=" ? i && f.indexOf(i) > -1 : t === "$=" ? i && f.slice(-i.length) === i : t === "~=" ? (" " + f + " ").indexOf(i) > -1 : t === "|=" ? f === i || f.slice(0, i.length + 1) === i + "-" : !1) : !0
- }
- },
- CHILD: function(n, t, i, r, u) {
- var s = n.slice(0, 3) !== "nth",
- o = n.slice(-4) !== "last",
- e = t === "of-type";
- return r === 1 && u === 0 ? function(n) {
- return !!n.parentNode
- } : function(t, i, h) {
- var v, k, c, l, y, w, b = s !== o ? "nextSibling" : "previousSibling",
- p = t.parentNode,
- g = e && t.nodeName.toLowerCase(),
- d = !h && !e;
- if (p) {
- if (s) {
- while (b) {
- for (c = t; c = c[b];)
- if (e ? c.nodeName.toLowerCase() === g : c.nodeType === 1) return !1;
- w = b = n === "only" && !w && "nextSibling"
- }
- return !0
- }
- if (w = [o ? p.firstChild : p.lastChild], o && d) {
- for (k = p[f] || (p[f] = {}), v = k[n] || [], y = v[0] === a && v[1], l = v[0] === a && v[2], c = y && p.childNodes[y]; c = ++y && c && c[b] || (l = y = 0) || w.pop();)
- if (c.nodeType === 1 && ++l && c === t) {
- k[n] = [a, y, l];
- break
- }
- } else if (d && (v = (t[f] || (t[f] = {}))[n]) && v[0] === a) l = v[1];
- else
- while (c = ++y && c && c[b] || (l = y = 0) || w.pop())
- if ((e ? c.nodeName.toLowerCase() === g : c.nodeType === 1) && ++l && (d && ((c[f] || (c[f] = {}))[n] = [a, l]), c === t)) break; return l -= u, l === r || l % r == 0 && l / r >= 0
- }
- }
- },
- PSEUDO: function(n, i) {
- var e, r = t.pseudos[n] || t.setFilters[n.toLowerCase()] || u.error("unsupported pseudo: " + n);
- return r[f] ? r(i) : r.length > 1 ? (e = [n, n, "", i], t.setFilters.hasOwnProperty(n.toLowerCase()) ? h(function(n, t) {
- for (var u, f = r(n, i), e = f.length; e--;) u = nt.call(n, f[e]), n[u] = !(t[u] = f[e])
- }) : function(n) {
- return r(n, 0, e)
- }) : r
- }
- },
- pseudos: {
- not: h(function(n) {
- var i = [],
- r = [],
- t = wt(n.replace(lt, "$1"));
- return t[f] ? h(function(n, i, r, u) {
- for (var e, o = t(n, null, u, []), f = n.length; f--;)(e = o[f]) && (n[f] = !(i[f] = e))
- }) : function(n, u, f) {
- return i[0] = n, t(i, null, f, r), !r.pop()
- }
- }),
- has: h(function(n) {
- return function(t) {
- return u(n, t).length > 0
- }
- }),
- contains: h(function(n) {
- return function(t) {
- return (t.textContent || t.innerText || st(t)).indexOf(n) > -1
- }
- }),
- lang: h(function(n) {
- return ur.test(n || "") || u.error("unsupported lang: " + n), n = n.replace(k, d).toLowerCase(),
- function(t) {
- var i;
- do
- if (i = l ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return i = i.toLowerCase(), i === n || i.indexOf(n + "-") === 0;
- while ((t = t.parentNode) && t.nodeType === 1);
- return !1
- }
- }),
- target: function(t) {
- var i = n.location && n.location.hash;
- return i && i.slice(1) === t.id
- },
- root: function(n) {
- return n === v
- },
- focus: function(n) {
- return n === e.activeElement && (!e.hasFocus || e.hasFocus()) && !!(n.type || n.href || ~n.tabIndex)
- },
- enabled: function(n) {
- return n.disabled === !1
- },
- disabled: function(n) {
- return n.disabled === !0
- },
- checked: function(n) {
- var t = n.nodeName.toLowerCase();
- return t === "input" && !!n.checked || t === "option" && !!n.selected
- },
- selected: function(n) {
- return n.parentNode && n.parentNode.selectedIndex, n.selected === !0
- },
- empty: function(n) {
- for (n = n.firstChild; n; n = n.nextSibling)
- if (n.nodeType < 6) return !1;
- return !0
- },
- parent: function(n) {
- return !t.pseudos.empty(n)
- },
- header: function(n) {
- return er.test(n.nodeName)
- },
- input: function(n) {
- return fr.test(n.nodeName)
- },
- button: function(n) {
- var t = n.nodeName.toLowerCase();
- return t === "input" && n.type === "button" || t === "button"
- },
- text: function(n) {
- var t;
- return n.nodeName.toLowerCase() === "input" && n.type === "text" && ((t = n.getAttribute("type")) == null || t.toLowerCase() === "text")
- },
- first: tt(function() {
- return [0]
- }),
- last: tt(function(n, t) {
- return [t - 1]
- }),
- eq: tt(function(n, t, i) {
- return [i < 0 ? i + t : i]
- }),
- even: tt(function(n, t) {
- for (var i = 0; i < t; i += 2) n.push(i);
- return n
- }),
- odd: tt(function(n, t) {
- for (var i = 1; i < t; i += 2) n.push(i);
- return n
- }),
- lt: tt(function(n, t, i) {
- for (var r = i < 0 ? i + t : i; --r >= 0;) n.push(r);
- return n
- }),
- gt: tt(function(n, t, i) {
- for (var r = i < 0 ? i + t : i; ++r < t;) n.push(r);
- return n
- })
- }
- };
- t.pseudos.nth = t.pseudos.eq;
- for (it in {
- radio: !0,
- checkbox: !0,
- file: !0,
- password: !0,
- image: !0
- }) t.pseudos[it] = hr(it);
- for (it in {
- submit: !0,
- reset: !0
- }) t.pseudos[it] = cr(it);
- return wi.prototype = t.filters = t.pseudos, t.setFilters = new wi, wt = u.compile = function(n, t) {
- var r, u = [],
- e = [],
- i = ci[n + " "];
- if (!i) {
- for (t || (t = vt(n)), r = t.length; r--;) i = ei(t[r]), i[f] ? u.push(i) : e.push(i);
- i = ci(n, lr(e, u))
- }
- return i
- }, r.sortStable = f.split("").sort(bt).join("") === f, r.detectDuplicates = !!rt, p(), r.sortDetached = c(function(n) {
- return n.compareDocumentPosition(e.createElement("div")) & 1
- }), c(function(n) {
- return n.innerHTML = "<a href='#'><\/a>", n.firstChild.getAttribute("href") === "#"
- }) || ti("type|href|height|width", function(n, t, i) {
- if (!i) return n.getAttribute(t, t.toLowerCase() === "type" ? 1 : 2)
- }), r.attributes && c(function(n) {
- return n.innerHTML = "<input/>", n.firstChild.setAttribute("value", ""), n.firstChild.getAttribute("value") === ""
- }) || ti("value", function(n, t, i) {
- if (!i && n.nodeName.toLowerCase() === "input") return n.defaultValue
- }), c(function(n) {
- return n.getAttribute("disabled") == null
- }) || ti(kt, function(n, t, i) {
- var r;
- if (!i) return n[t] === !0 ? t.toLowerCase() : (r = n.getAttributeNode(t)) && r.specified ? r.value : null
- }), u
- }(n);
- i.find = p;
- i.expr = p.selectors;
- i.expr[":"] = i.expr.pseudos;
- i.unique = p.uniqueSort;
- i.text = p.getText;
- i.isXMLDoc = p.isXML;
- i.contains = p.contains;
- var fr = i.expr.match.needsContext,
- er = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
- ue = /^.[^:#\[\.,]*$/;
- i.filter = function(n, t, r) {
- var u = t[0];
- return r && (n = ":not(" + n + ")"), t.length === 1 && u.nodeType === 1 ? i.find.matchesSelector(u, n) ? [u] : [] : i.find.matches(n, i.grep(t, function(n) {
- return n.nodeType === 1
- }))
- };
- i.fn.extend({
- find: function(n) {
- var t, r = [],
- u = this,
- f = u.length;
- if (typeof n != "string") return this.pushStack(i(n).filter(function() {
- for (t = 0; t < f; t++)
- if (i.contains(u[t], this)) return !0
- }));
- for (t = 0; t < f; t++) i.find(n, u[t], r);
- return r = this.pushStack(f > 1 ? i.unique(r) : r), r.selector = this.selector ? this.selector + " " + n : n, r
- },
- filter: function(n) {
- return this.pushStack(ui(this, n || [], !1))
- },
- not: function(n) {
- return this.pushStack(ui(this, n || [], !0))
- },
- is: function(n) {
- return !!ui(this, typeof n == "string" && fr.test(n) ? i(n) : n || [], !1).length
- }
- });
- var ft, u = n.document,
- fe = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
- ee = i.fn.init = function(n, t) {
- var r, f;
- if (!n) return this;
- if (typeof n == "string") {
- if (r = n.charAt(0) === "<" && n.charAt(n.length - 1) === ">" && n.length >= 3 ? [null, n, null] : fe.exec(n), r && (r[1] || !t)) {
- if (r[1]) {
- if (t = t instanceof i ? t[0] : t, i.merge(this, i.parseHTML(r[1], t && t.nodeType ? t.ownerDocument || t : u, !0)), er.test(r[1]) && i.isPlainObject(t))
- for (r in t) i.isFunction(this[r]) ? this[r](t[r]) : this.attr(r, t[r]);
- return this
- }
- if (f = u.getElementById(r[2]), f && f.parentNode) {
- if (f.id !== r[2]) return ft.find(n);
- this.length = 1;
- this[0] = f
- }
- return this.context = u, this.selector = n, this
- }
- return !t || t.jquery ? (t || ft).find(n) : this.constructor(t).find(n)
- }
- return n.nodeType ? (this.context = this[0] = n, this.length = 1, this) : i.isFunction(n) ? typeof ft.ready != "undefined" ? ft.ready(n) : n(i) : (n.selector !== undefined && (this.selector = n.selector, this.context = n.context), i.makeArray(n, this))
- };
- ee.prototype = i.fn;
- ft = i(u);
- or = /^(?:parents|prev(?:Until|All))/;
- sr = {
- children: !0,
- contents: !0,
- next: !0,
- prev: !0
- };
- i.extend({
- dir: function(n, t, r) {
- for (var f = [], u = n[t]; u && u.nodeType !== 9 && (r === undefined || u.nodeType !== 1 || !i(u).is(r));) u.nodeType === 1 && f.push(u), u = u[t];
- return f
- },
- sibling: function(n, t) {
- for (var i = []; n; n = n.nextSibling) n.nodeType === 1 && n !== t && i.push(n);
- return i
- }
- });
- i.fn.extend({
- has: function(n) {
- var t, r = i(n, this),
- u = r.length;
- return this.filter(function() {
- for (t = 0; t < u; t++)
- if (i.contains(this, r[t])) return !0
- })
- },
- closest: function(n, t) {
- for (var r, f = 0, o = this.length, u = [], e = fr.test(n) || typeof n != "string" ? i(n, t || this.context) : 0; f < o; f++)
- for (r = this[f]; r && r !== t; r = r.parentNode)
- if (r.nodeType < 11 && (e ? e.index(r) > -1 : r.nodeType === 1 && i.find.matchesSelector(r, n))) {
- u.push(r);
- break
- }
- return this.pushStack(u.length > 1 ? i.unique(u) : u)
- },
- index: function(n) {
- return n ? typeof n == "string" ? i.inArray(this[0], i(n)) : i.inArray(n.jquery ? n[0] : n, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
- },
- add: function(n, t) {
- return this.pushStack(i.unique(i.merge(this.get(), i(n, t))))
- },
- addBack: function(n) {
- return this.add(n == null ? this.prevObject : this.prevObject.filter(n))
- }
- });
- i.each({
- parent: function(n) {
- var t = n.parentNode;
- return t && t.nodeType !== 11 ? t : null
- },
- parents: function(n) {
- return i.dir(n, "parentNode")
- },
- parentsUntil: function(n, t, r) {
- return i.dir(n, "parentNode", r)
- },
- next: function(n) {
- return hr(n, "nextSibling")
- },
- prev: function(n) {
- return hr(n, "previousSibling")
- },
- nextAll: function(n) {
- return i.dir(n, "nextSibling")
- },
- prevAll: function(n) {
- return i.dir(n, "previousSibling")
- },
- nextUntil: function(n, t, r) {
- return i.dir(n, "nextSibling", r)
- },
- prevUntil: function(n, t, r) {
- return i.dir(n, "previousSibling", r)
- },
- siblings: function(n) {
- return i.sibling((n.parentNode || {}).firstChild, n)
- },
- children: function(n) {
- return i.sibling(n.firstChild)
- },
- contents: function(n) {
- return i.nodeName(n, "iframe") ? n.contentDocument || n.contentWindow.document : i.merge([], n.childNodes)
- }
- }, function(n, t) {
- i.fn[n] = function(r, u) {
- var f = i.map(this, t, r);
- return n.slice(-5) !== "Until" && (u = r), u && typeof u == "string" && (f = i.filter(u, f)), this.length > 1 && (sr[n] || (f = i.unique(f)), or.test(n) && (f = f.reverse())), this.pushStack(f)
- }
- });
- h = /\S+/g;
- fi = {};
- i.Callbacks = function(n) {
- n = typeof n == "string" ? fi[n] || oe(n) : i.extend({}, n);
- var o, u, h, f, e, c, t = [],
- r = !n.once && [],
- l = function(i) {
- for (u = n.memory && i, h = !0, e = c || 0, c = 0, f = t.length, o = !0; t && e < f; e++)
- if (t[e].apply(i[0], i[1]) === !1 && n.stopOnFalse) {
- u = !1;
- break
- }
- o = !1;
- t && (r ? r.length && l(r.shift()) : u ? t = [] : s.disable())
- },
- s = {
- add: function() {
- if (t) {
- var r = t.length;
- (function e(r) {
- i.each(r, function(r, u) {
- var f = i.type(u);
- f === "function" ? n.unique && s.has(u) || t.push(u) : u && u.length && f !== "string" && e(u)
- })
- })(arguments);
- o ? f = t.length : u && (c = r, l(u))
- }
- return this
- },
- remove: function() {
- return t && i.each(arguments, function(n, r) {
- for (var u;
- (u = i.inArray(r, t, u)) > -1;) t.splice(u, 1), o && (u <= f && f--, u <= e && e--)
- }), this
- },
- has: function(n) {
- return n ? i.inArray(n, t) > -1 : !!(t && t.length)
- },
- empty: function() {
- return t = [], f = 0, this
- },
- disable: function() {
- return t = r = u = undefined, this
- },
- disabled: function() {
- return !t
- },
- lock: function() {
- return r = undefined, u || s.disable(), this
- },
- locked: function() {
- return !r
- },
- fireWith: function(n, i) {
- return t && (!h || r) && (i = i || [], i = [n, i.slice ? i.slice() : i], o ? r.push(i) : l(i)), this
- },
- fire: function() {
- return s.fireWith(this, arguments), this
- },
- fired: function() {
- return !!h
- }
- };
- return s
- };
- i.extend({
- Deferred: function(n) {
- var u = [
- ["resolve", "done", i.Callbacks("once memory"), "resolved"],
- ["reject", "fail", i.Callbacks("once memory"), "rejected"],
- ["notify", "progress", i.Callbacks("memory")]
- ],
- f = "pending",
- r = {
- state: function() {
- return f
- },
- always: function() {
- return t.done(arguments).fail(arguments), this
- },
- then: function() {
- var n = arguments;
- return i.Deferred(function(f) {
- i.each(u, function(u, e) {
- var o = i.isFunction(n[u]) && n[u];
- t[e[1]](function() {
- var n = o && o.apply(this, arguments);
- n && i.isFunction(n.promise) ? n.promise().done(f.resolve).fail(f.reject).progress(f.notify) : f[e[0] + "With"](this === r ? f.promise() : this, o ? [n] : arguments)
- })
- });
- n = null
- }).promise()
- },
- promise: function(n) {
- return n != null ? i.extend(n, r) : r
- }
- },
- t = {};
- return r.pipe = r.then, i.each(u, function(n, i) {
- var e = i[2],
- o = i[3];
- r[i[1]] = e.add;
- o && e.add(function() {
- f = o
- }, u[n ^ 1][2].disable, u[2][2].lock);
- t[i[0]] = function() {
- return t[i[0] + "With"](this === t ? r : this, arguments), this
- };
- t[i[0] + "With"] = e.fireWith
- }), r.promise(t), n && n.call(t, t), t
- },
- when: function(n) {
- var t = 0,
- u = l.call(arguments),
- r = u.length,
- e = r !== 1 || n && i.isFunction(n.promise) ? r : 0,
- f = e === 1 ? n : i.Deferred(),
- h = function(n, t, i) {
- return function(r) {
- t[n] = this;
- i[n] = arguments.length > 1 ? l.call(arguments) : r;
- i === o ? f.notifyWith(t, i) : --e || f.resolveWith(t, i)
- }
- },
- o, c, s;
- if (r > 1)
- for (o = new Array(r), c = new Array(r), s = new Array(r); t < r; t++) u[t] && i.isFunction(u[t].promise) ? u[t].promise().done(h(t, s, u)).fail(f.reject).progress(h(t, c, o)) : --e;
- return e || f.resolveWith(s, u), f.promise()
- }
- });
- i.fn.ready = function(n) {
- return i.ready.promise().done(n), this
- };
- i.extend({
- isReady: !1,
- readyWait: 1,
- holdReady: function(n) {
- n ? i.readyWait++ : i.ready(!0)
- },
- ready: function(n) {
- if (n === !0 ? !--i.readyWait : !i.isReady) {
- if (!u.body) return setTimeout(i.ready);
- (i.isReady = !0, n !== !0 && --i.readyWait > 0) || (lt.resolveWith(u, [i]), i.fn.trigger && i(u).trigger("ready").off("ready"))
- }
- }
- });
- i.ready.promise = function(t) {
- if (!lt)
- if (lt = i.Deferred(), u.readyState === "complete") setTimeout(i.ready);
- else if (u.addEventListener) u.addEventListener("DOMContentLoaded", a, !1), n.addEventListener("load", a, !1);
- else {
- u.attachEvent("onreadystatechange", a);
- n.attachEvent("onload", a);
- var r = !1;
- try {
- r = n.frameElement == null && u.documentElement
- } catch (e) {}
- r && r.doScroll && function f() {
- if (!i.isReady) {
- try {
- r.doScroll("left")
- } catch (n) {
- return setTimeout(f, 50)
- }
- cr();
- i.ready()
- }
- }()
- }
- return lt.promise(t)
- };
- o = typeof undefined;
- for (lr in i(r)) break;
- r.ownLast = lr !== "0";
- r.inlineBlockNeedsLayout = !1;
- i(function() {
- var t, n, i = u.getElementsByTagName("body")[0];
- i && (t = u.createElement("div"), t.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", n = u.createElement("div"), i.appendChild(t).appendChild(n), typeof n.style.zoom !== o && (n.style.cssText = "border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1", (r.inlineBlockNeedsLayout = n.offsetWidth === 3) && (i.style.zoom = 1)), i.removeChild(t), t = n = null)
- }),
- function() {
- var n = u.createElement("div");
- if (r.deleteExpando == null) {
- r.deleteExpando = !0;
- try {
- delete n.test
- } catch (t) {
- r.deleteExpando = !1
- }
- }
- n = null
- }();
- i.acceptData = function(n) {
- var t = i.noData[(n.nodeName + " ").toLowerCase()],
- r = +n.nodeType || 1;
- return r !== 1 && r !== 9 ? !1 : !t || t !== !0 && n.getAttribute("classid") === t
- };
- ar = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/;
- vr = /([A-Z])/g;
- i.extend({
- cache: {},
- noData: {
- "applet ": !0,
- "embed ": !0,
- "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
- },
- hasData: function(n) {
- return n = n.nodeType ? i.cache[n[i.expando]] : n[i.expando], !!n && !ei(n)
- },
- data: function(n, t, i) {
- return pr(n, t, i)
- },
- removeData: function(n, t) {
- return wr(n, t)
- },
- _data: function(n, t, i) {
- return pr(n, t, i, !0)
- },
- _removeData: function(n, t) {
- return wr(n, t, !0)
- }
- });
- i.fn.extend({
- data: function(n, t) {
- var f, u, e, r = this[0],
- o = r && r.attributes;
- if (n === undefined) {
- if (this.length && (e = i.data(r), r.nodeType === 1 && !i._data(r, "parsedAttrs"))) {
- for (f = o.length; f--;) u = o[f].name, u.indexOf("data-") === 0 && (u = i.camelCase(u.slice(5)), yr(r, u, e[u]));
- i._data(r, "parsedAttrs", !0)
- }
- return e
- }
- return typeof n == "object" ? this.each(function() {
- i.data(this, n)
- }) : arguments.length > 1 ? this.each(function() {
- i.data(this, n, t)
- }) : r ? yr(r, n, i.data(r, n)) : undefined
- },
- removeData: function(n) {
- return this.each(function() {
- i.removeData(this, n)
- })
- }
- });
- i.extend({
- queue: function(n, t, r) {
- var u;
- if (n) return t = (t || "fx") + "queue", u = i._data(n, t), r && (!u || i.isArray(r) ? u = i._data(n, t, i.makeArray(r)) : u.push(r)), u || []
- },
- dequeue: function(n, t) {
- t = t || "fx";
- var r = i.queue(n, t),
- e = r.length,
- u = r.shift(),
- f = i._queueHooks(n, t),
- o = function() {
- i.dequeue(n, t)
- };
- u === "inprogress" && (u = r.shift(), e--);
- u && (t === "fx" && r.unshift("inprogress"), delete f.stop, u.call(n, o, f));
- !e && f && f.empty.fire()
- },
- _queueHooks: function(n, t) {
- var r = t + "queueHooks";
- return i._data(n, r) || i._data(n, r, {
- empty: i.Callbacks("once memory").add(function() {
- i._removeData(n, t + "queue");
- i._removeData(n, r)
- })
- })
- }
- });
- i.fn.extend({
- queue: function(n, t) {
- var r = 2;
- return (typeof n != "string" && (t = n, n = "fx", r--), arguments.length < r) ? i.queue(this[0], n) : t === undefined ? this : this.each(function() {
- var r = i.queue(this, n, t);
- i._queueHooks(this, n);
- n === "fx" && r[0] !== "inprogress" && i.dequeue(this, n)
- })
- },
- dequeue: function(n) {
- return this.each(function() {
- i.dequeue(this, n)
- })
- },
- clearQueue: function(n) {
- return this.queue(n || "fx", [])
- },
- promise: function(n, t) {
- var r, f = 1,
- e = i.Deferred(),
- u = this,
- o = this.length,
- s = function() {
- --f || e.resolveWith(u, [u])
- };
- for (typeof n != "string" && (t = n, n = undefined), n = n || "fx"; o--;) r = i._data(u[o], n + "queueHooks"), r && r.empty && (f++, r.empty.add(s));
- return s(), e.promise(t)
- }
- });
- var at = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
- w = ["Top", "Right", "Bottom", "Left"],
- et = function(n, t) {
- return n = t || n, i.css(n, "display") === "none" || !i.contains(n.ownerDocument, n)
- },
- b = i.access = function(n, t, r, u, f, e, o) {
- var s = 0,
- c = n.length,
- h = r == null;
- if (i.type(r) === "object") {
- f = !0;
- for (s in r) i.access(n, t, s, r[s], !0, e, o)
- } else if (u !== undefined && (f = !0, i.isFunction(u) || (o = !0), h && (o ? (t.call(n, u), t = null) : (h = t, t = function(n, t, r) {
- return h.call(i(n), r)
- })), t))
- for (; s < c; s++) t(n[s], r, o ? u : u.call(n[s], s, t(n[s], r)));
- return f ? n : h ? t.call(n) : c ? t(n[0], r) : e
- },
- oi = /^(?:checkbox|radio)$/i;
- (function() {
- var i = u.createDocumentFragment(),
- n = u.createElement("div"),
- t = u.createElement("input");
- if (n.setAttribute("className", "t"), n.innerHTML = " <link/><table><\/table><a href='/a'>a<\/a>", r.leadingWhitespace = n.firstChild.nodeType === 3, r.tbody = !n.getElementsByTagName("tbody").length, r.htmlSerialize = !!n.getElementsByTagName("link").length, r.html5Clone = u.createElement("nav").cloneNode(!0).outerHTML !== "<:nav><\/:nav>", t.type = "checkbox", t.checked = !0, i.appendChild(t), r.appendChecked = t.checked, n.innerHTML = "<textarea>x<\/textarea>", r.noCloneChecked = !!n.cloneNode(!0).lastChild.defaultValue, i.appendChild(n), n.innerHTML = "<input type='radio' checked='checked' name='t'/>", r.checkClone = n.cloneNode(!0).cloneNode(!0).lastChild.checked, r.noCloneEvent = !0, n.attachEvent && (n.attachEvent("onclick", function() {
- r.noCloneEvent = !1
- }), n.cloneNode(!0).click()), r.deleteExpando == null) {
- r.deleteExpando = !0;
- try {
- delete n.test
- } catch (f) {
- r.deleteExpando = !1
- }
- }
- i = n = t = null
- })(),
- function() {
- var t, i, f = u.createElement("div");
- for (t in {
- submit: !0,
- change: !0,
- focusin: !0
- }) i = "on" + t, (r[t + "Bubbles"] = i in n) || (f.setAttribute(i, "t"), r[t + "Bubbles"] = f.attributes[i].expando === !1);
- f = null
- }();
- var si = /^(?:input|select|textarea)$/i,
- se = /^key/,
- he = /^(?:mouse|contextmenu)|click/,
- br = /^(?:focusinfocus|focusoutblur)$/,
- kr = /^([^.]*)(?:\.(.+)|)$/;
- i.event = {
- global: {},
- add: function(n, t, r, u, f) {
- var w, y, b, p, s, c, l, a, e, k, d, v = i._data(n);
- if (v) {
- for (r.handler && (p = r, r = p.handler, f = p.selector), r.guid || (r.guid = i.guid++), (y = v.events) || (y = v.events = {}), (c = v.handle) || (c = v.handle = function(n) {
- return typeof i !== o && (!n || i.event.triggered !== n.type) ? i.event.dispatch.apply(c.elem, arguments) : undefined
- }, c.elem = n), t = (t || "").match(h) || [""], b = t.length; b--;)(w = kr.exec(t[b]) || [], e = d = w[1], k = (w[2] || "").split(".").sort(), e) && (s = i.event.special[e] || {}, e = (f ? s.delegateType : s.bindType) || e, s = i.event.special[e] || {}, l = i.extend({
- type: e,
- origType: d,
- data: u,
- handler: r,
- guid: r.guid,
- selector: f,
- needsContext: f && i.expr.match.needsContext.test(f),
- namespace: k.join(".")
- }, p), (a = y[e]) || (a = y[e] = [], a.delegateCount = 0, s.setup && s.setup.call(n, u, k, c) !== !1 || (n.addEventListener ? n.addEventListener(e, c, !1) : n.attachEvent && n.attachEvent("on" + e, c))), s.add && (s.add.call(n, l), l.handler.guid || (l.handler.guid = r.guid)), f ? a.splice(a.delegateCount++, 0, l) : a.push(l), i.event.global[e] = !0);
- n = null
- }
- },
- remove: function(n, t, r, u, f) {
- var y, o, s, b, p, a, c, l, e, w, k, v = i.hasData(n) && i._data(n);
- if (v && (a = v.events)) {
- for (t = (t || "").match(h) || [""], p = t.length; p--;) {
- if (s = kr.exec(t[p]) || [], e = k = s[1], w = (s[2] || "").split(".").sort(), !e) {
- for (e in a) i.event.remove(n, e + t[p], r, u, !0);
- continue
- }
- for (c = i.event.special[e] || {}, e = (u ? c.delegateType : c.bindType) || e, l = a[e] || [], s = s[2] && new RegExp("(^|\\.)" + w.join("\\.(?:.*\\.|)") + "(\\.|$)"), b = y = l.length; y--;) o = l[y], (f || k === o.origType) && (!r || r.guid === o.guid) && (!s || s.test(o.namespace)) && (!u || u === o.selector || u === "**" && o.selector) && (l.splice(y, 1), o.selector && l.delegateCount--, c.remove && c.remove.call(n, o));
- b && !l.length && (c.teardown && c.teardown.call(n, w, v.handle) !== !1 || i.removeEvent(n, e, v.handle), delete a[e])
- }
- i.isEmptyObject(a) && (delete v.handle, i._removeData(n, "events"))
- }
- },
- trigger: function(t, r, f, e) {
- var l, a, o, p, c, h, w, y = [f || u],
- s = tt.call(t, "type") ? t.type : t,
- v = tt.call(t, "namespace") ? t.namespace.split(".") : [];
- if ((o = h = f = f || u, f.nodeType !== 3 && f.nodeType !== 8) && !br.test(s + i.event.triggered) && (s.indexOf(".") >= 0 && (v = s.split("."), s = v.shift(), v.sort()), a = s.indexOf(":") < 0 && "on" + s, t = t[i.expando] ? t : new i.Event(s, typeof t == "object" && t), t.isTrigger = e ? 2 : 3, t.namespace = v.join("."), t.namespace_re = t.namespace ? new RegExp("(^|\\.)" + v.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, t.result = undefined, t.target || (t.target = f), r = r == null ? [t] : i.makeArray(r, [t]), c = i.event.special[s] || {}, e || !c.trigger || c.trigger.apply(f, r) !== !1)) {
- if (!e && !c.noBubble && !i.isWindow(f)) {
- for (p = c.delegateType || s, br.test(p + s) || (o = o.parentNode); o; o = o.parentNode) y.push(o), h = o;
- h === (f.ownerDocument || u) && y.push(h.defaultView || h.parentWindow || n)
- }
- for (w = 0;
- (o = y[w++]) && !t.isPropagationStopped();) t.type = w > 1 ? p : c.bindType || s, l = (i._data(o, "events") || {})[t.type] && i._data(o, "handle"), l && l.apply(o, r), l = a && o[a], l && l.apply && i.acceptData(o) && (t.result = l.apply(o, r), t.result === !1 && t.preventDefault());
- if (t.type = s, !e && !t.isDefaultPrevented() && (!c._default || c._default.apply(y.pop(), r) === !1) && i.acceptData(f) && a && f[s] && !i.isWindow(f)) {
- h = f[a];
- h && (f[a] = null);
- i.event.triggered = s;
- try {
- f[s]()
- } catch (b) {}
- i.event.triggered = undefined;
- h && (f[a] = h)
- }
- return t.result
- }
- },
- dispatch: function(n) {
- n = i.event.fix(n);
- var e, f, t, r, o, s = [],
- h = l.call(arguments),
- c = (i._data(this, "events") || {})[n.type] || [],
- u = i.event.special[n.type] || {};
- if (h[0] = n, n.delegateTarget = this, !u.preDispatch || u.preDispatch.call(this, n) !== !1) {
- for (s = i.event.handlers.call(this, n, c), e = 0;
- (r = s[e++]) && !n.isPropagationStopped();)
- for (n.currentTarget = r.elem, o = 0;
- (t = r.handlers[o++]) && !n.isImmediatePropagationStopped();)(!n.namespace_re || n.namespace_re.test(t.namespace)) && (n.handleObj = t, n.data = t.data, f = ((i.event.special[t.origType] || {}).handle || t.handler).apply(r.elem, h), f !== undefined && (n.result = f) === !1 && (n.preventDefault(), n.stopPropagation()));
- return u.postDispatch && u.postDispatch.call(this, n), n.result
- }
- },
- handlers: function(n, t) {
- var f, e, u, o, h = [],
- s = t.delegateCount,
- r = n.target;
- if (s && r.nodeType && (!n.button || n.type !== "click"))
- for (; r != this; r = r.parentNode || this)
- if (r.nodeType === 1 && (r.disabled !== !0 || n.type !== "click")) {
- for (u = [], o = 0; o < s; o++) e = t[o], f = e.selector + " ", u[f] === undefined && (u[f] = e.needsContext ? i(f, this).index(r) >= 0 : i.find(f, this, null, [r]).length), u[f] && u.push(e);
- u.length && h.push({
- elem: r,
- handlers: u
- })
- }
- return s < t.length && h.push({
- elem: this,
- handlers: t.slice(s)
- }), h
- },
- fix: function(n) {
- if (n[i.expando]) return n;
- var e, o, s, r = n.type,
- f = n,
- t = this.fixHooks[r];
- for (t || (this.fixHooks[r] = t = he.test(r) ? this.mouseHooks : se.test(r) ? this.keyHooks : {}), s = t.props ? this.props.concat(t.props) : this.props, n = new i.Event(f), e = s.length; e--;) o = s[e], n[o] = f[o];
- return n.target || (n.target = f.srcElement || u), n.target.nodeType === 3 && (n.target = n.target.parentNode), n.metaKey = !!n.metaKey, t.filter ? t.filter(n, f) : n
- },
- props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
- fixHooks: {},
- keyHooks: {
- props: "char charCode key keyCode".split(" "),
- filter: function(n, t) {
- return n.which == null && (n.which = t.charCode != null ? t.charCode : t.keyCode), n
- }
- },
- mouseHooks: {
- props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
- filter: function(n, t) {
- var i, e, r, f = t.button,
- o = t.fromElement;
- return n.pageX == null && t.clientX != null && (e = n.target.ownerDocument || u, r = e.documentElement, i = e.body, n.pageX = t.clientX + (r && r.scrollLeft || i && i.scrollLeft || 0) - (r && r.clientLeft || i && i.clientLeft || 0), n.pageY = t.clientY + (r && r.scrollTop || i && i.scrollTop || 0) - (r && r.clientTop || i && i.clientTop || 0)), !n.relatedTarget && o && (n.relatedTarget = o === n.target ? t.toElement : o), n.which || f === undefined || (n.which = f & 1 ? 1 : f & 2 ? 3 : f & 4 ? 2 : 0), n
- }
- },
- special: {
- load: {
- noBubble: !0
- },
- focus: {
- trigger: function() {
- if (this !== dr() && this.focus) try {
- return this.focus(), !1
- } catch (n) {}
- },
- delegateType: "focusin"
- },
- blur: {
- trigger: function() {
- if (this === dr() && this.blur) return this.blur(), !1
- },
- delegateType: "focusout"
- },
- click: {
- trigger: function() {
- if (i.nodeName(this, "input") && this.type === "checkbox" && this.click) return this.click(), !1
- },
- _default: function(n) {
- return i.nodeName(n.target, "a")
- }
- },
- beforeunload: {
- postDispatch: function(n) {
- n.result !== undefined && (n.originalEvent.returnValue = n.result)
- }
- }
- },
- simulate: function(n, t, r, u) {
- var f = i.extend(new i.Event, r, {
- type: n,
- isSimulated: !0,
- originalEvent: {}
- });
- u ? i.event.trigger(f, null, t) : i.event.dispatch.call(t, f);
- f.isDefaultPrevented() && r.preventDefault()
- }
- };
- i.removeEvent = u.removeEventListener ? function(n, t, i) {
- n.removeEventListener && n.removeEventListener(t, i, !1)
- } : function(n, t, i) {
- var r = "on" + t;
- n.detachEvent && (typeof n[r] === o && (n[r] = null), n.detachEvent(r, i))
- };
- i.Event = function(n, t) {
- if (!(this instanceof i.Event)) return new i.Event(n, t);
- n && n.type ? (this.originalEvent = n, this.type = n.type, this.isDefaultPrevented = n.defaultPrevented || n.defaultPrevented === undefined && (n.returnValue === !1 || n.getPreventDefault && n.getPreventDefault()) ? vt : it) : this.type = n;
- t && i.extend(this, t);
- this.timeStamp = n && n.timeStamp || i.now();
- this[i.expando] = !0
- };
- i.Event.prototype = {
- isDefaultPrevented: it,
- isPropagationStopped: it,
- isImmediatePropagationStopped: it,
- preventDefault: function() {
- var n = this.originalEvent;
- (this.isDefaultPrevented = vt, n) && (n.preventDefault ? n.preventDefault() : n.returnValue = !1)
- },
- stopPropagation: function() {
- var n = this.originalEvent;
- (this.isPropagationStopped = vt, n) && (n.stopPropagation && n.stopPropagation(), n.cancelBubble = !0)
- },
- stopImmediatePropagation: function() {
- this.isImmediatePropagationStopped = vt;
- this.stopPropagation()
- }
- };
- i.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
- }, function(n, t) {
- i.event.special[n] = {
- delegateType: t,
- bindType: t,
- handle: function(n) {
- var u, f = this,
- r = n.relatedTarget,
- e = n.handleObj;
- return r && (r === f || i.contains(f, r)) || (n.type = e.origType, u = e.handler.apply(this, arguments), n.type = t), u
- }
- }
- });
- r.submitBubbles || (i.event.special.submit = {
- setup: function() {
- if (i.nodeName(this, "form")) return !1;
- i.event.add(this, "click._submit keypress._submit", function(n) {
- var r = n.target,
- t = i.nodeName(r, "input") || i.nodeName(r, "button") ? r.form : undefined;
- t && !i._data(t, "submitBubbles") && (i.event.add(t, "submit._submit", function(n) {
- n._submit_bubble = !0
- }), i._data(t, "submitBubbles", !0))
- })
- },
- postDispatch: function(n) {
- n._submit_bubble && (delete n._submit_bubble, this.parentNode && !n.isTrigger && i.event.simulate("submit", this.parentNode, n, !0))
- },
- teardown: function() {
- if (i.nodeName(this, "form")) return !1;
- i.event.remove(this, "._submit")
- }
- });
- r.changeBubbles || (i.event.special.change = {
- setup: function() {
- if (si.test(this.nodeName)) return (this.type === "checkbox" || this.type === "radio") && (i.event.add(this, "propertychange._change", function(n) {
- n.originalEvent.propertyName === "checked" && (this._just_changed = !0)
- }), i.event.add(this, "click._change", function(n) {
- this._just_changed && !n.isTrigger && (this._just_changed = !1);
- i.event.simulate("change", this, n, !0)
- })), !1;
- i.event.add(this, "beforeactivate._change", function(n) {
- var t = n.target;
- si.test(t.nodeName) && !i._data(t, "changeBubbles") && (i.event.add(t, "change._change", function(n) {
- !this.parentNode || n.isSimulated || n.isTrigger || i.event.simulate("change", this.parentNode, n, !0)
- }), i._data(t, "changeBubbles", !0))
- })
- },
- handle: function(n) {
- var t = n.target;
- if (this !== t || n.isSimulated || n.isTrigger || t.type !== "radio" && t.type !== "checkbox") return n.handleObj.handler.apply(this, arguments)
- },
- teardown: function() {
- return i.event.remove(this, "._change"), !si.test(this.nodeName)
- }
- });
- r.focusinBubbles || i.each({
- focus: "focusin",
- blur: "focusout"
- }, function(n, t) {
- var r = function(n) {
- i.event.simulate(t, n.target, i.event.fix(n), !0)
- };
- i.event.special[t] = {
- setup: function() {
- var u = this.ownerDocument || this,
- f = i._data(u, t);
- f || u.addEventListener(n, r, !0);
- i._data(u, t, (f || 0) + 1)
- },
- teardown: function() {
- var u = this.ownerDocument || this,
- f = i._data(u, t) - 1;
- f ? i._data(u, t, f) : (u.removeEventListener(n, r, !0), i._removeData(u, t))
- }
- }
- });
- i.fn.extend({
- on: function(n, t, r, u, f) {
- var o, e;
- if (typeof n == "object") {
- typeof t != "string" && (r = r || t, t = undefined);
- for (o in n) this.on(o, t, r, n[o], f);
- return this
- }
- if (r == null && u == null ? (u = t, r = t = undefined) : u == null && (typeof t == "string" ? (u = r, r = undefined) : (u = r, r = t, t = undefined)), u === !1) u = it;
- else if (!u) return this;
- return f === 1 && (e = u, u = function(n) {
- return i().off(n), e.apply(this, arguments)
- }, u.guid = e.guid || (e.guid = i.guid++)), this.each(function() {
- i.event.add(this, n, u, r, t)
- })
- },
- one: function(n, t, i, r) {
- return this.on(n, t, i, r, 1)
- },
- off: function(n, t, r) {
- var u, f;
- if (n && n.preventDefault && n.handleObj) return u = n.handleObj, i(n.delegateTarget).off(u.namespace ? u.origType + "." + u.namespace : u.origType, u.selector, u.handler), this;
- if (typeof n == "object") {
- for (f in n) this.off(f, t, n[f]);
- return this
- }
- return (t === !1 || typeof t == "function") && (r = t, t = undefined), r === !1 && (r = it), this.each(function() {
- i.event.remove(this, n, r, t)
- })
- },
- trigger: function(n, t) {
- return this.each(function() {
- i.event.trigger(n, t, this)
- })
- },
- triggerHandler: function(n, t) {
- var r = this[0];
- if (r) return i.event.trigger(n, t, r, !0)
- }
- });
- var nu = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
- ce = / jQuery\d+="(?:null|\d+)"/g,
- tu = new RegExp("<(?:" + nu + ")[\\s/>]", "i"),
- hi = /^\s+/,
- iu = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
- ru = /<([\w:]+)/,
- uu = /<tbody/i,
- le = /<|&#?\w+;/,
- ae = /<(?:script|style|link)/i,
- ve = /checked\s*(?:[^=]|=\s*.checked.)/i,
- fu = /^$|\/(?:java|ecma)script/i,
- ye = /^true\/(.*)/,
- pe = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
- s = {
- option: [1, "<select multiple='multiple'>", "<\/select>"],
- legend: [1, "<fieldset>", "<\/fieldset>"],
- area: [1, "<map>", "<\/map>"],
- param: [1, "<object>", "<\/object>"],
- thead: [1, "<table>", "<\/table>"],
- tr: [2, "<table><tbody>", "<\/tbody><\/table>"],
- col: [2, "<table><tbody><\/tbody><colgroup>", "<\/colgroup><\/table>"],
- td: [3, "<table><tbody><tr>", "<\/tr><\/tbody><\/table>"],
- _default: r.htmlSerialize ? [0, "", ""] : [1, "X<div>", "<\/div>"]
- },
- we = gr(u),
- ci = we.appendChild(u.createElement("div"));
- s.optgroup = s.option;
- s.tbody = s.tfoot = s.colgroup = s.caption = s.thead;
- s.th = s.td;
- i.extend({
- clone: function(n, t, u) {
- var e, c, s, o, h, l = i.contains(n.ownerDocument, n);
- if (r.html5Clone || i.isXMLDoc(n) || !tu.test("<" + n.nodeName + ">") ? s = n.cloneNode(!0) : (ci.innerHTML = n.outerHTML, ci.removeChild(s = ci.firstChild)), (!r.noCloneEvent || !r.noCloneChecked) && (n.nodeType === 1 || n.nodeType === 11) && !i.isXMLDoc(n))
- for (e = f(s), h = f(n), o = 0;
- (c = h[o]) != null; ++o) e[o] && ke(c, e[o]);
- if (t)
- if (u)
- for (h = h || f(n), e = e || f(s), o = 0;
- (c = h[o]) != null; o++) hu(c, e[o]);
- else hu(n, s);
- return e = f(s, "script"), e.length > 0 && li(e, !l && f(n, "script")), e = h = c = null, s
- },
- buildFragment: function(n, t, u, e) {
- for (var c, o, b, h, p, w, a, k = n.length, v = gr(t), l = [], y = 0; y < k; y++)
- if (o = n[y], o || o === 0)
- if (i.type(o) === "object") i.merge(l, o.nodeType ? [o] : o);
- else if (le.test(o)) {
- for (h = h || v.appendChild(t.createElement("div")), p = (ru.exec(o) || ["", ""])[1].toLowerCase(), a = s[p] || s._default, h.innerHTML = a[1] + o.replace(iu, "<$1><\/$2>") + a[2], c = a[0]; c--;) h = h.lastChild;
- if (!r.leadingWhitespace && hi.test(o) && l.push(t.createTextNode(hi.exec(o)[0])), !r.tbody)
- for (o = p === "table" && !uu.test(o) ? h.firstChild : a[1] === "<table>" && !uu.test(o) ? h : 0, c = o && o.childNodes.length; c--;) i.nodeName(w = o.childNodes[c], "tbody") && !w.childNodes.length && o.removeChild(w);
- for (i.merge(l, h.childNodes), h.textContent = ""; h.firstChild;) h.removeChild(h.firstChild);
- h = v.lastChild
- } else l.push(t.createTextNode(o));
- for (h && v.removeChild(h), r.appendChecked || i.grep(f(l, "input"), be), y = 0; o = l[y++];)
- if ((!e || i.inArray(o, e) === -1) && (b = i.contains(o.ownerDocument, o), h = f(v.appendChild(o), "script"), b && li(h), u))
- for (c = 0; o = h[c++];) fu.test(o.type || "") && u.push(o);
- return h = null, v
- },
- cleanData: function(n, t) {
- for (var u, s, f, e, a = 0, h = i.expando, l = i.cache, v = r.deleteExpando, y = i.event.special;
- (u = n[a]) != null; a++)
- if ((t || i.acceptData(u)) && (f = u[h], e = f && l[f], e)) {
- if (e.events)
- for (s in e.events) y[s] ? i.event.remove(u, s) : i.removeEvent(u, s, e.handle);
- l[f] && (delete l[f], v ? delete u[h] : typeof u.removeAttribute !== o ? u.removeAttribute(h) : u[h] = null, c.push(f))
- }
- }
- });
- i.fn.extend({
- text: function(n) {
- return b(this, function(n) {
- return n === undefined ? i.text(this) : this.empty().append((this[0] && this[0].ownerDocument || u).createTextNode(n))
- }, null, n, arguments.length)
- },
- append: function() {
- return this.domManip(arguments, function(n) {
- if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
- var t = eu(this, n);
- t.appendChild(n)
- }
- })
- },
- prepend: function() {
- return this.domManip(arguments, function(n) {
- if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
- var t = eu(this, n);
- t.insertBefore(n, t.firstChild)
- }
- })
- },
- before: function() {
- return this.domManip(arguments, function(n) {
- this.parentNode && this.parentNode.insertBefore(n, this)
- })
- },
- after: function() {
- return this.domManip(arguments, function(n) {
- this.parentNode && this.parentNode.insertBefore(n, this.nextSibling)
- })
- },
- remove: function(n, t) {
- for (var r, e = n ? i.filter(n, this) : this, u = 0;
- (r = e[u]) != null; u++) t || r.nodeType !== 1 || i.cleanData(f(r)), r.parentNode && (t && i.contains(r.ownerDocument, r) && li(f(r, "script")), r.parentNode.removeChild(r));
- return this
- },
- empty: function() {
- for (var n, t = 0;
- (n = this[t]) != null; t++) {
- for (n.nodeType === 1 && i.cleanData(f(n, !1)); n.firstChild;) n.removeChild(n.firstChild);
- n.options && i.nodeName(n, "select") && (n.options.length = 0)
- }
- return this
- },
- clone: function(n, t) {
- return n = n == null ? !1 : n, t = t == null ? n : t, this.map(function() {
- return i.clone(this, n, t)
- })
- },
- html: function(n) {
- return b(this, function(n) {
- var t = this[0] || {},
- u = 0,
- e = this.length;
- if (n === undefined) return t.nodeType === 1 ? t.innerHTML.replace(ce, "") : undefined;
- if (typeof n == "string" && !ae.test(n) && (r.htmlSerialize || !tu.test(n)) && (r.leadingWhitespace || !hi.test(n)) && !s[(ru.exec(n) || ["", ""])[1].toLowerCase()]) {
- n = n.replace(iu, "<$1><\/$2>");
- try {
- for (; u < e; u++) t = this[u] || {}, t.nodeType === 1 && (i.cleanData(f(t, !1)), t.innerHTML = n);
- t = 0
- } catch (o) {}
- }
- t && this.empty().append(n)
- }, null, n, arguments.length)
- },
- replaceWith: function() {
- var n = arguments[0];
- return this.domManip(arguments, function(t) {
- n = this.parentNode;
- i.cleanData(f(this));
- n && n.replaceChild(t, this)
- }), n && (n.length || n.nodeType) ? this : this.remove()
- },
- detach: function(n) {
- return this.remove(n, !0)
- },
- domManip: function(n, t) {
- n = ir.apply([], n);
- var h, u, c, o, v, s, e = 0,
- l = this.length,
- p = this,
- w = l - 1,
- a = n[0],
- y = i.isFunction(a);
- if (y || l > 1 && typeof a == "string" && !r.checkClone && ve.test(a)) return this.each(function(i) {
- var r = p.eq(i);
- y && (n[0] = a.call(this, i, r.html()));
- r.domManip(n, t)
- });
- if (l && (s = i.buildFragment(n, this[0].ownerDocument, !1, this), h = s.firstChild, s.childNodes.length === 1 && (s = h), h)) {
- for (o = i.map(f(s, "script"), ou), c = o.length; e < l; e++) u = s, e !== w && (u = i.clone(u, !0, !0), c && i.merge(o, f(u, "script"))), t.call(this[e], u, e);
- if (c)
- for (v = o[o.length - 1].ownerDocument, i.map(o, su), e = 0; e < c; e++) u = o[e], fu.test(u.type || "") && !i._data(u, "globalEval") && i.contains(v, u) && (u.src ? i._evalUrl && i._evalUrl(u.src) : i.globalEval((u.text || u.textContent || u.innerHTML || "").replace(pe, "")));
- s = h = null
- }
- return this
- }
- });
- i.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
- }, function(n, t) {
- i.fn[n] = function(n) {
- for (var u, r = 0, f = [], e = i(n), o = e.length - 1; r <= o; r++) u = r === o ? this : this.clone(!0), i(e[r])[t](u), ti.apply(f, u.get());
- return this.pushStack(f)
- }
- });
- ai = {},
- function() {
- var t, i, n = u.createElement("div"),
- f = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";
- n.innerHTML = " <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>";
- t = n.getElementsByTagName("a")[0];
- t.style.cssText = "float:left;opacity:.5";
- r.opacity = /^0.5/.test(t.style.opacity);
- r.cssFloat = !!t.style.cssFloat;
- n.style.backgroundClip = "content-box";
- n.cloneNode(!0).style.backgroundClip = "";
- r.clearCloneStyle = n.style.backgroundClip === "content-box";
- t = n = null;
- r.shrinkWrapBlocks = function() {
- var t, r, n, e;
- if (i == null) {
- if (t = u.getElementsByTagName("body")[0], !t) return;
- e = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px";
- r = u.createElement("div");
- n = u.createElement("div");
- t.appendChild(r).appendChild(n);
- i = !1;
- typeof n.style.zoom !== o && (n.style.cssText = f + ";width:1px;padding:1px;zoom:1", n.innerHTML = "<div><\/div>", n.firstChild.style.width = "5px", i = n.offsetWidth !== 3);
- t.removeChild(r);
- t = r = n = null
- }
- return i
- }
- }();
- var au = /^margin/,
- yt = new RegExp("^(" + at + ")(?!px)[a-z%]+$", "i"),
- k, d, de = /^(top|right|bottom|left)$/;
- n.getComputedStyle ? (k = function(n) {
- return n.ownerDocument.defaultView.getComputedStyle(n, null)
- }, d = function(n, t, r) {
- var e, o, s, u, f = n.style;
- return r = r || k(n), u = r ? r.getPropertyValue(t) || r[t] : undefined, r && (u !== "" || i.contains(n.ownerDocument, n) || (u = i.style(n, t)), yt.test(u) && au.test(t) && (e = f.width, o = f.minWidth, s = f.maxWidth, f.minWidth = f.maxWidth = f.width = u, u = r.width, f.width = e, f.minWidth = o, f.maxWidth = s)), u === undefined ? u : u + ""
- }) : u.documentElement.currentStyle && (k = function(n) {
- return n.currentStyle
- }, d = function(n, t, i) {
- var o, f, e, r, u = n.style;
- return i = i || k(n), r = i ? i[t] : undefined, r == null && u && u[t] && (r = u[t]), yt.test(r) && !de.test(t) && (o = u.left, f = n.runtimeStyle, e = f && f.left, e && (f.left = n.currentStyle.left), u.left = t === "fontSize" ? "1em" : r, r = u.pixelLeft + "px", u.left = o, e && (f.left = e)), r === undefined ? r : r + "" || "auto"
- }),
- function() {
- function a() {
- var f, t, r = u.getElementsByTagName("body")[0];
- r && (f = u.createElement("div"), t = u.createElement("div"), f.style.cssText = l, r.appendChild(f).appendChild(t), t.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;display:block;padding:1px;border:1px;width:4px;margin-top:1%;top:1%", i.swap(r, r.style.zoom != null ? {
- zoom: 1
- } : {}, function() {
- c = t.offsetWidth === 4
- }), o = !0, s = !1, h = !0, n.getComputedStyle && (s = (n.getComputedStyle(t, null) || {}).top !== "1%", o = (n.getComputedStyle(t, null) || {
- width: "4px"
- }).width === "4px"), r.removeChild(f), t = r = null)
- }
- var f, e, c, o, s, h, t = u.createElement("div"),
- l = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px",
- v = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";
- t.innerHTML = " <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>";
- f = t.getElementsByTagName("a")[0];
- f.style.cssText = "float:left;opacity:.5";
- r.opacity = /^0.5/.test(f.style.opacity);
- r.cssFloat = !!f.style.cssFloat;
- t.style.backgroundClip = "content-box";
- t.cloneNode(!0).style.backgroundClip = "";
- r.clearCloneStyle = t.style.backgroundClip === "content-box";
- f = t = null;
- i.extend(r, {
- reliableHiddenOffsets: function() {
- if (e != null) return e;
- var i, n, f, t = u.createElement("div"),
- r = u.getElementsByTagName("body")[0];
- if (r) return t.setAttribute("className", "t"), t.innerHTML = " <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>", i = u.createElement("div"), i.style.cssText = l, r.appendChild(i).appendChild(t), t.innerHTML = "<table><tr><td><\/td><td>t<\/td><\/tr><\/table>", n = t.getElementsByTagName("td"), n[0].style.cssText = "padding:0;margin:0;border:0;display:none", f = n[0].offsetHeight === 0, n[0].style.display = "", n[1].style.display = "none", e = f && n[0].offsetHeight === 0, r.removeChild(i), t = r = null, e
- },
- boxSizing: function() {
- return c == null && a(), c
- },
- boxSizingReliable: function() {
- return o == null && a(), o
- },
- pixelPosition: function() {
- return s == null && a(), s
- },
- reliableMarginRight: function() {
- var r, f, t, i;
- if (h == null && n.getComputedStyle) {
- if (r = u.getElementsByTagName("body")[0], !r) return;
- f = u.createElement("div");
- t = u.createElement("div");
- f.style.cssText = l;
- r.appendChild(f).appendChild(t);
- i = t.appendChild(u.createElement("div"));
- i.style.cssText = t.style.cssText = v;
- i.style.marginRight = i.style.width = "0";
- t.style.width = "1px";
- h = !parseFloat((n.getComputedStyle(i, null) || {}).marginRight);
- r.removeChild(f)
- }
- return h
- }
- })
- }();
- i.swap = function(n, t, i, r) {
- var f, u, e = {};
- for (u in t) e[u] = n.style[u], n.style[u] = t[u];
- f = i.apply(n, r || []);
- for (u in t) n.style[u] = e[u];
- return f
- };
- var vi = /alpha\([^)]*\)/i,
- ge = /opacity\s*=\s*([^)]*)/,
- no = /^(none|table(?!-c[ea]).+)/,
- to = new RegExp("^(" + at + ")(.*)$", "i"),
- io = new RegExp("^([+-])=(" + at + ")", "i"),
- ro = {
- position: "absolute",
- visibility: "hidden",
- display: "block"
- },
- yu = {
- letterSpacing: 0,
- fontWeight: 400
- },
- pu = ["Webkit", "O", "Moz", "ms"];
- i.extend({
- cssHooks: {
- opacity: {
- get: function(n, t) {
- if (t) {
- var i = d(n, "opacity");
- return i === "" ? "1" : i
- }
- }
- }
- },
- cssNumber: {
- columnCount: !0,
- fillOpacity: !0,
- fontWeight: !0,
- lineHeight: !0,
- opacity: !0,
- order: !0,
- orphans: !0,
- widows: !0,
- zIndex: !0,
- zoom: !0
- },
- cssProps: {
- float: r.cssFloat ? "cssFloat" : "styleFloat"
- },
- style: function(n, t, u, f) {
- if (n && n.nodeType !== 3 && n.nodeType !== 8 && n.style) {
- var o, c, e, s = i.camelCase(t),
- h = n.style;
- if (t = i.cssProps[s] || (i.cssProps[s] = wu(h, s)), e = i.cssHooks[t] || i.cssHooks[s], u !== undefined) {
- if (c = typeof u, c === "string" && (o = io.exec(u)) && (u = (o[1] + 1) * o[2] + parseFloat(i.css(n, t)), c = "number"), u == null || u !== u) return;
- if (c !== "number" || i.cssNumber[s] || (u += "px"), r.clearCloneStyle || u !== "" || t.indexOf("background") !== 0 || (h[t] = "inherit"), !e || !("set" in e) || (u = e.set(n, u, f)) !== undefined) try {
- h[t] = "";
- h[t] = u
- } catch (l) {}
- } else return e && "get" in e && (o = e.get(n, !1, f)) !== undefined ? o : h[t]
- }
- },
- css: function(n, t, r, u) {
- var s, f, e, o = i.camelCase(t);
- return (t = i.cssProps[o] || (i.cssProps[o] = wu(n.style, o)), e = i.cssHooks[t] || i.cssHooks[o], e && "get" in e && (f = e.get(n, !0, r)), f === undefined && (f = d(n, t, u)), f === "normal" && t in yu && (f = yu[t]), r === "" || r) ? (s = parseFloat(f), r === !0 || i.isNumeric(s) ? s || 0 : f) : f
- }
- });
- i.each(["height", "width"], function(n, t) {
- i.cssHooks[t] = {
- get: function(n, r, u) {
- if (r) return n.offsetWidth === 0 && no.test(i.css(n, "display")) ? i.swap(n, ro, function() {
- return gu(n, t, u)
- }) : gu(n, t, u)
- },
- set: function(n, u, f) {
- var e = f && k(n);
- return ku(n, u, f ? du(n, t, f, r.boxSizing() && i.css(n, "boxSizing", !1, e) === "border-box", e) : 0)
- }
- }
- });
- r.opacity || (i.cssHooks.opacity = {
- get: function(n, t) {
- return ge.test((t && n.currentStyle ? n.currentStyle.filter : n.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : t ? "1" : ""
- },
- set: function(n, t) {
- var r = n.style,
- u = n.currentStyle,
- e = i.isNumeric(t) ? "alpha(opacity=" + t * 100 + ")" : "",
- f = u && u.filter || r.filter || "";
- (r.zoom = 1, (t >= 1 || t === "") && i.trim(f.replace(vi, "")) === "" && r.removeAttribute && (r.removeAttribute("filter"), t === "" || u && !u.filter)) || (r.filter = vi.test(f) ? f.replace(vi, e) : f + " " + e)
- }
- });
- i.cssHooks.marginRight = vu(r.reliableMarginRight, function(n, t) {
- if (t) return i.swap(n, {
- display: "inline-block"
- }, d, [n, "marginRight"])
- });
- i.each({
- margin: "",
- padding: "",
- border: "Width"
- }, function(n, t) {
- i.cssHooks[n + t] = {
- expand: function(i) {
- for (var r = 0, f = {}, u = typeof i == "string" ? i.split(" ") : [i]; r < 4; r++) f[n + w[r] + t] = u[r] || u[r - 2] || u[0];
- return f
- }
- };
- au.test(n) || (i.cssHooks[n + t].set = ku)
- });
- i.fn.extend({
- css: function(n, t) {
- return b(this, function(n, t, r) {
- var f, e, o = {},
- u = 0;
- if (i.isArray(t)) {
- for (f = k(n), e = t.length; u < e; u++) o[t[u]] = i.css(n, t[u], !1, f);
- return o
- }
- return r !== undefined ? i.style(n, t, r) : i.css(n, t)
- }, n, t, arguments.length > 1)
- },
- show: function() {
- return bu(this, !0)
- },
- hide: function() {
- return bu(this)
- },
- toggle: function(n) {
- return typeof n == "boolean" ? n ? this.show() : this.hide() : this.each(function() {
- et(this) ? i(this).show() : i(this).hide()
- })
- }
- });
- i.Tween = e;
- e.prototype = {
- constructor: e,
- init: function(n, t, r, u, f, e) {
- this.elem = n;
- this.prop = r;
- this.easing = f || "swing";
- this.options = t;
- this.start = this.now = this.cur();
- this.end = u;
- this.unit = e || (i.cssNumber[r] ? "" : "px")
- },
- cur: function() {
- var n = e.propHooks[this.prop];
- return n && n.get ? n.get(this) : e.propHooks._default.get(this)
- },
- run: function(n) {
- var t, r = e.propHooks[this.prop];
- return this.pos = this.options.duration ? t = i.easing[this.easing](n, this.options.duration * n, 0, 1, this.options.duration) : t = n, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), r && r.set ? r.set(this) : e.propHooks._default.set(this), this
- }
- };
- e.prototype.init.prototype = e.prototype;
- e.propHooks = {
- _default: {
- get: function(n) {
- var t;
- return n.elem[n.prop] != null && (!n.elem.style || n.elem.style[n.prop] == null) ? n.elem[n.prop] : (t = i.css(n.elem, n.prop, ""), !t || t === "auto" ? 0 : t)
- },
- set: function(n) {
- i.fx.step[n.prop] ? i.fx.step[n.prop](n) : n.elem.style && (n.elem.style[i.cssProps[n.prop]] != null || i.cssHooks[n.prop]) ? i.style(n.elem, n.prop, n.now + n.unit) : n.elem[n.prop] = n.now
- }
- }
- };
- e.propHooks.scrollTop = e.propHooks.scrollLeft = {
- set: function(n) {
- n.elem.nodeType && n.elem.parentNode && (n.elem[n.prop] = n.now)
- }
- };
- i.easing = {
- linear: function(n) {
- return n
- },
- swing: function(n) {
- return .5 - Math.cos(n * Math.PI) / 2
- }
- };
- i.fx = e.prototype.init;
- i.fx.step = {};
- var rt, pt, uo = /^(?:toggle|show|hide)$/,
- nf = new RegExp("^(?:([+-])=|)(" + at + ")([a-z%]*)$", "i"),
- fo = /queueHooks$/,
- wt = [eo],
- st = {
- "*": [function(n, t) {
- var f = this.createTween(n, t),
- s = f.cur(),
- u = nf.exec(t),
- e = u && u[3] || (i.cssNumber[n] ? "" : "px"),
- r = (i.cssNumber[n] || e !== "px" && +s) && nf.exec(i.css(f.elem, n)),
- o = 1,
- h = 20;
- if (r && r[3] !== e) {
- e = e || r[3];
- u = u || [];
- r = +s || 1;
- do o = o || ".5", r = r / o, i.style(f.elem, n, r + e); while (o !== (o = f.cur() / s) && o !== 1 && --h)
- }
- return u && (r = f.start = +r || +s || 0, f.unit = e, f.end = u[1] ? r + (u[1] + 1) * u[2] : +u[2]), f
- }]
- };
- i.Animation = i.extend(uf, {
- tweener: function(n, t) {
- i.isFunction(n) ? (t = n, n = ["*"]) : n = n.split(" ");
- for (var r, u = 0, f = n.length; u < f; u++) r = n[u], st[r] = st[r] || [], st[r].unshift(t)
- },
- prefilter: function(n, t) {
- t ? wt.unshift(n) : wt.push(n)
- }
- });
- i.speed = function(n, t, r) {
- var u = n && typeof n == "object" ? i.extend({}, n) : {
- complete: r || !r && t || i.isFunction(n) && n,
- duration: n,
- easing: r && t || t && !i.isFunction(t) && t
- };
- return u.duration = i.fx.off ? 0 : typeof u.duration == "number" ? u.duration : u.duration in i.fx.speeds ? i.fx.speeds[u.duration] : i.fx.speeds._default, (u.queue == null || u.queue === !0) && (u.queue = "fx"), u.old = u.complete, u.complete = function() {
- i.isFunction(u.old) && u.old.call(this);
- u.queue && i.dequeue(this, u.queue)
- }, u
- };
- i.fn.extend({
- fadeTo: function(n, t, i, r) {
- return this.filter(et).css("opacity", 0).show().end().animate({
- opacity: t
- }, n, i, r)
- },
- animate: function(n, t, r, u) {
- var o = i.isEmptyObject(n),
- e = i.speed(t, r, u),
- f = function() {
- var t = uf(this, i.extend({}, n), e);
- (o || i._data(this, "finish")) && t.stop(!0)
- };
- return f.finish = f, o || e.queue === !1 ? this.each(f) : this.queue(e.queue, f)
- },
- stop: function(n, t, r) {
- var u = function(n) {
- var t = n.stop;
- delete n.stop;
- t(r)
- };
- return typeof n != "string" && (r = t, t = n, n = undefined), t && n !== !1 && this.queue(n || "fx", []), this.each(function() {
- var o = !0,
- t = n != null && n + "queueHooks",
- e = i.timers,
- f = i._data(this);
- if (t) f[t] && f[t].stop && u(f[t]);
- else
- for (t in f) f[t] && f[t].stop && fo.test(t) && u(f[t]);
- for (t = e.length; t--;) e[t].elem === this && (n == null || e[t].queue === n) && (e[t].anim.stop(r), o = !1, e.splice(t, 1));
- (o || !r) && i.dequeue(this, n)
- })
- },
- finish: function(n) {
- return n !== !1 && (n = n || "fx"), this.each(function() {
- var t, f = i._data(this),
- r = f[n + "queue"],
- e = f[n + "queueHooks"],
- u = i.timers,
- o = r ? r.length : 0;
- for (f.finish = !0, i.queue(this, n, []), e && e.stop && e.stop.call(this, !0), t = u.length; t--;) u[t].elem === this && u[t].queue === n && (u[t].anim.stop(!0), u.splice(t, 1));
- for (t = 0; t < o; t++) r[t] && r[t].finish && r[t].finish.call(this);
- delete f.finish
- })
- }
- });
- i.each(["toggle", "show", "hide"], function(n, t) {
- var r = i.fn[t];
- i.fn[t] = function(n, i, u) {
- return n == null || typeof n == "boolean" ? r.apply(this, arguments) : this.animate(bt(t, !0), n, i, u)
- }
- });
- i.each({
- slideDown: bt("show"),
- slideUp: bt("hide"),
- slideToggle: bt("toggle"),
- fadeIn: {
- opacity: "show"
- },
- fadeOut: {
- opacity: "hide"
- },
- fadeToggle: {
- opacity: "toggle"
- }
- }, function(n, t) {
- i.fn[n] = function(n, i, r) {
- return this.animate(t, n, i, r)
- }
- });
- i.timers = [];
- i.fx.tick = function() {
- var r, n = i.timers,
- t = 0;
- for (rt = i.now(); t < n.length; t++) r = n[t], r() || n[t] !== r || n.splice(t--, 1);
- n.length || i.fx.stop();
- rt = undefined
- };
- i.fx.timer = function(n) {
- i.timers.push(n);
- n() ? i.fx.start() : i.timers.pop()
- };
- i.fx.interval = 13;
- i.fx.start = function() {
- pt || (pt = setInterval(i.fx.tick, i.fx.interval))
- };
- i.fx.stop = function() {
- clearInterval(pt);
- pt = null
- };
- i.fx.speeds = {
- slow: 600,
- fast: 200,
- _default: 400
- };
- i.fn.delay = function(n, t) {
- return n = i.fx ? i.fx.speeds[n] || n : n, t = t || "fx", this.queue(t, function(t, i) {
- var r = setTimeout(t, n);
- i.stop = function() {
- clearTimeout(r)
- }
- })
- },
- function() {
- var i, n, f, e, t = u.createElement("div");
- t.setAttribute("className", "t");
- t.innerHTML = " <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>";
- i = t.getElementsByTagName("a")[0];
- f = u.createElement("select");
- e = f.appendChild(u.createElement("option"));
- n = t.getElementsByTagName("input")[0];
- i.style.cssText = "top:1px";
- r.getSetAttribute = t.className !== "t";
- r.style = /top/.test(i.getAttribute("style"));
- r.hrefNormalized = i.getAttribute("href") === "/a";
- r.checkOn = !!n.value;
- r.optSelected = e.selected;
- r.enctype = !!u.createElement("form").enctype;
- f.disabled = !0;
- r.optDisabled = !e.disabled;
- n = u.createElement("input");
- n.setAttribute("value", "");
- r.input = n.getAttribute("value") === "";
- n.value = "t";
- n.setAttribute("type", "radio");
- r.radioValue = n.value === "t";
- i = n = f = e = t = null
- }();
- ff = /\r/g;
- i.fn.extend({
- val: function(n) {
- var t, r, f, u = this[0];
- return arguments.length ? (f = i.isFunction(n), this.each(function(r) {
- var u;
- this.nodeType === 1 && (u = f ? n.call(this, r, i(this).val()) : n, u == null ? u = "" : typeof u == "number" ? u += "" : i.isArray(u) && (u = i.map(u, function(n) {
- return n == null ? "" : n + ""
- })), t = i.valHooks[this.type] || i.valHooks[this.nodeName.toLowerCase()], t && "set" in t && t.set(this, u, "value") !== undefined || (this.value = u))
- })) : u ? (t = i.valHooks[u.type] || i.valHooks[u.nodeName.toLowerCase()], t && "get" in t && (r = t.get(u, "value")) !== undefined) ? r : (r = u.value, typeof r == "string" ? r.replace(ff, "") : r == null ? "" : r) : void 0
- }
- });
- i.extend({
- valHooks: {
- option: {
- get: function(n) {
- var t = i.find.attr(n, "value");
- return t != null ? t : i.text(n)
- }
- },
- select: {
- get: function(n) {
- for (var o, t, s = n.options, u = n.selectedIndex, f = n.type === "select-one" || u < 0, h = f ? null : [], c = f ? u + 1 : s.length, e = u < 0 ? c : f ? u : 0; e < c; e++)
- if (t = s[e], (t.selected || e === u) && (r.optDisabled ? !t.disabled : t.getAttribute("disabled") === null) && (!t.parentNode.disabled || !i.nodeName(t.parentNode, "optgroup"))) {
- if (o = i(t).val(), f) return o;
- h.push(o)
- }
- return h
- },
- set: function(n, t) {
- for (var f, r, u = n.options, o = i.makeArray(t), e = u.length; e--;)
- if (r = u[e], i.inArray(i.valHooks.option.get(r), o) >= 0) try {
- r.selected = f = !0
- } catch (s) {
- r.scrollHeight
- } else r.selected = !1;
- return f || (n.selectedIndex = -1), u
- }
- }
- }
- });
- i.each(["radio", "checkbox"], function() {
- i.valHooks[this] = {
- set: function(n, t) {
- if (i.isArray(t)) return n.checked = i.inArray(i(n).val(), t) >= 0
- }
- };
- r.checkOn || (i.valHooks[this].get = function(n) {
- return n.getAttribute("value") === null ? "on" : n.value
- })
- });
- var ut, ef, v = i.expr.attrHandle,
- yi = /^(?:checked|selected)$/i,
- g = r.getSetAttribute,
- kt = r.input;
- i.fn.extend({
- attr: function(n, t) {
- return b(this, i.attr, n, t, arguments.length > 1)
- },
- removeAttr: function(n) {
- return this.each(function() {
- i.removeAttr(this, n)
- })
- }
- });
- i.extend({
- attr: function(n, t, r) {
- var u, f, e = n.nodeType;
- if (n && e !== 3 && e !== 8 && e !== 2) {
- if (typeof n.getAttribute === o) return i.prop(n, t, r);
- if (e === 1 && i.isXMLDoc(n) || (t = t.toLowerCase(), u = i.attrHooks[t] || (i.expr.match.bool.test(t) ? ef : ut)), r !== undefined)
- if (r === null) i.removeAttr(n, t);
- else return u && "set" in u && (f = u.set(n, r, t)) !== undefined ? f : (n.setAttribute(t, r + ""), r);
- else return u && "get" in u && (f = u.get(n, t)) !== null ? f : (f = i.find.attr(n, t), f == null ? undefined : f)
- }
- },
- removeAttr: function(n, t) {
- var r, u, e = 0,
- f = t && t.match(h);
- if (f && n.nodeType === 1)
- while (r = f[e++]) u = i.propFix[r] || r, i.expr.match.bool.test(r) ? kt && g || !yi.test(r) ? n[u] = !1 : n[i.camelCase("default-" + r)] = n[u] = !1 : i.attr(n, r, ""), n.removeAttribute(g ? r : u)
- },
- attrHooks: {
- type: {
- set: function(n, t) {
- if (!r.radioValue && t === "radio" && i.nodeName(n, "input")) {
- var u = n.value;
- return n.setAttribute("type", t), u && (n.value = u), t
- }
- }
- }
- }
- });
- ef = {
- set: function(n, t, r) {
- return t === !1 ? i.removeAttr(n, r) : kt && g || !yi.test(r) ? n.setAttribute(!g && i.propFix[r] || r, r) : n[i.camelCase("default-" + r)] = n[r] = !0, r
- }
- };
- i.each(i.expr.match.bool.source.match(/\w+/g), function(n, t) {
- var r = v[t] || i.find.attr;
- v[t] = kt && g || !yi.test(t) ? function(n, t, i) {
- var u, f;
- return i || (f = v[t], v[t] = u, u = r(n, t, i) != null ? t.toLowerCase() : null, v[t] = f), u
- } : function(n, t, r) {
- if (!r) return n[i.camelCase("default-" + t)] ? t.toLowerCase() : null
- }
- });
- kt && g || (i.attrHooks.value = {
- set: function(n, t, r) {
- if (i.nodeName(n, "input")) n.defaultValue = t;
- else return ut && ut.set(n, t, r)
- }
- });
- g || (ut = {
- set: function(n, t, i) {
- var r = n.getAttributeNode(i);
- return r || n.setAttributeNode(r = n.ownerDocument.createAttribute(i)), r.value = t += "", i === "value" || t === n.getAttribute(i) ? t : void 0
- }
- }, v.id = v.name = v.coords = function(n, t, i) {
- var r;
- if (!i) return (r = n.getAttributeNode(t)) && r.value !== "" ? r.value : null
- }, i.valHooks.button = {
- get: function(n, t) {
- var i = n.getAttributeNode(t);
- if (i && i.specified) return i.value
- },
- set: ut.set
- }, i.attrHooks.contenteditable = {
- set: function(n, t, i) {
- ut.set(n, t === "" ? !1 : t, i)
- }
- }, i.each(["width", "height"], function(n, t) {
- i.attrHooks[t] = {
- set: function(n, i) {
- if (i === "") return n.setAttribute(t, "auto"), i
- }
- }
- }));
- r.style || (i.attrHooks.style = {
- get: function(n) {
- return n.style.cssText || undefined
- },
- set: function(n, t) {
- return n.style.cssText = t + ""
- }
- });
- of = /^(?:input|select|textarea|button|object)$/i;
- sf = /^(?:a|area)$/i;
- i.fn.extend({
- prop: function(n, t) {
- return b(this, i.prop, n, t, arguments.length > 1)
- },
- removeProp: function(n) {
- return n = i.propFix[n] || n, this.each(function() {
- try {
- this[n] = undefined;
- delete this[n]
- } catch (t) {}
- })
- }
- });
- i.extend({
- propFix: {
- "for": "htmlFor",
- "class": "className"
- },
- prop: function(n, t, r) {
- var f, u, o, e = n.nodeType;
- if (n && e !== 3 && e !== 8 && e !== 2) return o = e !== 1 || !i.isXMLDoc(n), o && (t = i.propFix[t] || t, u = i.propHooks[t]), r !== undefined ? u && "set" in u && (f = u.set(n, r, t)) !== undefined ? f : n[t] = r : u && "get" in u && (f = u.get(n, t)) !== null ? f : n[t]
- },
- propHooks: {
- tabIndex: {
- get: function(n) {
- var t = i.find.attr(n, "tabindex");
- return t ? parseInt(t, 10) : of.test(n.nodeName) || sf.test(n.nodeName) && n.href ? 0 : -1
- }
- }
- }
- });
- r.hrefNormalized || i.each(["href", "src"], function(n, t) {
- i.propHooks[t] = {
- get: function(n) {
- return n.getAttribute(t, 4)
- }
- }
- });
- r.optSelected || (i.propHooks.selected = {
- get: function(n) {
- var t = n.parentNode;
- return t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex), null
- }
- });
- i.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() {
- i.propFix[this.toLowerCase()] = this
- });
- r.enctype || (i.propFix.enctype = "encoding");
- dt = /[\t\r\n\f]/g;
- i.fn.extend({
- addClass: function(n) {
- var o, t, r, u, s, f, e = 0,
- c = this.length,
- l = typeof n == "string" && n;
- if (i.isFunction(n)) return this.each(function(t) {
- i(this).addClass(n.call(this, t, this.className))
- });
- if (l)
- for (o = (n || "").match(h) || []; e < c; e++)
- if (t = this[e], r = t.nodeType === 1 && (t.className ? (" " + t.className + " ").replace(dt, " ") : " "), r) {
- for (s = 0; u = o[s++];) r.indexOf(" " + u + " ") < 0 && (r += u + " ");
- f = i.trim(r);
- t.className !== f && (t.className = f)
- }
- return this
- },
- removeClass: function(n) {
- var o, t, r, u, s, f, e = 0,
- c = this.length,
- l = arguments.length === 0 || typeof n == "string" && n;
- if (i.isFunction(n)) return this.each(function(t) {
- i(this).removeClass(n.call(this, t, this.className))
- });
- if (l)
- for (o = (n || "").match(h) || []; e < c; e++)
- if (t = this[e], r = t.nodeType === 1 && (t.className ? (" " + t.className + " ").replace(dt, " ") : ""), r) {
- for (s = 0; u = o[s++];)
- while (r.indexOf(" " + u + " ") >= 0) r = r.replace(" " + u + " ", " ");
- f = n ? i.trim(r) : "";
- t.className !== f && (t.className = f)
- }
- return this
- },
- toggleClass: function(n, t) {
- var r = typeof n;
- return typeof t == "boolean" && r === "string" ? t ? this.addClass(n) : this.removeClass(n) : i.isFunction(n) ? this.each(function(r) {
- i(this).toggleClass(n.call(this, r, this.className, t), t)
- }) : this.each(function() {
- if (r === "string")
- for (var t, f = 0, u = i(this), e = n.match(h) || []; t = e[f++];) u.hasClass(t) ? u.removeClass(t) : u.addClass(t);
- else(r === o || r === "boolean") && (this.className && i._data(this, "__className__", this.className), this.className = this.className || n === !1 ? "" : i._data(this, "__className__") || "")
- })
- },
- hasClass: function(n) {
- for (var i = " " + n + " ", t = 0, r = this.length; t < r; t++)
- if (this[t].nodeType === 1 && (" " + this[t].className + " ").replace(dt, " ").indexOf(i) >= 0) return !0;
- return !1
- }
- });
- i.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function(n, t) {
- i.fn[t] = function(n, i) {
- return arguments.length > 0 ? this.on(t, null, n, i) : this.trigger(t)
- }
- });
- i.fn.extend({
- hover: function(n, t) {
- return this.mouseenter(n).mouseleave(t || n)
- },
- bind: function(n, t, i) {
- return this.on(n, null, t, i)
- },
- unbind: function(n, t) {
- return this.off(n, null, t)
- },
- delegate: function(n, t, i, r) {
- return this.on(t, n, i, r)
- },
- undelegate: function(n, t, i) {
- return arguments.length === 1 ? this.off(n, "**") : this.off(t, n || "**", i)
- }
- });
- var pi = i.now(),
- wi = /\?/,
- so = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
- i.parseJSON = function(t) {
- if (n.JSON && n.JSON.parse) return n.JSON.parse(t + "");
- var f, r = null,
- u = i.trim(t + "");
- return u && !i.trim(u.replace(so, function(n, t, i, u) {
- return (f && t && (r = 0), r === 0) ? n : (f = i || t, r += !u - !i, "")
- })) ? Function("return " + u)() : i.error("Invalid JSON: " + t)
- };
- i.parseXML = function(t) {
- var r, u;
- if (!t || typeof t != "string") return null;
- try {
- n.DOMParser ? (u = new DOMParser, r = u.parseFromString(t, "text/xml")) : (r = new ActiveXObject("Microsoft.XMLDOM"), r.async = "false", r.loadXML(t))
- } catch (f) {
- r = undefined
- }
- return r && r.documentElement && !r.getElementsByTagName("parsererror").length || i.error("Invalid XML: " + t), r
- };
- var nt, y, ho = /#.*$/,
- hf = /([?&])_=[^&]*/,
- co = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg,
- lo = /^(?:GET|HEAD)$/,
- ao = /^\/\//,
- cf = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
- lf = {},
- bi = {},
- af = "*/".concat("*");
- try {
- y = location.href
- } catch (ts) {
- y = u.createElement("a");
- y.href = "";
- y = y.href
- }
- nt = cf.exec(y.toLowerCase()) || [];
- i.extend({
- active: 0,
- lastModified: {},
- etag: {},
- ajaxSettings: {
- url: y,
- type: "GET",
- isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(nt[1]),
- global: !0,
- processData: !0,
- async: !0,
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- accepts: {
- "*": af,
- text: "text/plain",
- html: "text/html",
- xml: "application/xml, text/xml",
- json: "application/json, text/javascript"
- },
- contents: {
- xml: /xml/,
- html: /html/,
- json: /json/
- },
- responseFields: {
- xml: "responseXML",
- text: "responseText",
- json: "responseJSON"
- },
- converters: {
- "* text": String,
- "text html": !0,
- "text json": i.parseJSON,
- "text xml": i.parseXML
- },
- flatOptions: {
- url: !0,
- context: !0
- }
- },
- ajaxSetup: function(n, t) {
- return t ? ki(ki(n, i.ajaxSettings), t) : ki(i.ajaxSettings, n)
- },
- ajaxPrefilter: vf(lf),
- ajaxTransport: vf(bi),
- ajax: function(n, t) {
- function w(n, t, s, h) {
- var v, it, nt, y, w, c = t;
- e !== 2 && (e = 2, k && clearTimeout(k), l = undefined, b = h || "", u.readyState = n > 0 ? 4 : 0, v = n >= 200 && n < 300 || n === 304, s && (y = vo(r, u, s)), y = yo(r, y, u, v), v ? (r.ifModified && (w = u.getResponseHeader("Last-Modified"), w && (i.lastModified[f] = w), w = u.getResponseHeader("etag"), w && (i.etag[f] = w)), n === 204 || r.type === "HEAD" ? c = "nocontent" : n === 304 ? c = "notmodified" : (c = y.state, it = y.data, nt = y.error, v = !nt)) : (nt = c, (n || !c) && (c = "error", n < 0 && (n = 0))), u.status = n, u.statusText = (t || c) + "", v ? g.resolveWith(o, [it, c, u]) : g.rejectWith(o, [u, c, nt]), u.statusCode(p), p = undefined, a && d.trigger(v ? "ajaxSuccess" : "ajaxError", [u, r, v ? it : nt]), tt.fireWith(o, [u, c]), a && (d.trigger("ajaxComplete", [u, r]), --i.active || i.event.trigger("ajaxStop")))
- }
- typeof n == "object" && (t = n, n = undefined);
- t = t || {};
- var s, c, f, b, k, a, l, v, r = i.ajaxSetup({}, t),
- o = r.context || r,
- d = r.context && (o.nodeType || o.jquery) ? i(o) : i.event,
- g = i.Deferred(),
- tt = i.Callbacks("once memory"),
- p = r.statusCode || {},
- it = {},
- rt = {},
- e = 0,
- ut = "canceled",
- u = {
- readyState: 0,
- getResponseHeader: function(n) {
- var t;
- if (e === 2) {
- if (!v)
- for (v = {}; t = co.exec(b);) v[t[1].toLowerCase()] = t[2];
- t = v[n.toLowerCase()]
- }
- return t == null ? null : t
- },
- getAllResponseHeaders: function() {
- return e === 2 ? b : null
- },
- setRequestHeader: function(n, t) {
- var i = n.toLowerCase();
- return e || (n = rt[i] = rt[i] || n, it[n] = t), this
- },
- overrideMimeType: function(n) {
- return e || (r.mimeType = n), this
- },
- statusCode: function(n) {
- var t;
- if (n)
- if (e < 2)
- for (t in n) p[t] = [p[t], n[t]];
- else u.always(n[u.status]);
- return this
- },
- abort: function(n) {
- var t = n || ut;
- return l && l.abort(t), w(0, t), this
- }
- };
- if (g.promise(u).complete = tt.add, u.success = u.done, u.error = u.fail, r.url = ((n || r.url || y) + "").replace(ho, "").replace(ao, nt[1] + "//"), r.type = t.method || t.type || r.method || r.type, r.dataTypes = i.trim(r.dataType || "*").toLowerCase().match(h) || [""], r.crossDomain == null && (s = cf.exec(r.url.toLowerCase()), r.crossDomain = !!(s && (s[1] !== nt[1] || s[2] !== nt[2] || (s[3] || (s[1] === "http:" ? "80" : "443")) !== (nt[3] || (nt[1] === "http:" ? "80" : "443"))))), r.data && r.processData && typeof r.data != "string" && (r.data = i.param(r.data, r.traditional)), yf(lf, r, t, u), e === 2) return u;
- a = r.global;
- a && i.active++ == 0 && i.event.trigger("ajaxStart");
- r.type = r.type.toUpperCase();
- r.hasContent = !lo.test(r.type);
- f = r.url;
- r.hasContent || (r.data && (f = r.url += (wi.test(f) ? "&" : "?") + r.data, delete r.data), r.cache === !1 && (r.url = hf.test(f) ? f.replace(hf, "$1_=" + pi++) : f + (wi.test(f) ? "&" : "?") + "_=" + pi++));
- r.ifModified && (i.lastModified[f] && u.setRequestHeader("If-Modified-Since", i.lastModified[f]), i.etag[f] && u.setRequestHeader("If-None-Match", i.etag[f]));
- (r.data && r.hasContent && r.contentType !== !1 || t.contentType) && u.setRequestHeader("Content-Type", r.contentType);
- u.setRequestHeader("Accept", r.dataTypes[0] && r.accepts[r.dataTypes[0]] ? r.accepts[r.dataTypes[0]] + (r.dataTypes[0] !== "*" ? ", " + af + "; q=0.01" : "") : r.accepts["*"]);
- for (c in r.headers) u.setRequestHeader(c, r.headers[c]);
- if (r.beforeSend && (r.beforeSend.call(o, u, r) === !1 || e === 2)) return u.abort();
- ut = "abort";
- for (c in {
- success: 1,
- error: 1,
- complete: 1
- }) u[c](r[c]);
- if (l = yf(bi, r, t, u), l) {
- u.readyState = 1;
- a && d.trigger("ajaxSend", [u, r]);
- r.async && r.timeout > 0 && (k = setTimeout(function() {
- u.abort("timeout")
- }, r.timeout));
- try {
- e = 1;
- l.send(it, w)
- } catch (ft) {
- if (e < 2) w(-1, ft);
- else throw ft;
- }
- } else w(-1, "No Transport");
- return u
- },
- getJSON: function(n, t, r) {
- return i.get(n, t, r, "json")
- },
- getScript: function(n, t) {
- return i.get(n, undefined, t, "script")
- }
- });
- i.each(["get", "post"], function(n, t) {
- i[t] = function(n, r, u, f) {
- return i.isFunction(r) && (f = f || u, u = r, r = undefined), i.ajax({
- url: n,
- type: t,
- dataType: f,
- data: r,
- success: u
- })
- }
- });
- i.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(n, t) {
- i.fn[t] = function(n) {
- return this.on(t, n)
- }
- });
- i._evalUrl = function(n) {
- return i.ajax({
- url: n,
- type: "GET",
- dataType: "script",
- async: !1,
- global: !1,
- throws: !0
- })
- };
- i.fn.extend({
- wrapAll: function(n) {
- if (i.isFunction(n)) return this.each(function(t) {
- i(this).wrapAll(n.call(this, t))
- });
- if (this[0]) {
- var t = i(n, this[0].ownerDocument).eq(0).clone(!0);
- this[0].parentNode && t.insertBefore(this[0]);
- t.map(function() {
- for (var n = this; n.firstChild && n.firstChild.nodeType === 1;) n = n.firstChild;
- return n
- }).append(this)
- }
- return this
- },
- wrapInner: function(n) {
- return i.isFunction(n) ? this.each(function(t) {
- i(this).wrapInner(n.call(this, t))
- }) : this.each(function() {
- var t = i(this),
- r = t.contents();
- r.length ? r.wrapAll(n) : t.append(n)
- })
- },
- wrap: function(n) {
- var t = i.isFunction(n);
- return this.each(function(r) {
- i(this).wrapAll(t ? n.call(this, r) : n)
- })
- },
- unwrap: function() {
- return this.parent().each(function() {
- i.nodeName(this, "body") || i(this).replaceWith(this.childNodes)
- }).end()
- }
- });
- i.expr.filters.hidden = function(n) {
- return n.offsetWidth <= 0 && n.offsetHeight <= 0 || !r.reliableHiddenOffsets() && (n.style && n.style.display || i.css(n, "display")) === "none"
- };
- i.expr.filters.visible = function(n) {
- return !i.expr.filters.hidden(n)
- };
- var po = /%20/g,
- wo = /\[\]$/,
- pf = /\r?\n/g,
- bo = /^(?:submit|button|image|reset|file)$/i,
- ko = /^(?:input|select|textarea|keygen)/i;
- i.param = function(n, t) {
- var r, u = [],
- f = function(n, t) {
- t = i.isFunction(t) ? t() : t == null ? "" : t;
- u[u.length] = encodeURIComponent(n) + "=" + encodeURIComponent(t)
- };
- if (t === undefined && (t = i.ajaxSettings && i.ajaxSettings.traditional), i.isArray(n) || n.jquery && !i.isPlainObject(n)) i.each(n, function() {
- f(this.name, this.value)
- });
- else
- for (r in n) di(r, n[r], t, f);
- return u.join("&").replace(po, "+")
- };
- i.fn.extend({
- serialize: function() {
- return i.param(this.serializeArray())
- },
- serializeArray: function() {
- return this.map(function() {
- var n = i.prop(this, "elements");
- return n ? i.makeArray(n) : this
- }).filter(function() {
- var n = this.type;
- return this.name && !i(this).is(":disabled") && ko.test(this.nodeName) && !bo.test(n) && (this.checked || !oi.test(n))
- }).map(function(n, t) {
- var r = i(this).val();
- return r == null ? null : i.isArray(r) ? i.map(r, function(n) {
- return {
- name: t.name,
- value: n.replace(pf, "\r\n")
- }
- }) : {
- name: t.name,
- value: r.replace(pf, "\r\n")
- }
- }).get()
- }
- });
- i.ajaxSettings.xhr = n.ActiveXObject !== undefined ? function() {
- return !this.isLocal && /^(get|post|head|put|delete|options)$/i.test(this.type) && wf() || ns()
- } : wf;
- var go = 0,
- gt = {},
- ht = i.ajaxSettings.xhr();
- if (n.ActiveXObject) i(n).on("unload", function() {
- for (var n in gt) gt[n](undefined, !0)
- });
- return r.cors = !!ht && "withCredentials" in ht, ht = r.ajax = !!ht, ht && i.ajaxTransport(function(n) {
- if (!n.crossDomain || r.cors) {
- var t;
- return {
- send: function(r, u) {
- var e, f = n.xhr(),
- o = ++go;
- if (f.open(n.type, n.url, n.async, n.username, n.password), n.xhrFields)
- for (e in n.xhrFields) f[e] = n.xhrFields[e];
- n.mimeType && f.overrideMimeType && f.overrideMimeType(n.mimeType);
- n.crossDomain || r["X-Requested-With"] || (r["X-Requested-With"] = "XMLHttpRequest");
- for (e in r) r[e] !== undefined && f.setRequestHeader(e, r[e] + "");
- f.send(n.hasContent && n.data || null);
- t = function(r, e) {
- var s, c, h;
- if (t && (e || f.readyState === 4))
- if (delete gt[o], t = undefined, f.onreadystatechange = i.noop, e) f.readyState !== 4 && f.abort();
- else {
- h = {};
- s = f.status;
- typeof f.responseText == "string" && (h.text = f.responseText);
- try {
- c = f.statusText
- } catch (l) {
- c = ""
- }
- s || !n.isLocal || n.crossDomain ? s === 1223 && (s = 204) : s = h.text ? 200 : 404
- }
- h && u(s, c, h, f.getAllResponseHeaders())
- };
- n.async ? f.readyState === 4 ? setTimeout(t) : f.onreadystatechange = gt[o] = t : t()
- },
- abort: function() {
- t && t(undefined, !0)
- }
- }
- }
- }), i.ajaxSetup({
- accepts: {
- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /(?:java|ecma)script/
- },
- converters: {
- "text script": function(n) {
- return i.globalEval(n), n
- }
- }
- }), i.ajaxPrefilter("script", function(n) {
- n.cache === undefined && (n.cache = !1);
- n.crossDomain && (n.type = "GET", n.global = !1)
- }), i.ajaxTransport("script", function(n) {
- if (n.crossDomain) {
- var t, r = u.head || i("head")[0] || u.documentElement;
- return {
- send: function(i, f) {
- t = u.createElement("script");
- t.async = !0;
- n.scriptCharset && (t.charset = n.scriptCharset);
- t.src = n.url;
- t.onload = t.onreadystatechange = function(n, i) {
- (i || !t.readyState || /loaded|complete/.test(t.readyState)) && (t.onload = t.onreadystatechange = null, t.parentNode && t.parentNode.removeChild(t), t = null, i || f(200, "success"))
- };
- r.insertBefore(t, r.firstChild)
- },
- abort: function() {
- if (t) t.onload(undefined, !0)
- }
- }
- }
- }), gi = [], ni = /(=)\?(?=&|$)|\?\?/, i.ajaxSetup({
- jsonp: "callback",
- jsonpCallback: function() {
- var n = gi.pop() || i.expando + "_" + pi++;
- return this[n] = !0, n
- }
- }), i.ajaxPrefilter("json jsonp", function(t, r, u) {
- var f, o, e, s = t.jsonp !== !1 && (ni.test(t.url) ? "url" : typeof t.data == "string" && !(t.contentType || "").indexOf("application/x-www-form-urlencoded") && ni.test(t.data) && "data");
- if (s || t.dataTypes[0] === "jsonp") return f = t.jsonpCallback = i.isFunction(t.jsonpCallback) ? t.jsonpCallback() : t.jsonpCallback, s ? t[s] = t[s].replace(ni, "$1" + f) : t.jsonp !== !1 && (t.url += (wi.test(t.url) ? "&" : "?") + t.jsonp + "=" + f), t.converters["script json"] = function() {
- return e || i.error(f + " was not called"), e[0]
- }, t.dataTypes[0] = "json", o = n[f], n[f] = function() {
- e = arguments
- }, u.always(function() {
- n[f] = o;
- t[f] && (t.jsonpCallback = r.jsonpCallback, gi.push(f));
- e && i.isFunction(o) && o(e[0]);
- e = o = undefined
- }), "script"
- }), i.parseHTML = function(n, t, r) {
- if (!n || typeof n != "string") return null;
- typeof t == "boolean" && (r = t, t = !1);
- t = t || u;
- var f = er.exec(n),
- e = !r && [];
- return f ? [t.createElement(f[1])] : (f = i.buildFragment([n], t, e), e && e.length && i(e).remove(), i.merge([], f.childNodes))
- }, nr = i.fn.load, i.fn.load = function(n, t, r) {
- if (typeof n != "string" && nr) return nr.apply(this, arguments);
- var u, o, s, f = this,
- e = n.indexOf(" ");
- return e >= 0 && (u = n.slice(e, n.length), n = n.slice(0, e)), i.isFunction(t) ? (r = t, t = undefined) : t && typeof t == "object" && (s = "POST"), f.length > 0 && i.ajax({
- url: n,
- type: s,
- dataType: "html",
- data: t
- }).done(function(n) {
- o = arguments;
- f.html(u ? i("<div>").append(i.parseHTML(n)).find(u) : n)
- }).complete(r && function(n, t) {
- f.each(r, o || [n.responseText, t, n])
- }), this
- }, i.expr.filters.animated = function(n) {
- return i.grep(i.timers, function(t) {
- return n === t.elem
- }).length
- }, tr = n.document.documentElement, i.offset = {
- setOffset: function(n, t, r) {
- var e, o, s, h, u, c, v, l = i.css(n, "position"),
- a = i(n),
- f = {};
- l === "static" && (n.style.position = "relative");
- u = a.offset();
- s = i.css(n, "top");
- c = i.css(n, "left");
- v = (l === "absolute" || l === "fixed") && i.inArray("auto", [s, c]) > -1;
- v ? (e = a.position(), h = e.top, o = e.left) : (h = parseFloat(s) || 0, o = parseFloat(c) || 0);
- i.isFunction(t) && (t = t.call(n, r, u));
- t.top != null && (f.top = t.top - u.top + h);
- t.left != null && (f.left = t.left - u.left + o);
- "using" in t ? t.using.call(n, f) : a.css(f)
- }
- }, i.fn.extend({
- offset: function(n) {
- if (arguments.length) return n === undefined ? this : this.each(function(t) {
- i.offset.setOffset(this, n, t)
- });
- var t, f, u = {
- top: 0,
- left: 0
- },
- r = this[0],
- e = r && r.ownerDocument;
- if (e) return (t = e.documentElement, !i.contains(t, r)) ? u : (typeof r.getBoundingClientRect !== o && (u = r.getBoundingClientRect()), f = bf(e), {
- top: u.top + (f.pageYOffset || t.scrollTop) - (t.clientTop || 0),
- left: u.left + (f.pageXOffset || t.scrollLeft) - (t.clientLeft || 0)
- })
- },
- position: function() {
- if (this[0]) {
- var n, r, t = {
- top: 0,
- left: 0
- },
- u = this[0];
- return i.css(u, "position") === "fixed" ? r = u.getBoundingClientRect() : (n = this.offsetParent(), r = this.offset(), i.nodeName(n[0], "html") || (t = n.offset()), t.top += i.css(n[0], "borderTopWidth", !0), t.left += i.css(n[0], "borderLeftWidth", !0)), {
- top: r.top - t.top - i.css(u, "marginTop", !0),
- left: r.left - t.left - i.css(u, "marginLeft", !0)
- }
- }
- },
- offsetParent: function() {
- return this.map(function() {
- for (var n = this.offsetParent || tr; n && !i.nodeName(n, "html") && i.css(n, "position") === "static";) n = n.offsetParent;
- return n || tr
- })
- }
- }), i.each({
- scrollLeft: "pageXOffset",
- scrollTop: "pageYOffset"
- }, function(n, t) {
- var r = /Y/.test(t);
- i.fn[n] = function(u) {
- return b(this, function(n, u, f) {
- var e = bf(n);
- if (f === undefined) return e ? t in e ? e[t] : e.document.documentElement[u] : n[u];
- e ? e.scrollTo(r ? i(e).scrollLeft() : f, r ? f : i(e).scrollTop()) : n[u] = f
- }, n, u, arguments.length, null)
- }
- }), i.each(["top", "left"], function(n, t) {
- i.cssHooks[t] = vu(r.pixelPosition, function(n, r) {
- if (r) return r = d(n, t), yt.test(r) ? i(n).position()[t] + "px" : r
- })
- }), i.each({
- Height: "height",
- Width: "width"
- }, function(n, t) {
- i.each({
- padding: "inner" + n,
- content: t,
- "": "outer" + n
- }, function(r, u) {
- i.fn[u] = function(u, f) {
- var e = arguments.length && (r || typeof u != "boolean"),
- o = r || (u === !0 || f === !0 ? "margin" : "border");
- return b(this, function(t, r, u) {
- var f;
- return i.isWindow(t) ? t.document.documentElement["client" + n] : t.nodeType === 9 ? (f = t.documentElement, Math.max(t.body["scroll" + n], f["scroll" + n], t.body["offset" + n], f["offset" + n], f["client" + n])) : u === undefined ? i.css(t, r, o) : i.style(t, r, u, o)
- }, t, e ? u : undefined, e, null)
- }
- })
- }), i.fn.size = function() {
- return this.length
- }, i.fn.andSelf = i.fn.addBack, typeof define == "function" && define.amd && define("jquery", [], function() {
- return i
- }), kf = n.jQuery, df = n.$, i.noConflict = function(t) {
- return n.$ === i && (n.$ = df), t && n.jQuery === i && (n.jQuery = kf), i
- }, typeof t === o && (n.jQuery = n.$ = i), i
- }), function() {
- var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
- i = window.Crypto = {},
- r = i.util = {
- rotl: function(n, t) {
- return n << t | n >>> 32 - t
- },
- rotr: function(n, t) {
- return n << 32 - t | n >>> t
- },
- endian: function(n) {
- if (n.constructor == Number) return r.rotl(n, 8) & 16711935 | r.rotl(n, 24) & 4278255360;
- for (var t = 0; t < n.length; t++) n[t] = r.endian(n[t]);
- return n
- },
- randomBytes: function(n) {
- for (var t = []; n > 0; n--) t.push(Math.floor(Math.random() * 256));
- return t
- },
- bytesToWords: function(n) {
- for (var r = [], t = 0, i = 0; t < n.length; t++, i += 8) r[i >>> 5] |= n[t] << 24 - i % 32;
- return r
- },
- wordsToBytes: function(n) {
- for (var i = [], t = 0; t < n.length * 32; t += 8) i.push(n[t >>> 5] >>> 24 - t % 32 & 255);
- return i
- },
- bytesToHex: function(n) {
- for (var i = [], t = 0; t < n.length; t++) i.push((n[t] >>> 4).toString(16)), i.push((n[t] & 15).toString(16));
- return i.join("")
- },
- hexToBytes: function(n) {
- for (var i = [], t = 0; t < n.length; t += 2) i.push(parseInt(n.substr(t, 2), 16));
- return i
- },
- bytesToBase64: function(i) {
- var f, r, e, u;
- if (typeof btoa == "function") return btoa(n.bytesToString(i));
- for (f = [], r = 0; r < i.length; r += 3)
- for (e = i[r] << 16 | i[r + 1] << 8 | i[r + 2], u = 0; u < 4; u++) r * 8 + u * 6 <= i.length * 8 ? f.push(t.charAt(e >>> 6 * (3 - u) & 63)) : f.push("=");
- return f.join("")
- },
- base64ToBytes: function(i) {
- if (typeof atob == "function") return n.stringToBytes(atob(i));
- i = i.replace(/[^A-Z0-9+\/]/ig, "");
- for (var f = [], u = 0, r = 0; u < i.length; r = ++u % 4) r != 0 && f.push((t.indexOf(i.charAt(u - 1)) & Math.pow(2, -2 * r + 8) - 1) << r * 2 | t.indexOf(i.charAt(u)) >>> 6 - r * 2);
- return f
- }
- };
- i.mode = {};
- var u = i.charenc = {},
- f = u.UTF8 = {
- stringToBytes: function(t) {
- return n.stringToBytes(unescape(encodeURIComponent(t)))
- },
- bytesToString: function(t) {
- return decodeURIComponent(escape(n.bytesToString(t)))
- }
- },
- n = u.Binary = {
- stringToBytes: function(n) {
- for (var i = [], t = 0; t < n.length; t++) i.push(n.charCodeAt(t));
- return i
- },
- bytesToString: function(n) {
- for (var i = [], t = 0; t < n.length; t++) i.push(String.fromCharCode(n[t]));
- return i.join("")
- }
- }
- }(), function() {
- var t = Crypto,
- i = t.util,
- r = t.charenc,
- u = r.UTF8,
- f = r.Binary,
- e = [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],
- n = t.SHA256 = function(t, r) {
- var u = i.wordsToBytes(n._sha256(t));
- return r && r.asBytes ? u : r && r.asString ? f.bytesToString(u) : i.bytesToHex(u)
- };
- n._sha256 = function(n) {
- var d, r;
- n.constructor == String && (n = u.stringToBytes(n));
- var p = i.bytesToWords(n),
- w = n.length * 8,
- t = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225],
- s = [],
- f, h, c, b, o, l, a, k, d, r, g, nt;
- for (p[w >> 5] |= 128 << 24 - w % 32, p[(w + 64 >> 9 << 4) + 15] = w, d = 0; d < p.length; d += 16) {
- for (f = t[0], h = t[1], c = t[2], b = t[3], o = t[4], l = t[5], a = t[6], k = t[7], r = 0; r < 64; r++) {
- if (r < 16) s[r] = p[r + d];
- else {
- var v = s[r - 15],
- y = s[r - 2],
- tt = (v << 25 | v >>> 7) ^ (v << 14 | v >>> 18) ^ v >>> 3,
- it = (y << 15 | y >>> 17) ^ (y << 13 | y >>> 19) ^ y >>> 10;
- s[r] = tt + (s[r - 7] >>> 0) + it + (s[r - 16] >>> 0)
- }
- var rt = o & l ^ ~o & a,
- ut = f & h ^ f & c ^ h & c,
- ft = (f << 30 | f >>> 2) ^ (f << 19 | f >>> 13) ^ (f << 10 | f >>> 22),
- et = (o << 26 | o >>> 6) ^ (o << 21 | o >>> 11) ^ (o << 7 | o >>> 25);
- g = (k >>> 0) + et + rt + e[r] + (s[r] >>> 0);
- nt = ft + ut;
- k = a;
- a = l;
- l = o;
- o = b + g >>> 0;
- b = c;
- c = h;
- h = f;
- f = g + nt >>> 0
- }
- t[0] += f;
- t[1] += h;
- t[2] += c;
- t[3] += b;
- t[4] += o;
- t[5] += l;
- t[6] += a;
- t[7] += k
- }
- return t
- };
- n._blocksize = 16;
- n._digestsize = 32
- }(), function() {
- function e(n, t, i, r) {
- return 0 <= n && n <= 15 ? t ^ i ^ r : 16 <= n && n <= 31 ? t & i | ~t & r : 32 <= n && n <= 47 ? (t | ~i) ^ r : 48 <= n && n <= 63 ? t & r | i & ~r : 64 <= n && n <= 79 ? t ^ (i | ~r) : "rmd160_f: j out of range"
- }
- function h(n) {
- return 0 <= n && n <= 15 ? 0 : 16 <= n && n <= 31 ? 1518500249 : 32 <= n && n <= 47 ? 1859775393 : 48 <= n && n <= 63 ? 2400959708 : 64 <= n && n <= 79 ? 2840853838 : "rmd160_K1: j out of range"
- }
- function c(n) {
- return 0 <= n && n <= 15 ? 1352829926 : 16 <= n && n <= 31 ? 1548603684 : 32 <= n && n <= 47 ? 1836072691 : 48 <= n && n <= 63 ? 2053994217 : 64 <= n && n <= 79 ? 0 : "rmd160_K2: j out of range"
- }
- function n(n, t) {
- var i = (n & 65535) + (t & 65535),
- r = (n >> 16) + (t >> 16) + (i >> 16);
- return r << 16 | i & 65535
- }
- function i(n, t) {
- return n << t | n >>> 32 - t
- }
- var r = Crypto,
- t = r.util,
- f = r.charenc,
- o = f.UTF8,
- s = f.Binary,
- u;
- t.bytesToLWords = function(n) {
- for (var i = Array(n.length >> 2), t = 0; t < i.length; t++) i[t] = 0;
- for (t = 0; t < n.length * 8; t += 8) i[t >> 5] |= (n[t / 8] & 255) << t % 32;
- return i
- };
- t.lWordsToBytes = function(n) {
- for (var i = [], t = 0; t < n.length * 32; t += 8) i.push(n[t >> 5] >>> t % 32 & 255);
- return i
- };
- u = r.RIPEMD160 = function(n, i) {
- var r = t.lWordsToBytes(u._rmd160(n));
- return i && i.asBytes ? r : i && i.asString ? s.bytesToString(r) : t.bytesToHex(r)
- };
- u._rmd160 = function(r) {
- var s, p, nt, f;
- r.constructor == String && (r = o.stringToBytes(r));
- s = t.bytesToLWords(r);
- p = r.length * 8;
- s[p >> 5] |= 128 << p % 32;
- s[(p + 64 >>> 9 << 4) + 14] = p;
- var w = 1732584193,
- b = 4023233417,
- k = 2562383102,
- d = 271733878,
- g = 3285377520;
- for (nt = 0; nt < s.length; nt += 16) {
- var u, ht = w,
- tt = b,
- it = k,
- rt = d,
- ut = g,
- ct = w,
- ft = b,
- et = k,
- ot = d,
- st = g;
- for (f = 0; f <= 79; ++f) u = n(ht, e(f, tt, it, rt)), u = n(u, s[nt + l[f]]), u = n(u, h(f)), u = n(i(u, v[f]), ut), ht = ut, ut = rt, rt = i(it, 10), it = tt, tt = u, u = n(ct, e(79 - f, ft, et, ot)), u = n(u, s[nt + a[f]]), u = n(u, c(f)), u = n(i(u, y[f]), st), ct = st, st = ot, ot = i(et, 10), et = ft, ft = u;
- u = n(b, n(it, ot));
- b = n(k, n(rt, st));
- k = n(d, n(ut, ct));
- d = n(g, n(ht, ft));
- g = n(w, n(tt, et));
- w = u
- }
- return [w, b, k, d, g]
- };
- var l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13],
- a = [5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11],
- v = [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6],
- y = [8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]
- }(), function() {
- var n = Crypto,
- r = n.util,
- t = n.charenc,
- i = t.UTF8,
- u = t.Binary;
- n.HMAC = function(n, t, f, e) {
- var h, c, o, s;
- for (t.constructor == String && (t = i.stringToBytes(t)), f.constructor == String && (f = i.stringToBytes(f)), f.length > n._blocksize * 4 && (f = n(f, {
- asBytes: !0
- })), h = f.slice(0), c = f.slice(0), o = 0; o < n._blocksize * 4; o++) h[o] ^= 92, c[o] ^= 54;
- return s = n(h.concat(n(c.concat(t), {
- asBytes: !0
- })), {
- asBytes: !0
- }), e && e.asBytes ? s : e && e.asString ? u.bytesToString(s) : r.bytesToHex(s)
- }
- }(), function() {
- var n = Crypto,
- t = n.util,
- i = n.charenc,
- r = i.UTF8,
- u = i.Binary;
- n.nextTick || (typeof process != "undefined" && typeof process.nextTick != "undefined" ? n.nextTick = process.nextTick : typeof setTimeout != "undefined" && (n.nextTick = function(n) {
- setTimeout(n, 0)
- }));
- n.PBKDF2Async = function(i, f, e, o, s) {
- function y(n) {
- if (v) {
- var t = h.length / a._digestsize * c + n;
- setTimeout(function() {
- v(Math.round(t / d * 100))
- }, 0)
- }
- }
- function p(t, i) {
- return n.HMAC(a, i, t, {
- asBytes: !0
- })
- }
- i.constructor == String && (i = r.stringToBytes(i));
- f.constructor == String && (f = r.stringToBytes(f));
- var a = s && s.hasher || n.SHA1,
- c = s && s.iterations || 1,
- v = s && s.onProgressChange,
- d = Math.ceil(e / a._digestsize) * c;
- var l = n.nextTick,
- h = [],
- w = 1,
- b, k;
- l(b = function() {
- var n, a, r;
- h.length < e ? (n = p(i, f.concat(t.wordsToBytes([w]))), y(1), a = n, r = 1, l(k = function() {
- var u = 0,
- t;
- if (r < c) {
- while (r < c && u < 10) {
- for (a = p(i, a), t = 0; t < n.length; t++) n[t] ^= a[t];
- r++;
- u++
- }
- y(r);
- l(k)
- } else h = h.concat(n), w++, l(b)
- })) : (h.length = e, o(s && s.asBytes ? h : s && s.asString ? u.bytesToString(h) : t.bytesToHex(h)))
- })
- }
- }(), function(n) {
- function e(n, t) {
- var i = n._blocksize * 4;
- return i - t.length % i
- }
- var i = n.pad = {},
- h = function(n, t, i, r) {
- var u = t.pop(),
- o, f, e;
- if (u == 0) throw new Error("Invalid zero-length padding specified for " + i + ". Wrong cipher specification or key used?");
- if (o = n._blocksize * 4, u > o) throw new Error("Invalid padding length of " + u + " specified for " + i + ". Wrong cipher specification or key used?");
- for (f = 1; f < u; f++)
- if (e = t.pop(), r != undefined && r != e) throw new Error("Invalid padding byte of 0x" + e.toString(16) + " specified for " + i + ". Wrong cipher specification or key used?");
- },
- r, t, l, o, a, c, v, s, y, u, p, f;
- i.NoPadding = {
- pad: function() {},
- unpad: function() {}
- };
- i.ZeroPadding = {
- pad: function(n, t) {
- var r = n._blocksize * 4,
- i = t.length % r;
- if (i != 0)
- for (i = r - i; i > 0; i--) t.push(0)
- },
- unpad: function(n, t) {
- while (t[t.length - 1] == 0) t.pop()
- }
- };
- i.iso7816 = {
- pad: function(n, t) {
- var i = e(n, t);
- for (t.push(128); i > 1; i--) t.push(0)
- },
- unpad: function(n, t) {
- for (var i, r = n._blocksize * 4; r > 0; r--) {
- if (i = t.pop(), i == 128) return;
- if (i != 0) throw new Error("ISO-7816 padding byte must be 0, not 0x" + i.toString(16) + ". Wrong cipher specification or key used?");
- }
- throw new Error("ISO-7816 padded beyond cipher block size. Wrong cipher specification or key used?");
- }
- };
- i.ansix923 = {
- pad: function(n, t) {
- for (var i = e(n, t), r = 1; r < i; r++) t.push(0);
- t.push(i)
- },
- unpad: function(n, t) {
- h(n, t, "ANSI X.923", 0)
- }
- };
- i.iso10126 = {
- pad: function(n, t) {
- for (var i = e(n, t), r = 1; r < i; r++) t.push(Math.floor(Math.random() * 256));
- t.push(i)
- },
- unpad: function(n, t) {
- h(n, t, "ISO 10126", undefined)
- }
- };
- i.pkcs7 = {
- pad: function(n, t) {
- for (var i = e(n, t), r = 0; r < i; r++) t.push(i)
- },
- unpad: function(n, t) {
- h(n, t, "PKCS 7", t[t.length - 1])
- }
- };
- r = n.mode = {};
- t = r.Mode = function(n) {
- n && (this._padding = n)
- };
- t.prototype = {
- encrypt: function(n, t, i) {
- this._padding.pad(n, t);
- this._doEncrypt(n, t, i)
- },
- decrypt: function(n, t, i) {
- this._doDecrypt(n, t, i);
- this._padding.unpad(n, t)
- },
- _padding: i.iso7816
- };
- l = r.ECB = function() {
- t.apply(this, arguments)
- };
- o = l.prototype = new t;
- o._doEncrypt = function(n, t) {
- for (var r = n._blocksize * 4, i = 0; i < t.length; i += r) n._encryptblock(t, i)
- };
- o._doDecrypt = function(n, t) {
- for (var r = n._blocksize * 4, i = 0; i < t.length; i += r) n._decryptblock(t, i)
- };
- o.fixOptions = function(n) {
- n.iv = []
- };
- a = r.CBC = function() {
- t.apply(this, arguments)
- };
- c = a.prototype = new t;
- c._doEncrypt = function(n, t, i) {
- for (var r, f = n._blocksize * 4, u = 0; u < t.length; u += f) {
- if (u == 0)
- for (r = 0; r < f; r++) t[r] ^= i[r];
- else
- for (r = 0; r < f; r++) t[u + r] ^= t[u + r - f];
- n._encryptblock(t, u)
- }
- };
- c._doDecrypt = function(n, t, i) {
- for (var o, u, f = n._blocksize * 4, e = i, r = 0; r < t.length; r += f) {
- for (o = t.slice(r, r + f), n._decryptblock(t, r), u = 0; u < f; u++) t[r + u] ^= e[u];
- e = o
- }
- };
- v = r.CFB = function() {
- t.apply(this, arguments)
- };
- s = v.prototype = new t;
- s._padding = i.NoPadding;
- s._doEncrypt = function(n, t, i) {
- for (var u, e = n._blocksize * 4, f = i.slice(0), r = 0; r < t.length; r++) u = r % e, u == 0 && n._encryptblock(f, 0), t[r] ^= f[u], f[u] = t[r]
- };
- s._doDecrypt = function(n, t, i) {
- for (var u, e, o = n._blocksize * 4, f = i.slice(0), r = 0; r < t.length; r++) u = r % o, u == 0 && n._encryptblock(f, 0), e = t[r], t[r] ^= f[u], f[u] = e
- };
- y = r.OFB = function() {
- t.apply(this, arguments)
- };
- u = y.prototype = new t;
- u._padding = i.NoPadding;
- u._doEncrypt = function(n, t, i) {
- for (var u = n._blocksize * 4, f = i.slice(0), r = 0; r < t.length; r++) r % u == 0 && n._encryptblock(f, 0), t[r] ^= f[r % u]
- };
- u._doDecrypt = u._doEncrypt;
- p = r.CTR = function() {
- t.apply(this, arguments)
- };
- f = p.prototype = new t;
- f._padding = i.NoPadding;
- f._doEncrypt = function(n, t, i) {
- for (var o, e, r = n._blocksize * 4, u = i.slice(0), f = 0; f < t.length;) {
- for (o = u.slice(0), n._encryptblock(o, 0), e = 0; f < t.length && e < r; e++, f++) t[f] ^= o[e];
- ++u[r - 1] == 256 && (u[r - 1] = 0, ++u[r - 2] == 256 && (u[r - 2] = 0, ++u[r - 3] == 256 && (u[r - 3] = 0, ++u[r - 4])))
- }
- };
- f._doDecrypt = f._doEncrypt
- }(Crypto), function() {
- function s(n, t) {
- for (var u, i = 0, r = 0; r < 8; r++) t & 1 && (i ^= n), u = n & 128, n = n << 1 & 255, u && (n ^= 27), t >>>= 1;
- return i
- }
- for (var e = Crypto, p = e.util, k = e.charenc, b = k.UTF8, f = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22], w = [], t = 0; t < 256; t++) w[f[t]] = t;
- var h = [],
- c = [],
- l = [],
- a = [],
- v = [],
- y = [];
- for (t = 0; t < 256; t++) h[t] = s(t, 2), c[t] = s(t, 3), l[t] = s(t, 9), a[t] = s(t, 11), v[t] = s(t, 13), y[t] = s(t, 14);
- var d = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54],
- n = [
- [],
- [],
- [],
- []
- ],
- r, o, i, u = e.AES = {
- encrypt: function(n, t, i) {
- var f;
- i = i || {};
- f = i.mode || new e.mode.OFB;
- f.fixOptions && f.fixOptions(i);
- var r = n.constructor == String ? b.stringToBytes(n) : n,
- o = i.iv || p.randomBytes(u._blocksize * 4),
- s = t.constructor == String ? e.PBKDF2(t, o, 32, {
- asBytes: !0
- }) : t;
- return u._init(s), f.encrypt(u, r, o), r = i.iv ? r : o.concat(r), i && i.asBytes ? r : p.bytesToBase64(r)
- },
- decrypt: function(n, t, i) {
- var r;
- i = i || {};
- r = i.mode || new e.mode.OFB;
- r.fixOptions && r.fixOptions(i);
- var f = n.constructor == String ? p.base64ToBytes(n) : n,
- o = i.iv || f.splice(0, u._blocksize * 4),
- s = t.constructor == String ? e.PBKDF2(t, o, 32, {
- asBytes: !0
- }) : t;
- return u._init(s), r.decrypt(u, f, o), i && i.asBytes ? f : b.bytesToString(f)
- },
- _blocksize: 4,
- _encryptblock: function(t, r) {
- for (var l, e, s = 0; s < u._blocksize; s++)
- for (e = 0; e < 4; e++) n[s][e] = t[r + e * 4 + s];
- for (s = 0; s < 4; s++)
- for (e = 0; e < 4; e++) n[s][e] ^= i[e][s];
- for (l = 1; l < o; l++) {
- for (s = 0; s < 4; s++)
- for (e = 0; e < 4; e++) n[s][e] = f[n[s][e]];
- for (n[1].push(n[1].shift()), n[2].push(n[2].shift()), n[2].push(n[2].shift()), n[3].unshift(n[3].pop()), e = 0; e < 4; e++) {
- var a = n[0][e],
- v = n[1][e],
- y = n[2][e],
- p = n[3][e];
- n[0][e] = h[a] ^ c[v] ^ y ^ p;
- n[1][e] = a ^ h[v] ^ c[y] ^ p;
- n[2][e] = a ^ v ^ h[y] ^ c[p];
- n[3][e] = c[a] ^ v ^ y ^ h[p]
- }
- for (s = 0; s < 4; s++)
- for (e = 0; e < 4; e++) n[s][e] ^= i[l * 4 + e][s]
- }
- for (s = 0; s < 4; s++)
- for (e = 0; e < 4; e++) n[s][e] = f[n[s][e]];
- for (n[1].push(n[1].shift()), n[2].push(n[2].shift()), n[2].push(n[2].shift()), n[3].unshift(n[3].pop()), s = 0; s < 4; s++)
- for (e = 0; e < 4; e++) n[s][e] ^= i[o * 4 + e][s];
- for (s = 0; s < u._blocksize; s++)
- for (e = 0; e < 4; e++) t[r + e * 4 + s] = n[s][e]
- },
- _decryptblock: function(t, r) {
- for (var s, f, e = 0; e < u._blocksize; e++)
- for (f = 0; f < 4; f++) n[e][f] = t[r + f * 4 + e];
- for (e = 0; e < 4; e++)
- for (f = 0; f < 4; f++) n[e][f] ^= i[o * 4 + f][e];
- for (s = 1; s < o; s++) {
- for (n[1].unshift(n[1].pop()), n[2].push(n[2].shift()), n[2].push(n[2].shift()), n[3].push(n[3].shift()), e = 0; e < 4; e++)
- for (f = 0; f < 4; f++) n[e][f] = w[n[e][f]];
- for (e = 0; e < 4; e++)
- for (f = 0; f < 4; f++) n[e][f] ^= i[(o - s) * 4 + f][e];
- for (f = 0; f < 4; f++) {
- var h = n[0][f],
- c = n[1][f],
- p = n[2][f],
- b = n[3][f];
- n[0][f] = y[h] ^ a[c] ^ v[p] ^ l[b];
- n[1][f] = l[h] ^ y[c] ^ a[p] ^ v[b];
- n[2][f] = v[h] ^ l[c] ^ y[p] ^ a[b];
- n[3][f] = a[h] ^ v[c] ^ l[p] ^ y[b]
- }
- }
- for (n[1].unshift(n[1].pop()), n[2].push(n[2].shift()), n[2].push(n[2].shift()), n[3].push(n[3].shift()), e = 0; e < 4; e++)
- for (f = 0; f < 4; f++) n[e][f] = w[n[e][f]];
- for (e = 0; e < 4; e++)
- for (f = 0; f < 4; f++) n[e][f] ^= i[f][e];
- for (e = 0; e < u._blocksize; e++)
- for (f = 0; f < 4; f++) t[r + f * 4 + e] = n[e][f]
- },
- _init: function(n) {
- r = n.length / 4;
- o = r + 6;
- u._keyexpansion(n)
- },
- _keyexpansion: function(n) {
- var e, t;
- for (i = [], e = 0; e < r; e++) i[e] = [n[e * 4], n[e * 4 + 1], n[e * 4 + 2], n[e * 4 + 3]];
- for (e = r; e < u._blocksize * (o + 1); e++) t = [i[e - 1][0], i[e - 1][1], i[e - 1][2], i[e - 1][3]], e % r == 0 ? (t.push(t.shift()), t[0] = f[t[0]], t[1] = f[t[1]], t[2] = f[t[2]], t[3] = f[t[3]], t[0] ^= d[e / r]) : r > 6 && e % r == 4 && (t[0] = f[t[0]], t[1] = f[t[1]], t[2] = f[t[2]], t[3] = f[t[3]]), i[e] = [i[e - r][0] ^ t[0], i[e - r][1] ^ t[1], i[e - r][2] ^ t[2], i[e - r][3] ^ t[3]]
- }
- }
- }(), Arcfour.prototype.init = ARC4init, Arcfour.prototype.next = ARC4next, rng_psize = 256, secure_browser = !1, rng_pool == null) {
- if (rng_pool = [], rng_pptr = 0, windowCrypto = window.crypto || window.msCrypto, windowCrypto && windowCrypto.getRandomValues) {
- for (z = new Uint32Array(256), windowCrypto.getRandomValues(z), t = 0; t < z.length; ++t) rng_pool[rng_pptr++] = z[t] & 255;
- secure_browser = !0
- }
- onMouseMoveListener = function(n) {
- if (this.count = this.count || 0, this.count >= 256 || rng_pptr >= rng_psize) {
- window.removeEventListener("mousemove", onMouseMoveListener);
- return
- }
- this.count += 1;
- var t = n.x + n.y;
- rng_pool[rng_pptr++] = t & 255
- };
- window.addEventListener("mousemove", onMouseMoveListener)
- }
- for (SecureRandom.prototype.nextBytes = rng_get_bytes, canary = 0xdeadbeefcafe, j_lm = (canary & 16777215) == 15715070, j_lm && navigator.appName == "Microsoft Internet Explorer" ? (BigInteger.prototype.am = am2, dbits = 30) : j_lm && navigator.appName != "Netscape" ? (BigInteger.prototype.am = am1, dbits = 26) : (BigInteger.prototype.am = am3, dbits = 28), BigInteger.prototype.DB = dbits, BigInteger.prototype.DM = (1 << dbits) - 1, BigInteger.prototype.DV = 1 << dbits, BI_FP = 52, BigInteger.prototype.FV = Math.pow(2, BI_FP), BigInteger.prototype.F1 = BI_FP - dbits, BigInteger.prototype.F2 = 2 * dbits - BI_FP, BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz", BI_RC = [], rr = "0".charCodeAt(0), vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
- for (rr = "a".charCodeAt(0), vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
- for (rr = "A".charCodeAt(0), vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
- for (Classic.prototype.convert = cConvert, Classic.prototype.revert = cRevert, Classic.prototype.reduce = cReduce, Classic.prototype.mulTo = cMulTo, Classic.prototype.sqrTo = cSqrTo, Montgomery.prototype.convert = montConvert, Montgomery.prototype.revert = montRevert, Montgomery.prototype.reduce = montReduce, Montgomery.prototype.mulTo = montMulTo, Montgomery.prototype.sqrTo = montSqrTo, 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, 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, BigInteger.ZERO = nbv(0), BigInteger.ONE = nbv(1), NullExp.prototype.convert = nNop, NullExp.prototype.revert = nNop, NullExp.prototype.mulTo = nMulTo, NullExp.prototype.sqrTo = nSqrTo, Barrett.prototype.convert = barrettConvert, Barrett.prototype.revert = barrettRevert, Barrett.prototype.reduce = barrettReduce, Barrett.prototype.mulTo = barrettMulTo, Barrett.prototype.sqrTo = barrettSqrTo, 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, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997], lplim = 67108864 / lowprimes[lowprimes.length - 1], 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, 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.prototype.square = bnSquare, ECFieldElementFp.prototype.equals = feFpEquals, ECFieldElementFp.prototype.toBigInteger = feFpToBigInteger, ECFieldElementFp.prototype.negate = feFpNegate, ECFieldElementFp.prototype.add = feFpAdd, ECFieldElementFp.prototype.subtract = feFpSubtract, ECFieldElementFp.prototype.multiply = feFpMultiply, ECFieldElementFp.prototype.square = feFpSquare, ECFieldElementFp.prototype.divide = feFpDivide, ECPointFp.prototype.getX = pointFpGetX, ECPointFp.prototype.getY = pointFpGetY, ECPointFp.prototype.equals = pointFpEquals, ECPointFp.prototype.isInfinity = pointFpIsInfinity, ECPointFp.prototype.negate = pointFpNegate, ECPointFp.prototype.add = pointFpAdd, ECPointFp.prototype.twice = pointFpTwice, ECPointFp.prototype.multiply = pointFpMultiply, ECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo, ECCurveFp.prototype.getQ = curveFpGetQ, ECCurveFp.prototype.getA = curveFpGetA, ECCurveFp.prototype.getB = curveFpGetB, ECCurveFp.prototype.equals = curveFpEquals, ECCurveFp.prototype.getInfinity = curveFpGetInfinity, ECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger, ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex, X9ECParameters.prototype.getCurve = x9getCurve, X9ECParameters.prototype.getG = x9getG, X9ECParameters.prototype.getN = x9getN, X9ECParameters.prototype.getH = x9getH, EventEmitter = function() {}, EventEmitter.prototype.on = function(n, t, i) {
- i || (i = this);
- this._listeners || (this._listeners = {});
- this._listeners[n] || (this._listeners[n] = []);
- this._unbinders || (this._unbinders = {});
- this._unbinders[n] || (this._unbinders[n] = []);
- var r = function(n) {
- t.apply(i, [n])
- };
- this._unbinders[n].push(t);
- this._listeners[n].push(r)
- }, EventEmitter.prototype.trigger = function(n, t) {
- if (t === undefined && (t = {}), this._listeners || (this._listeners = {}), this._listeners[n])
- for (var i = this._listeners[n].length; i--;) this._listeners[n][i](t)
- }, EventEmitter.prototype.removeListener = function(n, t) {
- if (this._unbinders || (this._unbinders = {}), this._unbinders[n])
- for (var i = this._unbinders[n].length; i--;) this._unbinders[n][i] === t && (this._unbinders[n].splice(i, 1), this._listeners[n].splice(i, 1))
- }, EventEmitter.augment = function(n) {
- for (var t in EventEmitter.prototype) n[t] || (n[t] = EventEmitter.prototype[t])
- }, function(n) {
- var t = n;
- "object" != typeof module && (t.EventEmitter = EventEmitter)
- }("object" == typeof module ? module.exports : window.Bitcoin = {}), BigInteger.valueOf = nbv, BigInteger.prototype.toByteArrayUnsigned = function() {
- var n = this.abs().toByteArray();
- return n.length ? (n[0] == 0 && (n = n.slice(1)), n.map(function(n) {
- return n < 0 ? n + 256 : n
- })) : n
- }, BigInteger.fromByteArrayUnsigned = function(n) {
- return n.length ? n[0] & 128 ? new BigInteger([0].concat(n)) : new BigInteger(n) : n.valueOf(0)
- }, BigInteger.prototype.toByteArraySigned = function() {
- var n = this.abs().toByteArrayUnsigned(),
- t = this.compareTo(BigInteger.ZERO) < 0;
- return t ? n[0] & 128 ? n.unshift(128) : n[0] |= 128 : n[0] & 128 && n.unshift(0), n
- }, BigInteger.fromByteArraySigned = function(n) {
- return n[0] & 128 ? (n[0] &= 127, BigInteger.fromByteArrayUnsigned(n).negate()) : BigInteger.fromByteArrayUnsigned(n)
- }, names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"], "undefined" == typeof console && (window.console = {}), i = 0; i < names.length; ++i) "undefined" == typeof window.console[names[i]] && (window.console[names[i]] = function() {});
- Bitcoin.Util = {
- isArray: Array.isArray || function(n) {
- return Object.prototype.toString.call(n) === "[object Array]"
- },
- makeFilledArray: function(n, t) {
- for (var i = [], r = 0; r < n;) i[r++] = t;
- return i
- },
- numToVarInt: function(n) {
- return n < 253 ? [n] : n <= 65536 ? [253, n >>> 8, n & 255] : n <= 1 ? [254].concat(Crypto.util.wordsToBytes([n])) : [255].concat(Crypto.util.wordsToBytes([n >>> 32, n]))
- },
- valueToBigInt: function(n) {
- return n instanceof BigInteger ? n : BigInteger.fromByteArrayUnsigned(n)
- },
- formatValue: function(n) {
- for (var i = this.valueToBigInt(n).toString(), r = i.length > 8 ? i.substr(0, i.length - 8) : "0", t = i.length > 8 ? i.substr(i.length - 8) : i; t.length < 8;) t = "0" + t;
- for (t = t.replace(/0*$/, ""); t.length < 2;) t += "0";
- return r + "." + t
- },
- parseValue: function(n) {
- for (var r = n.split("."), u = r[0], t = r[1] || "0", i; t.length < 8;) t += "0";
- return t = t.replace(/^0+/g, ""), i = BigInteger.valueOf(parseInt(u)), i = i.multiply(BigInteger.valueOf(1e8)), i.add(BigInteger.valueOf(parseInt(t)))
- },
- sha256ripe160: function(n) {
- return Crypto.RIPEMD160(Crypto.SHA256(n, {
- asBytes: !0
- }), {
- asBytes: !0
- })
- }
- };
- for (i in Crypto.util) Crypto.util.hasOwnProperty(i) && (Bitcoin.Util[i] = Crypto.util[i]);
- if (function(n) {
- n.Base58 = {
- alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",
- validRegex: /^[1-9A-HJ-NP-Za-km-z]+$/,
- base: BigInteger.valueOf(58),
- encode: function(n) {
- for (var i = BigInteger.fromByteArrayUnsigned(n), r = [], f, u; i.compareTo(t.base) >= 0;) f = i.mod(t.base), r.unshift(t.alphabet[f.intValue()]), i = i.subtract(f).divide(t.base);
- for (r.unshift(t.alphabet[i.intValue()]), u = 0; u < n.length; u++)
- if (n[u] == 0) r.unshift(t.alphabet[0]);
- else break;
- return r.join("")
- },
- decode: function(n) {
- for (var f, e, r = BigInteger.valueOf(0), u = 0, i = n.length - 1; i >= 0; i--) {
- if (f = t.alphabet.indexOf(n[i]), f < 0) throw "Invalid character";
- r = r.add(BigInteger.valueOf(f).multiply(t.base.pow(n.length - 1 - i)));
- n[i] == "1" ? u++ : u = 0
- }
- for (e = r.toByteArrayUnsigned(); u-- > 0;) e.unshift(0);
- return e
- }
- };
- var t = n.Base58
- }("undefined" != typeof Bitcoin ? Bitcoin : module.exports), Bitcoin.Address = function(n) {
- "string" == typeof n && (n = Bitcoin.Address.decodeString(n));
- this.hash = n;
- this.version = 0
- }, Bitcoin.Address.prototype.toString = function() {
- var n = this.hash.slice(0),
- t, i;
- return n.unshift(this.version), t = Crypto.SHA256(Crypto.SHA256(n, {
- asBytes: !0
- }), {
- asBytes: !0
- }), i = n.concat(t.slice(0, 4)), Bitcoin.Base58.encode(i)
- }, Bitcoin.Address.prototype.getHashBase64 = function() {
- return Crypto.util.bytesToBase64(this.hash)
- }, Bitcoin.Address.decodeString = function(n) {
- var t = Bitcoin.Base58.decode(n),
- r = t.slice(0, 21),
- i = Crypto.SHA256(Crypto.SHA256(r, {
- asBytes: !0
- }), {
- asBytes: !0
- }),
- u;
- if (i[0] != t[21] || i[1] != t[22] || i[2] != t[23] || i[3] != t[24]) throw "Checksum validation failed!";
- if (u = r.shift(), u != 0) throw "Version " + u + " not supported!";
- return r
- }, ECFieldElementFp.prototype.getByteLength = function() {
- return Math.floor((this.toBigInteger().bitLength() + 7) / 8)
- }, ECPointFp.prototype.getEncoded = function(n) {
- var r = this.getX().toBigInteger(),
- i = this.getY().toBigInteger(),
- t = integerToBytes(r, 32);
- return n ? i.isEven() ? t.unshift(2) : t.unshift(3) : (t.unshift(4), t = t.concat(integerToBytes(i, 32))), t
- }, ECPointFp.decodeFrom = function(n, t) {
- var o = t[0],
- i = t.length - 1,
- r = t.slice(1, 1 + i / 2),
- u = t.slice(1 + i / 2, 1 + i),
- f, e;
- return r.unshift(0), u.unshift(0), f = new BigInteger(r), e = new BigInteger(u), new ECPointFp(n, n.fromBigInteger(f), n.fromBigInteger(e))
- }, ECPointFp.prototype.add2D = function(n) {
- if (this.isInfinity()) return n;
- if (n.isInfinity()) return this;
- if (this.x.equals(n.x)) return this.y.equals(n.y) ? this.twice() : this.curve.getInfinity();
- var r = n.x.subtract(this.x),
- u = n.y.subtract(this.y),
- t = u.divide(r),
- i = t.square().subtract(this.x).subtract(n.x),
- f = t.multiply(this.x.subtract(i)).subtract(this.y);
- return new ECPointFp(this.curve, i, f)
- }, ECPointFp.prototype.twice2D = function() {
- if (this.isInfinity()) return this;
- if (this.y.toBigInteger().signum() == 0) return this.curve.getInfinity();
- var n = this.curve.fromBigInteger(BigInteger.valueOf(2)),
- r = this.curve.fromBigInteger(BigInteger.valueOf(3)),
- t = this.x.square().multiply(r).add(this.curve.a).divide(this.y.multiply(n)),
- i = t.square().subtract(this.x.multiply(n)),
- u = t.multiply(this.x.subtract(i)).subtract(this.y);
- return new ECPointFp(this.curve, i, u)
- }, ECPointFp.prototype.multiply2D = function(n) {
- var r, e;
- if (this.isInfinity()) return this;
- if (n.signum() == 0) return this.curve.getInfinity();
- for (var u = n, f = u.multiply(new BigInteger("3")), o = this.negate(), t = this, i = f.bitLength() - 2; i > 0; --i) t = t.twice(), r = f.testBit(i), e = u.testBit(i), r != e && (t = t.add2D(r ? this : o));
- return t
- }, ECPointFp.prototype.isOnCurve = function() {
- var n = this.getX().toBigInteger(),
- t = this.getY().toBigInteger(),
- r = this.curve.getA().toBigInteger(),
- u = this.curve.getB().toBigInteger(),
- i = this.curve.getQ(),
- f = t.multiply(t).mod(i),
- e = n.multiply(n).multiply(n).add(r.multiply(n)).add(u).mod(i);
- return f.equals(e)
- }, ECPointFp.prototype.toString = function() {
- return "(" + this.getX().toBigInteger().toString() + "," + this.getY().toBigInteger().toString() + ")"
- }, ECPointFp.prototype.validate = function() {
- var n = this.curve.getQ(),
- t, i;
- if (this.isInfinity()) throw new Error("Point is at infinity.");
- if (t = this.getX().toBigInteger(), i = this.getY().toBigInteger(), t.compareTo(BigInteger.ONE) < 0 || t.compareTo(n.subtract(BigInteger.ONE)) > 0) throw new Error("x coordinate out of bounds");
- if (i.compareTo(BigInteger.ONE) < 0 || i.compareTo(n.subtract(BigInteger.ONE)) > 0) throw new Error("y coordinate out of bounds");
- if (!this.isOnCurve()) throw new Error("Point is not on the curve.");
- if (this.multiply(n).isInfinity()) throw new Error("Point is not a scalar multiple of G.");
- return !0
- }, Bitcoin.ECDSA = function() {
- function u(n, t, i, r) {
- for (var e = Math.max(t.bitLength(), r.bitLength()), o = n.add2D(i), u = n.curve.getInfinity(), f = e - 1; f >= 0; --f) u = u.twice2D(), u.z = BigInteger.ONE, t.testBit(f) ? u = r.testBit(f) ? u.add2D(o) : u.add2D(n) : r.testBit(f) && (u = u.add2D(i));
- return u
- }
- var n = getSECCurveByName("secp256k1"),
- r = new SecureRandom,
- i = null,
- t = {
- getBigRandom: function(n) {
- return new BigInteger(n.bitLength(), r).mod(n.subtract(BigInteger.ONE)).add(BigInteger.ONE)
- },
- sign: function(i, r) {
- var s = r,
- u = n.getN(),
- h = BigInteger.fromByteArrayUnsigned(i),
- o;
- do var e = t.getBigRandom(u),
- c = n.getG(),
- l = c.multiply(e),
- f = l.getX().toBigInteger().mod(u); while (f.compareTo(BigInteger.ZERO) <= 0);
- return o = e.modInverse(u).multiply(h.add(s.multiply(f))).mod(u), t.serializeSig(f, o)
- },
- verify: function(i, r, u) {
- var f, e, o, s, h;
- if (Bitcoin.Util.isArray(r)) o = t.parseSig(r), f = o.r, e = o.s;
- else if ("object" == typeof r && r.r && r.s) f = r.r, e = r.s;
- else throw "Invalid value for signature";
- if (u instanceof ECPointFp) s = u;
- else if (Bitcoin.Util.isArray(u)) s = ECPointFp.decodeFrom(n.getCurve(), u);
- else throw "Invalid format for pubkey value, must be byte array or ECPointFp";
- return h = BigInteger.fromByteArrayUnsigned(i), t.verifyRaw(h, f, e, s)
- },
- verifyRaw: function(t, i, r, u) {
- var f = n.getN(),
- o = n.getG();
- if (i.compareTo(BigInteger.ONE) < 0 || i.compareTo(f) >= 0 || r.compareTo(BigInteger.ONE) < 0 || r.compareTo(f) >= 0) return !1;
- var e = r.modInverse(f),
- s = t.multiply(e).mod(f),
- h = i.multiply(e).mod(f),
- c = o.multiply(s).add(u.multiply(h)),
- l = c.getX().toBigInteger().mod(f);
- return l.equals(i)
- },
- serializeSig: function(n, t) {
- var r = n.toByteArraySigned(),
- u = t.toByteArraySigned(),
- i = [];
- return i.push(2), i.push(r.length), i = i.concat(r), i.push(2), i.push(u.length), i = i.concat(u), i.unshift(i.length), i.unshift(48), i
- },
- parseSig: function(n) {
- var t, i, r, u, f;
- if (n[0] != 48) throw new Error("Signature not a valid DERSequence");
- if (t = 2, n[t] != 2) throw new Error("First element in signature must be a DERInteger");
- if (i = n.slice(t + 2, t + 2 + n[t + 1]), t += 2 + n[t + 1], n[t] != 2) throw new Error("Second element in signature must be a DERInteger");
- return r = n.slice(t + 2, t + 2 + n[t + 1]), t += 2 + n[t + 1], u = BigInteger.fromByteArrayUnsigned(i), f = BigInteger.fromByteArrayUnsigned(r), {
- r: u,
- s: f
- }
- },
- parseSigCompact: function(t) {
- var i;
- if (t.length !== 65) throw "Signature has the wrong length";
- if (i = t[0] - 27, i < 0 || i > 7) throw "Invalid signature type";
- var r = n.getN(),
- u = BigInteger.fromByteArrayUnsigned(t.slice(1, 33)).mod(r),
- f = BigInteger.fromByteArrayUnsigned(t.slice(33, 65)).mod(r);
- return {
- r: u,
- s: f,
- i: i
- }
- },
- recoverPubKey: function(r, f, e, o) {
- var y;
- o = o & 3;
- var p = o & 1,
- k = o >> 1,
- a = n.getN(),
- d = n.getG(),
- s = n.getCurve(),
- c = s.getQ(),
- g = s.getA().toBigInteger(),
- nt = s.getB().toBigInteger();
- i || (i = c.add(BigInteger.ONE).divide(BigInteger.valueOf(4)));
- var h = k ? r.add(a) : r,
- tt = h.multiply(h).multiply(h).add(g.multiply(h)).add(nt).mod(c),
- l = tt.modPow(i, c),
- ft = l.isEven() ? o % 2 : (o + 1) % 2,
- it = (l.isEven() ? !p : p) ? l : c.subtract(l),
- w = new ECPointFp(s, s.fromBigInteger(h), s.fromBigInteger(it));
- w.validate();
- var b = BigInteger.fromByteArrayUnsigned(e),
- rt = BigInteger.ZERO.subtract(b).mod(a),
- ut = r.modInverse(a),
- v = u(w, f, d, rt).multiply(ut);
- if (v.validate(), !t.verifyRaw(b, r, f, v)) throw "Pubkey recovery unsuccessful";
- return y = new Bitcoin.ECKey, y.pub = v, y
- },
- calcPubkeyRecoveryParam: function(n, t, i, r) {
- for (var f, u = 0; u < 4; u++) try {
- if (f = Bitcoin.ECDSA.recoverPubKey(t, i, r, u), f.getBitcoinAddress().toString() == n) return u
- } catch (e) {}
- throw "Unable to find valid recovery factor";
- }
- };
- return t
- }(), Bitcoin.ECKey = function() {
- var t = Bitcoin.ECDSA,
- i = getSECCurveByName("secp256k1"),
- r = new SecureRandom,
- n = function(r) {
- if (r) r instanceof BigInteger ? this.priv = r : Bitcoin.Util.isArray(r) ? this.priv = BigInteger.fromByteArrayUnsigned(r) : "string" == typeof r && (this.priv = r.length == 51 && r[0] == "5" ? BigInteger.fromByteArrayUnsigned(n.decodeString(r)) : BigInteger.fromByteArrayUnsigned(Crypto.util.base64ToBytes(r)));
- else {
- var u = i.getN();
- this.priv = t.getBigRandom(u)
- }
- this.compressed = !!n.compressByDefault
- };
- return n.compressByDefault = !1, n.prototype.setCompressed = function(n) {
- this.compressed = !!n
- }, n.prototype.getPub = function() {
- return this.getPubPoint().getEncoded(this.compressed)
- }, n.prototype.getPubPoint = function() {
- return this.pub || (this.pub = i.getG().multiply(this.priv)), this.pub
- }, n.prototype.getPubKeyHash = function() {
- return this.pubKeyHash ? this.pubKeyHash : this.pubKeyHash = Bitcoin.Util.sha256ripe160(this.getPub())
- }, n.prototype.getBitcoinAddress = function() {
- var n = this.getPubKeyHash();
- return new Bitcoin.Address(n)
- }, n.prototype.getExportedPrivateKey = function() {
- for (var n = this.priv.toByteArrayUnsigned(), t, i; n.length < 32;) n.unshift(0);
- return n.unshift(128), t = Crypto.SHA256(Crypto.SHA256(n, {
- asBytes: !0
- }), {
- asBytes: !0
- }), i = n.concat(t.slice(0, 4)), Bitcoin.Base58.encode(i)
- }, n.prototype.setPub = function(n) {
- this.pub = ECPointFp.decodeFrom(i.getCurve(), n)
- }, n.prototype.toString = function(n) {
- return n === "base64" ? Crypto.util.bytesToBase64(this.priv.toByteArrayUnsigned()) : Crypto.util.bytesToHex(this.priv.toByteArrayUnsigned())
- }, n.prototype.sign = function(n) {
- return t.sign(n, this.priv)
- }, n.prototype.verify = function(n, i) {
- return t.verify(n, i, this.getPub())
- }, n.decodeString = function(n) {
- var t = Bitcoin.Base58.decode(n),
- r = t.slice(0, 33),
- i = Crypto.SHA256(Crypto.SHA256(r, {
- asBytes: !0
- }), {
- asBytes: !0
- }),
- u;
- if (i[0] != t[33] || i[1] != t[34] || i[2] != t[35] || i[3] != t[36]) throw "Checksum validation failed!";
- if (u = r.shift(), u != 128) throw "Version " + u + " not supported!";
- return r
- }, n
- }(), function() {
- var n = Bitcoin.Opcode = function(n) {
- this.code = n
- },
- t;
- n.prototype.toString = function() {
- return n.reverseMap[this.code]
- };
- n.map = {
- OP_0: 0,
- OP_FALSE: 0,
- OP_PUSHDATA1: 76,
- OP_PUSHDATA2: 77,
- OP_PUSHDATA4: 78,
- OP_1NEGATE: 79,
- OP_RESERVED: 80,
- OP_1: 81,
- OP_TRUE: 81,
- OP_2: 82,
- OP_3: 83,
- OP_4: 84,
- OP_5: 85,
- OP_6: 86,
- OP_7: 87,
- OP_8: 88,
- OP_9: 89,
- OP_10: 90,
- OP_11: 91,
- OP_12: 92,
- OP_13: 93,
- OP_14: 94,
- OP_15: 95,
- OP_16: 96,
- OP_NOP: 97,
- OP_VER: 98,
- OP_IF: 99,
- OP_NOTIF: 100,
- OP_VERIF: 101,
- OP_VERNOTIF: 102,
- OP_ELSE: 103,
- OP_ENDIF: 104,
- OP_VERIFY: 105,
- OP_RETURN: 106,
- OP_TOALTSTACK: 107,
- OP_FROMALTSTACK: 108,
- OP_2DROP: 109,
- OP_2DUP: 110,
- OP_3DUP: 111,
- OP_2OVER: 112,
- OP_2ROT: 113,
- OP_2SWAP: 114,
- OP_IFDUP: 115,
- OP_DEPTH: 116,
- OP_DROP: 117,
- OP_DUP: 118,
- OP_NIP: 119,
- OP_OVER: 120,
- OP_PICK: 121,
- OP_ROLL: 122,
- OP_ROT: 123,
- OP_SWAP: 124,
- OP_TUCK: 125,
- OP_CAT: 126,
- OP_SUBSTR: 127,
- OP_LEFT: 128,
- OP_RIGHT: 129,
- OP_SIZE: 130,
- OP_INVERT: 131,
- OP_AND: 132,
- OP_OR: 133,
- OP_XOR: 134,
- OP_EQUAL: 135,
- OP_EQUALVERIFY: 136,
- OP_RESERVED1: 137,
- OP_RESERVED2: 138,
- OP_1ADD: 139,
- OP_1SUB: 140,
- OP_2MUL: 141,
- OP_2DIV: 142,
- OP_NEGATE: 143,
- OP_ABS: 144,
- OP_NOT: 145,
- OP_0NOTEQUAL: 146,
- OP_ADD: 147,
- OP_SUB: 148,
- OP_MUL: 149,
- OP_DIV: 150,
- OP_MOD: 151,
- OP_LSHIFT: 152,
- OP_RSHIFT: 153,
- OP_BOOLAND: 154,
- OP_BOOLOR: 155,
- OP_NUMEQUAL: 156,
- OP_NUMEQUALVERIFY: 157,
- OP_NUMNOTEQUAL: 158,
- OP_LESSTHAN: 159,
- OP_GREATERTHAN: 160,
- OP_LESSTHANOREQUAL: 161,
- OP_GREATERTHANOREQUAL: 162,
- OP_MIN: 163,
- OP_MAX: 164,
- OP_WITHIN: 165,
- OP_RIPEMD160: 166,
- OP_SHA1: 167,
- OP_SHA256: 168,
- OP_HASH160: 169,
- OP_HASH256: 170,
- OP_CODESEPARATOR: 171,
- OP_CHECKSIG: 172,
- OP_CHECKSIGVERIFY: 173,
- OP_CHECKMULTISIG: 174,
- OP_CHECKMULTISIGVERIFY: 175,
- OP_NOP1: 176,
- OP_NOP2: 177,
- OP_NOP3: 178,
- OP_NOP4: 179,
- OP_NOP5: 180,
- OP_NOP6: 181,
- OP_NOP7: 182,
- OP_NOP8: 183,
- OP_NOP9: 184,
- OP_NOP10: 185,
- OP_PUBKEYHASH: 253,
- OP_PUBKEY: 254,
- OP_INVALIDOPCODE: 255
- };
- n.reverseMap = [];
- for (t in n.map) n.reverseMap[n.map[t]] = t
- }(), function() {
- var n = Bitcoin.Opcode,
- t = Bitcoin.Script = function(n) {
- if (n)
- if ("string" == typeof n) this.buffer = Crypto.util.base64ToBytes(n);
- else if (Bitcoin.Util.isArray(n)) this.buffer = n;
- else if (n instanceof t) this.buffer = n.buffer;
- else throw new Error("Invalid script");
- else this.buffer = [];
- this.parse()
- };
- t.prototype.parse = function() {
- function u(n) {
- f.chunks.push(f.buffer.slice(t, t + n));
- t += n
- }
- var f = this,
- t, i, r;
- for (this.chunks = [], t = 0; t < this.buffer.length;) i = this.buffer[t++], i >= 240 && (i = i << 8 | this.buffer[t++]), i > 0 && i < n.map.OP_PUSHDATA1 ? u(i) : i == n.map.OP_PUSHDATA1 ? (r = this.buffer[t++], u(r)) : i == n.map.OP_PUSHDATA2 ? (r = this.buffer[t++] << 8 | this.buffer[t++], u(r)) : i == n.map.OP_PUSHDATA4 ? (r = this.buffer[t++] << 24 | this.buffer[t++] << 16 | this.buffer[t++] << 8 | this.buffer[t++], u(r)) : this.chunks.push(i)
- };
- t.prototype.getOutType = function() {
- return this.chunks[this.chunks.length - 1] == n.map.OP_CHECKMULTISIG && this.chunks[this.chunks.length - 2] <= 3 ? "Multisig" : this.chunks.length == 5 && this.chunks[0] == n.map.OP_DUP && this.chunks[1] == n.map.OP_HASH160 && this.chunks[3] == n.map.OP_EQUALVERIFY && this.chunks[4] == n.map.OP_CHECKSIG ? "Address" : this.chunks.length == 2 && this.chunks[1] == n.map.OP_CHECKSIG ? "Pubkey" : "Strange"
- };
- t.prototype.simpleOutHash = function() {
- switch (this.getOutType()) {
- case "Address":
- return this.chunks[2];
- case "Pubkey":
- return Bitcoin.Util.sha256ripe160(this.chunks[0]);
- default:
- throw new Error("Encountered non-standard scriptPubKey");
- }
- };
- t.prototype.simpleOutPubKeyHash = t.prototype.simpleOutHash;
- t.prototype.getInType = function() {
- return this.chunks.length == 1 && Bitcoin.Util.isArray(this.chunks[0]) ? "Pubkey" : this.chunks.length == 2 && Bitcoin.Util.isArray(this.chunks[0]) && Bitcoin.Util.isArray(this.chunks[1]) ? "Address" : "Strange"
- };
- t.prototype.simpleInPubKey = function() {
- switch (this.getInType()) {
- case "Address":
- return this.chunks[1];
- case "Pubkey":
- throw new Error("Script does not contain pubkey.");
- default:
- throw new Error("Encountered non-standard scriptSig");
- }
- };
- t.prototype.simpleInHash = function() {
- return Bitcoin.Util.sha256ripe160(this.simpleInPubKey())
- };
- t.prototype.simpleInPubKeyHash = t.prototype.simpleInHash;
- t.prototype.writeOp = function(n) {
- this.buffer.push(n);
- this.chunks.push(n)
- };
- t.prototype.writeBytes = function(t) {
- t.length < n.map.OP_PUSHDATA1 ? this.buffer.push(t.length) : t.length <= 255 ? (this.buffer.push(n.map.OP_PUSHDATA1), this.buffer.push(t.length)) : t.length <= 65535 ? (this.buffer.push(n.map.OP_PUSHDATA2), this.buffer.push(t.length & 255), this.buffer.push(t.length >>> 8 & 255)) : (this.buffer.push(n.map.OP_PUSHDATA4), this.buffer.push(t.length & 255), this.buffer.push(t.length >>> 8 & 255), this.buffer.push(t.length >>> 16 & 255), this.buffer.push(t.length >>> 24 & 255));
- this.buffer = this.buffer.concat(t);
- this.chunks.push(t)
- };
- t.createOutputScript = function(i) {
- var r = new t;
- return r.writeOp(n.map.OP_DUP), r.writeOp(n.map.OP_HASH160), r.writeBytes(i.hash), r.writeOp(n.map.OP_EQUALVERIFY), r.writeOp(n.map.OP_CHECKSIG), r
- };
- t.prototype.extractAddresses = function(t) {
- switch (this.getOutType()) {
- case "Address":
- return t.push(new Address(this.chunks[2])), 1;
- case "Pubkey":
- return t.push(new Address(Util.sha256ripe160(this.chunks[0]))), 1;
- case "Multisig":
- for (var i = 1; i < this.chunks.length - 2; ++i) t.push(new Address(Util.sha256ripe160(this.chunks[i])));
- return this.chunks[0] - n.map.OP_1 + 1;
- default:
- throw new Error("Encountered non-standard scriptPubKey");
- }
- };
- t.createMultiSigOutputScript = function(t, i) {
- var r = new Bitcoin.Script,
- u;
- for (r.writeOp(n.map.OP_1 + t - 1), u = 0; u < i.length; ++u) r.writeBytes(i[u]);
- return r.writeOp(n.map.OP_1 + i.length - 1), r.writeOp(n.map.OP_CHECKMULTISIG), r
- };
- t.createInputScript = function(n, i) {
- var r = new t;
- return r.writeBytes(n), r.writeBytes(i), r
- };
- t.prototype.clone = function() {
- return new t(this.buffer)
- }
- }(), function() {
- var t = Bitcoin.Script,
- n = Bitcoin.Transaction = function(n) {
- var t;
- if (this.version = 1, this.lock_time = 0, this.ins = [], this.outs = [], this.timestamp = null, this.block = null, n) {
- if (n.hash && (this.hash = n.hash), n.version && (this.version = n.version), n.lock_time && (this.lock_time = n.lock_time), n.ins && n.ins.length)
- for (t = 0; t < n.ins.length; t++) this.addInput(new i(n.ins[t]));
- if (n.outs && n.outs.length)
- for (t = 0; t < n.outs.length; t++) this.addOutput(new r(n.outs[t]));
- n.timestamp && (this.timestamp = n.timestamp);
- n.block && (this.block = n.block)
- }
- },
- i, r;
- n.objectify = function(t) {
- for (var r = [], i = 0; i < t.length; i++) r.push(new n(t[i]));
- return r
- };
- n.prototype.addInput = function(n, t) {
- arguments[0] instanceof i ? this.ins.push(arguments[0]) : this.ins.push(new i({
- outpoint: {
- hash: n.hash,
- index: t
- },
- script: new Bitcoin.Script,
- sequence: 4294967295
- }))
- };
- n.prototype.addOutput = function(n, i) {
- if (arguments[0] instanceof r) this.outs.push(arguments[0]);
- else {
- if (i instanceof BigInteger)
- for (i = i.toByteArrayUnsigned().reverse(); i.length < 8;) i.push(0);
- else Bitcoin.Util.isArray(i);
- this.outs.push(new r({
- value: i,
- script: t.createOutputScript(n)
- }))
- }
- };
- n.prototype.serialize = function() {
- var n = [],
- r, t, u, i;
- for (n = n.concat(Crypto.util.wordsToBytes([parseInt(this.version)]).reverse()), n = n.concat(Bitcoin.Util.numToVarInt(this.ins.length)), t = 0; t < this.ins.length; t++) r = this.ins[t], n = n.concat(Crypto.util.base64ToBytes(r.outpoint.hash)), n = n.concat(Crypto.util.wordsToBytes([parseInt(r.outpoint.index)]).reverse()), i = r.script.buffer, n = n.concat(Bitcoin.Util.numToVarInt(i.length)), n = n.concat(i), n = n.concat(Crypto.util.wordsToBytes([parseInt(r.sequence)]).reverse());
- for (n = n.concat(Bitcoin.Util.numToVarInt(this.outs.length)), t = 0; t < this.outs.length; t++) u = this.outs[t], n = n.concat(u.value), i = u.script.buffer, n = n.concat(Bitcoin.Util.numToVarInt(i.length)), n = n.concat(i);
- return n.concat(Crypto.util.wordsToBytes([parseInt(this.lock_time)]).reverse())
- };
- var u = 2,
- f = 3,
- e = 80;
- n.prototype.hashTransactionForSignature = function(n, i, r) {
- for (var h, c, o = this.clone(), s = 0; s < o.ins.length; s++) o.ins[s].script = new t;
- if (o.ins[i].script = n, (r & 31) == u)
- for (o.outs = [], s = 0; s < o.ins.length; s++) s != i && (o.ins[s].sequence = 0);
- else(r & 31) == f;
- return r & e && (o.ins = [o.ins[i]]), h = o.serialize(), h = h.concat(Crypto.util.wordsToBytes([parseInt(r)]).reverse()), c = Crypto.SHA256(h, {
- asBytes: !0
- }), Crypto.SHA256(c, {
- asBytes: !0
- })
- };
- n.prototype.getHash = function() {
- var n = this.serialize();
- return Crypto.SHA256(Crypto.SHA256(n, {
- asBytes: !0
- }), {
- asBytes: !0
- })
- };
- n.prototype.clone = function() {
- var i = new n,
- r, t, u;
- for (i.version = this.version, i.lock_time = this.lock_time, t = 0; t < this.ins.length; t++) r = this.ins[t].clone(), i.addInput(r);
- for (t = 0; t < this.outs.length; t++) u = this.outs[t].clone(), i.addOutput(u);
- return i
- };
- n.prototype.analyze = function(n) {
- var c, r, i, l, u, t;
- if (!(n instanceof Bitcoin.Wallet)) return null;
- var f = !0,
- e = !0,
- o = null,
- s = null,
- h = null;
- for (i = this.outs.length - 1; i >= 0; i--) c = this.outs[i], r = c.script.simpleOutPubKeyHash(), n.hasHash(r) ? s = r : e = !1, o = r;
- for (i = this.ins.length - 1; i >= 0; i--)
- if (l = this.ins[i], h = l.script.simpleInPubKeyHash(), !n.hasHash(h)) {
- f = !1;
- break
- }
- return u = this.calcImpact(n), t = {}, t.impact = u, u.sign > 0 && u.value.compareTo(BigInteger.ZERO) > 0 ? (t.type = "recv", t.addr = new Bitcoin.Address(s)) : f && e ? t.type = "self" : f ? (t.type = "sent", t.addr = new Bitcoin.Address(o)) : t.type = "other", t
- };
- n.prototype.getDescription = function(n) {
- var t = this.analyze(n);
- if (!t) return "";
- switch (t.type) {
- case "recv":
- return "Received with " + t.addr;
- case "sent":
- return "Payment to " + t.addr;
- case "self":
- return "Payment to yourself";
- case "other":
- default:
- return ""
- }
- };
- n.prototype.getTotalOutValue = function() {
- for (var i, n = BigInteger.ZERO, t = 0; t < this.outs.length; t++) i = this.outs[t], n = n.add(Bitcoin.Util.valueToBigInt(i.value));
- return n
- };
- n.prototype.getTotalValue = n.prototype.getTotalOutValue;
- n.prototype.calcImpact = function(n) {
- var i, e, r, t, f, u, o;
- if (!(n instanceof Bitcoin.Wallet)) return BigInteger.ZERO;
- for (i = BigInteger.ZERO, t = 0; t < this.outs.length; t++) e = this.outs[t], u = Crypto.util.bytesToBase64(e.script.simpleOutPubKeyHash()), n.hasHash(u) && (i = i.add(Bitcoin.Util.valueToBigInt(e.value)));
- for (r = BigInteger.ZERO, t = 0; t < this.ins.length; t++) f = this.ins[t], u = Crypto.util.bytesToBase64(f.script.simpleInPubKeyHash()), n.hasHash(u) && (o = n.txIndex[f.outpoint.hash], o && (r = r.add(Bitcoin.Util.valueToBigInt(o.outs[f.outpoint.index].value))));
- return i.compareTo(r) >= 0 ? {
- sign: 1,
- value: i.subtract(r)
- } : {
- sign: -1,
- value: r.subtract(i)
- }
- };
- i = Bitcoin.TransactionIn = function(n) {
- this.outpoint = n.outpoint;
- this.script = n.script instanceof t ? n.script : new t(n.script);
- this.sequence = n.sequence
- };
- i.prototype.clone = function() {
- return new i({
- outpoint: {
- hash: this.outpoint.hash,
- index: this.outpoint.index
- },
- script: this.script.clone(),
- sequence: this.sequence
- })
- };
- r = Bitcoin.TransactionOut = function(n) {
- if (this.script = n.script instanceof t ? n.script : new t(n.script), Bitcoin.Util.isArray(n.value)) this.value = n.value;
- else if ("string" == typeof n.value) {
- for (var i = new BigInteger(n.value, 10).toString(16); i.length < 16;) i = "0" + i;
- this.value = Crypto.util.hexToBytes(i)
- }
- };
- r.prototype.clone = function() {
- return new r({
- script: this.script.clone(),
- value: this.value.slice(0)
- })
- }
- }(), Bitcoin.Wallet = function() {
- var t = Bitcoin.Script,
- i = Bitcoin.TransactionIn,
- r = Bitcoin.TransactionOut,
- n = function() {
- var n = [];
- this.addressHashes = [];
- this.txIndex = {};
- this.unspentOuts = [];
- this.addressPointer = 0;
- this.addKey = function(t, i) {
- t instanceof Bitcoin.ECKey || (t = new Bitcoin.ECKey(t));
- n.push(t);
- i && ("string" == typeof i && (i = Crypto.util.base64ToBytes(i)), t.setPub(i));
- this.addressHashes.push(t.getBitcoinAddress().getHashBase64())
- };
- this.addKeys = function(n, t) {
- "string" == typeof n && (n = n.split(","));
- "string" == typeof t && (t = t.split(","));
- var i;
- if (Array.isArray(t) && n.length == t.length)
- for (i = 0; i < n.length; i++) this.addKey(n[i], t[i]);
- else
- for (i = 0; i < n.length; i++) this.addKey(n[i])
- };
- this.getKeys = function() {
- for (var i = [], t = 0; t < n.length; t++) i.push(n[t].toString("base64"));
- return i
- };
- this.getPubKeys = function() {
- for (var i = [], t = 0; t < n.length; t++) i.push(Crypto.util.bytesToBase64(n[t].getPub()));
- return i
- };
- this.clear = function() {
- n = []
- };
- this.getLength = function() {
- return n.length
- };
- this.getAllAddresses = function() {
- for (var i = [], t = 0; t < n.length; t++) i.push(n[t].getBitcoinAddress());
- return i
- };
- this.getCurAddress = function() {
- return n[this.addressPointer] ? n[this.addressPointer].getBitcoinAddress() : null
- };
- this.getNextAddress = function() {
- return this.addressPointer++, n[this.addressPointer] || this.generateAddress(), n[this.addressPointer].getBitcoinAddress()
- };
- this.signWithKey = function(t, i) {
- t = Crypto.util.bytesToBase64(t);
- for (var r = 0; r < this.addressHashes.length; r++)
- if (this.addressHashes[r] == t) return n[r].sign(i);
- throw new Error("Missing key for signature");
- };
- this.getPubKeyFromHash = function(t) {
- t = Crypto.util.bytesToBase64(t);
- for (var i = 0; i < this.addressHashes.length; i++)
- if (this.addressHashes[i] == t) return n[i].getPub();
- throw new Error("Hash unknown");
- }
- };
- return n.prototype.generateAddress = function() {
- this.addKey(new Bitcoin.ECKey)
- }, n.prototype.process = function(n) {
- var t, u, e, s, o, h, f;
- if (!this.txIndex[n.hash]) {
- for (t = 0; t < n.outs.length; t++)
- for (s = new r(n.outs[t]), e = Crypto.util.bytesToBase64(s.script.simpleOutPubKeyHash()), u = 0; u < this.addressHashes.length; u++)
- if (this.addressHashes[u] === e) {
- this.unspentOuts.push({
- tx: n,
- index: t,
- out: s
- });
- break
- }
- for (t = 0; t < n.ins.length; t++)
- for (o = new i(n.ins[t]), h = o.script.simpleInPubKey(), e = Crypto.util.bytesToBase64(Bitcoin.Util.sha256ripe160(h)), u = 0; u < this.addressHashes.length; u++)
- if (this.addressHashes[u] === e) {
- for (f = 0; f < this.unspentOuts.length; f++) o.outpoint.hash == this.unspentOuts[f].tx.hash && o.outpoint.index == this.unspentOuts[f].index && this.unspentOuts.splice(f, 1);
- break
- }
- this.txIndex[n.hash] = n
- }
- }, n.prototype.getBalance = function() {
- for (var i, n = BigInteger.valueOf(0), t = 0; t < this.unspentOuts.length; t++) i = this.unspentOuts[t].out, n = n.add(Bitcoin.Util.valueToBigInt(i.value));
- return n
- }, n.prototype.createSend = function(n, i, r) {
- for (var e = [], s = i.add(r), o = BigInteger.ZERO, h, f, c, u = 0; u < this.unspentOuts.length; u++)
- if (e.push(this.unspentOuts[u]), o = o.add(Bitcoin.Util.valueToBigInt(this.unspentOuts[u].out.value)), o.compareTo(s) >= 0) break;
- if (o.compareTo(s) < 0) throw new Error("Insufficient funds.");
- for (h = o.subtract(s), f = new Bitcoin.Transaction, u = 0; u < e.length; u++) f.addInput(e[u].tx, e[u].index);
- for (f.addOutput(n, i), h.compareTo(BigInteger.ZERO) > 0 && f.addOutput(this.getNextAddress(), h), c = 1, u = 0; u < f.ins.length; u++) {
- var v = f.hashTransactionForSignature(e[u].out.script, u, c),
- l = e[u].out.script.simpleOutPubKeyHash(),
- a = this.signWithKey(l, v);
- a.push(parseInt(c, 10));
- f.ins[u].script = t.createInputScript(a, this.getPubKeyFromHash(l))
- }
- return f
- }, n.prototype.clearTransactions = function() {
- this.txIndex = {};
- this.unspentOuts = []
- }, n.prototype.hasHash = function(n) {
- Bitcoin.Util.isArray(n) && (n = Crypto.util.bytesToBase64(n));
- for (var t = 0; t < this.addressHashes.length; t++)
- if (this.addressHashes[t] === n) return !0;
- return !1
- }, n
- }(), TransactionDatabase = function() {
- this.txs = [];
- this.txIndex = {}
- }, EventEmitter.augment(TransactionDatabase.prototype), TransactionDatabase.prototype.addTransaction = function(n) {
- this.addTransactionNoUpdate(n);
- $(this).trigger("update")
- }, TransactionDatabase.prototype.addTransactionNoUpdate = function(n) {
- this.txIndex[n.hash] || (this.txs.push(new Bitcoin.Transaction(n)), this.txIndex[n.hash] = n)
- }, TransactionDatabase.prototype.removeTransaction = function(n) {
- this.removeTransactionNoUpdate(n);
- $(this).trigger("update")
- }, TransactionDatabase.prototype.removeTransactionNoUpdate = function(n) {
- var r = this.txIndex[n],
- t, i;
- if (r) {
- for (t = 0, i = this.txs.length; t < i; t++)
- if (this.txs[t].hash == n) {
- this.txs.splice(t, 1);
- break
- }
- delete this.txIndex[n]
- }
- }, TransactionDatabase.prototype.loadTransactions = function(n) {
- for (var t = 0; t < n.length; t++) this.addTransactionNoUpdate(n[t]);
- $(this).trigger("update")
- }, TransactionDatabase.prototype.getTransactions = function() {
- return this.txs
- }, TransactionDatabase.prototype.clear = function() {
- this.txs = [];
- this.txIndex = {};
- $(this).trigger("update")
- }, function() {
- var n = function() {
- function n() {
- var i;
- this.digits = 0;
- this.form = 0;
- this.lostDigits = !1;
- this.roundingMode = 0;
- var t = this.DEFAULT_FORM,
- u = this.DEFAULT_LOSTDIGITS,
- r = this.DEFAULT_ROUNDINGMODE;
- if (n.arguments.length == 4) t = n.arguments[1], u = n.arguments[2], r = n.arguments[3];
- else if (n.arguments.length == 3) t = n.arguments[1], u = n.arguments[2];
- else if (n.arguments.length == 2) t = n.arguments[1];
- else if (n.arguments.length != 1) throw "MathContext(): " + n.arguments.length + " arguments given; expected 1 to 4";
- if (i = n.arguments[0], i != this.DEFAULT_DIGITS) {
- if (i < this.MIN_DIGITS) throw "MathContext(): Digits too small: " + i;
- if (i > this.MAX_DIGITS) throw "MathContext(): Digits too large: " + i;
- }
- if (t != this.SCIENTIFIC && t != this.ENGINEERING && t != this.PLAIN) throw "MathContext() Bad form value: " + t;
- if (!this.isValidRound(r)) throw "MathContext(): Bad roundingMode value: " + r;
- this.digits = i;
- this.form = t;
- this.lostDigits = u;
- this.roundingMode = r;
- return
- }
- function t() {
- return this.digits
- }
- function i() {
- return this.form
- }
- function r() {
- return this.lostDigits
- }
- function u() {
- return this.roundingMode
- }
- function f() {
- var i = null,
- n = 0,
- r = null,
- t;
- i = this.form == this.SCIENTIFIC ? "SCIENTIFIC" : this.form == this.ENGINEERING ? "ENGINEERING" : "PLAIN";
- t = this.ROUNDS.length;
- n = 0;
- n: for (; t > 0; t--, n++)
- if (this.roundingMode == this.ROUNDS[n]) {
- r = this.ROUNDWORDS[n];
- break n
- }
- return "digits=" + this.digits + " form=" + i + " lostDigits=" + (this.lostDigits ? "1" : "0") + " roundingMode=" + r
- }
- function e(n) {
- for (var t = 0, i = this.ROUNDS.length, t = 0; i > 0; i--, t++)
- if (n == this.ROUNDS[t]) return !0;
- return !1
- }
- return n.prototype.getDigits = t, n.prototype.getForm = i, n.prototype.getLostDigits = r, n.prototype.getRoundingMode = u, n.prototype.toString = f, n.prototype.isValidRound = e, n.PLAIN = n.prototype.PLAIN = 0, n.SCIENTIFIC = n.prototype.SCIENTIFIC = 1, n.ENGINEERING = n.prototype.ENGINEERING = 2, n.ROUND_CEILING = n.prototype.ROUND_CEILING = 2, n.ROUND_DOWN = n.prototype.ROUND_DOWN = 1, n.ROUND_FLOOR = n.prototype.ROUND_FLOOR = 3, n.ROUND_HALF_DOWN = n.prototype.ROUND_HALF_DOWN = 5, n.ROUND_HALF_EVEN = n.prototype.ROUND_HALF_EVEN = 6, n.ROUND_HALF_UP = n.prototype.ROUND_HALF_UP = 4, n.ROUND_UNNECESSARY = n.prototype.ROUND_UNNECESSARY = 7, n.ROUND_UP = n.prototype.ROUND_UP = 0, n.prototype.DEFAULT_FORM = n.prototype.SCIENTIFIC, n.prototype.DEFAULT_DIGITS = 9, n.prototype.DEFAULT_LOSTDIGITS = !1, n.prototype.DEFAULT_ROUNDINGMODE = n.prototype.ROUND_HALF_UP, n.prototype.MIN_DIGITS = 0, n.prototype.MAX_DIGITS = 999999999, n.prototype.ROUNDS = [n.prototype.ROUND_HALF_UP, n.prototype.ROUND_UNNECESSARY, n.prototype.ROUND_CEILING, n.prototype.ROUND_DOWN, n.prototype.ROUND_FLOOR, n.prototype.ROUND_HALF_DOWN, n.prototype.ROUND_HALF_EVEN, n.prototype.ROUND_UP], n.prototype.ROUNDWORDS = ["ROUND_HALF_UP", "ROUND_UNNECESSARY", "ROUND_CEILING", "ROUND_DOWN", "ROUND_FLOOR", "ROUND_HALF_DOWN", "ROUND_HALF_EVEN", "ROUND_UP"], n.prototype.DEFAULT = new n(n.prototype.DEFAULT_DIGITS, n.prototype.DEFAULT_FORM, n.prototype.DEFAULT_LOSTDIGITS, n.prototype.DEFAULT_ROUNDINGMODE), n
- }(),
- t = function(n) {
- function p(n, t) {
- return (n - n % t) / t
- }
- function nt(n, t, i, r, u) {
- var f;
- if (r > t)
- for (f = u - 1; f >= 0; --f) i[f + r] = n[f + t];
- else
- for (f = 0; f < u; ++f) i[f + r] = n[f + t]
- }
- function d(n) {
- for (var i = new Array(n), t = 0; t < n; ++t) i[t] = 0;
- return i
- }
- function t() {
- var i, u, e, k, d, it, g, nt;
- if (this.ind = 0, this.form = n.prototype.PLAIN, this.mant = null, this.exp = 0, t.arguments.length != 0) {
- t.arguments.length == 1 ? (i = t.arguments[0], u = 0, e = i.length) : (i = t.arguments[0], u = t.arguments[1], e = t.arguments[2]);
- typeof i == "string" && (i = i.split(""));
- var p, l, s, h, a, r = 0,
- f = 0,
- w = !1,
- v = 0,
- y = 0,
- o = 0,
- c = 0,
- tt = 0,
- b = 0;
- e <= 0 && this.bad("BigDecimal(): ", i);
- this.ind = this.ispos;
- i[0] == "-" ? (e--, e == 0 && this.bad("BigDecimal(): ", i), this.ind = this.isneg, u++) : i[0] == "+" && (e--, e == 0 && this.bad("BigDecimal(): ", i), u++);
- p = !1;
- l = !1;
- s = 0;
- h = -1;
- a = -1;
- k = e;
- r = u;
- n: for (; k > 0; k--, r++) {
- if (f = i[r], f >= "0" && f <= "9") {
- a = r;
- s++;
- continue n
- }
- if (f == ".") {
- h >= 0 && this.bad("BigDecimal(): ", i);
- h = r - u;
- continue n
- }
- if (f != "e" && f != "E") {
- (f < "0" || f > "9") && this.bad("BigDecimal(): ", i);
- p = !0;
- a = r;
- s++;
- continue n
- }
- for (r - u > e - 2 && this.bad("BigDecimal(): ", i), w = !1, i[r + 1] == "-" ? (w = !0, v = r + 2) : v = i[r + 1] == "+" ? r + 2 : r + 1, y = e - (v - u), (y == 0 || y > 9) && this.bad("BigDecimal(): ", i), d = y, o = v; d > 0; d--, o++) c = i[o], c < "0" && this.bad("BigDecimal(): ", i), c > "9" ? this.bad("BigDecimal(): ", i) : tt = c - "0", this.exp = this.exp * 10 + tt;
- w && (this.exp = -this.exp);
- l = !0;
- break n
- }
- s == 0 && this.bad("BigDecimal(): ", i);
- h >= 0 && (this.exp = this.exp + h - s);
- it = a - 1;
- r = u;
- n: for (; r <= it; r++)
- if (f = i[r], f == "0") u++, h--, s--;
- else
- if (f == ".") u++, h--;
- else if (f <= "9") break n;
- else break n;
- if (this.mant = new Array(s), o = u, p) {
- do
- for (g = s, r = 0; g > 0; g--, r++) r == h && o++, c = i[o], c <= "9" ? this.mant[r] = c - "0" : this.bad("BigDecimal(): ", i), o++; while (0)
- } else
- do
- for (nt = s, r = 0; nt > 0; nt--, r++) r == h && o++, this.mant[r] = i[o] - "0", o++; while (0);
- this.mant[0] == 0 ? (this.ind = this.iszero, this.exp > 0 && (this.exp = 0), l && (this.mant = this.ZERO.mant, this.exp = 0)) : l && (this.form = n.prototype.SCIENTIFIC, b = this.exp + this.mant.length - 1, (b < this.MinExp || b > this.MaxExp) && this.bad("BigDecimal(): ", i));
- return
- }
- }
- function w() {
- var n;
- if (w.arguments.length == 1) n = w.arguments[0];
- else if (w.arguments.length == 0) n = this.plainMC;
- else throw "abs(): " + w.arguments.length + " arguments given; expected 0 or 1";
- return this.ind == this.isneg ? this.negate(n) : this.plus(n)
- }
- function f() {
- var h;
- if (f.arguments.length == 2) h = f.arguments[1];
- else if (f.arguments.length == 1) h = this.plainMC;
- else throw "add(): " + f.arguments.length + " arguments given; expected 1 or 2";
- var e = f.arguments[0],
- u, r, i, a, o, v, s, c = 0,
- l = 0,
- k = 0,
- p = null,
- w = 0,
- y = 0,
- nt = 0,
- d = 0,
- b = 0,
- g = 0;
- if (h.lostDigits && this.checkdigits(e, h.digits), u = this, u.ind == 0 && h.form != n.prototype.PLAIN) return e.plus(h);
- if (e.ind == 0 && h.form != n.prototype.PLAIN) return u.plus(h);
- r = h.digits;
- r > 0 && (u.mant.length > r && (u = this.clone(u).round(h)), e.mant.length > r && (e = this.clone(e).round(h)));
- i = new t;
- a = u.mant;
- o = u.mant.length;
- v = e.mant;
- s = e.mant.length;
- do
- if (u.exp == e.exp) i.exp = u.exp;
- else if (u.exp > e.exp) {
- if (c = o + u.exp - e.exp, c >= s + r + 1 && r > 0) return i.mant = a, i.exp = u.exp, i.ind = u.ind, o < r && (i.mant = this.extend(u.mant, r), i.exp = i.exp - (r - o)), i.finish(h, !1);
- i.exp = e.exp;
- c > r + 1 && r > 0 && (l = c - r - 1, s = s - l, i.exp = i.exp + l, c = r + 1);
- c > o && (o = c)
- } else {
- if (c = s + e.exp - u.exp, c >= o + r + 1 && r > 0) return i.mant = v, i.exp = e.exp, i.ind = e.ind, s < r && (i.mant = this.extend(e.mant, r), i.exp = i.exp - (r - s)), i.finish(h, !1);
- i.exp = u.exp;
- c > r + 1 && r > 0 && (l = c - r - 1, o = o - l, i.exp = i.exp + l, c = r + 1);
- c > s && (s = c)
- }
- while (0);
- if (i.ind = u.ind == this.iszero ? this.ispos : u.ind, (u.ind == this.isneg ? 1 : 0) == (e.ind == this.isneg ? 1 : 0)) k = 1;
- else
- do {
- k = -1;
- do
- if (e.ind != this.iszero)
- if (o < s || u.ind == this.iszero) p = a, a = v, v = p, l = o, o = s, s = l, i.ind = -i.ind;
- else if (!(o > s)) {
- w = 0;
- y = 0;
- nt = a.length - 1;
- d = v.length - 1;
- i: for (;;) {
- if (w <= nt) b = a[w];
- else {
- if (y > d) {
- if (h.form != n.prototype.PLAIN) return this.ZERO;
- break i
- }
- b = 0
- }
- if (g = y <= d ? v[y] : 0, b != g) {
- b < g && (p = a, a = v, v = p, l = o, o = s, s = l, i.ind = -i.ind);
- break i
- }
- w++;
- y++
- }
- } while (0)
- } while (0);
- return i.mant = this.byteaddsub(a, o, v, s, k, !1), i.finish(h, !1)
- }
- function e() {
- var t, f;
- if (e.arguments.length == 2) t = e.arguments[1];
- else if (e.arguments.length == 1) t = this.plainMC;
- else throw "compareTo(): " + e.arguments.length + " arguments given; expected 1 or 2";
- var n = e.arguments[0],
- r = 0,
- i = 0,
- u;
- if (t.lostDigits && this.checkdigits(n, t.digits), this.ind == n.ind && this.exp == n.exp) {
- if (r = this.mant.length, r < n.mant.length) return -this.ind;
- if (r > n.mant.length) return this.ind;
- if (r <= t.digits || t.digits == 0) {
- for (f = r, i = 0; f > 0; f--, i++) {
- if (this.mant[i] < n.mant[i]) return -this.ind;
- if (this.mant[i] > n.mant[i]) return this.ind
- }
- return 0
- }
- } else {
- if (this.ind < n.ind) return -1;
- if (this.ind > n.ind) return 1
- }
- return u = this.clone(n), u.ind = -u.ind, this.add(u, t).ind
- }
- function i() {
- var t, r = -1,
- u;
- if (i.arguments.length == 2) t = typeof i.arguments[1] == "number" ? new n(0, n.prototype.PLAIN, !1, i.arguments[1]) : i.arguments[1];
- else if (i.arguments.length == 3) {
- if (r = i.arguments[1], r < 0) throw "divide(): Negative scale: " + r;
- t = new n(0, n.prototype.PLAIN, !1, i.arguments[2])
- } else if (i.arguments.length == 1) t = this.plainMC;
- else throw "divide(): " + i.arguments.length + " arguments given; expected between 1 and 3";
- return u = i.arguments[0], this.dodivide("D", u, t, r)
- }
- function o() {
- var n, t;
- if (o.arguments.length == 2) n = o.arguments[1];
- else if (o.arguments.length == 1) n = this.plainMC;
- else throw "divideInteger(): " + o.arguments.length + " arguments given; expected 1 or 2";
- return t = o.arguments[0], this.dodivide("I", t, n, 0)
- }
- function s() {
- var n, t;
- if (s.arguments.length == 2) n = s.arguments[1];
- else if (s.arguments.length == 1) n = this.plainMC;
- else throw "max(): " + s.arguments.length + " arguments given; expected 1 or 2";
- return t = s.arguments[0], this.compareTo(t, n) >= 0 ? this.plus(n) : t.plus(n)
- }
- function h() {
- var n, t;
- if (h.arguments.length == 2) n = h.arguments[1];
- else if (h.arguments.length == 1) n = this.plainMC;
- else throw "min(): " + h.arguments.length + " arguments given; expected 1 or 2";
- return t = h.arguments[0], this.compareTo(t, n) <= 0 ? this.plus(n) : t.plus(n)
- }
- function c() {
- var r, y;
- if (c.arguments.length == 2) r = c.arguments[1];
- else if (c.arguments.length == 1) r = this.plainMC;
- else throw "multiply(): " + c.arguments.length + " arguments given; expected 1 or 2";
- var n = c.arguments[0],
- i, u, l, e = null,
- o = null,
- s, p = 0,
- h, f, a = 0,
- v = 0;
- for (r.lostDigits && this.checkdigits(n, r.digits), i = this, u = 0, l = r.digits, l > 0 ? (i.mant.length > l && (i = this.clone(i).round(r)), n.mant.length > l && (n = this.clone(n).round(r))) : (i.exp > 0 && (u = u + i.exp), n.exp > 0 && (u = u + n.exp)), i.mant.length < n.mant.length ? (e = i.mant, o = n.mant) : (e = n.mant, o = i.mant), s = e.length + o.length - 1, p = e[0] * o[0] > 9 ? s + 1 : s, h = new t, f = this.createArrayWithZeros(p), y = e.length, a = 0; y > 0; y--, a++) v = e[a], v != 0 && (f = this.byteaddsub(f, f.length, o, s, v, !0)), s--;
- return h.ind = i.ind * n.ind, h.exp = i.exp + n.exp - u, h.mant = u == 0 ? f : this.extend(f, f.length + u), h.finish(r, !1)
- }
- function b() {
- var n, t;
- if (b.arguments.length == 1) n = b.arguments[0];
- else if (b.arguments.length == 0) n = this.plainMC;
- else throw "negate(): " + b.arguments.length + " arguments given; expected 0 or 1";
- return n.lostDigits && this.checkdigits(null, n.digits), t = this.clone(this), t.ind = -t.ind, t.finish(n, !1)
- }
- function k() {
- var t;
- if (k.arguments.length == 1) t = k.arguments[0];
- else if (k.arguments.length == 0) t = this.plainMC;
- else throw "plus(): " + k.arguments.length + " arguments given; expected 0 or 1";
- return (t.lostDigits && this.checkdigits(null, t.digits), t.form == n.prototype.PLAIN && this.form == n.prototype.PLAIN && (this.mant.length <= t.digits || t.digits == 0)) ? this : this.clone(this).finish(t, !1)
- }
- function l() {
- var r;
- if (l.arguments.length == 2) r = l.arguments[1];
- else if (l.arguments.length == 1) r = this.plainMC;
- else throw "pow(): " + l.arguments.length + " arguments given; expected 1 or 2";
- var t = l.arguments[0],
- u, f, e, s = 0,
- a = 0,
- o, i, h, c = 0;
- if (r.lostDigits && this.checkdigits(t, r.digits), u = t.intcheck(this.MinArg, this.MaxArg), f = this, e = r.digits, e == 0) {
- if (t.ind == this.isneg) throw "pow(): Negative power: " + t.toString();
- s = 0
- } else {
- if (t.mant.length + t.exp > e) throw "pow(): Too many digits: " + t.toString();
- f.mant.length > e && (f = this.clone(f).round(r));
- a = t.mant.length + t.exp;
- s = e + a + 1
- }
- if (o = new n(s, r.form, !1, r.roundingMode), i = this.ONE, u == 0) return i;
- u < 0 && (u = -u);
- h = !1;
- c = 1;
- n: for (;; c++) {
- if (u <<= 1, u < 0 && (h = !0, i = i.multiply(f, o)), c == 31) break n;
- h && (i = i.multiply(i, o))
- }
- return t.ind < 0 && (i = this.ONE.divide(i, o)), i.finish(r, !0)
- }
- function a() {
- var n, t;
- if (a.arguments.length == 2) n = a.arguments[1];
- else if (a.arguments.length == 1) n = this.plainMC;
- else throw "remainder(): " + a.arguments.length + " arguments given; expected 1 or 2";
- return t = a.arguments[0], this.dodivide("R", t, n, -1)
- }
- function v() {
- var n, i, t;
- if (v.arguments.length == 2) n = v.arguments[1];
- else if (v.arguments.length == 1) n = this.plainMC;
- else throw "subtract(): " + v.arguments.length + " arguments given; expected 1 or 2";
- return i = v.arguments[0], n.lostDigits && this.checkdigits(i, n.digits), t = this.clone(i), t.ind = -t.ind, this.add(t, n)
- }
- function tt(n) {
- var r, i = 0,
- u = null,
- f = null,
- e, o;
- if (n == null || !(n instanceof t) || (r = n, this.ind != r.ind)) return !1;
- if (this.mant.length == r.mant.length && this.exp == r.exp && this.form == r.form) {
- for (e = this.mant.length, i = 0; e > 0; e--, i++)
- if (this.mant[i] != r.mant[i]) return !1
- } else {
- if (u = this.layout(), f = r.layout(), u.length != f.length) return !1;
- for (o = u.length, i = 0; o > 0; o--, i++)
- if (u[i] != f[i]) return !1
- }
- return !0
- }
- function r() {
- var f, y, s, c, k, d, g, nt, tt;
- if (r.arguments.length == 6) f = r.arguments[2], y = r.arguments[3], s = r.arguments[4], c = r.arguments[5];
- else if (r.arguments.length == 2) f = -1, y = -1, s = n.prototype.SCIENTIFIC, c = this.ROUND_HALF_UP;
- else throw "format(): " + r.arguments.length + " arguments given; expected 2 or 6";
- var h = r.arguments[0],
- l = r.arguments[1],
- t, b = 0,
- a = 0,
- v = 0,
- it = null,
- w = 0,
- rt = 0,
- ut = 0,
- i, u = 0,
- e = null,
- o = 0,
- p = 0;
- if ((h < -1 || h == 0) && this.badarg("format", 1, h), l < -1 && this.badarg("format", 2, l), (f < -1 || f == 0) && this.badarg("format", 3, f), y < -1 && this.badarg("format", 4, y), s == n.prototype.SCIENTIFIC || s == n.prototype.ENGINEERING || (s == -1 ? s = n.prototype.SCIENTIFIC : this.badarg("format", 5, s)), c != this.ROUND_HALF_UP) try {
- c == -1 ? c = this.ROUND_HALF_UP : new n(9, n.prototype.SCIENTIFIC, !1, c)
- } catch (ft) {
- this.badarg("format", 6, c)
- }
- t = this.clone(this);
- do y == -1 ? t.form = n.prototype.PLAIN : t.ind == this.iszero ? t.form = n.prototype.PLAIN : (b = t.exp + t.mant.length, t.form = b > y ? s : b < -5 ? s : n.prototype.PLAIN); while (0);
- if (l >= 0) n: for (;;) {
- if (t.form == n.prototype.PLAIN ? a = -t.exp : t.form == n.prototype.SCIENTIFIC ? a = t.mant.length - 1 : (v = (t.exp + t.mant.length - 1) % 3, v < 0 && (v = 3 + v), v++, a = v >= t.mant.length ? 0 : t.mant.length - v), a == l) break n;
- if (a < l) {
- if (it = this.extend(t.mant, t.mant.length + l - a), t.mant = it, t.exp = t.exp - (l - a), t.exp < this.MinExp) throw "format(): Exponent Overflow: " + t.exp;
- break n
- }
- if (w = a - l, w > t.mant.length) {
- t.mant = this.ZERO.mant;
- t.ind = this.iszero;
- t.exp = 0;
- continue n
- }
- if (rt = t.mant.length - w, ut = t.exp, t.round(rt, c), t.exp - ut == w) break n
- }
- if (i = t.layout(), h > 0) {
- k = i.length;
- u = 0;
- n: for (; k > 0; k--, u++) {
- if (i[u] == ".") break n;
- if (i[u] == "E") break n
- }
- if (u > h && this.badarg("format", 1, h), u < h) {
- for (e = new Array(i.length + h - u), d = h - u, o = 0; d > 0; d--, o++) e[o] = " ";
- this.arraycopy(i, 0, e, o, i.length);
- i = e
- }
- }
- if (f > 0) {
- g = i.length - 1;
- u = i.length - 1;
- n: for (; g > 0; g--, u--)
- if (i[u] == "E") break n;
- if (u == 0) {
- for (e = new Array(i.length + f + 2), this.arraycopy(i, 0, e, 0, i.length), nt = f + 2, o = i.length; nt > 0; nt--, o++) e[o] = " ";
- i = e
- } else if (p = i.length - u - 2, p > f && this.badarg("format", 3, f), p < f) {
- for (e = new Array(i.length + f - p), this.arraycopy(i, 0, e, 0, u + 2), tt = f - p, o = u + 2; tt > 0; tt--, o++) e[o] = "0";
- this.arraycopy(i, u + 2, e, o, p);
- i = e
- }
- }
- return i.join("")
- }
- function it() {
- var t, r = 0,
- n, i = 0,
- u = 0,
- f;
- if (this.ind == this.iszero) return 0;
- if (t = this.mant.length - 1, this.exp < 0) {
- if (t = t + this.exp, !this.allzero(this.mant, t + 1)) throw "intValueExact(): Decimal part non-zero: " + this.toString();
- if (t < 0) return 0;
- r = 0
- } else {
- if (this.exp + t > 9) throw "intValueExact(): Conversion overflow: " + this.toString();
- r = this.exp
- }
- for (n = 0, f = t + r, i = 0; i <= f; i++) n = n * 10, i <= t && (n = n + this.mant[i]);
- if (t + r == 9 && (u = p(n, 1e9), u != this.mant[0])) {
- if (n == -2147483648 && this.ind == this.isneg && this.mant[0] == 2) return n;
- throw "intValueExact(): Conversion overflow: " + this.toString();
- }
- return this.ind == this.ispos ? n : -n
- }
- function rt(n) {
- var t;
- return t = this.clone(this), t.exp = t.exp - n, t.finish(this.plainMC, !1)
- }
- function ut(n) {
- var t;
- return t = this.clone(this), t.exp = t.exp + n, t.finish(this.plainMC, !1)
- }
- function ft() {
- return this.exp >= 0 ? 0 : -this.exp
- }
- function y() {
- var u;
- if (y.arguments.length == 2) u = y.arguments[1];
- else if (y.arguments.length == 1) u = this.ROUND_UNNECESSARY;
- else throw "setScale(): " + y.arguments.length + " given; expected 1 or 2";
- var i = y.arguments[0],
- r, t, f = 0,
- e = 0;
- if (r = this.scale(), r == i && this.form == n.prototype.PLAIN) return this;
- if (t = this.clone(this), r <= i) f = r == 0 ? t.exp + i : i - r, t.mant = this.extend(t.mant, t.mant.length + f), t.exp = -i;
- else {
- if (i < 0) throw "setScale(): Negative scale: " + i;
- e = t.mant.length - (r - i);
- t = t.round(e, u);
- t.exp != -i && (t.mant = this.extend(t.mant, t.mant.length + 1), t.exp = t.exp - 1)
- }
- return t.form = n.prototype.PLAIN, t
- }
- function et() {
- return this.ind
- }
- function ot() {
- return this.layout().join("")
- }
- function st() {
- var t, e = 0,
- u = null,
- s = 0,
- o = 0,
- c = 0,
- i = null,
- r, f, h = 0,
- l, a, v, y;
- for (t = new Array(this.mant.length), l = this.mant.length, e = 0; l > 0; l--, e++) t[e] = this.mant[e] + "";
- if (this.form != n.prototype.PLAIN) {
- if (u = "", this.ind == this.isneg && (u += "-"), s = this.exp + t.length - 1, this.form == n.prototype.SCIENTIFIC) u += t[0], t.length > 1 && (u += "."), u += t.slice(1).join("");
- else
- do
- if (o = s % 3, o < 0 && (o = 3 + o), s = s - o, o++, o >= t.length)
- for (u += t.join(""), a = o - t.length; a > 0; a--) u += "0";
- else u += t.slice(0, o).join(""), u += ".", u += t.slice(o).join(""); while (0);
- return s != 0 && (s < 0 ? (c = "-", s = -s) : c = "+", u += "E", u += c, u += s), u.split("")
- }
- if (this.exp == 0) return this.ind >= 0 ? t : (i = new Array(t.length + 1), i[0] = "-", this.arraycopy(t, 0, i, 1, t.length), i);
- if (r = this.ind == this.isneg ? 1 : 0, f = this.exp + t.length, f < 1) {
- for (h = r + 2 - this.exp, i = new Array(h), r != 0 && (i[0] = "-"), i[r] = "0", i[r + 1] = ".", v = -f, e = r + 2; v > 0; v--, e++) i[e] = "0";
- return this.arraycopy(t, 0, i, r + 2 - f, t.length), i
- }
- if (f > t.length) {
- for (h = r + f, i = new Array(h), r != 0 && (i[0] = "-"), this.arraycopy(t, 0, i, r, t.length), y = f - t.length, e = r + t.length; y > 0; y--, e++) i[e] = "0";
- return i
- }
- return h = r + 1 + t.length, i = new Array(h), r != 0 && (i[0] = "-"), this.arraycopy(t, 0, i, r, f), i[r + f] = ".", this.arraycopy(t, f, i, r + f + 1, t.length - f), i
- }
- function ht(n, t) {
- var i;
- if (i = this.intValueExact(), i < n || i > t) throw "intcheck(): Conversion overflow: " + i;
- return i
- }
- function ct(i, r, u, f) {
- var o, s, it, e, nt, h, l, v, k, tt, c, y = 0,
- a = 0,
- rt = 0,
- d = 0,
- g = 0,
- w = 0,
- st = 0,
- b = 0,
- ut = null,
- ft = 0,
- ht = 0,
- et = null,
- ot, ct;
- if (u.lostDigits && this.checkdigits(r, u.digits), o = this, r.ind == 0) throw "dodivide(): Divide by 0";
- if (o.ind == 0) return u.form != n.prototype.PLAIN ? this.ZERO : f == -1 ? o : o.setScale(f);
- if (s = u.digits, s > 0 ? (o.mant.length > s && (o = this.clone(o).round(u)), r.mant.length > s && (r = this.clone(r).round(u))) : (f == -1 && (f = o.scale()), s = o.mant.length, f != -o.exp && (s = s + f + o.exp), s = s - (r.mant.length - 1) - r.exp, s < o.mant.length && (s = o.mant.length), s < r.mant.length && (s = r.mant.length)), it = o.exp - r.exp + o.mant.length - r.mant.length, it < 0 && i != "D") return i == "I" ? this.ZERO : this.clone(o).finish(u, !1);
- e = new t;
- e.ind = o.ind * r.ind;
- e.exp = it;
- e.mant = this.createArrayWithZeros(s + 1);
- nt = s + s + 1;
- h = this.extend(o.mant, nt);
- l = nt;
- v = r.mant;
- k = nt;
- tt = v[0] * 10 + 1;
- v.length > 1 && (tt = tt + v[1]);
- c = 0;
- n: for (;;) {
- y = 0;
- t: for (;;) {
- if (l < k) break t;
- if (l == k) {
- i: do {
- for (ot = l, a = 0; ot > 0; ot--, a++) {
- if (rt = a < v.length ? v[a] : 0, h[a] < rt) break t;
- if (h[a] > rt) break i
- }
- y++;
- e.mant[c] = y;
- c++;
- h[0] = 0;
- break n
- } while (0);d = h[0]
- } else d = h[0] * 10, l > 1 && (d = d + h[1]);
- if (g = p(d * 10, tt), g == 0 && (g = 1), y = y + g, h = this.byteaddsub(h, l, v, k, -g, !0), h[0] == 0) {
- ct = l - 2;
- w = 0;
- i: for (; w <= ct; w++) {
- if (h[w] != 0) break i;
- l--
- }
- w != 0 && this.arraycopy(h, w, h, 0, l)
- }
- }
- if (c != 0 || y != 0) {
- if (e.mant[c] = y, c++, c == s + 1) break n;
- if (h[0] == 0) break n
- }
- if (f >= 0 && -e.exp > f) break n;
- if (i != "D" && e.exp <= 0) break n;
- e.exp = e.exp - 1;
- k--
- }
- if (c == 0 && (c = 1), i == "I" || i == "R") {
- if (c + e.exp > s) throw "dodivide(): Integer overflow";
- if (i == "R")
- do {
- if (e.mant[0] == 0) return this.clone(o).finish(u, !1);
- if (h[0] == 0) return this.ZERO;
- e.ind = o.ind;
- st = s + s + 1 - o.mant.length;
- e.exp = e.exp - st + o.exp;
- b = l;
- a = b - 1;
- t: for (; a >= 1; a--) {
- if (!(e.exp < o.exp && e.exp < r.exp)) break;
- if (h[a] != 0) break t;
- b--;
- e.exp = e.exp + 1
- }
- return b < h.length && (ut = new Array(b), this.arraycopy(h, 0, ut, 0, b), h = ut), e.mant = h, e.finish(u, !1)
- } while (0)
- } else h[0] != 0 && (ft = e.mant[c - 1], ft % 5 == 0 && (e.mant[c - 1] = ft + 1));
- if (f >= 0)
- do return c != e.mant.length && (e.exp = e.exp - (e.mant.length - c)), ht = e.mant.length - (-e.exp - f), e.round(ht, u.roundingMode), e.exp != -f && (e.mant = this.extend(e.mant, e.mant.length + 1), e.exp = e.exp - 1), e.finish(u, !0); while (0);
- if (c == e.mant.length) e.round(u), c = s;
- else {
- if (e.mant[0] == 0) return this.ZERO;
- et = new Array(c);
- this.arraycopy(e.mant, 0, et, 0, c);
- e.mant = et
- }
- return e.finish(u, !0)
- }
- function lt(n, t) {
- throw n + "Not a number: " + t;
- }
- function at(n, t, i) {
- throw "Bad argument " + t + " to " + n + ": " + i;
- }
- function vt(n, t) {
- var i;
- return n.length == t ? n : (i = d(t), this.arraycopy(n, 0, i, 0, n.length), i)
- }
- function yt(n, t, i, r, u, f) {
- var p, k, c, s, o, h, v, e, a = 0,
- w = 0,
- l, y = 0,
- b;
- p = n.length;
- k = i.length;
- c = t - 1;
- s = r - 1;
- o = s;
- o < c && (o = c);
- h = null;
- f && o + 1 == p && (h = n);
- h == null && (h = this.createArrayWithZeros(o + 1));
- v = !1;
- u == 1 ? v = !0 : u == -1 && (v = !0);
- e = 0;
- a = o;
- n: for (; a >= 0; a--) {
- if (c >= 0 && (c < p && (e = e + n[c]), c--), s >= 0 && (s < k && (e = v ? u > 0 ? e + i[s] : e - i[s] : e + i[s] * u), s--), e < 10 && e >= 0)
- do {
- h[a] = e;
- e = 0;
- continue n
- } while (0);
- w = e + 90;
- h[a] = this.bytedig[w];
- e = this.bytecar[w]
- }
- if (e == 0) return h;
- for (l = null, f && o + 2 == n.length && (l = n), l == null && (l = new Array(o + 2)), l[0] = e, b = o + 1, y = 0; b > 0; b--, y++) l[y + 1] = h[y];
- return l
- }
- function g() {
- var r, n = 0,
- i = 0;
- r = new Array(190);
- n = 0;
- n: for (; n <= 189; n++) {
- if (i = n - 90, i >= 0) {
- r[n] = i % 10;
- t.prototype.bytecar[n] = p(i, 10);
- continue n
- }
- i = i + 100;
- r[n] = i % 10;
- t.prototype.bytecar[n] = p(i, 10) - 10
- }
- return r
- }
- function pt(n) {
- var i;
- return i = new t, i.ind = n.ind, i.exp = n.exp, i.form = n.form, i.mant = n.mant, i
- }
- function wt(n, t) {
- if (t != 0) {
- if (this.mant.length > t && !this.allzero(this.mant, t)) throw "Too many digits: " + this.toString();
- if (n != null) {
- if (n.mant.length > t && !this.allzero(n.mant, t)) throw "Too many digits: " + n.toString();
- return
- }
- }
- }
- function u() {
- var t, r, s;
- if (u.arguments.length == 2) t = u.arguments[0], r = u.arguments[1];
- else if (u.arguments.length == 1) s = u.arguments[0], t = s.digits, r = s.roundingMode;
- else throw "round(): " + u.arguments.length + " arguments given; expected 1 or 2";
- var h, i, f, c = !1,
- e = 0,
- n, o = null;
- if (h = this.mant.length - t, h <= 0) return this;
- this.exp = this.exp + h;
- i = this.ind;
- f = this.mant;
- t > 0 ? (this.mant = new Array(t), this.arraycopy(f, 0, this.mant, 0, t), c = !0, e = f[t]) : (this.mant = this.ZERO.mant, this.ind = this.iszero, c = !1, e = t == 0 ? f[0] : 0);
- n = 0;
- do
- if (r == this.ROUND_HALF_UP) e >= 5 && (n = i);
- else if (r == this.ROUND_UNNECESSARY) {
- if (!this.allzero(f, t)) throw "round(): Rounding necessary";
- } else if (r == this.ROUND_HALF_DOWN) e > 5 ? n = i : e == 5 && (this.allzero(f, t + 1) || (n = i));
- else if (r == this.ROUND_HALF_EVEN) e > 5 ? n = i : e == 5 && (this.allzero(f, t + 1) ? this.mant[this.mant.length - 1] % 2 == 1 && (n = i) : n = i);
- else if (r != this.ROUND_DOWN)
- if (r == this.ROUND_UP) this.allzero(f, t) || (n = i);
- else if (r == this.ROUND_CEILING) i > 0 && (this.allzero(f, t) || (n = i));
- else if (r == this.ROUND_FLOOR) i < 0 && (this.allzero(f, t) || (n = i));
- else throw "round(): Bad round value: " + r;
- while (0);
- if (n != 0)
- do this.ind == this.iszero ? (this.mant = this.ONE.mant, this.ind = n) : (this.ind == this.isneg && (n = -n), o = this.byteaddsub(this.mant, this.mant.length, this.ONE.mant, 1, n, c), o.length > this.mant.length ? (this.exp++, this.arraycopy(o, 0, this.mant, 0, this.mant.length)) : this.mant = o); while (0);
- if (this.exp > this.MaxExp) throw "round(): Exponent Overflow: " + this.exp;
- return this
- }
- function bt(n, t) {
- var i = 0,
- r;
- for (t < 0 && (t = 0), r = n.length - 1, i = t; i <= r; i++)
- if (n[i] != 0) return !1;
- return !0
- }
- function kt(t, i) {
- var f = 0,
- u = 0,
- e = null,
- r = 0,
- o = 0,
- s;
- if (t.digits != 0 && this.mant.length > t.digits && this.round(t), i && t.form != n.prototype.PLAIN) {
- f = this.mant.length;
- u = f - 1;
- n: for (; u >= 1; u--) {
- if (this.mant[u] != 0) break n;
- f--;
- this.exp++
- }
- f < this.mant.length && (e = new Array(f), this.arraycopy(this.mant, 0, e, 0, f), this.mant = e)
- }
- for (this.form = n.prototype.PLAIN, s = this.mant.length, u = 0; s > 0; s--, u++)
- if (this.mant[u] != 0) {
- if (u > 0)
- do e = new Array(this.mant.length - u), this.arraycopy(this.mant, u, e, 0, this.mant.length - u), this.mant = e; while (0);
- if (r = this.exp + this.mant.length, r > 0) {
- if (r > t.digits && t.digits != 0 && (this.form = t.form), r - 1 <= this.MaxExp) return this
- } else r < -5 && (this.form = t.form);
- if (r--, r < this.MinExp || r > this.MaxExp) t: do {
- if (this.form == n.prototype.ENGINEERING && (o = r % 3, o < 0 && (o = 3 + o), r = r - o, r >= this.MinExp && r <= this.MaxExp)) break t;
- throw "finish(): Exponent Overflow: " + r;
- } while (0);
- return this
- }
- if (this.ind = this.iszero, t.form != n.prototype.PLAIN) this.exp = 0;
- else if (this.exp > 0) this.exp = 0;
- else if (this.exp < this.MinExp) throw "finish(): Exponent Overflow: " + this.exp;
- return this.mant = this.ZERO.mant, this
- }
- function dt(n) {
- return this.compareTo(n) > 0
- }
- function gt(n) {
- return this.compareTo(n) < 0
- }
- function ni(n) {
- return this.compareTo(n) >= 0
- }
- function ti(n) {
- return this.compareTo(n) <= 0
- }
- function ii() {
- return this.compareTo(t.prototype.ZERO) > 0
- }
- function ri() {
- return this.compareTo(t.prototype.ZERO) < 0
- }
- function ui() {
- return this.equals(t.prototype.ZERO)
- }
- return t.prototype.div = p, t.prototype.arraycopy = nt, t.prototype.createArrayWithZeros = d, t.prototype.abs = w, t.prototype.add = f, t.prototype.compareTo = e, t.prototype.divide = i, t.prototype.divideInteger = o, t.prototype.max = s, t.prototype.min = h, t.prototype.multiply = c, t.prototype.negate = b, t.prototype.plus = k, t.prototype.pow = l, t.prototype.remainder = a, t.prototype.subtract = v, t.prototype.equals = tt, t.prototype.format = r, t.prototype.intValueExact = it, t.prototype.movePointLeft = rt, t.prototype.movePointRight = ut, t.prototype.scale = ft, t.prototype.setScale = y, t.prototype.signum = et, t.prototype.toString = ot, t.prototype.layout = st, t.prototype.intcheck = ht, t.prototype.dodivide = ct, t.prototype.bad = lt, t.prototype.badarg = at, t.prototype.extend = vt, t.prototype.byteaddsub = yt, t.prototype.diginit = g, t.prototype.clone = pt, t.prototype.checkdigits = wt, t.prototype.round = u, t.prototype.allzero = bt, t.prototype.finish = kt, t.prototype.isGreaterThan = dt, t.prototype.isLessThan = gt, t.prototype.isGreaterThanOrEqualTo = ni, t.prototype.isLessThanOrEqualTo = ti, t.prototype.isPositive = ii, t.prototype.isNegative = ri, t.prototype.isZero = ui, t.ROUND_CEILING = t.prototype.ROUND_CEILING = n.prototype.ROUND_CEILING, t.ROUND_DOWN = t.prototype.ROUND_DOWN = n.prototype.ROUND_DOWN, t.ROUND_FLOOR = t.prototype.ROUND_FLOOR = n.prototype.ROUND_FLOOR, t.ROUND_HALF_DOWN = t.prototype.ROUND_HALF_DOWN = n.prototype.ROUND_HALF_DOWN, t.ROUND_HALF_EVEN = t.prototype.ROUND_HALF_EVEN = n.prototype.ROUND_HALF_EVEN, t.ROUND_HALF_UP = t.prototype.ROUND_HALF_UP = n.prototype.ROUND_HALF_UP, t.ROUND_UNNECESSARY = t.prototype.ROUND_UNNECESSARY = n.prototype.ROUND_UNNECESSARY, t.ROUND_UP = t.prototype.ROUND_UP = n.prototype.ROUND_UP, t.prototype.ispos = 1, t.prototype.iszero = 0, t.prototype.isneg = -1, t.prototype.MinExp = -999999999, t.prototype.MaxExp = 999999999, t.prototype.MinArg = -999999999, t.prototype.MaxArg = 999999999, t.prototype.plainMC = new n(0, n.prototype.PLAIN), t.prototype.bytecar = new Array(190), t.prototype.bytedig = g(), t.ZERO = t.prototype.ZERO = new t("0"), t.ONE = t.prototype.ONE = new t("1"), t.TEN = t.prototype.TEN = new t("10"), t
- }(n);
- typeof define == "function" && define.amd != null ? define({
- BigDecimal: t,
- MathContext: n
- }) : typeof this == "object" && (this.BigDecimal = t, this.MathContext = n)
- }.call(this), ! function(n) {
- "use strict";
- n.matchMedia = n.matchMedia || function(n) {
- var u, i = n.documentElement,
- f = i.firstElementChild || i.firstChild,
- r = n.createElement("body"),
- t = n.createElement("div");
- return t.id = "mq-test-1", t.style.cssText = "position:absolute;top:-100em", r.style.background = "none", r.appendChild(t),
- function(n) {
- return t.innerHTML = '­<style media="' + n + '"> #mq-test-1 { width: 42px; }<\/style>', i.insertBefore(r, f), u = 42 === t.offsetWidth, i.removeChild(r), {
- matches: u,
- media: n
- }
- }
- }(n.document)
- }(this), function(n) {
- "use strict";
- function p() {
- y(!0)
- }
- var t = {};
- n.respond = t;
- t.update = function() {};
- var f = [],
- tt = function() {
- var t = !1;
- try {
- t = new n.XMLHttpRequest
- } catch (i) {
- t = new n.ActiveXObject("Microsoft.XMLHTTP")
- }
- return function() {
- return t
- }
- }(),
- w = function(n, t) {
- var i = tt();
- i && (i.open("GET", n, !0), i.onreadystatechange = function() {
- 4 !== i.readyState || 200 !== i.status && 304 !== i.status || t(i.responseText)
- }, 4 !== i.readyState && i.send(null))
- };
- if (t.ajax = w, t.queue = f, t.regex = {
- media: /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,
- keyframes: /@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,
- urls: /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,
- findStyles: /@media *([^\{]+)\{([\S\s]+?)$/,
- only: /(only\s+)?([a-zA-Z]+)\s?/,
- minw: /\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,
- maxw: /\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/
- }, t.mediaQueriesSupported = n.matchMedia && null !== n.matchMedia("only all") && n.matchMedia("only all").matches, !t.mediaQueriesSupported) {
- var c, b, l, i = n.document,
- r = i.documentElement,
- e = [],
- o = [],
- u = [],
- a = {},
- k = 30,
- s = i.getElementsByTagName("head")[0] || r,
- it = i.getElementsByTagName("base")[0],
- h = s.getElementsByTagName("link"),
- v = function() {
- var u, t = i.createElement("div"),
- n = i.body,
- o = r.style.fontSize,
- e = n && n.style.fontSize,
- f = !1;
- return t.style.cssText = "position:absolute;font-size:1em;width:1em", n || (n = f = i.createElement("body"), n.style.background = "none"), r.style.fontSize = "100%", n.style.fontSize = "100%", n.appendChild(t), f && r.insertBefore(n, r.firstChild), u = t.offsetWidth, f ? r.removeChild(n) : n.removeChild(t), r.style.fontSize = o, e && (n.style.fontSize = e), u = l = parseFloat(u)
- },
- y = function(t) {
- var rt = "clientWidth",
- ut = r[rt],
- ft = "CSS1Compat" === i.compatMode && ut || i.body[rt] || ut,
- p = {},
- ct = h[h.length - 1],
- et = (new Date).getTime(),
- tt, g, nt, f, it;
- if (t && c && k > et - c) return n.clearTimeout(b), b = n.setTimeout(y, k), void 0;
- c = et;
- for (tt in e)
- if (e.hasOwnProperty(tt)) {
- var a = e[tt],
- w = a.minw,
- d = a.maxw,
- ot = null === w,
- st = null === d,
- ht = "em";
- w && (w = parseFloat(w) * (w.indexOf(ht) > -1 ? l || v() : 1));
- d && (d = parseFloat(d) * (d.indexOf(ht) > -1 ? l || v() : 1));
- a.hasquery && (ot && st || !(ot || ft >= w) || !(st || d >= ft)) || (p[a.media] || (p[a.media] = []), p[a.media].push(o[a.rules]))
- }
- for (g in u) u.hasOwnProperty(g) && u[g] && u[g].parentNode === s && s.removeChild(u[g]);
- u.length = 0;
- for (nt in p) p.hasOwnProperty(nt) && (f = i.createElement("style"), it = p[nt].join("\n"), f.type = "text/css", f.media = nt, s.insertBefore(f, ct.nextSibling), f.styleSheet ? f.styleSheet.cssText = it : f.appendChild(i.createTextNode(it)), u.push(f))
- },
- d = function(n, i, r) {
- var h = n.replace(t.regex.keyframes, "").match(t.regex.media),
- c = h && h.length || 0,
- l, a, f, v, u, p, w, s;
- for (i = i.substring(0, i.lastIndexOf("/")), l = function(n) {
- return n.replace(t.regex.urls, "$1" + i + "$2$3")
- }, a = !c && r, i.length && (i += "/"), a && (c = 1), f = 0; c > f; f++)
- for (a ? (v = r, o.push(l(n))) : (v = h[f].match(t.regex.findStyles) && RegExp.$1, o.push(RegExp.$2 && l(RegExp.$2))), p = v.split(","), w = p.length, s = 0; w > s; s++) u = p[s], e.push({
- media: u.split("(")[0].match(t.regex.only) && RegExp.$2 || "all",
- rules: o.length - 1,
- hasquery: u.indexOf("(") > -1,
- minw: u.match(t.regex.minw) && parseFloat(RegExp.$1) + (RegExp.$2 || ""),
- maxw: u.match(t.regex.maxw) && parseFloat(RegExp.$1) + (RegExp.$2 || "")
- });
- y()
- },
- g = function() {
- if (f.length) {
- var t = f.shift();
- w(t.href, function(i) {
- d(i, t.href, t.media);
- a[t.href] = !0;
- n.setTimeout(function() {
- g()
- }, 0)
- })
- }
- },
- nt = function() {
- for (var r = 0; r < h.length; r++) {
- var i = h[r],
- t = i.href,
- u = i.media,
- e = i.rel && "stylesheet" === i.rel.toLowerCase();
- t && e && !a[t] && (i.styleSheet && i.styleSheet.rawCssText ? (d(i.styleSheet.rawCssText, t, u), a[t] = !0) : (!/^([a-zA-Z:]*\/\/)/.test(t) && !it || t.replace(RegExp.$1, "").split("/")[0] === n.location.host) && ("//" === t.substring(0, 2) && (t = n.location.protocol + t), f.push({
- href: t,
- media: u
- })))
- }
- g()
- };
- nt();
- t.update = nt;
- t.getEmValue = v;
- n.addEventListener ? n.addEventListener("resize", p, !1) : n.attachEvent && n.attachEvent("onresize", p)
- }
- }(this), + function(n) {
- "use strict";
- var i = '[data-dismiss="alert"]',
- t = function(t) {
- n(t).on("click", i, this.close)
- },
- r;
- t.prototype.close = function(t) {
- function f() {
- i.trigger("closed.bs.alert").remove()
- }
- var u = n(this),
- r = u.attr("data-target"),
- i;
- (r || (r = u.attr("href"), r = r && r.replace(/.*(?=#[^\s]*$)/, "")), i = n(r), t && t.preventDefault(), i.length || (i = u.hasClass("alert") ? u : u.parent()), i.trigger(t = n.Event("close.bs.alert")), t.isDefaultPrevented()) || (i.removeClass("in"), n.support.transition && i.hasClass("fade") ? i.one(n.support.transition.end, f).emulateTransitionEnd(150) : f())
- };
- r = n.fn.alert;
- n.fn.alert = function(i) {
- return this.each(function() {
- var r = n(this),
- u = r.data("bs.alert");
- u || r.data("bs.alert", u = new t(this));
- typeof i == "string" && u[i].call(r)
- })
- };
- n.fn.alert.Constructor = t;
- n.fn.alert.noConflict = function() {
- return n.fn.alert = r, this
- };
- n(document).on("click.bs.alert.data-api", i, t.prototype.close)
- }(jQuery), + function(n) {
- "use strict";
- var t = function(i, r) {
- this.$element = n(i);
- this.options = n.extend({}, t.DEFAULTS, r)
- },
- i;
- t.DEFAULTS = {
- loadingText: "loading..."
- };
- t.prototype.setState = function(n) {
- var i = "disabled",
- t = this.$element,
- r = t.is("input") ? "val" : "html",
- u = t.data();
- n = n + "Text";
- u.resetText || t.data("resetText", t[r]());
- t[r](u[n] || this.options[n]);
- setTimeout(function() {
- n == "loadingText" ? t.addClass(i).attr(i, i) : t.removeClass(i).removeAttr(i)
- }, 0)
- };
- t.prototype.toggle = function() {
- var i = this.$element.closest('[data-toggle="buttons"]'),
- t = !0,
- n;
- i.length && (n = this.$element.find("input"), n.prop("type") === "radio" && (n.prop("checked") && this.$element.hasClass("active") ? t = !1 : i.find(".active").removeClass("active")), t && n.prop("checked", !this.$element.hasClass("active")).trigger("change"));
- t && this.$element.toggleClass("active")
- };
- i = n.fn.button;
- n.fn.button = function(i) {
- return this.each(function() {
- var u = n(this),
- r = u.data("bs.button"),
- f = typeof i == "object" && i;
- r || u.data("bs.button", r = new t(this, f));
- i == "toggle" ? r.toggle() : i && r.setState(i)
- })
- };
- n.fn.button.Constructor = t;
- n.fn.button.noConflict = function() {
- return n.fn.button = i, this
- };
- n(document).on("click.bs.button.data-api", "[data-toggle^=button]", function(t) {
- var i = n(t.target);
- i.hasClass("btn") || (i = i.closest(".btn"));
- i.button("toggle");
- t.preventDefault()
- })
- }(jQuery), + function(n) {
- "use strict";
- function r() {
- n(e).remove();
- n(i).each(function(t) {
- var i = u(n(this));
- i.hasClass("open") && ((i.trigger(t = n.Event("hide.bs.dropdown")), t.isDefaultPrevented()) || i.removeClass("open").trigger("hidden.bs.dropdown"))
- })
- }
- function u(t) {
- var i = t.attr("data-target"),
- r;
- return i || (i = t.attr("href"), i = i && /#/.test(i) && i.replace(/.*(?=#[^\s]*$)/, "")), r = i && n(i), r && r.length ? r : t.parent()
- }
- var e = ".dropdown-backdrop",
- i = "[data-toggle=dropdown]",
- t = function(t) {
- n(t).on("click.bs.dropdown", this.toggle)
- },
- f;
- t.prototype.toggle = function(t) {
- var f = n(this),
- i, e;
- if (!f.is(".disabled, :disabled")) {
- if (i = u(f), e = i.hasClass("open"), r(), !e) {
- if ("ontouchstart" in document.documentElement && !i.closest(".navbar-nav").length) n('<div class="dropdown-backdrop"/>').insertAfter(n(this)).on("click", r);
- if (i.trigger(t = n.Event("show.bs.dropdown")), t.isDefaultPrevented()) return;
- i.toggleClass("open").trigger("shown.bs.dropdown");
- f.focus()
- }
- return !1
- }
- };
- t.prototype.keydown = function(t) {
- var e, o, s, f, r;
- if (/(38|40|27)/.test(t.keyCode) && (e = n(this), t.preventDefault(), t.stopPropagation(), !e.is(".disabled, :disabled"))) {
- if (o = u(e), s = o.hasClass("open"), !s || s && t.keyCode == 27) return t.which == 27 && o.find(i).focus(), e.click();
- (f = n("[role=menu] li:not(.divider):visible a", o), f.length) && (r = f.index(f.filter(":focus")), t.keyCode == 38 && r > 0 && r--, t.keyCode == 40 && r < f.length - 1 && r++, ~r || (r = 0), f.eq(r).focus())
- }
- };
- f = n.fn.dropdown;
- n.fn.dropdown = function(i) {
- return this.each(function() {
- var r = n(this),
- u = r.data("bs.dropdown");
- u || r.data("bs.dropdown", u = new t(this));
- typeof i == "string" && u[i].call(r)
- })
- };
- n.fn.dropdown.Constructor = t;
- n.fn.dropdown.noConflict = function() {
- return n.fn.dropdown = f, this
- };
- n(document).on("click.bs.dropdown.data-api", r).on("click.bs.dropdown.data-api", ".dropdown form", function(n) {
- n.stopPropagation()
- }).on("click.bs.dropdown.data-api", i, t.prototype.toggle).on("keydown.bs.dropdown.data-api", i + ", [role=menu]", t.prototype.keydown)
- }(jQuery), + function(n) {
- "use strict";
- var t = function(t, i) {
- this.options = i;
- this.$element = n(t);
- this.$backdrop = this.isShown = null;
- this.options.remote && this.$element.load(this.options.remote)
- },
- i;
- t.DEFAULTS = {
- backdrop: !0,
- keyboard: !0,
- show: !0
- };
- t.prototype.toggle = function(n) {
- return this[this.isShown ? "hide" : "show"](n)
- };
- t.prototype.show = function(t) {
- var i = this,
- r = n.Event("show.bs.modal", {
- relatedTarget: t
- });
- if (this.$element.trigger(r), !this.isShown && !r.isDefaultPrevented()) {
- this.isShown = !0;
- this.escape();
- this.$element.on("click.dismiss.modal", '[data-dismiss="modal"]', n.proxy(this.hide, this));
- this.backdrop(function() {
- var u = n.support.transition && i.$element.hasClass("fade"),
- r;
- i.$element.parent().length || i.$element.appendTo(document.body);
- i.$element.show();
- u && i.$element[0].offsetWidth;
- i.$element.addClass("in").attr("aria-hidden", !1);
- i.enforceFocus();
- r = n.Event("shown.bs.modal", {
- relatedTarget: t
- });
- u ? i.$element.find(".modal-dialog").one(n.support.transition.end, function() {
- i.$element.focus().trigger(r)
- }).emulateTransitionEnd(300) : i.$element.focus().trigger(r)
- })
- }
- };
- t.prototype.hide = function(t) {
- (t && t.preventDefault(), t = n.Event("hide.bs.modal"), this.$element.trigger(t), this.isShown && !t.isDefaultPrevented()) && (this.isShown = !1, this.escape(), n(document).off("focusin.bs.modal"), this.$element.removeClass("in").attr("aria-hidden", !0).off("click.dismiss.modal"), n.support.transition && this.$element.hasClass("fade") ? this.$element.one(n.support.transition.end, n.proxy(this.hideModal, this)).emulateTransitionEnd(300) : this.hideModal())
- };
- t.prototype.enforceFocus = function() {
- n(document).off("focusin.bs.modal").on("focusin.bs.modal", n.proxy(function(n) {
- this.$element[0] === n.target || this.$element.has(n.target).length || this.$element.focus()
- }, this))
- };
- t.prototype.escape = function() {
- if (this.isShown && this.options.keyboard) this.$element.on("keyup.dismiss.bs.modal", n.proxy(function(n) {
- n.which == 27 && this.hide()
- }, this));
- else this.isShown || this.$element.off("keyup.dismiss.bs.modal")
- };
- t.prototype.hideModal = function() {
- var n = this;
- this.$element.hide();
- this.backdrop(function() {
- n.removeBackdrop();
- n.$element.trigger("hidden.bs.modal")
- })
- };
- t.prototype.removeBackdrop = function() {
- this.$backdrop && this.$backdrop.remove();
- this.$backdrop = null
- };
- t.prototype.backdrop = function(t) {
- var u = this,
- r = this.$element.hasClass("fade") ? "fade" : "",
- i;
- if (this.isShown && this.options.backdrop) {
- i = n.support.transition && r;
- this.$backdrop = n('<div class="modal-backdrop ' + r + '" />').appendTo(document.body);
- this.$element.on("click.dismiss.modal", n.proxy(function(n) {
- n.target === n.currentTarget && (this.options.backdrop == "static" ? this.$element[0].focus.call(this.$element[0]) : this.hide.call(this))
- }, this));
- if (i && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"), !t) return;
- i ? this.$backdrop.one(n.support.transition.end, t).emulateTransitionEnd(150) : t()
- } else !this.isShown && this.$backdrop ? (this.$backdrop.removeClass("in"), n.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one(n.support.transition.end, t).emulateTransitionEnd(150) : t()) : t && t()
- };
- i = n.fn.modal;
- n.fn.modal = function(i, r) {
- return this.each(function() {
- var f = n(this),
- u = f.data("bs.modal"),
- e = n.extend({}, t.DEFAULTS, f.data(), typeof i == "object" && i);
- u || f.data("bs.modal", u = new t(this, e));
- typeof i == "string" ? u[i](r) : e.show && u.show(r)
- })
- };
- n.fn.modal.Constructor = t;
- n.fn.modal.noConflict = function() {
- return n.fn.modal = i, this
- };
- n(document).on("click.bs.modal.data-api", '[data-toggle="modal"]', function(t) {
- var i = n(this),
- r = i.attr("href"),
- u = n(i.attr("data-target") || r && r.replace(/.*(?=#[^\s]+$)/, "")),
- f = u.data("modal") ? "toggle" : n.extend({
- remote: !/#/.test(r) && r
- }, u.data(), i.data());
- t.preventDefault();
- u.modal(f, this).one("hide", function() {
- i.is(":visible") && i.focus()
- })
- });
- n(document).on("show.bs.modal", ".modal", function() {
- n(document.body).addClass("modal-open")
- }).on("hidden.bs.modal", ".modal", function() {
- n(document.body).removeClass("modal-open")
- })
- }(jQuery), + function(n) {
- "use strict";
- var t = function(n, t) {
- this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null;
- this.init("tooltip", n, t)
- },
- i;
- t.DEFAULTS = {
- animation: !0,
- placement: "top",
- selector: !1,
- template: '<div class="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',
- trigger: "hover focus",
- title: "",
- delay: 0,
- html: !1,
- container: !1
- };
- t.prototype.init = function(t, i, r) {
- var f, e, u, o, s;
- for (this.enabled = !0, this.type = t, this.$element = n(i), this.options = this.getOptions(r), f = this.options.trigger.split(" "), e = f.length; e--;)
- if (u = f[e], u == "click") this.$element.on("click." + this.type, this.options.selector, n.proxy(this.toggle, this));
- else if (u != "manual") {
- o = u == "hover" ? "mouseenter" : "focus";
- s = u == "hover" ? "mouseleave" : "blur";
- this.$element.on(o + "." + this.type, this.options.selector, n.proxy(this.enter, this));
- this.$element.on(s + "." + this.type, this.options.selector, n.proxy(this.leave, this))
- }
- this.options.selector ? this._options = n.extend({}, this.options, {
- trigger: "manual",
- selector: ""
- }) : this.fixTitle()
- };
- t.prototype.getDefaults = function() {
- return t.DEFAULTS
- };
- t.prototype.getOptions = function(t) {
- return t = n.extend({}, this.getDefaults(), this.$element.data(), t), t.delay && typeof t.delay == "number" && (t.delay = {
- show: t.delay,
- hide: t.delay
- }), t
- };
- t.prototype.getDelegateOptions = function() {
- var t = {},
- i = this.getDefaults();
- return this._options && n.each(this._options, function(n, r) {
- i[n] != r && (t[n] = r)
- }), t
- };
- t.prototype.enter = function(t) {
- var i = t instanceof this.constructor ? t : n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
- if (clearTimeout(i.timeout), i.hoverState = "in", !i.options.delay || !i.options.delay.show) return i.show();
- i.timeout = setTimeout(function() {
- i.hoverState == "in" && i.show()
- }, i.options.delay.show)
- };
- t.prototype.leave = function(t) {
- var i = t instanceof this.constructor ? t : n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
- if (clearTimeout(i.timeout), i.hoverState = "out", !i.options.delay || !i.options.delay.hide) return i.hide();
- i.timeout = setTimeout(function() {
- i.hoverState == "out" && i.hide()
- }, i.options.delay.hide)
- };
- t.prototype.show = function() {
- var o = n.Event("show.bs." + this.type),
- i, l;
- if (this.hasContent() && this.enabled) {
- if (this.$element.trigger(o), o.isDefaultPrevented()) return;
- i = this.tip();
- this.setContent();
- this.options.animation && i.addClass("fade");
- var t = typeof this.options.placement == "function" ? this.options.placement.call(this, i[0], this.$element[0]) : this.options.placement,
- s = /\s?auto?\s?/i,
- h = s.test(t);
- h && (t = t.replace(s, "") || "top");
- i.detach().css({
- top: 0,
- left: 0,
- display: "block"
- }).addClass(t);
- this.options.container ? i.appendTo(this.options.container) : i.insertAfter(this.$element);
- var r = this.getPosition(),
- u = i[0].offsetWidth,
- f = i[0].offsetHeight;
- if (h) {
- var e = this.$element.parent(),
- a = t,
- c = document.documentElement.scrollTop || document.body.scrollTop,
- v = this.options.container == "body" ? window.innerWidth : e.outerWidth(),
- y = this.options.container == "body" ? window.innerHeight : e.outerHeight(),
- p = this.options.container == "body" ? 0 : e.offset().left;
- t = t == "bottom" && r.top + r.height + f - c > y ? "top" : t == "top" && r.top - c - f < 0 ? "bottom" : t == "right" && r.right + u > v ? "left" : t == "left" && r.left - u < p ? "right" : t;
- i.removeClass(a).addClass(t)
- }
- l = this.getCalculatedOffset(t, r, u, f);
- this.applyPlacement(l, t);
- this.$element.trigger("shown.bs." + this.type)
- }
- };
- t.prototype.applyPlacement = function(n, t) {
- var h, i = this.tip(),
- c = i[0].offsetWidth,
- f = i[0].offsetHeight,
- e = parseInt(i.css("margin-top"), 10),
- o = parseInt(i.css("margin-left"), 10),
- u, r, s;
- isNaN(e) && (e = 0);
- isNaN(o) && (o = 0);
- n.top = n.top + e;
- n.left = n.left + o;
- i.offset(n).addClass("in");
- u = i[0].offsetWidth;
- r = i[0].offsetHeight;
- t == "top" && r != f && (h = !0, n.top = n.top + f - r);
- /bottom|top/.test(t) ? (s = 0, n.left < 0 && (s = n.left * -2, n.left = 0, i.offset(n), u = i[0].offsetWidth, r = i[0].offsetHeight), this.replaceArrow(s - c + u, u, "left")) : this.replaceArrow(r - f, r, "top");
- h && i.offset(n)
- };
- t.prototype.replaceArrow = function(n, t, i) {
- this.arrow().css(i, n ? 50 * (1 - n / t) + "%" : "")
- };
- t.prototype.setContent = function() {
- var n = this.tip(),
- t = this.getTitle();
- n.find(".tooltip-inner")[this.options.html ? "html" : "text"](t);
- n.removeClass("fade in top bottom left right")
- };
- t.prototype.hide = function() {
- function r() {
- u.hoverState != "in" && t.detach()
- }
- var u = this,
- t = this.tip(),
- i = n.Event("hide.bs." + this.type);
- if (this.$element.trigger(i), !i.isDefaultPrevented()) return t.removeClass("in"), n.support.transition && this.$tip.hasClass("fade") ? t.one(n.support.transition.end, r).emulateTransitionEnd(150) : r(), this.$element.trigger("hidden.bs." + this.type), this
- };
- t.prototype.fixTitle = function() {
- var n = this.$element;
- (n.attr("title") || typeof n.attr("data-original-title") != "string") && n.attr("data-original-title", n.attr("title") || "").attr("title", "")
- };
- t.prototype.hasContent = function() {
- return this.getTitle()
- };
- t.prototype.getPosition = function() {
- var t = this.$element[0];
- return n.extend({}, typeof t.getBoundingClientRect == "function" ? t.getBoundingClientRect() : {
- width: t.offsetWidth,
- height: t.offsetHeight
- }, this.$element.offset())
- };
- t.prototype.getCalculatedOffset = function(n, t, i, r) {
- return n == "bottom" ? {
- top: t.top + t.height,
- left: t.left + t.width / 2 - i / 2
- } : n == "top" ? {
- top: t.top - r,
- left: t.left + t.width / 2 - i / 2
- } : n == "left" ? {
- top: t.top + t.height / 2 - r / 2,
- left: t.left - i
- } : {
- top: t.top + t.height / 2 - r / 2,
- left: t.left + t.width
- }
- };
- t.prototype.getTitle = function() {
- var t = this.$element,
- n = this.options;
- return t.attr("data-original-title") || (typeof n.title == "function" ? n.title.call(t[0]) : n.title)
- };
- t.prototype.tip = function() {
- return this.$tip = this.$tip || n(this.options.template)
- };
- t.prototype.arrow = function() {
- return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
- };
- t.prototype.validate = function() {
- this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null)
- };
- t.prototype.enable = function() {
- this.enabled = !0
- };
- t.prototype.disable = function() {
- this.enabled = !1
- };
- t.prototype.toggleEnabled = function() {
- this.enabled = !this.enabled
- };
- t.prototype.toggle = function(t) {
- var i = t ? n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type) : this;
- i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
- };
- t.prototype.destroy = function() {
- this.hide().$element.off("." + this.type).removeData("bs." + this.type)
- };
- i = n.fn.tooltip;
- n.fn.tooltip = function(i) {
- return this.each(function() {
- var u = n(this),
- r = u.data("bs.tooltip"),
- f = typeof i == "object" && i;
- r || u.data("bs.tooltip", r = new t(this, f));
- typeof i == "string" && r[i]()
- })
- };
- n.fn.tooltip.Constructor = t;
- n.fn.tooltip.noConflict = function() {
- return n.fn.tooltip = i, this
- }
- }(jQuery), + function(n) {
- "use strict";
- var t = function(n, t) {
- this.init("popover", n, t)
- },
- i;
- if (!n.fn.tooltip) throw new Error("Popover requires tooltip.js");
- t.DEFAULTS = n.extend({}, n.fn.tooltip.Constructor.DEFAULTS, {
- placement: "right",
- trigger: "click",
- content: "",
- template: '<div class="popover"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'
- });
- t.prototype = n.extend({}, n.fn.tooltip.Constructor.prototype);
- t.prototype.constructor = t;
- t.prototype.getDefaults = function() {
- return t.DEFAULTS
- };
- t.prototype.setContent = function() {
- var n = this.tip(),
- t = this.getTitle(),
- i = this.getContent();
- n.find(".popover-title")[this.options.html ? "html" : "text"](t);
- n.find(".popover-content")[this.options.html ? "html" : "text"](i);
- n.removeClass("fade top bottom left right in");
- n.find(".popover-title").html() || n.find(".popover-title").hide()
- };
- t.prototype.hasContent = function() {
- return this.getTitle() || this.getContent()
- };
- t.prototype.getContent = function() {
- var t = this.$element,
- n = this.options;
- return t.attr("data-content") || (typeof n.content == "function" ? n.content.call(t[0]) : n.content)
- };
- t.prototype.arrow = function() {
- return this.$arrow = this.$arrow || this.tip().find(".arrow")
- };
- t.prototype.tip = function() {
- return this.$tip || (this.$tip = n(this.options.template)), this.$tip
- };
- i = n.fn.popover;
- n.fn.popover = function(i) {
- return this.each(function() {
- var u = n(this),
- r = u.data("bs.popover"),
- f = typeof i == "object" && i;
- r || u.data("bs.popover", r = new t(this, f));
- typeof i == "string" && r[i]()
- })
- };
- n.fn.popover.Constructor = t;
- n.fn.popover.noConflict = function() {
- return n.fn.popover = i, this
- }
- }(jQuery), + function(n) {
- "use strict";
- var t = function(i, r) {
- this.$element = n(i);
- this.options = n.extend({}, t.DEFAULTS, r);
- this.transitioning = null;
- this.options.parent && (this.$parent = n(this.options.parent));
- this.options.toggle && this.toggle()
- },
- i;
- t.DEFAULTS = {
- toggle: !0
- };
- t.prototype.dimension = function() {
- var n = this.$element.hasClass("width");
- return n ? "width" : "height"
- };
- t.prototype.show = function() {
- var u, t, r, i, f, e;
- if (!this.transitioning && !this.$element.hasClass("in") && (u = n.Event("show.bs.collapse"), this.$element.trigger(u), !u.isDefaultPrevented())) {
- if (t = this.$parent && this.$parent.find("> .panel > .in"), t && t.length) {
- if (r = t.data("bs.collapse"), r && r.transitioning) return;
- t.collapse("hide");
- r || t.data("bs.collapse", null)
- }
- if (i = this.dimension(), this.$element.removeClass("collapse").addClass("collapsing")[i](0), this.transitioning = 1, f = function() {
- this.$element.removeClass("collapsing").addClass("in")[i]("auto");
- this.transitioning = 0;
- this.$element.trigger("shown.bs.collapse")
- }, !n.support.transition) return f.call(this);
- e = n.camelCase(["scroll", i].join("-"));
- this.$element.one(n.support.transition.end, n.proxy(f, this)).emulateTransitionEnd(350)[i](this.$element[0][e])
- }
- };
- t.prototype.hide = function() {
- var i, t, r;
- if (!this.transitioning && this.$element.hasClass("in") && (i = n.Event("hide.bs.collapse"), this.$element.trigger(i), !i.isDefaultPrevented())) {
- if (t = this.dimension(), this.$element[t](this.$element[t]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"), this.transitioning = 1, r = function() {
- this.transitioning = 0;
- this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")
- }, !n.support.transition) return r.call(this);
- this.$element[t](0).one(n.support.transition.end, n.proxy(r, this)).emulateTransitionEnd(350)
- }
- };
- t.prototype.toggle = function() {
- this[this.$element.hasClass("in") ? "hide" : "show"]()
- };
- i = n.fn.collapse;
- n.fn.collapse = function(i) {
- return this.each(function() {
- var r = n(this),
- u = r.data("bs.collapse"),
- f = n.extend({}, t.DEFAULTS, r.data(), typeof i == "object" && i);
- u || r.data("bs.collapse", u = new t(this, f));
- typeof i == "string" && u[i]()
- })
- };
- n.fn.collapse.Constructor = t;
- n.fn.collapse.noConflict = function() {
- return n.fn.collapse = i, this
- };
- n(document).on("click.bs.collapse.data-api", "[data-toggle=collapse]", function(t) {
- var i = n(this),
- e, s = i.attr("data-target") || t.preventDefault() || (e = i.attr("href")) && e.replace(/.*(?=#[^\s]+$)/, ""),
- r = n(s),
- u = r.data("bs.collapse"),
- h = u ? "toggle" : i.data(),
- f = i.attr("data-parent"),
- o = f && n(f);
- u && u.transitioning || (o && o.find('[data-toggle=collapse][data-parent="' + f + '"]').not(i).addClass("collapsed"), i[r.hasClass("in") ? "addClass" : "removeClass"]("collapsed"));
- r.collapse(h)
- })
- }(jQuery), + function(n) {
- "use strict";
- function t() {
- var i = document.createElement("bootstrap"),
- n = {
- WebkitTransition: "webkitTransitionEnd",
- MozTransition: "transitionend",
- OTransition: "oTransitionEnd otransitionend",
- transition: "transitionend"
- };
- for (var t in n)
- if (i.style[t] !== undefined) return {
- end: n[t]
- }
- }
- n.fn.emulateTransitionEnd = function(t) {
- var i = !1,
- u = this,
- r;
- n(this).one(n.support.transition.end, function() {
- i = !0
- });
- return r = function() {
- i || n(u).trigger(n.support.transition.end)
- }, setTimeout(r, t), this
- };
- n(function() {
- n.support.transition = t()
- })
- }(jQuery), typeof jQuery == "undefined") throw new Error("Bootstrap requires jQuery"); + function(n) {
- "use strict";
- var t = function(i, r) {
- var u, f;
- if (this.$element = n(i), this.$canvas = r.canvas ? n(r.canvas) : this.$element, this.options = n.extend({}, t.DEFAULTS, r), this.transitioning = null, this.calcTransform(), this.transform || (this.$canvas = this.$element), this.options.placement === "auto" && (this.options.placement = this.calcPlacement()), this.options.recalc) {
- this.calcClone();
- n(window).on("resize.bs.offcanvas", n.proxy(this.recalc, this))
- }
- if (this.options.autohide) n(document).on("click.bs.offcanvas", n.proxy(this.autohide, this));
- u = window.navigator.appName == "Microsoft Internet Explorer";
- u && this.$canvas !== this.$element && (f = this.$canvas.find("*").filter(function() {
- return n(this).css("position") === "fixed"
- }), this.$canvas = this.$canvas.add(f));
- this.options.toggle && this.toggle()
- },
- i;
- t.DEFAULTS = {
- toggle: !0,
- placement: "auto",
- autohide: !0,
- recalc: !0
- };
- t.prototype.calcTransform = function() {
- var t, r, i, u;
- if (this.transform = !1, n.support.transition || this.$canvas !== this.$element) {
- t = n('<div style="visibility: hidden"><\/div>');
- r = {
- transform: "transform",
- webkitTransform: "-webkit-transform",
- OTransform: "-o-transform",
- msTransform: "-ms-transform",
- MozTransform: "-moz-transform"
- };
- t.appendTo(n("body"));
- for (i in r)
- if (t[0].style[i] !== undefined) {
- t[0].style[i] = "translate3d(1px,1px,1px)";
- u = window.getComputedStyle(t[0]).getPropertyValue(r[i]);
- this.transform = r[i];
- this.translate = u.match(/^matrix3d/) ? "translate3d" : "translate";
- break
- }
- t.remove()
- }
- };
- t.prototype.calcPlacement = function() {
- function i(n, i) {
- if (t.css(i) === "auto") return n;
- if (t.css(n) === "auto") return i;
- var r = parseInt(t.css(n), 10),
- u = parseInt(t.css(i), 10);
- return r > u ? i : n
- }
- var r = n(window).width() / this.$element.width(),
- u = n(window).height() / this.$element.height(),
- t = this.$element;
- return r > u ? i("left", "right") : i("top", "bottom")
- };
- t.prototype.offset = function() {
- switch (this.options.placement) {
- case "left":
- case "right":
- return this.$element.outerWidth();
- case "top":
- case "bottom":
- return this.$element.outerHeight()
- }
- };
- t.prototype.slideTransform = function(t, i) {
- var u = this.options.placement,
- f = this.transform,
- r;
- if (t *= u === "right" || u === "bottom" ? -1 : 1, r = u === "left" || u === "right" ? "{}px, 0" : "0, {}px", this.translate === "translate3d" && (r += ", 0"), r = this.translate + "(" + r + ")", !n.support.transition) return this.$canvas.animate({
- borderSpacing: t
- }, {
- step: function(t) {
- n(this).css(f, r.replace("{}", t))
- },
- complete: i,
- duration: 350
- });
- this.$canvas.css(f, r.replace("{}", t));
- this.$element.one(n.support.transition.end, i).emulateTransitionEnd(350)
- };
- t.prototype.slidePosition = function(t, i) {
- if (!n.support.transition) {
- var r = {};
- return r[this.options.placement] = t, this.$canvas.animate(r, 350, i)
- }
- this.$canvas.css(this.options.placement, t);
- this.$element.one(n.support.transition.end, i).emulateTransitionEnd(350)
- };
- t.prototype.show = function() {
- var t, i;
- this.transitioning || this.$canvas.hasClass("canvas-slid") || (t = n.Event("show.bs.offcanvas"), this.$element.trigger(t), t.isDefaultPrevented()) || (i = function() {
- this.$canvas.addClass("canvas-slid").removeClass("canvas-sliding");
- this.transitioning = 0;
- this.$element.trigger("shown.bs.offcanvas")
- }, this.$element.is(":visible") && this.transform || this.$element.css(this.options.placement, -1 * this.offset() + "px"), this.$element.addClass("in"), this.$canvas.addClass("canvas-sliding"), this.$canvas != this.$element && n("body").css("overflow-x", "hidden"), this.transitioning = 1, this.transform ? this.slideTransform(this.offset(), n.proxy(i, this)) : this.slidePosition(0, n.proxy(i, this)))
- };
- t.prototype.hide = function(t) {
- var r, i;
- if (!this.transitioning && this.$canvas.hasClass("canvas-slid") && (r = n.Event("hide.bs.offcanvas"), this.$element.trigger(r), !r.isDefaultPrevented())) {
- if (i = function() {
- this.transitioning = 0;
- this.$element.removeClass("in").css("left", "").css("right", "").css("top", "").css("bottom", "");
- this.$canvas.removeClass("canvas-sliding canvas-slid").css("transform", "");
- n("body").css("overflow-x", "");
- this.$element.trigger("hidden.bs.offcanvas")
- }, t) return i.call(this);
- this.$canvas.removeClass("canvas-slid").addClass("canvas-sliding");
- this.transitioning = 1;
- this.transform ? this.slideTransform(0, n.proxy(i, this)) : this.slidePosition(-1 * this.offset(), n.proxy(i, this))
- }
- };
- t.prototype.toggle = function() {
- this[this.$canvas.hasClass("canvas-slid") ? "hide" : "show"]()
- };
- t.prototype.calcClone = function() {
- this.$calcClone = this.$element.clone().html("").addClass("offcanvas-clone").removeClass("in").appendTo(n("body"))
- };
- t.prototype.recalc = function() {
- this.$calcClone.css("display") !== "none" && this.hide(!0)
- };
- t.prototype.autohide = function(t) {
- n(t.target).closest(this.$element).length === 0 && this.hide()
- };
- i = n.fn.offcanvas;
- n.fn.offcanvas = function(i) {
- return this.each(function() {
- var r = n(this),
- u = r.data("bs.offcanvas"),
- f = n.extend({}, t.DEFAULTS, r.data(), typeof i == "object" && i);
- u || r.data("bs.offcanvas", u = new t(this, f));
- typeof i == "string" && u[i]()
- })
- };
- n.fn.offcanvas.Constructor = t;
- n.fn.offcanvas.noConflict = function() {
- return n.fn.offcanvas = i, this
- };
- n(document).on("click.bs.offcanvas.data-api", "[data-toggle=offcanvas]", function(t) {
- var i = n(this),
- u, e = i.attr("data-target") || t.preventDefault() || (u = i.attr("href")) && u.replace(/.*(?=#[^\s]+$)/, ""),
- f = n(e),
- r = f.data("bs.offcanvas"),
- o = r ? "toggle" : i.data();
- t.stopPropagation();
- r ? r.toggle() : f.offcanvas(o)
- })
- }(window.jQuery); + function(n) {
- "use strict";
- var t = function(i, r) {
- this.$element = n(i);
- this.options = n.extend({}, t.DEFAULTS, r);
- this.$element.on("click.bs.rowlink", "td:not(.rowlink-skip)", n.proxy(this.click, this))
- };
- t.DEFAULTS = {
- target: "a"
- };
- t.prototype.click = function(t) {
- var i = n(t.currentTarget).closest("tr").find(this.options.target)[0],
- r;
- n(t.target)[0] !== i && (t.preventDefault(), i.click ? i.click() : document.createEvent && (r = document.createEvent("MouseEvents"), r.initMouseEvent("click", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), i.dispatchEvent(r)))
- };
- n.fn.rowlink = function(i) {
- return this.each(function() {
- var r = n(this),
- u = r.data("rowlink");
- u || r.data("rowlink", u = new t(this, i))
- })
- };
- n.fn.rowlink.Constructor = t;
- n.fn.rowlink.noConflict = function() {
- return n.fn.inputmask = old, this
- };
- n(document).on("click.bs.rowlink.data-api", '[data-link="row"]', function(t) {
- var i = n(this);
- i.data("rowlink") || (i.rowlink(i.data()), n(t.target).trigger("click.bs.rowlink"))
- })
- }(window.jQuery); + function(n) {
- "use strict";
- var r = window.orientation !== undefined,
- u = navigator.userAgent.toLowerCase().indexOf("android") > -1,
- f = window.navigator.appName == "Microsoft Internet Explorer",
- t = function(i, r) {
- u || (this.$element = n(i), this.options = n.extend({}, t.DEFAULS, r), this.mask = String(this.options.mask), this.init(), this.listen(), this.checkVal())
- },
- i;
- t.DEFAULS = {
- mask: "",
- placeholder: "_",
- definitions: {
- "9": "[0-9]",
- a: "[A-Za-z]",
- "?": "[A-Za-z0-9]",
- "*": "."
- }
- };
- t.prototype.init = function() {
- var t = this.options.definitions,
- i = this.mask.length;
- this.tests = [];
- this.partialPosition = this.mask.length;
- this.firstNonMaskPos = null;
- n.each(this.mask.split(""), n.proxy(function(n, r) {
- r == "?" ? (i--, this.partialPosition = n) : t[r] ? (this.tests.push(new RegExp(t[r])), this.firstNonMaskPos === null && (this.firstNonMaskPos = this.tests.length - 1)) : this.tests.push(null)
- }, this));
- this.buffer = n.map(this.mask.split(""), n.proxy(function(n) {
- if (n != "?") return t[n] ? this.options.placeholder : n
- }, this));
- this.focusText = this.$element.val();
- this.$element.data("rawMaskFn", n.proxy(function() {
- return n.map(this.buffer, function(n, t) {
- return this.tests[t] && n != this.options.placeholder ? n : null
- }).join("")
- }, this))
- };
- t.prototype.listen = function() {
- if (!this.$element.attr("readonly")) {
- var t = (f ? "paste" : "input") + ".mask";
- this.$element.on("unmask.bs.inputmask", n.proxy(this.unmask, this)).on("focus.bs.inputmask", n.proxy(this.focusEvent, this)).on("blur.bs.inputmask", n.proxy(this.blurEvent, this)).on("keydown.bs.inputmask", n.proxy(this.keydownEvent, this)).on("keypress.bs.inputmask", n.proxy(this.keypressEvent, this)).on(t, n.proxy(this.pasteEvent, this))
- }
- };
- t.prototype.caret = function(n, t) {
- if (this.$element.length !== 0) {
- if (typeof n == "number") return t = typeof t == "number" ? t : n, this.$element.each(function() {
- if (this.setSelectionRange) this.setSelectionRange(n, t);
- else if (this.createTextRange) {
- var i = this.createTextRange();
- i.collapse(!0);
- i.moveEnd("character", t);
- i.moveStart("character", n);
- i.select()
- }
- });
- if (this.$element[0].setSelectionRange) n = this.$element[0].selectionStart, t = this.$element[0].selectionEnd;
- else if (document.selection && document.selection.createRange) {
- var i = document.selection.createRange();
- n = 0 - i.duplicate().moveStart("character", -1e5);
- t = n + i.text.length
- }
- return {
- begin: n,
- end: t
- }
- }
- };
- t.prototype.seekNext = function(n) {
- for (var t = this.mask.length; ++n <= t && !this.tests[n];);
- return n
- };
- t.prototype.seekPrev = function(n) {
- while (--n >= 0 && !this.tests[n]);
- return n
- };
- t.prototype.shiftL = function(n, t) {
- var u = this.mask.length,
- r, i;
- if (!(n < 0)) {
- for (r = n, i = this.seekNext(t); r < u; r++)
- if (this.tests[r]) {
- if (i < u && this.tests[r].test(this.buffer[i])) this.buffer[r] = this.buffer[i], this.buffer[i] = this.options.placeholder;
- else break;
- i = this.seekNext(i)
- }
- this.writeBuffer();
- this.caret(Math.max(this.firstNonMaskPos, n))
- }
- };
- t.prototype.shiftR = function(n) {
- for (var i, r, u = this.mask.length, t = n, f = this.options.placeholder; t < u; t++)
- if (this.tests[t])
- if (i = this.seekNext(t), r = this.buffer[t], this.buffer[t] = f, i < u && this.tests[i].test(r)) f = r;
- else break
- };
- t.prototype.unmask = function() {
- this.$element.unbind(".mask").removeData("inputmask")
- };
- t.prototype.focusEvent = function() {
- var r, n, t, i;
- this.focusText = this.$element.val();
- r = this.mask.length;
- n = this.checkVal();
- this.writeBuffer();
- t = this;
- i = function() {
- n == r ? t.caret(0, n) : t.caret(n)
- };
- i();
- setTimeout(i, 50)
- };
- t.prototype.blurEvent = function() {
- this.checkVal();
- this.$element.val() !== this.focusText && this.$element.trigger("change")
- };
- t.prototype.keydownEvent = function(n) {
- var i = n.which;
- if (i == 8 || i == 46 || r && i == 127) {
- var f = this.caret(),
- u = f.begin,
- t = f.end;
- return t - u == 0 && (u = i != 46 ? this.seekPrev(u) : t = this.seekNext(u - 1), t = i == 46 ? this.seekNext(t) : t), this.clearBuffer(u, t), this.shiftL(u, t - 1), !1
- }
- if (i == 27) return this.$element.val(this.focusText), this.caret(0, this.checkVal()), !1
- };
- t.prototype.keypressEvent = function(n) {
- var e = this.mask.length,
- r = n.which,
- t = this.caret(),
- i, u, f;
- return n.ctrlKey || n.altKey || n.metaKey || r < 32 ? !0 : r ? (t.end - t.begin != 0 && (this.clearBuffer(t.begin, t.end), this.shiftL(t.begin, t.end - 1)), i = this.seekNext(t.begin - 1), i < e && (u = String.fromCharCode(r), this.tests[i].test(u) && (this.shiftR(i), this.buffer[i] = u, this.writeBuffer(), f = this.seekNext(i), this.caret(f))), !1) : void 0
- };
- t.prototype.pasteEvent = function() {
- var n = this;
- setTimeout(function() {
- n.caret(n.checkVal(!0))
- }, 0)
- };
- t.prototype.clearBuffer = function(n, t) {
- for (var r = this.mask.length, i = n; i < t && i < r; i++) this.tests[i] && (this.buffer[i] = this.options.placeholder)
- };
- t.prototype.writeBuffer = function() {
- return this.$element.val(this.buffer.join("")).val()
- };
- t.prototype.checkVal = function(n) {
- for (var f, e = this.mask.length, u = this.$element.val(), i = -1, t = 0, r = 0; t < e; t++)
- if (this.tests[t]) {
- for (this.buffer[t] = this.options.placeholder; r++ < u.length;)
- if (f = u.charAt(r - 1), this.tests[t].test(f)) {
- this.buffer[t] = f;
- i = t;
- break
- }
- if (r > u.length) break
- } else this.buffer[t] == u.charAt(r) && t != this.partialPosition && (r++, i = t);
- return !n && i + 1 < this.partialPosition ? (this.$element.val(""), this.clearBuffer(0, e)) : (n || i + 1 >= this.partialPosition) && (this.writeBuffer(), n || this.$element.val(this.$element.val().substring(0, i + 1))), this.partialPosition ? t : this.firstNonMaskPos
- };
- i = n.fn.inputmask;
- n.fn.inputmask = function(i) {
- return this.each(function() {
- var r = n(this),
- u = r.data("inputmask");
- u || r.data("inputmask", u = new t(this, i))
- })
- };
- n.fn.inputmask.Constructor = t;
- n.fn.inputmask.noConflict = function() {
- return n.fn.inputmask = i, this
- };
- n(document).on("focus.bs.inputmask.data-api", "[data-mask]", function() {
- var t = n(this);
- t.data("inputmask") || t.inputmask(t.data())
- })
- }(window.jQuery); + function(n) {
- "use strict";
- var i = window.navigator.appName == "Microsoft Internet Explorer",
- t = function(t, i) {
- if (this.$element = n(t), this.$input = this.$element.find(":file"), this.$input.length !== 0) {
- this.name = this.$input.attr("name") || i.name;
- this.$hidden = this.$element.find('input[type=hidden][name="' + this.name + '"]');
- this.$hidden.length === 0 && (this.$hidden = n('<input type="hidden" />'), this.$element.prepend(this.$hidden));
- this.$preview = this.$element.find(".fileinput-preview");
- var r = this.$preview.css("height");
- this.$preview.css("display") != "inline" && r != "0px" && r != "none" && this.$preview.css("line-height", r);
- this.original = {
- exists: this.$element.hasClass("fileinput-exists"),
- preview: this.$preview.html(),
- hiddenVal: this.$hidden.val()
- };
- this.listen()
- }
- };
- t.prototype.listen = function() {
- this.$input.on("change.bs.fileinput", n.proxy(this.change, this));
- n(this.$input[0].form).on("reset.bs.fileinput", n.proxy(this.reset, this));
- this.$element.find('[data-trigger="fileinput"]').on("click.bs.fileinput", n.proxy(this.trigger, this));
- this.$element.find('[data-dismiss="fileinput"]').on("click.bs.fileinput", n.proxy(this.clear, this))
- };
- t.prototype.change = function(t) {
- var i;
- if (t.target.files === undefined && (t.target.files = t.target && t.target.value ? [{
- name: t.target.value.replace(/^.+\\/, "")
- }] : []), t.target.files.length !== 0)
- if (this.$hidden.val(""), this.$hidden.attr("name", ""), this.$input.attr("name", this.name), i = t.target.files[0], this.$preview.length > 0 && (typeof i.type != "undefined" ? i.type.match("image.*") : i.name.match(/\.(gif|png|jpe?g)$/i)) && typeof FileReader != "undefined") {
- var f = new FileReader,
- r = this.$preview,
- u = this.$element;
- f.onload = function(f) {
- var e = n("<img>").attr("src", f.target.result);
- t.target.files[0].result = f.target.result;
- u.find(".fileinput-filename").text(i.name);
- r.css("max-height") != "none" && e.css("max-height", parseInt(r.css("max-height"), 10) - parseInt(r.css("padding-top"), 10) - parseInt(r.css("padding-bottom"), 10) - parseInt(r.css("border-top"), 10) - parseInt(r.css("border-bottom"), 10));
- r.html(e);
- u.addClass("fileinput-exists").removeClass("fileinput-new");
- u.trigger("change.bs.fileinput", t.target.files)
- };
- f.readAsDataURL(i)
- } else this.$element.find(".fileinput-filename").text(i.name), this.$preview.text(i.name), this.$element.addClass("fileinput-exists").removeClass("fileinput-new"), this.$element.trigger("change.bs.fileinput")
- };
- t.prototype.clear = function(n) {
- if (n && n.preventDefault(), this.$hidden.val(""), this.$hidden.attr("name", this.name), this.$input.attr("name", ""), i) {
- var t = this.$input.clone(!0);
- this.$input.after(t);
- this.$input.remove();
- this.$input = t
- } else this.$input.val("");
- this.$preview.html("");
- this.$element.find(".fileinput-filename").text("");
- this.$element.addClass("fileinput-new").removeClass("fileinput-exists");
- n !== !1 && (this.$input.trigger("change"), this.$element.trigger("clear.bs.fileinput"))
- };
- t.prototype.reset = function() {
- this.clear(!1);
- this.$hidden.val(this.original.hiddenVal);
- this.$preview.html(this.original.preview);
- this.$element.find(".fileinput-filename").text("");
- this.original.exists ? this.$element.addClass("fileinput-exists").removeClass("fileinput-new") : this.$element.addClass("fileinput-new").removeClass("fileinput-exists");
- this.$element.trigger("reset.bs.fileinput")
- };
- t.prototype.trigger = function(n) {
- this.$input.trigger("click");
- n.preventDefault()
- };
- n.fn.fileinput = function(i) {
- return this.each(function() {
- var u = n(this),
- r = u.data("fileinput");
- r || u.data("fileinput", r = new t(this, i));
- typeof i == "string" && r[i]()
- })
- };
- n.fn.fileinput.Constructor = t;
- n(document).on("click.fileinput.data-api", '[data-provides="fileinput"]', function(t) {
- var i = n(this),
- r;
- i.data("fileinput") || (i.fileinput(i.data()), r = n(t.target).closest('[data-dismiss="fileinput"],[data-trigger="fileinput"]'), r.length > 0 && (t.preventDefault(), r.trigger("click.bs.fileinput")))
- })
- }(window.jQuery);
- saveAs = saveAs || navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator) || function(n) {
- "use strict";
- if (!/MSIE [1-9]\./.test(navigator.userAgent)) {
- var i = n.document,
- l = function() {
- return n.URL || n.webkitURL || n
- },
- a = n.URL || n.webkitURL || n,
- r = i.createElementNS("http://www.w3.org/1999/xhtml", "a"),
- v = !n.externalHost && "download" in r,
- b = function(t) {
- var r = i.createEvent("MouseEvents");
- r.initMouseEvent("click", !0, !1, n, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null);
- t.dispatchEvent(r)
- },
- f = n.webkitRequestFileSystem,
- s = n.requestFileSystem || f || n.mozRequestFileSystem,
- y = function(t) {
- (n.setImmediate || n.setTimeout)(function() {
- throw t;
- }, 0)
- },
- e = "application/octet-stream",
- h = 0,
- u = [],
- p = function() {
- for (var t = u.length, n; t--;) n = u[t], typeof n == "string" ? a.revokeObjectURL(n) : n.remove();
- u.length = 0
- },
- o = function(n, t, i) {
- var r, u;
- for (t = [].concat(t), r = t.length; r--;)
- if (u = n["on" + t[r]], typeof u == "function") try {
- u.call(n, i || n)
- } catch (f) {
- y(f)
- }
- },
- c = function(t, c) {
- var a = this,
- k = t.type,
- g = !1,
- p, b, nt = function() {
- var n = l().createObjectURL(t);
- return u.push(n), n
- },
- tt = function() {
- o(a, "writestart progress write writeend".split(" "))
- },
- y = function() {
- (g || !p) && (p = nt(t));
- b ? b.location.href = p : window.open(p, "_blank");
- a.readyState = a.DONE;
- tt()
- },
- w = function(n) {
- return function() {
- if (a.readyState !== a.DONE) return n.apply(this, arguments)
- }
- },
- it = {
- create: !0,
- exclusive: !1
- },
- rt, d;
- if (a.readyState = a.INIT, c || (c = "download"), v) {
- p = nt(t);
- i = n.document;
- r = i.createElementNS("http://www.w3.org/1999/xhtml", "a");
- r.href = p;
- r.download = c;
- d = i.createEvent("MouseEvents");
- d.initMouseEvent("click", !0, !1, n, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null);
- r.dispatchEvent(d);
- a.readyState = a.DONE;
- tt();
- return
- }
- if (n.chrome && k && k !== e && (rt = t.slice || t.webkitSlice, t = rt.call(t, 0, t.size, e), g = !0), f && c !== "download" && (c += ".download"), (k === e || f) && (b = n), !s) {
- y();
- return
- }
- h += t.size;
- s(n.TEMPORARY, h, w(function(n) {
- n.root.getDirectory("saved", it, w(function(n) {
- var i = function() {
- n.getFile(c, it, w(function(n) {
- n.createWriter(w(function(i) {
- i.onwriteend = function(t) {
- b.location.href = n.toURL();
- u.push(n);
- a.readyState = a.DONE;
- o(a, "writeend", t)
- };
- i.onerror = function() {
- var n = i.error;
- n.code !== n.ABORT_ERR && y()
- };
- "writestart progress write abort".split(" ").forEach(function(n) {
- i["on" + n] = a["on" + n]
- });
- i.write(t);
- a.abort = function() {
- i.abort();
- a.readyState = a.DONE
- };
- a.readyState = a.WRITING
- }), y)
- }), y)
- };
- n.getFile(c, {
- create: !1
- }, w(function(n) {
- n.remove();
- i()
- }), w(function(n) {
- n.code === n.NOT_FOUND_ERR ? i() : y()
- }))
- }), y)
- }), y)
- },
- t = c.prototype,
- w = function(n, t) {
- return new c(n, t)
- };
- return t.abort = function() {
- var n = this;
- n.readyState = n.DONE;
- o(n, "abort")
- }, t.readyState = t.INIT = 0, t.WRITING = 1, t.DONE = 2, t.error = t.onwritestart = t.onprogress = t.onwrite = t.onabort = t.onerror = t.onwriteend = null, n.addEventListener("unload", p, !1), w
- }
- }(typeof self != "undefined" && self || typeof window != "undefined" && window || this.content);
- typeof module != "undefined" && (module.exports = saveAs);
- ColorWallet = {
- buildTransaction: function(n) {
- var i = new Bitcoin.Transaction,
- r, u, t, f;
- for (i.version = n.version, i.lock_time = n.locktime, t = 0; t < n.inputs.length; t++) r = new Bitcoin.Script(Crypto.util.hexToBytes(n.inputs[t].script)), u = new Bitcoin.TransactionIn({
- script: r,
- sequence: n.inputs[t].sequence_number,
- outpoint: {
- hash: Crypto.util.bytesToBase64(Crypto.util.hexToBytes(n.inputs[t].previous_hash).reverse()),
- index: n.inputs[t].previous_index
- }
- }), i.addInput(u);
- for (t = 0; t < n.outputs.length; t++) f = new Bitcoin.TransactionOut({
- script: new Bitcoin.Script(Crypto.util.hexToBytes(n.outputs[t].script)),
- value: Crypto.util.hexToBytes(n.outputs[t].value).reverse()
- }), i.addOutput(f);
- return i
- },
- signTransaction: function(n, t) {
- for (var u, f = 1, i = 0; i < n.ins.length; i++) {
- var e = n.ins[i].script,
- s = Crypto.util.bytesToHex(e.buffer),
- h = t[s].decryptedKey,
- r = new Bitcoin.ECKey(h);
- r.setCompressed(!0);
- var c = r.getPub(),
- l = n.hashTransactionForSignature(e, i, f),
- o = r.sign(l);
- if (o.push(f), u = Bitcoin.Script.createInputScript(o, c), u == null) throw "Error creating input script";
- n.ins[i].script = u
- }
- return n.getHash()
- },
- hashPassword: function(n, t) {
- return Crypto.HMAC(Crypto.SHA256, Crypto.util.hexToBytes(t), n)
- },
- hashPasswordToForm: function(n, t, i) {
- var u = ColorWallet.hashPassword(t, i),
- r = $("input[name='passwordHash']", n);
- r.size() == 0 && (r = $("<input type='hidden' name='passwordHash' />"), n.append(r));
- r.val(u)
- },
- encryptPrivateKeys: function(n, t, i, r, u) {
- function f(n) {
- var u, i;
- for (u in t) i = t[u], i.privateKey = Crypto.AES.encrypt(i.decryptedKey, n, {
- asBytes: !1
- });
- r(t)
- }
- Crypto.PBKDF2Async(n, Crypto.util.hexToBytes(i), 32, f, {
- iterations: ColorWallet.walletEncryptionMode.iterations,
- hasher: Crypto.SHA256,
- onProgressChange: u,
- asBytes: !0
- })
- },
- encryptPrivateKey: function(n, t, i, r, u) {
- function o() {
- r(f[""].privateKey)
- }
- var e = t.priv.toByteArrayUnsigned(),
- f = {
- "": {
- decryptedKey: e
- }
- };
- this.encryptPrivateKeys(n, f, i, o, u)
- },
- decryptPrivateKey: function(n, t, i, r, u) {
- function f(n) {
- var u, t;
- for (u in i) t = i[u], t.decryptedKey = Crypto.AES.decrypt(Crypto.util.hexToBytes(t.privateKey), n, {
- asBytes: !0
- });
- r(i)
- }
- Crypto.PBKDF2Async(n, Crypto.util.hexToBytes(t), 32, f, {
- iterations: ColorWallet.walletEncryptionMode.iterations,
- hasher: Crypto.SHA256,
- onProgressChange: u,
- asBytes: !0
- })
- },
- walletEncryptionMode: {
- mode: "PKBDF2-SHA256",
- iterations: 2e3
- }
- };
- startup = function() {
- global = {};
- $("[js-var]").each(function() {
- global[$(this).attr("js-var")] = JSON.parse($(this).text())
- });
- setupAssetPopup($(document));
- $(".address-card h4").click(function() {
- var i = $(this)[0],
- t, n;
- document.selection ? (n = document.body.createTextRange(), n.moveToElementText(i), n.select()) : window.getSelection && (t = window.getSelection(), n = document.createRange(), n.selectNodeContents(i), t.removeAllRanges(), t.addRange(n))
- });
- $(".address-card .dropdown-menu a").click(function(n) {
- var t = $(this).attr("switch"),
- i = $(this).closest(".address-card");
- $("[address-type]").addClass("hide");
- $("[address-type='" + t + "']").removeClass("hide");
- $(".drop-down-text", i).text($(this).text());
- n.preventDefault()
- });
- $(".save-as").click(function() {
- var n = $(this).attr("save-as-field"),
- t = new Blob([$(n).val()], {
- type: "text/plain;charset=utf-8"
- });
- return saveAs(t, $(this).attr("save-as-filename")), !1
- })
- };
- $(document).ready(startup);
- startup = function() {
- var n = !1;
- $(".generate-address").submit(function() {
- var r = $(this),
- t, u, i, f, e;
- if (!n && ($("select#addressType").size() == 0 || $("select#addressType option:selected").val() == "online")) return $("button[type='submit']", r).prop("disabled", !0), $(".hashing-progress-container").removeClass("hide"), t = new Bitcoin.ECKey, t.setCompressed(!0), u = new SecureRandom, i = [], i[31] = 0, u.nextBytes(i), f = t.priv.toByteArrayUnsigned(), e = {
- key: {
- decryptedKey: f
- },
- seed: {
- decryptedKey: i
- }
- }, ColorWallet.hashPasswordToForm(r, $("#password").val(), $("#loginSalt").val()), ColorWallet.encryptPrivateKeys($("#password").val(), e, $("#salt").val(), function(i) {
- var u = Crypto.util.bytesToHex(t.getPub());
- $("input[name='publicKey']").val(u);
- $("input[name='encryptionMode']").val(ColorWallet.walletEncryptionMode.mode);
- $("input[name='encryptionIterations']").val(ColorWallet.walletEncryptionMode.iterations);
- $("input[name='privateKey']").val(i.key.privateKey);
- $("input[name='seed']").val(i.seed.privateKey);
- n = !0;
- r.submit()
- }, function(n) {
- $(".hash-progress").css("width", n + "%");
- $(".hash-progress-text").text(n + "%")
- }), !1
- });
- $("select#addressType").on("change", function() {
- var t = $("option:selected", this),
- n = this.value;
- $(".storage-type").addClass("hide");
- $(".show-" + n + "-address").removeClass("hide")
- });
- $(".show-trezor-address .load-address").click(function() {
- var t = trezorWallet.getTransport().then(trezorWallet.getSession),
- n = Number($("select#trezor-path option:selected").val());
- t.then(function(t) {
- return t.getPublicKey(trezorWallet.getAddressPath(0, n))
- }).then(function(t) {
- $("#trezor-pubkey").val(t.message.xpub);
- $("#trezorPath").val(n);
- $(".trezor-error").addClass("hide")
- }).catch(function(n) {
- $(".trezor-error").removeClass("hide");
- console.log(n)
- })
- })
- };
- $(document).ready(startup);
- startup = function() {
- $(".check-password").on("input", function() {
- $("#password").val() != $("#passwordConfirm").val() ? $("#passwordConfirm").val() != "" && $(".confirm-group").addClass("has-error") : $(".confirm-group").removeClass("has-error");
- $("#password").val().length >= 10 && $(".password-group").removeClass("has-error");
- $("#password").val() == $("#passwordConfirm").val() && $("#password").val().length >= 10 ? $("button[type='submit']").prop("disabled", !1) : $("button[type='submit']").prop("disabled", !0)
- });
- $(".password-group #password").change(function() {
- $("#password").val().length < 10 && $(".password-group").addClass("has-error")
- });
- $("form.sign-in-form").submit(function() {
- var n = $(this),
- i = $("input.hash-password", n),
- t = $("input[name='loginSalt']", n),
- r = i.val(),
- u = t.val();
- if (!$("input[name='passwordHash']", n).val()) return $.post(global.logininfo, {
- username: $("#username").val(),
- __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val()
- }, function(i) {
- i.error ? window.location.href = window.location.href : (t.val(i.salt), ColorWallet.hashPasswordToForm(n, r, i.salt), n.submit())
- }), $("button[type='submit']").prop("disabled", !0), !1
- })
- };
- $(document).ready(startup);
- startup = function() {
- function n() {
- $("#send-coins-form .units-helper").text(global.color.helper);
- $("#send-coins-form .ticker-text").text(global.color.ticker);
- $(".color-balance").addClass("hide");
- $(".available-balance" + global.color.id).removeClass("hide");
- $("#send-coins-form input[name='color']").val(global.color.id)
- }
- $("#send-coins-form #from-select").change(function() {
- var n = $("#from-select option:selected").attr("value");
- window.location.replace(n)
- });
- $("#send-coins-form").submit(function() {
- var r = $("#amount-unit").val(),
- t = $("input[name='amount']");
- try {
- var u = new BigDecimal(r),
- n = u.multiply(new BigDecimal(global.color.rate)).toString(),
- i = n.indexOf(".");
- i >= 0 && (n = n.substr(0, i));
- t.val(n)
- } catch (f) {
- t.val("")
- }
- });
- $("#send-coins-form .color-option").click(function() {
- var t = $(this).attr("colorid");
- return global.color = global.colors[t], n(), $("#send-coins-form .selected-color-dropdown").dropdown("toggle"), !1
- });
- $(".metadata-selector").change(function() {
- var n = $("option:selected", $(this)).val();
- n == "profile" ? $(".metadata-profile").removeClass("hide") : $(".metadata-profile").addClass("hide");
- n == "url" ? $(".metadata-url").removeClass("hide") : $(".metadata-url").addClass("hide")
- });
- $("[set-address-to]").click(function(n) {
- $("#addressTo").val($(this).attr("set-address-to"));
- $("#addressTo").trigger("input");
- n.preventDefault()
- });
- $("#addressTo").on("input", function() {
- var n = $(this).val();
- $("ul.dropdown-menu li a[set-address-to]").each(function() {
- var t = $(this).attr("set-address-to"),
- i = $(this).attr("other-address");
- if (t === n || i === n) return $(".address-selector-label").text($(this).text()), !1;
- $(".address-selector-label").text("Addresses")
- })
- });
- typeof global.color != "undefined" && $("#send-coins-form").size() > 0 && n();
- $("#addressTo").trigger("input");
- $(".metadata-selector").trigger("change")
- };
- $(document).ready(startup);
- startup = function() {
- function r(n) {
- var t, r, i, f, u;
- try {
- t = Bitcoin.Base58.decode(n)
- } catch (e) {
- return null
- }
- return t.length != 38 || t[33] != 1 ? null : (r = t.slice(0, 34), i = Crypto.SHA256(Crypto.SHA256(r, {
- asBytes: !0
- }), {
- asBytes: !0
- }), i[0] != t[34] || i[1] != t[35] || i[2] != t[36] || i[3] != t[37]) ? null : (f = r.shift(), f != 128) ? null : (u = new Bitcoin.ECKey(t.slice(1, 33)), u.setCompressed(!0), u)
- }
- var i = !1,
- n, t;
- $(".change-password").submit(function() {
- var n = $(this);
- if (!i) {
- $("button[type='submit']", n).prop("disabled", !0);
- $(".hashing-progress-container").removeClass("hide");
- var r = $("#currentPassword").val(),
- t = global.loginSalt,
- u = ColorWallet.hashPassword(r, t);
- return $("input[name='currentPasswordHash']").val(u), ColorWallet.hashPasswordToForm(n, $("#password").val(), t), ColorWallet.decryptPrivateKey($("#currentPassword").val(), $("#salt").val(), global.keys, function() {
- ColorWallet.encryptPrivateKeys($("#password").val(), global.keys, $("#salt").val(), function() {
- var t = {};
- for (var r in global.keys) t[r] = global.keys[r].privateKey;
- $("input[name='encryptionMode']").val(ColorWallet.walletEncryptionMode.mode);
- $("input[name='encryptionIterations']").val(ColorWallet.walletEncryptionMode.iterations);
- $("input[name='privateKeys']").val(JSON.stringify(t));
- i = !0;
- n.submit()
- }, function(n) {
- $(".hash-progress").css("width", 50 + Math.round(n / 2) + "%");
- $(".hash-progress-text").text(50 + Math.round(n / 2) + "%")
- })
- }, function(n) {
- $(".hash-progress").css("width", Math.round(n / 2) + "%");
- $(".hash-progress-text").text(Math.round(n / 2) + "%")
- }), !1
- }
- });
- $("#backup-type").change(function() {
- var n = $("option:selected", $(this)).val();
- n == "dec" ? $(".backup-password").removeClass("hide") : $(".backup-password").addClass("hide")
- });
- $(".run-export").submit(function() {
- function u() {
- $("#backup-content").val(JSON.stringify(n));
- $(".backup-result").removeClass("hide");
- $(".hashing-progress-container").addClass("hide");
- $(".backup-type-group").addClass("hide");
- $(".backup-password").addClass("hide");
- i.length > 0 && ($(".backup-error").removeClass("hide"), $(".corrupted-addresses").text(i.join(", ")))
- }
- var e = $(this),
- n, i, f, t, r;
- if ($("button[type='submit']", e).prop("disabled", !0), $(".hashing-progress-container").removeClass("hide"), n = {
- keys: []
- }, i = [], f = $("#backup-type option:selected").val(), f == "enc") {
- n.salt = global.salt;
- for (t in global.keys) n.keys.push({
- addr: t,
- priv: global.keys[t].privateKey,
- encryptionMode: global.keys[t].encryptionMode,
- iterations: global.keys[t].iterations
- });
- u()
- } else {
- r = $("#password").val();
- function o() {
- ColorWallet.decryptPrivateKey(r, global.salt, global.keys, function() {
- var r, f, e, t, o;
- for (r in global.keys)
- if (t = global.keys[r].decryptedKey, f = new Bitcoin.ECKey(t), f.setCompressed(!0), e = f.getBitcoinAddress(), e.version = global.version, e.toString() != r) i.push(r);
- else {
- for (t = f.priv.toByteArrayUnsigned(); t.length < 32;) t.unshift(0);
- t.push(1);
- o = new Bitcoin.Address(t);
- o.version = global.privVersion;
- n.keys.push({
- addr: r,
- priv: o.toString()
- })
- }
- u()
- }, function(n) {
- $(".hash-progress").css("width", n + "%");
- $(".hash-progress-text").text(n + "%")
- })
- }
- $.post(global.validateUrl, {
- password: ColorWallet.hashPassword(r, global.loginSalt),
- __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val()
- }, function(n) {
- n.valid ? o() : window.location.href = window.location.href
- })
- }
- return !1
- });
- $(".run-import #privateKey").on("input", function() {
- var n, i;
- t || (n = r($(this).val()), n == null ? ($(".run-import #address").val(""), $(".run-import #rawPrivateKey").val(""), global.importedPrivateKey = null, $(".run-import button[type='submit']").prop("disabled", !0)) : (i = n.getBitcoinAddress(), i.version = global.version, $(".run-import #address").val(i.toString()), global.importedPrivateKey = n, $(".run-import button[type='submit']").prop("disabled", !1)))
- });
- n = !1;
- t = !1;
- $(".run-import").submit(function() {
- var r, i, u, f;
- return global.importedPrivateKey == null ? !1 : (r = global.importedPrivateKey, i = $(this), n ? void 0 : (t = !0, $("button[type='submit']", i).prop("disabled", !0), $(".hashing-progress-container").removeClass("hide"), u = r.priv.toByteArrayUnsigned(), f = {
- key: {
- decryptedKey: u
- }
- }, ColorWallet.hashPasswordToForm(i, $("#password").val(), $("#loginSalt").val()), ColorWallet.encryptPrivateKeys($("#password").val(), f, $("#salt").val(), function(t) {
- var u = Crypto.util.bytesToHex(r.getPub());
- $("input[name='publicKey']").val(u);
- $("input[name='encryptionMode']").val(ColorWallet.walletEncryptionMode.mode);
- $("input[name='encryptionIterations']").val(ColorWallet.walletEncryptionMode.iterations);
- $("input[name='privateKey']").val(t.key.privateKey);
- n = !0;
- i.submit()
- }, function(n) {
- $(".hash-progress").css("width", n + "%");
- $(".hash-progress-text").text(n + "%")
- }), !1))
- });
- $(".two-factor").submit(function() {
- var n = $("#password").val(),
- t = ColorWallet.hashPassword(n, global.loginSalt);
- $("input[name='passwordHash']").val(t)
- })
- };
- $(document).ready(startup);
- startup = function() {
- function t(n, t) {
- $(".pin-matrix button").click(function() {
- $("#trezor-pin").val($("#trezor-pin").val() + $(this).attr("data-value"))
- });
- $("#confirm-pin").click(function() {
- $(".pin-show").addClass("hide");
- t(null, $("#trezor-pin").val())
- });
- $(".pin-show").removeClass("hide")
- }
- var n = !1;
- $("#sign-transaction").submit(function() {
- var t, i;
- if (!n) {
- for ($("button[type='submit']", $(this)).prop("disabled", !0), $(".hashing-progress-container").removeClass("hide"), ColorWallet.hashPasswordToForm($(this), $("#password").val(), $("#loginSalt").val()), t = [], i = 0; i < global.transactions.length; i++) t.push(ColorWallet.buildTransaction(global.transactions[i]));
- return ColorWallet.decryptPrivateKey($("#password").val(), global.salt, global.keys, function() {
- for (var r, f, u = null, e = "", i = 0; i < t.length; i++) {
- if (u != null)
- for (r = 0; r < t[i].ins.length; r++) f = t[i].ins[r], f.outpoint.hash.length == 0 && (f.outpoint.hash = Crypto.util.bytesToBase64(u));
- u = ColorWallet.signTransaction(t[i], global.keys);
- e += Crypto.util.bytesToHex(t[i].serialize()) + " "
- }
- $("input[name='rawTransaction']").val(e);
- n = !0;
- $("#sign-transaction").submit()
- }, function(n) {
- $(".hash-progress").css("width", n + "%");
- $(".hash-progress-text").text(n + "%")
- }), !1
- }
- });
- $("#sign-trezor").click(function() {
- var i, n, f, r;
- for ($("#sign-trezor").prop("disabled", !0), i = [], n = 0; n < global.supportingTransactions.length; n++) f = ColorWallet.buildTransaction(global.supportingTransactions[n]), r = ColorWallet.buildTransaction(global.supportingTransactions[n]), r.hash = global.supportingTransactions[n].hash, i[global.supportingTransactions[n].hash] = global.supportingTransactions[n];
- var e = trezorWallet.getAddressPath(0, global.derivationPath),
- u = trezorWallet.getTransport().then(trezorWallet.getSession).then(function(n) {
- return n._emitter.addListener("pin", t), n
- }),
- o = u.then(function(n) {
- var t = u,
- r = global.transactions.map(function(r) {
- var u = t.then(function() {
- return trezorWallet.createTrezorTransaction(n, r, i, e, global.coinName)
- });
- return t = u, u
- });
- return Promise.all(r)
- }),
- r = o.then(function(n) {
- var t = n.map(function(n) {
- return n.message.serialized.serialized_tx
- });
- $("input[name='rawTransaction']").val(t.join(" "));
- $("#submit-trezor").submit()
- }).catch(function(n) {
- console.log(n);
- $(".trezor-error").removeClass("hide");
- $(".error-message").text($(".error-message").text() + n.message)
- })
- });
- $(".get-recipients").click(function() {
- var n = new Blob([global.recipients], {
- type: "text/csv;charset=utf-8"
- });
- return saveAs(n, "summary.csv"), !1
- });
- $("select#offlineWalletType").on("change", function() {
- var t = $("option:selected", this),
- n = this.value;
- $(".offline-wallet-group").addClass("hide");
- $(".offline-wallet-group." + n).removeClass("hide")
- })
- };
- $(document).ready(startup);
- startup = function() {
- function t(i) {
- function u() {
- n = JSON.parse($("[js-var]", r).text());
- $("button.load-more", r).click(t);
- setupAssetPopup(r)
- }
- var r = $($(this).parents(".transactions-container")[0]),
- f = $("input[name='__RequestVerificationToken']").val();
- n.__RequestVerificationToken = f;
- r.load("/address/getmoretransactions", n, u);
- $(this).prop("disabled", !0);
- i.preventDefault()
- }
- var n = global.pagingToken;
- $("button.load-more").click(t)
- };
- $(document).ready(startup);
- startup = function() {
- $(".smart-address").size() > 0 && (setInterval(refreshQuote, 5e3), $(".btc-to-usd-btn").click(function() {
- $(".btc-to-usd").removeClass("hide");
- $(".usd-to-btc").addClass("hide");
- $(".btc-to-usd-btn").addClass("btn-primary");
- $(".btc-to-usd-btn").removeClass("btn-default");
- $(".usd-to-btc-btn").removeClass("btn-primary");
- $(".usd-to-btc-btn").addClass("btn-default")
- }), $(".usd-to-btc-btn").click(function() {
- $(".btc-to-usd").addClass("hide");
- $(".usd-to-btc").removeClass("hide");
- $(".btc-to-usd-btn").removeClass("btn-primary");
- $(".btc-to-usd-btn").addClass("btn-default");
- $(".usd-to-btc-btn").addClass("btn-primary");
- $(".usd-to-btc-btn").removeClass("btn-default")
- }))
- };
- $(document).ready(startup);
- startup = function() {};
- $(document).ready(startup);
- _gaq = _gaq || [];
- _gaq.push(["_setAccount", "UA-26257569-4"]);
- _gaq.push(["_trackPageview"])
Add Comment
Please, Sign In to add comment