UNPKG

oidc-client

Version:

OpenID Connect (OIDC) & OAuth2 client library

1,231 lines (1,196 loc) 1.56 MB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else { var a = factory(); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./index.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./index.js": /*!******************!*\ !*** ./index.js ***! \******************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _Log = __webpack_require__(/*! ./src/Log.js */ "./src/Log.js"); var _OidcClient = __webpack_require__(/*! ./src/OidcClient.js */ "./src/OidcClient.js"); var _OidcClientSettings = __webpack_require__(/*! ./src/OidcClientSettings.js */ "./src/OidcClientSettings.js"); var _WebStorageStateStore = __webpack_require__(/*! ./src/WebStorageStateStore.js */ "./src/WebStorageStateStore.js"); var _InMemoryWebStorage = __webpack_require__(/*! ./src/InMemoryWebStorage.js */ "./src/InMemoryWebStorage.js"); var _UserManager = __webpack_require__(/*! ./src/UserManager.js */ "./src/UserManager.js"); var _AccessTokenEvents = __webpack_require__(/*! ./src/AccessTokenEvents.js */ "./src/AccessTokenEvents.js"); var _MetadataService = __webpack_require__(/*! ./src/MetadataService.js */ "./src/MetadataService.js"); var _CordovaPopupNavigator = __webpack_require__(/*! ./src/CordovaPopupNavigator.js */ "./src/CordovaPopupNavigator.js"); var _CordovaIFrameNavigator = __webpack_require__(/*! ./src/CordovaIFrameNavigator.js */ "./src/CordovaIFrameNavigator.js"); var _CheckSessionIFrame = __webpack_require__(/*! ./src/CheckSessionIFrame.js */ "./src/CheckSessionIFrame.js"); var _TokenRevocationClient = __webpack_require__(/*! ./src/TokenRevocationClient.js */ "./src/TokenRevocationClient.js"); var _SessionMonitor = __webpack_require__(/*! ./src/SessionMonitor.js */ "./src/SessionMonitor.js"); var _Global = __webpack_require__(/*! ./src/Global.js */ "./src/Global.js"); var _User = __webpack_require__(/*! ./src/User.js */ "./src/User.js"); exports.default = { Log: _Log.Log, OidcClient: _OidcClient.OidcClient, OidcClientSettings: _OidcClientSettings.OidcClientSettings, WebStorageStateStore: _WebStorageStateStore.WebStorageStateStore, InMemoryWebStorage: _InMemoryWebStorage.InMemoryWebStorage, UserManager: _UserManager.UserManager, AccessTokenEvents: _AccessTokenEvents.AccessTokenEvents, MetadataService: _MetadataService.MetadataService, CordovaPopupNavigator: _CordovaPopupNavigator.CordovaPopupNavigator, CordovaIFrameNavigator: _CordovaIFrameNavigator.CordovaIFrameNavigator, CheckSessionIFrame: _CheckSessionIFrame.CheckSessionIFrame, TokenRevocationClient: _TokenRevocationClient.TokenRevocationClient, SessionMonitor: _SessionMonitor.SessionMonitor, Global: _Global.Global, User: _User.User }; // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. module.exports = exports['default']; /***/ }), /***/ "./jsrsasign/dist/jsrsasign.js": /*!*************************************!*\ !*** ./jsrsasign/dist/jsrsasign.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(Buffer) { Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* * jsrsasign(all) 8.0.12 (2018-04-22) (c) 2010-2018 Kenji Urushima | kjur.github.com/jsrsasign/license */ var navigator = {}; navigator.userAgent = false; var window = {}; /*! Copyright (c) 2011, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html version: 2.9.0 */ if (YAHOO === undefined) { var YAHOO = {}; }YAHOO.lang = { extend: function extend(g, h, f) { if (!h || !g) { throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included."); }var d = function d() {};d.prototype = h.prototype;g.prototype = new d();g.prototype.constructor = g;g.superclass = h.prototype;if (h.prototype.constructor == Object.prototype.constructor) { h.prototype.constructor = h; }if (f) { var b;for (b in f) { g.prototype[b] = f[b]; }var e = function e() {}, c = ["toString", "valueOf"];try { if (/MSIE/.test(navigator.userAgent)) { e = function e(j, i) { for (b = 0; b < c.length; b = b + 1) { var l = c[b], k = i[l];if (typeof k === "function" && k != Object.prototype[l]) { j[l] = k; } } }; } } catch (a) {}e(g.prototype, f); } } }; /*! CryptoJS v3.1.2 core-fix.js * code.google.com/p/crypto-js * (c) 2009-2013 by Jeff Mott. All rights reserved. * code.google.com/p/crypto-js/wiki/License * THIS IS FIX of 'core.js' to fix Hmac issue. * https://code.google.com/p/crypto-js/issues/detail?id=84 * https://crypto-js.googlecode.com/svn-history/r667/branches/3.x/src/core.js */ var CryptoJS = CryptoJS || function (e, g) { var a = {};var b = a.lib = {};var j = b.Base = function () { function n() {}return { extend: function extend(p) { n.prototype = this;var o = new n();if (p) { o.mixIn(p); }if (!o.hasOwnProperty("init")) { o.init = function () { o.$super.init.apply(this, arguments); }; }o.init.prototype = o;o.$super = this;return o; }, create: function create() { var o = this.extend();o.init.apply(o, arguments);return o; }, init: function init() {}, mixIn: function mixIn(p) { for (var o in p) { if (p.hasOwnProperty(o)) { this[o] = p[o]; } }if (p.hasOwnProperty("toString")) { this.toString = p.toString; } }, clone: function clone() { return this.init.prototype.extend(this); } }; }();var l = b.WordArray = j.extend({ init: function init(o, n) { o = this.words = o || [];if (n != g) { this.sigBytes = n; } else { this.sigBytes = o.length * 4; } }, toString: function toString(n) { return (n || h).stringify(this); }, concat: function concat(t) { var q = this.words;var p = t.words;var n = this.sigBytes;var s = t.sigBytes;this.clamp();if (n % 4) { for (var r = 0; r < s; r++) { var o = p[r >>> 2] >>> 24 - r % 4 * 8 & 255;q[n + r >>> 2] |= o << 24 - (n + r) % 4 * 8; } } else { for (var r = 0; r < s; r += 4) { q[n + r >>> 2] = p[r >>> 2]; } }this.sigBytes += s;return this; }, clamp: function clamp() { var o = this.words;var n = this.sigBytes;o[n >>> 2] &= 4294967295 << 32 - n % 4 * 8;o.length = e.ceil(n / 4); }, clone: function clone() { var n = j.clone.call(this);n.words = this.words.slice(0);return n; }, random: function random(p) { var o = [];for (var n = 0; n < p; n += 4) { o.push(e.random() * 4294967296 | 0); }return new l.init(o, p); } });var m = a.enc = {};var h = m.Hex = { stringify: function stringify(p) { var r = p.words;var o = p.sigBytes;var q = [];for (var n = 0; n < o; n++) { var s = r[n >>> 2] >>> 24 - n % 4 * 8 & 255;q.push((s >>> 4).toString(16));q.push((s & 15).toString(16)); }return q.join(""); }, parse: function parse(p) { var n = p.length;var q = [];for (var o = 0; o < n; o += 2) { q[o >>> 3] |= parseInt(p.substr(o, 2), 16) << 24 - o % 8 * 4; }return new l.init(q, n / 2); } };var d = m.Latin1 = { stringify: function stringify(q) { var r = q.words;var p = q.sigBytes;var n = [];for (var o = 0; o < p; o++) { var s = r[o >>> 2] >>> 24 - o % 4 * 8 & 255;n.push(String.fromCharCode(s)); }return n.join(""); }, parse: function parse(p) { var n = p.length;var q = [];for (var o = 0; o < n; o++) { q[o >>> 2] |= (p.charCodeAt(o) & 255) << 24 - o % 4 * 8; }return new l.init(q, n); } };var c = m.Utf8 = { stringify: function stringify(n) { try { return decodeURIComponent(escape(d.stringify(n))); } catch (o) { throw new Error("Malformed UTF-8 data"); } }, parse: function parse(n) { return d.parse(unescape(encodeURIComponent(n))); } };var i = b.BufferedBlockAlgorithm = j.extend({ reset: function reset() { this._data = new l.init();this._nDataBytes = 0; }, _append: function _append(n) { if (typeof n == "string") { n = c.parse(n); }this._data.concat(n);this._nDataBytes += n.sigBytes; }, _process: function _process(w) { var q = this._data;var x = q.words;var n = q.sigBytes;var t = this.blockSize;var v = t * 4;var u = n / v;if (w) { u = e.ceil(u); } else { u = e.max((u | 0) - this._minBufferSize, 0); }var s = u * t;var r = e.min(s * 4, n);if (s) { for (var p = 0; p < s; p += t) { this._doProcessBlock(x, p); }var o = x.splice(0, s);q.sigBytes -= r; }return new l.init(o, r); }, clone: function clone() { var n = j.clone.call(this);n._data = this._data.clone();return n; }, _minBufferSize: 0 });var f = b.Hasher = i.extend({ cfg: j.extend(), init: function init(n) { this.cfg = this.cfg.extend(n);this.reset(); }, reset: function reset() { i.reset.call(this);this._doReset(); }, update: function update(n) { this._append(n);this._process();return this; }, finalize: function finalize(n) { if (n) { this._append(n); }var o = this._doFinalize();return o; }, blockSize: 512 / 32, _createHelper: function _createHelper(n) { return function (p, o) { return new n.init(o).finalize(p); }; }, _createHmacHelper: function _createHmacHelper(n) { return function (p, o) { return new k.HMAC.init(n, o).finalize(p); }; } });var k = a.algo = {};return a; }(Math); /* CryptoJS v3.1.2 x64-core-min.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function (g) { var a = CryptoJS, f = a.lib, e = f.Base, h = f.WordArray, a = a.x64 = {};a.Word = e.extend({ init: function init(b, c) { this.high = b;this.low = c; } });a.WordArray = e.extend({ init: function init(b, c) { b = this.words = b || [];this.sigBytes = c != g ? c : 8 * b.length; }, toX32: function toX32() { for (var b = this.words, c = b.length, a = [], d = 0; d < c; d++) { var e = b[d];a.push(e.high);a.push(e.low); }return h.create(a, this.sigBytes); }, clone: function clone() { for (var b = e.clone.call(this), c = b.words = this.words.slice(0), a = c.length, d = 0; d < a; d++) { c[d] = c[d].clone(); }return b; } }); })(); /* CryptoJS v3.1.2 enc-base64.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function () { var h = CryptoJS, j = h.lib.WordArray;h.enc.Base64 = { stringify: function stringify(b) { var e = b.words, f = b.sigBytes, c = this._map;b.clamp();b = [];for (var a = 0; a < f; a += 3) { for (var d = (e[a >>> 2] >>> 24 - 8 * (a % 4) & 255) << 16 | (e[a + 1 >>> 2] >>> 24 - 8 * ((a + 1) % 4) & 255) << 8 | e[a + 2 >>> 2] >>> 24 - 8 * ((a + 2) % 4) & 255, g = 0; 4 > g && a + 0.75 * g < f; g++) { b.push(c.charAt(d >>> 6 * (3 - g) & 63)); } }if (e = c.charAt(64)) for (; b.length % 4;) { b.push(e); }return b.join(""); }, parse: function parse(b) { var e = b.length, f = this._map, c = f.charAt(64);c && (c = b.indexOf(c), -1 != c && (e = c));for (var c = [], a = 0, d = 0; d < e; d++) { if (d % 4) { var g = f.indexOf(b.charAt(d - 1)) << 2 * (d % 4), h = f.indexOf(b.charAt(d)) >>> 6 - 2 * (d % 4);c[a >>> 2] |= (g | h) << 24 - 8 * (a % 4);a++; } }return j.create(c, a); }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" }; })(); /* CryptoJS v3.1.2 sha256-min.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function (k) { for (var g = CryptoJS, h = g.lib, v = h.WordArray, j = h.Hasher, h = g.algo, s = [], t = [], u = function u(q) { return 4294967296 * (q - (q | 0)) | 0; }, l = 2, b = 0; 64 > b;) { var d;a: { d = l;for (var w = k.sqrt(d), r = 2; r <= w; r++) { if (!(d % r)) { d = !1;break a; } }d = !0; }d && (8 > b && (s[b] = u(k.pow(l, 0.5))), t[b] = u(k.pow(l, 1 / 3)), b++);l++; }var n = [], h = h.SHA256 = j.extend({ _doReset: function _doReset() { this._hash = new v.init(s.slice(0)); }, _doProcessBlock: function _doProcessBlock(q, h) { for (var a = this._hash.words, c = a[0], d = a[1], b = a[2], k = a[3], f = a[4], g = a[5], j = a[6], l = a[7], e = 0; 64 > e; e++) { if (16 > e) n[e] = q[h + e] | 0;else { var m = n[e - 15], p = n[e - 2];n[e] = ((m << 25 | m >>> 7) ^ (m << 14 | m >>> 18) ^ m >>> 3) + n[e - 7] + ((p << 15 | p >>> 17) ^ (p << 13 | p >>> 19) ^ p >>> 10) + n[e - 16]; }m = l + ((f << 26 | f >>> 6) ^ (f << 21 | f >>> 11) ^ (f << 7 | f >>> 25)) + (f & g ^ ~f & j) + t[e] + n[e];p = ((c << 30 | c >>> 2) ^ (c << 19 | c >>> 13) ^ (c << 10 | c >>> 22)) + (c & d ^ c & b ^ d & b);l = j;j = g;g = f;f = k + m | 0;k = b;b = d;d = c;c = m + p | 0; }a[0] = a[0] + c | 0;a[1] = a[1] + d | 0;a[2] = a[2] + b | 0;a[3] = a[3] + k | 0;a[4] = a[4] + f | 0;a[5] = a[5] + g | 0;a[6] = a[6] + j | 0;a[7] = a[7] + l | 0; }, _doFinalize: function _doFinalize() { var d = this._data, b = d.words, a = 8 * this._nDataBytes, c = 8 * d.sigBytes; b[c >>> 5] |= 128 << 24 - c % 32;b[(c + 64 >>> 9 << 4) + 14] = k.floor(a / 4294967296);b[(c + 64 >>> 9 << 4) + 15] = a;d.sigBytes = 4 * b.length;this._process();return this._hash; }, clone: function clone() { var b = j.clone.call(this);b._hash = this._hash.clone();return b; } });g.SHA256 = j._createHelper(h);g.HmacSHA256 = j._createHmacHelper(h); })(Math); /* CryptoJS v3.1.2 sha512-min.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function () { function a() { return d.create.apply(d, arguments); }for (var n = CryptoJS, r = n.lib.Hasher, e = n.x64, d = e.Word, T = e.WordArray, e = n.algo, ea = [a(1116352408, 3609767458), a(1899447441, 602891725), a(3049323471, 3964484399), a(3921009573, 2173295548), a(961987163, 4081628472), a(1508970993, 3053834265), a(2453635748, 2937671579), a(2870763221, 3664609560), a(3624381080, 2734883394), a(310598401, 1164996542), a(607225278, 1323610764), a(1426881987, 3590304994), a(1925078388, 4068182383), a(2162078206, 991336113), a(2614888103, 633803317), a(3248222580, 3479774868), a(3835390401, 2666613458), a(4022224774, 944711139), a(264347078, 2341262773), a(604807628, 2007800933), a(770255983, 1495990901), a(1249150122, 1856431235), a(1555081692, 3175218132), a(1996064986, 2198950837), a(2554220882, 3999719339), a(2821834349, 766784016), a(2952996808, 2566594879), a(3210313671, 3203337956), a(3336571891, 1034457026), a(3584528711, 2466948901), a(113926993, 3758326383), a(338241895, 168717936), a(666307205, 1188179964), a(773529912, 1546045734), a(1294757372, 1522805485), a(1396182291, 2643833823), a(1695183700, 2343527390), a(1986661051, 1014477480), a(2177026350, 1206759142), a(2456956037, 344077627), a(2730485921, 1290863460), a(2820302411, 3158454273), a(3259730800, 3505952657), a(3345764771, 106217008), a(3516065817, 3606008344), a(3600352804, 1432725776), a(4094571909, 1467031594), a(275423344, 851169720), a(430227734, 3100823752), a(506948616, 1363258195), a(659060556, 3750685593), a(883997877, 3785050280), a(958139571, 3318307427), a(1322822218, 3812723403), a(1537002063, 2003034995), a(1747873779, 3602036899), a(1955562222, 1575990012), a(2024104815, 1125592928), a(2227730452, 2716904306), a(2361852424, 442776044), a(2428436474, 593698344), a(2756734187, 3733110249), a(3204031479, 2999351573), a(3329325298, 3815920427), a(3391569614, 3928383900), a(3515267271, 566280711), a(3940187606, 3454069534), a(4118630271, 4000239992), a(116418474, 1914138554), a(174292421, 2731055270), a(289380356, 3203993006), a(460393269, 320620315), a(685471733, 587496836), a(852142971, 1086792851), a(1017036298, 365543100), a(1126000580, 2618297676), a(1288033470, 3409855158), a(1501505948, 4234509866), a(1607167915, 987167468), a(1816402316, 1246189591)], v = [], w = 0; 80 > w; w++) { v[w] = a(); }e = e.SHA512 = r.extend({ _doReset: function _doReset() { this._hash = new T.init([new d.init(1779033703, 4089235720), new d.init(3144134277, 2227873595), new d.init(1013904242, 4271175723), new d.init(2773480762, 1595750129), new d.init(1359893119, 2917565137), new d.init(2600822924, 725511199), new d.init(528734635, 4215389547), new d.init(1541459225, 327033209)]); }, _doProcessBlock: function _doProcessBlock(a, d) { for (var f = this._hash.words, F = f[0], e = f[1], n = f[2], r = f[3], G = f[4], H = f[5], I = f[6], f = f[7], w = F.high, J = F.low, X = e.high, K = e.low, Y = n.high, L = n.low, Z = r.high, M = r.low, $ = G.high, N = G.low, aa = H.high, O = H.low, ba = I.high, P = I.low, ca = f.high, Q = f.low, k = w, g = J, z = X, x = K, A = Y, y = L, U = Z, B = M, l = $, h = N, R = aa, C = O, S = ba, D = P, V = ca, E = Q, m = 0; 80 > m; m++) { var s = v[m];if (16 > m) var j = s.high = a[d + 2 * m] | 0, b = s.low = a[d + 2 * m + 1] | 0;else { var j = v[m - 15], b = j.high, p = j.low, j = (b >>> 1 | p << 31) ^ (b >>> 8 | p << 24) ^ b >>> 7, p = (p >>> 1 | b << 31) ^ (p >>> 8 | b << 24) ^ (p >>> 7 | b << 25), u = v[m - 2], b = u.high, c = u.low, u = (b >>> 19 | c << 13) ^ (b << 3 | c >>> 29) ^ b >>> 6, c = (c >>> 19 | b << 13) ^ (c << 3 | b >>> 29) ^ (c >>> 6 | b << 26), b = v[m - 7], W = b.high, t = v[m - 16], q = t.high, t = t.low, b = p + b.low, j = j + W + (b >>> 0 < p >>> 0 ? 1 : 0), b = b + c, j = j + u + (b >>> 0 < c >>> 0 ? 1 : 0), b = b + t, j = j + q + (b >>> 0 < t >>> 0 ? 1 : 0);s.high = j;s.low = b; }var W = l & R ^ ~l & S, t = h & C ^ ~h & D, s = k & z ^ k & A ^ z & A, T = g & x ^ g & y ^ x & y, p = (k >>> 28 | g << 4) ^ (k << 30 | g >>> 2) ^ (k << 25 | g >>> 7), u = (g >>> 28 | k << 4) ^ (g << 30 | k >>> 2) ^ (g << 25 | k >>> 7), c = ea[m], fa = c.high, da = c.low, c = E + ((h >>> 14 | l << 18) ^ (h >>> 18 | l << 14) ^ (h << 23 | l >>> 9)), q = V + ((l >>> 14 | h << 18) ^ (l >>> 18 | h << 14) ^ (l << 23 | h >>> 9)) + (c >>> 0 < E >>> 0 ? 1 : 0), c = c + t, q = q + W + (c >>> 0 < t >>> 0 ? 1 : 0), c = c + da, q = q + fa + (c >>> 0 < da >>> 0 ? 1 : 0), c = c + b, q = q + j + (c >>> 0 < b >>> 0 ? 1 : 0), b = u + T, s = p + s + (b >>> 0 < u >>> 0 ? 1 : 0), V = S, E = D, S = R, D = C, R = l, C = h, h = B + c | 0, l = U + q + (h >>> 0 < B >>> 0 ? 1 : 0) | 0, U = A, B = y, A = z, y = x, z = k, x = g, g = c + b | 0, k = q + s + (g >>> 0 < c >>> 0 ? 1 : 0) | 0; }J = F.low = J + g;F.high = w + k + (J >>> 0 < g >>> 0 ? 1 : 0);K = e.low = K + x;e.high = X + z + (K >>> 0 < x >>> 0 ? 1 : 0);L = n.low = L + y;n.high = Y + A + (L >>> 0 < y >>> 0 ? 1 : 0);M = r.low = M + B;r.high = Z + U + (M >>> 0 < B >>> 0 ? 1 : 0);N = G.low = N + h;G.high = $ + l + (N >>> 0 < h >>> 0 ? 1 : 0);O = H.low = O + C;H.high = aa + R + (O >>> 0 < C >>> 0 ? 1 : 0);P = I.low = P + D; I.high = ba + S + (P >>> 0 < D >>> 0 ? 1 : 0);Q = f.low = Q + E;f.high = ca + V + (Q >>> 0 < E >>> 0 ? 1 : 0); }, _doFinalize: function _doFinalize() { var a = this._data, d = a.words, f = 8 * this._nDataBytes, e = 8 * a.sigBytes;d[e >>> 5] |= 128 << 24 - e % 32;d[(e + 128 >>> 10 << 5) + 30] = Math.floor(f / 4294967296);d[(e + 128 >>> 10 << 5) + 31] = f;a.sigBytes = 4 * d.length;this._process();return this._hash.toX32(); }, clone: function clone() { var a = r.clone.call(this);a._hash = this._hash.clone();return a; }, blockSize: 32 });n.SHA512 = r._createHelper(e);n.HmacSHA512 = r._createHmacHelper(e); })(); /* CryptoJS v3.1.2 sha384-min.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function () { var c = CryptoJS, a = c.x64, b = a.Word, e = a.WordArray, a = c.algo, d = a.SHA512, a = a.SHA384 = d.extend({ _doReset: function _doReset() { this._hash = new e.init([new b.init(3418070365, 3238371032), new b.init(1654270250, 914150663), new b.init(2438529370, 812702999), new b.init(355462360, 4144912697), new b.init(1731405415, 4290775857), new b.init(2394180231, 1750603025), new b.init(3675008525, 1694076839), new b.init(1203062813, 3204075428)]); }, _doFinalize: function _doFinalize() { var a = d._doFinalize.call(this);a.sigBytes -= 16;return a; } });c.SHA384 = d._createHelper(a);c.HmacSHA384 = d._createHmacHelper(a); })(); /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */ var b64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var b64pad = "=";function hex2b64(d) { var b;var e;var a = "";for (b = 0; b + 3 <= d.length; b += 3) { e = parseInt(d.substring(b, b + 3), 16);a += b64map.charAt(e >> 6) + b64map.charAt(e & 63); }if (b + 1 == d.length) { e = parseInt(d.substring(b, b + 1), 16);a += b64map.charAt(e << 2); } else { if (b + 2 == d.length) { e = parseInt(d.substring(b, b + 2), 16);a += b64map.charAt(e >> 2) + b64map.charAt((e & 3) << 4); } }if (b64pad) { while ((a.length & 3) > 0) { a += b64pad; } }return a; }function b64tohex(f) { var d = "";var e;var b = 0;var c;var a;for (e = 0; e < f.length; ++e) { if (f.charAt(e) == b64pad) { break; }a = b64map.indexOf(f.charAt(e));if (a < 0) { continue; }if (b == 0) { d += int2char(a >> 2);c = a & 3;b = 1; } else { if (b == 1) { d += int2char(c << 2 | a >> 4);c = a & 15;b = 2; } else { if (b == 2) { d += int2char(c);d += int2char(a >> 2);c = a & 3;b = 3; } else { d += int2char(c << 2 | a >> 4);d += int2char(a & 15);b = 0; } } } }if (b == 1) { d += int2char(c << 2); }return d; }function b64toBA(e) { var d = b64tohex(e);var c;var b = new Array();for (c = 0; 2 * c < d.length; ++c) { b[c] = parseInt(d.substring(2 * c, 2 * c + 2), 16); }return b; }; /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */ var dbits;var canary = 244837814094590;var j_lm = (canary & 16777215) == 15715070;function BigInteger(e, d, f) { if (e != null) { if ("number" == typeof e) { this.fromNumber(e, d, f); } else { if (d == null && "string" != typeof e) { this.fromString(e, 256); } else { this.fromString(e, d); } } } }function nbi() { return new BigInteger(null); }function am1(f, a, b, e, h, g) { while (--g >= 0) { var d = a * this[f++] + b[e] + h;h = Math.floor(d / 67108864);b[e++] = d & 67108863; }return h; }function am2(f, q, r, e, o, a) { var k = q & 32767, p = q >> 15;while (--a >= 0) { var d = this[f] & 32767;var g = this[f++] >> 15;var b = p * d + g * k;d = k * d + ((b & 32767) << 15) + r[e] + (o & 1073741823);o = (d >>> 30) + (b >>> 15) + p * g + (o >>> 30);r[e++] = d & 1073741823; }return o; }function am3(f, q, r, e, o, a) { var k = q & 16383, p = q >> 14;while (--a >= 0) { var d = this[f] & 16383;var g = this[f++] >> 14;var b = p * d + g * k;d = k * d + ((b & 16383) << 14) + r[e] + o;o = (d >> 28) + (b >> 14) + p * g;r[e++] = d & 268435455; }return o; }if (j_lm && navigator.appName == "Microsoft Internet Explorer") { BigInteger.prototype.am = am2;dbits = 30; } else { if (j_lm && navigator.appName != "Netscape") { BigInteger.prototype.am = am1;dbits = 26; } else { BigInteger.prototype.am = am3;dbits = 28; } }BigInteger.prototype.DB = dbits;BigInteger.prototype.DM = (1 << dbits) - 1;BigInteger.prototype.DV = 1 << dbits;var BI_FP = 52;BigInteger.prototype.FV = Math.pow(2, BI_FP);BigInteger.prototype.F1 = BI_FP - dbits;BigInteger.prototype.F2 = 2 * dbits - BI_FP;var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";var BI_RC = new Array();var rr, vv;rr = "0".charCodeAt(0);for (vv = 0; vv <= 9; ++vv) { BI_RC[rr++] = vv; }rr = "a".charCodeAt(0);for (vv = 10; vv < 36; ++vv) { BI_RC[rr++] = vv; }rr = "A".charCodeAt(0);for (vv = 10; vv < 36; ++vv) { BI_RC[rr++] = vv; }function int2char(a) { return BI_RM.charAt(a); }function intAt(b, a) { var d = BI_RC[b.charCodeAt(a)];return d == null ? -1 : d; }function bnpCopyTo(b) { for (var a = this.t - 1; a >= 0; --a) { b[a] = this[a]; }b.t = this.t;b.s = this.s; }function bnpFromInt(a) { this.t = 1;this.s = a < 0 ? -1 : 0;if (a > 0) { this[0] = a; } else { if (a < -1) { this[0] = a + this.DV; } else { this.t = 0; } } }function nbv(a) { var b = nbi();b.fromInt(a);return b; }function bnpFromString(h, c) { var e;if (c == 16) { e = 4; } else { if (c == 8) { e = 3; } else { if (c == 256) { e = 8; } else { if (c == 2) { e = 1; } else { if (c == 32) { e = 5; } else { if (c == 4) { e = 2; } else { this.fromRadix(h, c);return; } } } } } }this.t = 0;this.s = 0;var g = h.length, d = false, f = 0;while (--g >= 0) { var a = e == 8 ? h[g] & 255 : intAt(h, g);if (a < 0) { if (h.charAt(g) == "-") { d = true; }continue; }d = false;if (f == 0) { this[this.t++] = a; } else { if (f + e > this.DB) { this[this.t - 1] |= (a & (1 << this.DB - f) - 1) << f;this[this.t++] = a >> this.DB - f; } else { this[this.t - 1] |= a << f; } }f += e;if (f >= this.DB) { f -= this.DB; } }if (e == 8 && (h[0] & 128) != 0) { this.s = -1;if (f > 0) { this[this.t - 1] |= (1 << this.DB - f) - 1 << f; } }this.clamp();if (d) { BigInteger.ZERO.subTo(this, this); } }function bnpClamp() { var a = this.s & this.DM;while (this.t > 0 && this[this.t - 1] == a) { --this.t; } }function bnToString(c) { if (this.s < 0) { return "-" + this.negate().toString(c); }var e;if (c == 16) { e = 4; } else { if (c == 8) { e = 3; } else { if (c == 2) { e = 1; } else { if (c == 32) { e = 5; } else { if (c == 4) { e = 2; } else { return this.toRadix(c); } } } } }var g = (1 << e) - 1, l, a = false, h = "", f = this.t;var j = this.DB - f * this.DB % e;if (f-- > 0) { if (j < this.DB && (l = this[f] >> j) > 0) { a = true;h = int2char(l); }while (f >= 0) { if (j < e) { l = (this[f] & (1 << j) - 1) << e - j;l |= this[--f] >> (j += this.DB - e); } else { l = this[f] >> (j -= e) & g;if (j <= 0) { j += this.DB;--f; } }if (l > 0) { a = true; }if (a) { h += int2char(l); } } }return a ? h : "0"; }function bnNegate() { var a = nbi();BigInteger.ZERO.subTo(this, a);return a; }function bnAbs() { return this.s < 0 ? this.negate() : this; }function bnCompareTo(b) { var d = this.s - b.s;if (d != 0) { return d; }var c = this.t;d = c - b.t;if (d != 0) { return this.s < 0 ? -d : d; }while (--c >= 0) { if ((d = this[c] - b[c]) != 0) { return d; } }return 0; }function nbits(a) { var c = 1, b;if ((b = a >>> 16) != 0) { a = b;c += 16; }if ((b = a >> 8) != 0) { a = b;c += 8; }if ((b = a >> 4) != 0) { a = b;c += 4; }if ((b = a >> 2) != 0) { a = b;c += 2; }if ((b = a >> 1) != 0) { a = b;c += 1; }return c; }function bnBitLength() { if (this.t <= 0) { return 0; }return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM); }function bnpDLShiftTo(c, b) { var a;for (a = this.t - 1; a >= 0; --a) { b[a + c] = this[a]; }for (a = c - 1; a >= 0; --a) { b[a] = 0; }b.t = this.t + c;b.s = this.s; }function bnpDRShiftTo(c, b) { for (var a = c; a < this.t; ++a) { b[a - c] = this[a]; }b.t = Math.max(this.t - c, 0);b.s = this.s; }function bnpLShiftTo(j, e) { var b = j % this.DB;var a = this.DB - b;var g = (1 << a) - 1;var f = Math.floor(j / this.DB), h = this.s << b & this.DM, d;for (d = this.t - 1; d >= 0; --d) { e[d + f + 1] = this[d] >> a | h;h = (this[d] & g) << b; }for (d = f - 1; d >= 0; --d) { e[d] = 0; }e[f] = h;e.t = this.t + f + 1;e.s = this.s;e.clamp(); }function bnpRShiftTo(g, d) { d.s = this.s;var e = Math.floor(g / this.DB);if (e >= this.t) { d.t = 0;return; }var b = g % this.DB;var a = this.DB - b;var f = (1 << b) - 1;d[0] = this[e] >> b;for (var c = e + 1; c < this.t; ++c) { d[c - e - 1] |= (this[c] & f) << a;d[c - e] = this[c] >> b; }if (b > 0) { d[this.t - e - 1] |= (this.s & f) << a; }d.t = this.t - e;d.clamp(); }function bnpSubTo(d, f) { var e = 0, g = 0, b = Math.min(d.t, this.t);while (e < b) { g += this[e] - d[e];f[e++] = g & this.DM;g >>= this.DB; }if (d.t < this.t) { g -= d.s;while (e < this.t) { g += this[e];f[e++] = g & this.DM;g >>= this.DB; }g += this.s; } else { g += this.s;while (e < d.t) { g -= d[e];f[e++] = g & this.DM;g >>= this.DB; }g -= d.s; }f.s = g < 0 ? -1 : 0;if (g < -1) { f[e++] = this.DV + g; } else { if (g > 0) { f[e++] = g; } }f.t = e;f.clamp(); }function bnpMultiplyTo(c, e) { var b = this.abs(), f = c.abs();var d = b.t;e.t = d + f.t;while (--d >= 0) { e[d] = 0; }for (d = 0; d < f.t; ++d) { e[d + b.t] = b.am(0, f[d], e, d, 0, b.t); }e.s = 0;e.clamp();if (this.s != c.s) { BigInteger.ZERO.subTo(e, e); } }function bnpSquareTo(d) { var a = this.abs();var b = d.t = 2 * a.t;while (--b >= 0) { d[b] = 0; }for (b = 0; b < a.t - 1; ++b) { var e = a.am(b, a[b], d, 2 * b, 0, 1);if ((d[b + a.t] += a.am(b + 1, 2 * a[b], d, 2 * b + 1, e, a.t - b - 1)) >= a.DV) { d[b + a.t] -= a.DV;d[b + a.t + 1] = 1; } }if (d.t > 0) { d[d.t - 1] += a.am(b, a[b], d, 2 * b, 0, 1); }d.s = 0;d.clamp(); }function bnpDivRemTo(n, h, g) { var w = n.abs();if (w.t <= 0) { return; }var k = this.abs();if (k.t < w.t) { if (h != null) { h.fromInt(0); }if (g != null) { this.copyTo(g); }return; }if (g == null) { g = nbi(); }var d = nbi(), a = this.s, l = n.s;var v = this.DB - nbits(w[w.t - 1]);if (v > 0) { w.lShiftTo(v, d);k.lShiftTo(v, g); } else { w.copyTo(d);k.copyTo(g); }var p = d.t;var b = d[p - 1];if (b == 0) { return; }var o = b * (1 << this.F1) + (p > 1 ? d[p - 2] >> this.F2 : 0);var A = this.FV / o, z = (1 << this.F1) / o, x = 1 << this.F2;var u = g.t, s = u - p, f = h == null ? nbi() : h;d.dlShiftTo(s, f);if (g.compareTo(f) >= 0) { g[g.t++] = 1;g.subTo(f, g); }BigInteger.ONE.dlShiftTo(p, f);f.subTo(d, d);while (d.t < p) { d[d.t++] = 0; }while (--s >= 0) { var c = g[--u] == b ? this.DM : Math.floor(g[u] * A + (g[u - 1] + x) * z);if ((g[u] += d.am(0, c, g, s, 0, p)) < c) { d.dlShiftTo(s, f);g.subTo(f, g);while (g[u] < --c) { g.subTo(f, g); } } }if (h != null) { g.drShiftTo(p, h);if (a != l) { BigInteger.ZERO.subTo(h, h); } }g.t = p;g.clamp();if (v > 0) { g.rShiftTo(v, g); }if (a < 0) { BigInteger.ZERO.subTo(g, g); } }function bnMod(b) { var c = nbi();this.abs().divRemTo(b, null, c);if (this.s < 0 && c.compareTo(BigInteger.ZERO) > 0) { b.subTo(c, c); }return c; }function Classic(a) { this.m = a; }function cConvert(a) { if (a.s < 0 || a.compareTo(this.m) >= 0) { return a.mod(this.m); } else { return a; } }function cRevert(a) { return a; }function cReduce(a) { a.divRemTo(this.m, null, a); }function cMulTo(a, c, b) { a.multiplyTo(c, b);this.reduce(b); }function cSqrTo(a, b) { a.squareTo(b);this.reduce(b); }Classic.prototype.convert = cConvert;Classic.prototype.revert = cRevert;Classic.prototype.reduce = cReduce;Classic.prototype.mulTo = cMulTo;Classic.prototype.sqrTo = cSqrTo;function bnpInvDigit() { if (this.t < 1) { return 0; }var a = this[0];if ((a & 1) == 0) { return 0; }var b = a & 3;b = b * (2 - (a & 15) * b) & 15;b = b * (2 - (a & 255) * b) & 255;b = b * (2 - ((a & 65535) * b & 65535)) & 65535;b = b * (2 - a * b % this.DV) % this.DV;return b > 0 ? this.DV - b : -b; }function Montgomery(a) { this.m = a;this.mp = a.invDigit();this.mpl = this.mp & 32767;this.mph = this.mp >> 15;this.um = (1 << a.DB - 15) - 1;this.mt2 = 2 * a.t; }function montConvert(a) { var b = nbi();a.abs().dlShiftTo(this.m.t, b);b.divRemTo(this.m, null, b);if (a.s < 0 && b.compareTo(BigInteger.ZERO) > 0) { this.m.subTo(b, b); }return b; }function montRevert(a) { var b = nbi();a.copyTo(b);this.reduce(b);return b; }function montReduce(a) { while (a.t <= this.mt2) { a[a.t++] = 0; }for (var c = 0; c < this.m.t; ++c) { var b = a[c] & 32767;var d = b * this.mpl + ((b * this.mph + (a[c] >> 15) * this.mpl & this.um) << 15) & a.DM;b = c + this.m.t;a[b] += this.m.am(0, d, a, c, 0, this.m.t);while (a[b] >= a.DV) { a[b] -= a.DV;a[++b]++; } }a.clamp();a.drShiftTo(this.m.t, a);if (a.compareTo(this.m) >= 0) { a.subTo(this.m, a); } }function montSqrTo(a, b) { a.squareTo(b);this.reduce(b); }function montMulTo(a, c, b) { a.multiplyTo(c, b);this.reduce(b); }Montgomery.prototype.convert = montConvert;Montgomery.prototype.revert = montRevert;Montgomery.prototype.reduce = montReduce;Montgomery.prototype.mulTo = montMulTo;Montgomery.prototype.sqrTo = montSqrTo;function bnpIsEven() { return (this.t > 0 ? this[0] & 1 : this.s) == 0; }function bnpExp(h, j) { if (h > 4294967295 || h < 1) { return BigInteger.ONE; }var f = nbi(), a = nbi(), d = j.convert(this), c = nbits(h) - 1;d.copyTo(f);while (--c >= 0) { j.sqrTo(f, a);if ((h & 1 << c) > 0) { j.mulTo(a, d, f); } else { var b = f;f = a;a = b; } }return j.revert(f); }function bnModPowInt(b, a) { var c;if (b < 256 || a.isEven()) { c = new Classic(a); } else { c = new Montgomery(a); }return this.exp(b, c); }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); /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */ function bnClone() { var a = nbi();this.copyTo(a);return a; }function bnIntValue() { if (this.s < 0) { if (this.t == 1) { return this[0] - this.DV; } else { if (this.t == 0) { return -1; } } } else { if (this.t == 1) { return this[0]; } else { 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(a) { return Math.floor(Math.LN2 * this.DB / Math.log(a)); }function bnSigNum() { if (this.s < 0) { return -1; } else { if (this.t <= 0 || this.t == 1 && this[0] <= 0) { return 0; } else { return 1; } } }function bnpToRadix(c) { if (c == null) { c = 10; }if (this.signum() == 0 || c < 2 || c > 36) { return "0"; }var f = this.chunkSize(c);var e = Math.pow(c, f);var i = nbv(e), j = nbi(), h = nbi(), g = "";this.divRemTo(i, j, h);while (j.signum() > 0) { g = (e + h.intValue()).toString(c).substr(1) + g;j.divRemTo(i, j, h); }return h.intValue().toString(c) + g; }function bnpFromRadix(m, h) { this.fromInt(0);if (h == null) { h = 10; }var f = this.chunkSize(h);var g = Math.pow(h, f), e = false, a = 0, l = 0;for (var c = 0; c < m.length; ++c) { var k = intAt(m, c);if (k < 0) { if (m.charAt(c) == "-" && this.signum() == 0) { e = true; }continue; }l = h * l + k;if (++a >= f) { this.dMultiply(g);this.dAddOffset(l, 0);a = 0;l = 0; } }if (a > 0) { this.dMultiply(Math.pow(h, a));this.dAddOffset(l, 0); }if (e) { BigInteger.ZERO.subTo(this, this); } }function bnpFromNumber(f, e, h) { if ("number" == typeof e) { if (f < 2) { this.fromInt(1); } else { this.fromNumber(f, h);if (!this.testBit(f - 1)) { this.bitwiseTo(BigInteger.ONE.shiftLeft(f - 1), op_or, this); }if (this.isEven()) { this.dAddOffset(1, 0); }while (!this.isProbablePrime(e)) { this.dAddOffset(2, 0);if (this.bitLength() > f) { this.subTo(BigInteger.ONE.shiftLeft(f - 1), this); } } } } else { var d = new Array(), g = f & 7;d.length = (f >> 3) + 1;e.nextBytes(d);if (g > 0) { d[0] &= (1 << g) - 1; } else { d[0] = 0; }this.fromString(d, 256); } }function bnToByteArray() { var b = this.t, c = new Array();c[0] = this.s;var e = this.DB - b * this.DB % 8, f, a = 0;if (b-- > 0) { if (e < this.DB && (f = this[b] >> e) != (this.s & this.DM) >> e) { c[a++] = f | this.s << this.DB - e; }while (b >= 0) { if (e < 8) { f = (this[b] & (1 << e) - 1) << 8 - e;f |= this[--b] >> (e += this.DB - 8); } else { f = this[b] >> (e -= 8) & 255;if (e <= 0) { e += this.DB;--b; } }if ((f & 128) != 0) { f |= -256; }if (a == 0 && (this.s & 128) != (f & 128)) { ++a; }if (a > 0 || f != this.s) { c[a++] = f; } } }return c; }function bnEquals(b) { return this.compareTo(b) == 0; }function bnMin(b) { return this.compareTo(b) < 0 ? this : b; }function bnMax(b) { return this.compareTo(b) > 0 ? this : b; }function bnpBitwiseTo(c, h, e) { var d, g, b = Math.min(c.t, this.t);for (d = 0; d < b; ++d) { e[d] = h(this[d], c[d]); }if (c.t < this.t) { g = c.s & this.DM;for (d = b; d < this.t; ++d) { e[d] = h(this[d], g); }e.t = this.t; } else { g = this.s & this.DM;for (d = b; d < c.t; ++d) { e[d] = h(g, c[d]); }e.t = c.t; }e.s = h(this.s, c.s);e.clamp(); }function op_and(a, b) { return a & b; }function bnAnd(b) { var c = nbi();this.bitwiseTo(b, op_and, c);return c; }function op_or(a, b) { return a | b; }function bnOr(b) { var c = nbi();this.bitwiseTo(b, op_or, c);return c; }function op_xor(a, b) { return a ^ b; }function bnXor(b) { var c = nbi();this.bitwiseTo(b, op_xor, c);return c; }function op_andnot(a, b) { return a & ~b; }function bnAndNot(b) { var c = nbi();this.bitwiseTo(b, op_andnot, c);return c; }function bnNot() { var b = nbi();for (var a = 0; a < this.t; ++a) { b[a] = this.DM & ~this[a]; }b.t = this.t;b.s = ~this.s;return b; }function bnShiftLeft(b) { var a = nbi();if (b < 0) { this.rShiftTo(-b, a); } else { this.lShiftTo(b, a); }return a; }function bnShiftRight(b) { var a = nbi();if (b < 0) { this.lShiftTo(-b, a); } else { this.rShiftTo(b, a); }return a; }function lbit(a) { if (a == 0) { return -1; }var b = 0;if ((a & 65535) == 0) { a >>= 16;b += 16; }if ((a & 255) == 0) { a >>= 8;b += 8; }if ((a & 15) == 0) { a >>= 4;b += 4; }if ((a & 3) == 0) { a >>= 2;b += 2; }if ((a & 1) == 0) { ++b; }return b; }function bnGetLowestSetBit() { for (var a = 0; a < this.t; ++a) { if (this[a] != 0) { return a * this.DB + lbit(this[a]); } }if (this.s < 0) { return this.t * this.DB; }return -1; }function cbit(a) { var b = 0;while (a != 0) { a &= a - 1;++b; }return b; }function bnBitCount() { var c = 0, a = this.s & this.DM;for (var b = 0; b < this.t; ++b) { c += cbit(this[b] ^ a); }return c; }function bnTestBit(b) { var a = Math.floor(b / this.DB);if (a >= this.t) { return this.s != 0; }return (this[a] & 1 << b % this.DB) != 0; }function bnpChangeBit(c, b) { var a = BigInteger.ONE.shiftLeft(c);this.bitwiseTo(a, b, a);return a; }function bnSetBit(a) { return this.changeBit(a, op_or); }function bnClearBit(a) { return this.changeBit(a, op_andnot); }function bnFlipBit(a) { return this.changeBit(a, op_xor); }function bnpAddTo(d, f) { var e = 0, g = 0, b = Math.min(d.t, this.t);while (e < b) { g += this[e] + d[e];f[e++] = g & this.DM;g >>= this.DB; }if (d.t < this.t) { g += d.s;while (e < this.t) { g += this[e];f[e++] = g & this.DM;g >>= this.DB; }g += this.s; } else { g += this.s;while (e < d.t) { g += d[e];f[e++] = g & this.DM;g >>= this.DB; }g += d.s; }f.s = g < 0 ? -1 : 0;if (g > 0) { f[e++] = g; } else { if (g < -1) { f[e++] = this.DV + g; } }f.t = e;f.clamp(); }function bnAdd(b) { var c = nbi();this.addTo(b, c);return c; }function bnSubtract(b) { var c = nbi();this.subTo(b, c);return c; }function bnMultiply(b) { var c = nbi();this.multiplyTo(b, c);return c; }function bnSquare() { var a = nbi();this.squareTo(a);return a; }function bnDivide(b) { var c = nbi();this.divRemTo(b, c, null);return c; }function bnRemainder(b) { var c = nbi();this.divRemTo(b, null, c);return c; }function bnDivideAndRemainder(b) { var d = nbi(), c = nbi();this.divRemTo(b, d, c);return new Array(d, c); }function bnpDMultiply(a) { this[this.t] = this.am(0, a - 1, this, 0, 0, this.t);++this.t;this.clamp(); }function bnpDAddOffset(b, a) { if (b == 0) { return; }while (this.t <= a) { this[this.t++] = 0; }this[a] += b;while (this[a] >= this.DV) { this[a] -= this.DV;if (++a >= this.t) { this[this.t++] = 0; }++this[a]; } }function NullExp() {}function nNop(a) { return a; }function nMulTo(a, c, b) { a.multiplyTo(c, b); }function nSqrTo(a, b) { a.squareTo(b); }NullExp.prototype.convert = nNop;NullExp.prototype.revert = nNop;NullExp.prototype.mulTo = nMulTo;NullExp.prototype.sqrTo = nSqrTo;function bnPow(a) { return this.exp(a, new NullExp()); }function bnpMultiplyLowerTo(b, f, e) { var d = Math.min(this.t + b.t, f);e.s = 0;e.t = d;while (d > 0) { e[--d] = 0; }var c;for (c = e.t - this.t; d < c; ++d) { e[d + this.t] = this.am(0, b[d], e, d, 0, this.t); }for (c = Math.min(b.t, f); d < c; ++d) { this.am(0, b[d], e, d, 0, f - d); }e.clamp(); }function bnpMultiplyUpperTo(b, e, d) { --e;var c = d.t = this.t + b.t - e;d.s = 0;while (--c >= 0) { d[c] = 0; }for (c = Math.max(e - this.t, 0); c < b.t; ++c) { d[this.t + c - e] = this.am(e - c, b[c], d, 0, 0, this.t + c - e); }d.clamp();d.drShiftTo(1, d); }function Barre