Files
schoolNews/schoolNewsCrawler/crawler/xxqg/search/search/gray-pub-sdk.chunk.7a00bc.js

24 lines
419 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

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

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

webpackJsonp([2],{dQt6:function(t,e,r){(function(e){var r;r=function(){return function(){var t={553:function(t,e,r){"use strict";var n=r(2),i=r(830),s=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&s(t,".prototype.")>-1?i(r):r}},830:function(t,e,r){"use strict";var n=r(888),i=r(2),s=i("%Function.prototype.apply%"),o=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(o,s),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),h=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=a(n,o,arguments);return u&&c&&u(e,"length").configurable&&c(e,"length",{value:1+h(0,t.length-(arguments.length-1))}),e};var l=function(){return a(n,s,arguments)};c?c(t.exports,"apply",{value:l}):t.exports.apply=l},760:function(t){function e(t){if(t)return function(t){for(var r in e.prototype)t[r]=e.prototype[r];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<n.length;i++)if((r=n[i])===e||r.fn===e){n.splice(i,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){n=0;for(var i=(r=r.slice(0)).length;n<i;++n)r[n].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}},997:function(t,e,r){var n;t.exports=n=n||function(t,e){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==r.g&&r.g.crypto&&(n=r.g.crypto),!n)try{n=r(342)}catch(t){}var i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),o={},a=o.lib={},u=a.Base={extend:function(t){var e=s(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=u.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=void 0!=e?e:4*t.length},toString:function(t){return(t||l).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var s=0;s<i;s++){var o=r[s>>>2]>>>24-s%4*8&255;e[n+s>>>2]|=o<<24-(n+s)%4*8}else for(var a=0;a<i;a+=4)e[n+a>>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=u.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(i());return new c.init(e,t)}}),h=o.enc={},l=h.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i++){var s=e[i>>>2]>>>24-i%4*8&255;n.push((s>>>4).toString(16)),n.push((15&s).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new c.init(r,e/2)}},f=h.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i++){var s=e[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new c.init(r,e)}},p=h.Utf8={stringify:function(t){try{return decodeURIComponent(escape(f.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return f.parse(unescape(encodeURIComponent(t)))}},d=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,i=n.words,s=n.sigBytes,o=this.blockSize,a=s/(4*o),u=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*o,h=t.min(4*u,s);if(u){for(var l=0;l<u;l+=o)this._doProcessBlock(i,l);r=i.splice(0,u),n.sigBytes-=h}return new c.init(r,h)},clone:function(){var t=u.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),g=(a.Hasher=d.extend({cfg:u.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new g.HMAC.init(t,r).finalize(e)}}}),o.algo={});return o}(Math)},618:function(t,e,r){t.exports=r(997).enc.Hex},411:function(t,e,r){var n;t.exports=(n=r(997),r(866),r(970),n.HmacSHA1)},970:function(t,e,r){var n,i,s;t.exports=(i=(n=r(997)).lib.Base,s=n.enc.Utf8,void(n.algo.HMAC=i.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=s.parse(e));var r=t.blockSize,n=4*r;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var i=this._oKey=e.clone(),o=this._iKey=e.clone(),a=i.words,u=o.words,c=0;c<r;c++)a[c]^=1549556828,u[c]^=909522486;i.sigBytes=o.sigBytes=n,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,r=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(r))}})))},866:function(t,e,r){var n,i,s,o,a,u,c,h;t.exports=(i=(n=h=r(997)).lib,s=i.WordArray,o=i.Hasher,a=n.algo,u=[],c=a.SHA1=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],o=r[3],a=r[4],c=0;c<80;c++){if(c<16)u[c]=0|t[e+c];else{var h=u[c-3]^u[c-8]^u[c-14]^u[c-16];u[c]=h<<1|h>>>31}var l=(n<<5|n>>>27)+a+u[c];l+=c<20?1518500249+(i&s|~i&o):c<40?1859775393+(i^s^o):c<60?(i&s|i&o|s&o)-1894007588:(i^s^o)-899497514,a=o,o=s,s=i<<30|i>>>2,i=n,n=l}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+s|0,r[3]=r[3]+o|0,r[4]=r[4]+a|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(n+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}}),n.SHA1=o._createHelper(c),n.HmacSHA1=o._createHmacHelper(c),h.SHA1)},306:function(t){t.exports=o,o.default=o,o.stable=h,o.stableStringify=h;var e="[...]",r="[Circular]",n=[],i=[];function s(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function o(t,e,r,o){var a;void 0===o&&(o=s()),u(t,"",0,[],void 0,0,o);try{a=0===i.length?JSON.stringify(t,e,r):JSON.stringify(t,f(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function a(t,e,r,s){var o=Object.getOwnPropertyDescriptor(s,r);void 0!==o.get?o.configurable?(Object.defineProperty(s,r,{value:t}),n.push([s,r,e,o])):i.push([e,r,t]):(s[r]=t,n.push([s,r,e]))}function u(t,n,i,s,o,c,h){var l;if(c+=1,"object"==typeof t&&null!==t){for(l=0;l<s.length;l++)if(s[l]===t)return void a(r,t,n,o);if(void 0!==h.depthLimit&&c>h.depthLimit)return void a(e,t,n,o);if(void 0!==h.edgesLimit&&i+1>h.edgesLimit)return void a(e,t,n,o);if(s.push(t),Array.isArray(t))for(l=0;l<t.length;l++)u(t[l],l,l,s,t,c,h);else{var f=Object.keys(t);for(l=0;l<f.length;l++){var p=f[l];u(t[p],p,l,s,t,c,h)}}s.pop()}}function c(t,e){return t<e?-1:t>e?1:0}function h(t,e,r,o){void 0===o&&(o=s());var a,u=l(t,"",0,[],void 0,0,o)||t;try{a=0===i.length?JSON.stringify(u,e,r):JSON.stringify(u,f(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function l(t,i,s,o,u,h,f){var p;if(h+=1,"object"==typeof t&&null!==t){for(p=0;p<o.length;p++)if(o[p]===t)return void a(r,t,i,u);try{if("function"==typeof t.toJSON)return}catch(t){return}if(void 0!==f.depthLimit&&h>f.depthLimit)return void a(e,t,i,u);if(void 0!==f.edgesLimit&&s+1>f.edgesLimit)return void a(e,t,i,u);if(o.push(t),Array.isArray(t))for(p=0;p<t.length;p++)l(t[p],p,p,o,t,h,f);else{var d={},g=Object.keys(t).sort(c);for(p=0;p<g.length;p++){var y=g[p];l(t[y],y,p,o,t,h,f),d[y]=t[y]}if(void 0===u)return d;n.push([u,i,t]),u[i]=d}o.pop()}}function f(t){return t=void 0!==t?t:function(t,e){return e},function(e,r){if(i.length>0)for(var n=0;n<i.length;n++){var s=i[n];if(s[1]===e&&s[0]===r){r=s[2],i.splice(n,1);break}}return t.call(this,e,r)}}},986:function(t){"use strict";var e=Array.prototype.slice,r=Object.prototype.toString;t.exports=function(t){var n=this;if("function"!=typeof n||"[object Function]"!==r.call(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var i,s=e.call(arguments,1),o=Math.max(0,n.length-s.length),a=[],u=0;u<o;u++)a.push("$"+u);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var r=n.apply(this,s.concat(e.call(arguments)));return Object(r)===r?r:this}return n.apply(t,s.concat(e.call(arguments)))}),n.prototype){var c=function(){};c.prototype=n.prototype,i.prototype=new c,c.prototype=null}return i}},888:function(t,e,r){"use strict";var n=r(986);t.exports=Function.prototype.bind||n},2:function(t,e,r){"use strict";var n,i=SyntaxError,s=Function,o=TypeError,a=function(t){try{return s('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new o},h=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,l=r(563)(),f=r(394)(),p=Object.getPrototypeOf||(f?function(t){return t.__proto__}:null),d={},g="undefined"!=typeof Uint8Array&&p?p(Uint8Array):n,y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l&&p?p([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l&&p?p(p([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l&&p?p((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l&&p?p((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l&&p?p(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":h,"%TypedArray%":g,"%TypeError%":o,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(p)try{null.error}catch(t){var v=p(p(t));y["%Error.prototype%"]=v}var m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},x=r(888),w=r(392),b=x.call(Function.call,Array.prototype.concat),S=x.call(Function.apply,Array.prototype.splice),E=x.call(Function.call,String.prototype.replace),A=x.call(Function.call,String.prototype.slice),F=x.call(Function.call,RegExp.prototype.exec),P=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,C=/\\(\\)?/g,I=function(t,e){var r,n=t;if(w(m,n)&&(n="%"+(r=m[n])[0]+"%"),w(y,n)){var s=y[n];if(s===d&&(s=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&p&&(r=p(i.prototype))}return y[e]=r,r}(n)),void 0===s&&!e)throw new o("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:s}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new o('"allowMissing" argument must be a boolean');if(null===F(/^%?[^%]*%?$/,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=A(t,0,1),r=A(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return E(t,P,function(t,e,r,i){n[n.length]=r?E(i,C,"$1"):e||t}),n}(t),n=r.length>0?r[0]:"",s=I("%"+n+"%",e),a=s.name,c=s.value,h=!1,l=s.alias;l&&(n=l[0],S(r,b([0,1],l)));for(var f=1,p=!0;f<r.length;f+=1){var d=r[f],g=A(d,0,1),v=A(d,-1);if(('"'===g||"'"===g||"`"===g||'"'===v||"'"===v||"`"===v)&&g!==v)throw new i("property names with quotes must have matching quotes");if("constructor"!==d&&p||(h=!0),w(y,a="%"+(n+="."+d)+"%"))c=y[a];else if(null!=c){if(!(d in c)){if(!e)throw new o("base intrinsic for "+t+" exists, but the property is not available.");return}if(u&&f+1>=r.length){var m=u(c,d);c=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[d]}else p=w(c,d),c=c[d];p&&!h&&(y[a]=c)}}return c}},394:function(t){"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},563:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(669);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},669:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},392:function(t,e,r){"use strict";var n=r(888);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},310:function(t,e,r){var n,i;i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:this,t.exports=function(r){"use strict";var i,s=(r=r||{}).Base64,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=function(t){for(var e={},r=0,n=t.length;r<n;r++)e[t.charAt(r)]=r;return e}(o),u=String.fromCharCode,c=function(t){if(t.length<2)return(e=t.charCodeAt(0))<128?t:e<2048?u(192|e>>>6)+u(128|63&e):u(224|e>>>12&15)+u(128|e>>>6&63)+u(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return u(240|e>>>18&7)+u(128|e>>>12&63)+u(128|e>>>6&63)+u(128|63&e)},h=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,l=function(t){return t.replace(h,c)},f=function(t){var e=[0,2,1][t.length%3],r=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[o.charAt(r>>>18),o.charAt(r>>>12&63),e>=2?"=":o.charAt(r>>>6&63),e>=1?"=":o.charAt(63&r)].join("")},p=r.btoa&&"function"==typeof r.btoa?function(t){return r.btoa(t)}:function(t){if(t.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return t.replace(/[\s\S]{1,3}/g,f)},d=function(t){return p(l(String(t)))},g=function(t){return t.replace(/[+\/]/g,function(t){return"+"==t?"-":"_"}).replace(/=/g,"")},y=function(t,e){return e?g(d(t)):d(t)};r.Uint8Array&&(i=function(t,e){for(var r="",n=0,i=t.length;n<i;n+=3){var s=t[n],a=t[n+1],u=t[n+2],c=s<<16|a<<8|u;r+=o.charAt(c>>>18)+o.charAt(c>>>12&63)+(void 0!==a?o.charAt(c>>>6&63):"=")+(void 0!==u?o.charAt(63&c):"=")}return e?g(r):r});var v,m=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,x=function(t){switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return u(55296+(e>>>10))+u(56320+(1023&e));case 3:return u((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return u((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},w=function(t){return t.replace(m,x)},b=function(t){var e=t.length,r=e%4,n=(e>0?a[t.charAt(0)]<<18:0)|(e>1?a[t.charAt(1)]<<12:0)|(e>2?a[t.charAt(2)]<<6:0)|(e>3?a[t.charAt(3)]:0),i=[u(n>>>16),u(n>>>8&255),u(255&n)];return i.length-=[0,0,2,1][r],i.join("")},S=r.atob&&"function"==typeof r.atob?function(t){return r.atob(t)}:function(t){return t.replace(/\S{1,4}/g,b)},E=function(t){return S(String(t).replace(/[^A-Za-z0-9\+\/]/g,""))},A=function(t){return String(t).replace(/[-_]/g,function(t){return"-"==t?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},F=function(t){return function(t){return w(S(t))}(A(t))};r.Uint8Array&&(v=function(t){return Uint8Array.from(E(A(t)),function(t){return t.charCodeAt(0)})});if(r.Base64={VERSION:"2.6.4",atob:E,btoa:p,fromBase64:F,toBase64:y,utob:l,encode:y,encodeURI:function(t){return y(t,!0)},btou:w,decode:F,noConflict:function(){var t=r.Base64;return r.Base64=s,t},fromUint8Array:i,toUint8Array:v},"function"==typeof Object.defineProperty){var P=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}};r.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",P(function(){return F(this)})),Object.defineProperty(String.prototype,"toBase64",P(function(t){return y(this,t)})),Object.defineProperty(String.prototype,"toBase64URI",P(function(){return y(this,!0)}))}}return r.Meteor&&(Base64=r.Base64),t.exports?t.exports.Base64=r.Base64:void 0===(n=function(){return r.Base64}.apply(e,[]))||(t.exports=n),{Base64:r.Base64}}(i)},911:function(t,r){var n,i,s,o,a,u,c,h,l,f,p,d={userAgent:!1},g={},y=y||(n=Math,s=(i={}).lib={},o=s.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var r=new t;return e&&r.mixIn(e),r.hasOwnProperty("init")||(r.init=function(){r.$super.init.apply(this,arguments)}),r.init.prototype=r,r.$super=this,r},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=s.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||c).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var s=0;s<i;s++){var o=r[s>>>2]>>>24-s%4*8&255;e[n+s>>>2]|=o<<24-(n+s)%4*8}else for(s=0;s<i;s+=4)e[n+s>>>2]=r[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=n.ceil(e/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(4294967296*n.random()|0);return new a.init(e,t)}}),u=i.enc={},c=u.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i++){var s=e[i>>>2]>>>24-i%4*8&255;n.push((s>>>4).toString(16)),n.push((15&s).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new a.init(r,e/2)}},h=u.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i++){var s=e[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new a.init(r,e)}},l=u.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},f=s.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=l.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e=this._data,r=e.words,i=e.sigBytes,s=this.blockSize,o=i/(4*s),u=(o=t?n.ceil(o):n.max((0|o)-this._minBufferSize,0))*s,c=n.min(4*u,i);if(u){for(var h=0;h<u;h+=s)this._doProcessBlock(r,h);var l=r.splice(0,u);e.sigBytes-=c}return new a.init(l,c)},clone:function(){var t=o.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),s.Hasher=f.extend({cfg:o.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new p.HMAC.init(t,r).finalize(e)}}}),p=i.algo={},i);!function(t){var e,r=(e=y).lib,n=r.Base,i=r.WordArray;(e=e.x64={}).Word=n.extend({init:function(t,e){this.high=t,this.low=e}}),e.WordArray=n.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,r=[],n=0;n<e;n++){var s=t[n];r.push(s.high),r.push(s.low)}return i.create(r,this.sigBytes)},clone:function(){for(var t=n.clone.call(this),e=t.words=this.words.slice(0),r=e.length,i=0;i<r;i++)e[i]=e[i].clone();return t}})}(),y.lib.Cipher||function(t){var e=(p=y).lib,r=e.Base,n=e.WordArray,i=e.BufferedBlockAlgorithm,s=p.enc.Base64,o=p.algo.EvpKDF,a=e.Cipher=i.extend({cfg:r.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(t){return{encrypt:function(e,r,n){return("string"==typeof r?d:f).encrypt(t,e,r,n)},decrypt:function(e,r,n){return("string"==typeof r?d:f).decrypt(t,e,r,n)}}}});e.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=p.mode={},c=function(t,e,r){var n=this._iv;n?this._iv=void 0:n=this._prevBlock;for(var i=0;i<r;i++)t[e+i]^=n[i]},h=(e.BlockCipherMode=r.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}})).extend();h.Encryptor=h.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize;c.call(this,t,e,n),r.encryptBlock(t,e),this._prevBlock=t.slice(e,e+n)}}),h.Decryptor=h.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize,i=t.slice(e,e+n);r.decryptBlock(t,e),c.call(this,t,e,n),this._prevBlock=i}}),u=u.CBC=h,h=(p.pad={}).Pkcs7={pad:function(t,e){for(var r,i=(r=(r=4*e)-t.sigBytes%r)<<24|r<<16|r<<8|r,s=[],o=0;o<r;o+=4)s.push(i);r=n.create(s,r),t.concat(r)},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2]}},e.BlockCipher=a.extend({cfg:a.cfg.extend({mode:u,padding:h}),reset:function(){a.reset.call(this);var t=(e=this.cfg).iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=e.createEncryptor;else r=e.createDecryptor,this._minBufferSize=1;this._mode=r.call(e,this,t&&t.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4});var l=e.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),f=(u=(p.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext;return((t=t.salt)?n.create([1398893684,1701076831]).concat(t).concat(e):e).toString(s)},parse:function(t){var e=(t=s.parse(t)).words;if(1398893684==e[0]&&1701076831==e[1]){var r=n.create(e.slice(2,4));e.splice(0,4),t.sigBytes-=16}return l.create({ciphertext:t,salt:r})}},e.SerializableCipher=r.extend({cfg:r.extend({format:u}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n);return e=i.finalize(e),i=i.cfg,l.create({ciphertext:e,key:r,iv:i.iv,algorithm:t,mode:i.mode,padding:i.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){return n=this.cfg.extend(n),e=this._parse(e,n.format),t.createDecryptor(r,n).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}})),p=(p.kdf={}).OpenSSL={execute:function(t,e,r,i){return i||(i=n.random(8)),t=o.create({keySize:e+r}).compute(t,i),r=n.create(t.words.slice(e),4*r),t.sigBytes=4*e,l.create({key:t,iv:r,salt:i})}},d=e.PasswordBasedCipher=f.extend({cfg:f.cfg.extend({kdf:p}),encrypt:function(t,e,r,n){return r=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize),n.iv=r.iv,(t=f.encrypt.call(this,t,e,r.key,n)).mixIn(r),t},decrypt:function(t,e,r,n){return n=this.cfg.extend(n),e=this._parse(e,n.format),r=n.kdf.execute(r,t.keySize,t.ivSize,e.salt),n.iv=r.iv,f.decrypt.call(this,t,e,r.key,n)}})}(),function(){for(var t=y,e=t.lib.BlockCipher,r=t.algo,n=[],i=[],s=[],o=[],a=[],u=[],c=[],h=[],l=[],f=[],p=[],d=0;256>d;d++)p[d]=128>d?d<<1:d<<1^283;var g=0,v=0;for(d=0;256>d;d++){var m=(m=v^v<<1^v<<2^v<<3^v<<4)>>>8^255&m^99;n[g]=m,i[m]=g;var x=p[g],w=p[x],b=p[w],S=257*p[m]^16843008*m;s[g]=S<<24|S>>>8,o[g]=S<<16|S>>>16,a[g]=S<<8|S>>>24,u[g]=S,S=16843009*b^65537*w^257*x^16843008*g,c[m]=S<<24|S>>>8,h[m]=S<<16|S>>>16,l[m]=S<<8|S>>>24,f[m]=S,g?(g=x^p[p[p[b^x]]],v^=p[p[v]]):g=v=1}var E=[0,1,2,4,8,16,32,64,128,27,54];r=r.AES=e.extend({_doReset:function(){for(var t=(r=this._key).words,e=r.sigBytes/4,r=4*((this._nRounds=e+6)+1),i=this._keySchedule=[],s=0;s<r;s++)if(s<e)i[s]=t[s];else{var o=i[s-1];s%e?6<e&&4==s%e&&(o=n[o>>>24]<<24|n[o>>>16&255]<<16|n[o>>>8&255]<<8|n[255&o]):(o=n[(o=o<<8|o>>>24)>>>24]<<24|n[o>>>16&255]<<16|n[o>>>8&255]<<8|n[255&o],o^=E[s/e|0]<<24),i[s]=i[s-e]^o}for(t=this._invKeySchedule=[],e=0;e<r;e++)s=r-e,o=e%4?i[s]:i[s-4],t[e]=4>e||4>=s?o:c[n[o>>>24]]^h[n[o>>>16&255]]^l[n[o>>>8&255]]^f[n[255&o]]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,o,a,u,n)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,c,h,l,f,i),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,s,o,a){for(var u=this._nRounds,c=t[e]^r[0],h=t[e+1]^r[1],l=t[e+2]^r[2],f=t[e+3]^r[3],p=4,d=1;d<u;d++){var g=n[c>>>24]^i[h>>>16&255]^s[l>>>8&255]^o[255&f]^r[p++],y=n[h>>>24]^i[l>>>16&255]^s[f>>>8&255]^o[255&c]^r[p++],v=n[l>>>24]^i[f>>>16&255]^s[c>>>8&255]^o[255&h]^r[p++];f=n[f>>>24]^i[c>>>16&255]^s[h>>>8&255]^o[255&l]^r[p++],c=g,h=y,l=v}g=(a[c>>>24]<<24|a[h>>>16&255]<<16|a[l>>>8&255]<<8|a[255&f])^r[p++],y=(a[h>>>24]<<24|a[l>>>16&255]<<16|a[f>>>8&255]<<8|a[255&c])^r[p++],v=(a[l>>>24]<<24|a[f>>>16&255]<<16|a[c>>>8&255]<<8|a[255&h])^r[p++],f=(a[f>>>24]<<24|a[c>>>16&255]<<16|a[h>>>8&255]<<8|a[255&l])^r[p++],t[e]=g,t[e+1]=y,t[e+2]=v,t[e+3]=f},keySize:8}),t.AES=e._createHelper(r)}(),function(){function t(t,e){var r=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=r,this._lBlock^=r<<t}function e(t,e){var r=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=r,this._rBlock^=r<<t}var r=y,n=(i=r.lib).WordArray,i=i.BlockCipher,s=r.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],h=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],l=s.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;56>r;r++){var n=o[r]-1;e[r]=t[n>>>5]>>>31-n%32&1}for(t=this._subKeys=[],n=0;16>n;n++){var i=t[n]=[],s=u[n];for(r=0;24>r;r++)i[r/6|0]|=e[(a[r]-1+s)%28]<<31-r%6,i[4+(r/6|0)]|=e[28+(a[r+24]-1+s)%28]<<31-r%6;for(i[0]=i[0]<<1|i[0]>>>31,r=1;7>r;r++)i[r]>>>=4*(r-1)+3;i[7]=i[7]<<5|i[7]>>>27}for(e=this._invSubKeys=[],r=0;16>r;r++)e[r]=t[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(r,n,i){this._lBlock=r[n],this._rBlock=r[n+1],t.call(this,4,252645135),t.call(this,16,65535),e.call(this,2,858993459),e.call(this,8,16711935),t.call(this,1,1431655765);for(var s=0;16>s;s++){for(var o=i[s],a=this._lBlock,u=this._rBlock,l=0,f=0;8>f;f++)l|=c[f][((u^o[f])&h[f])>>>0];this._lBlock=u,this._rBlock=a^l}i=this._lBlock,this._lBlock=this._rBlock,this._rBlock=i,t.call(this,1,1431655765),e.call(this,8,16711935),e.call(this,2,858993459),t.call(this,16,65535),t.call(this,4,252645135),r[n]=this._lBlock,r[n+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});r.DES=i._createHelper(l),s=s.TripleDES=i.extend({_doReset:function(){var t=this._key.words;this._des1=l.createEncryptor(n.create(t.slice(0,2))),this._des2=l.createEncryptor(n.create(t.slice(2,4))),this._des3=l.createEncryptor(n.create(t.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2}),r.TripleDES=i._createHelper(s)}(),function(){var t=y,e=t.lib.WordArray;t.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp(),t=[];for(var i=0;i<r;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,o=0;4>o&&i+.75*o<r;o++)t.push(n.charAt(s>>>6*(3-o)&63));if(e=n.charAt(64))for(;t.length%4;)t.push(e);return t.join("")},parse:function(t){var r=t.length,n=this._map;(i=n.charAt(64))&&-1!=(i=t.indexOf(i))&&(r=i);for(var i=[],s=0,o=0;o<r;o++)if(o%4){var a=n.indexOf(t.charAt(o-1))<<o%4*2,u=n.indexOf(t.charAt(o))>>>6-o%4*2;i[s>>>2]|=(a|u)<<24-s%4*8,s++}return e.create(i,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(t){function e(t,e,r,n,i,s,o){return((t=t+(e&r|~e&n)+i+o)<<s|t>>>32-s)+e}function r(t,e,r,n,i,s,o){return((t=t+(e&n|r&~n)+i+o)<<s|t>>>32-s)+e}function n(t,e,r,n,i,s,o){return((t=t+(e^r^n)+i+o)<<s|t>>>32-s)+e}function i(t,e,r,n,i,s,o){return((t=t+(r^(e|~n))+i+o)<<s|t>>>32-s)+e}for(var s=y,o=(u=s.lib).WordArray,a=u.Hasher,u=s.algo,c=[],h=0;64>h;h++)c[h]=4294967296*t.abs(t.sin(h+1))|0;u=u.MD5=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,s){for(var o=0;16>o;o++){var a=t[u=s+o];t[u]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}o=this._hash.words;var u=t[s+0],h=(a=t[s+1],t[s+2]),l=t[s+3],f=t[s+4],p=t[s+5],d=t[s+6],g=t[s+7],y=t[s+8],v=t[s+9],m=t[s+10],x=t[s+11],w=t[s+12],b=t[s+13],S=t[s+14],E=t[s+15],A=e(A=o[0],C=o[1],P=o[2],F=o[3],u,7,c[0]),F=e(F,A,C,P,a,12,c[1]),P=e(P,F,A,C,h,17,c[2]),C=e(C,P,F,A,l,22,c[3]);A=i(A=n(A=n(A=n(A=n(A=r(A=r(A=r(A=r(A=e(A=e(A=e(A,C,P,F,f,7,c[4]),C=e(C,P=e(P,F=e(F,A,C,P,p,12,c[5]),A,C,d,17,c[6]),F,A,g,22,c[7]),P,F,y,7,c[8]),C=e(C,P=e(P,F=e(F,A,C,P,v,12,c[9]),A,C,m,17,c[10]),F,A,x,22,c[11]),P,F,w,7,c[12]),C=e(C,P=e(P,F=e(F,A,C,P,b,12,c[13]),A,C,S,17,c[14]),F,A,E,22,c[15]),P,F,a,5,c[16]),C=r(C,P=r(P,F=r(F,A,C,P,d,9,c[17]),A,C,x,14,c[18]),F,A,u,20,c[19]),P,F,p,5,c[20]),C=r(C,P=r(P,F=r(F,A,C,P,m,9,c[21]),A,C,E,14,c[22]),F,A,f,20,c[23]),P,F,v,5,c[24]),C=r(C,P=r(P,F=r(F,A,C,P,S,9,c[25]),A,C,l,14,c[26]),F,A,y,20,c[27]),P,F,b,5,c[28]),C=r(C,P=r(P,F=r(F,A,C,P,h,9,c[29]),A,C,g,14,c[30]),F,A,w,20,c[31]),P,F,p,4,c[32]),C=n(C,P=n(P,F=n(F,A,C,P,y,11,c[33]),A,C,x,16,c[34]),F,A,S,23,c[35]),P,F,a,4,c[36]),C=n(C,P=n(P,F=n(F,A,C,P,f,11,c[37]),A,C,g,16,c[38]),F,A,m,23,c[39]),P,F,b,4,c[40]),C=n(C,P=n(P,F=n(F,A,C,P,u,11,c[41]),A,C,l,16,c[42]),F,A,d,23,c[43]),P,F,v,4,c[44]),C=n(C,P=n(P,F=n(F,A,C,P,w,11,c[45]),A,C,E,16,c[46]),F,A,h,23,c[47]),P,F,u,6,c[48]),C=i(C=i(C=i(C=i(C,P=i(P,F=i(F,A,C,P,g,10,c[49]),A,C,S,15,c[50]),F,A,p,21,c[51]),P=i(P,F=i(F,A=i(A,C,P,F,w,6,c[52]),C,P,l,10,c[53]),A,C,m,15,c[54]),F,A,a,21,c[55]),P=i(P,F=i(F,A=i(A,C,P,F,y,6,c[56]),C,P,E,10,c[57]),A,C,d,15,c[58]),F,A,b,21,c[59]),P=i(P,F=i(F,A=i(A,C,P,F,f,6,c[60]),C,P,x,10,c[61]),A,C,h,15,c[62]),F,A,v,21,c[63]),o[0]=o[0]+A|0,o[1]=o[1]+C|0,o[2]=o[2]+P|0,o[3]=o[3]+F|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var s=t.floor(n/4294967296);for(r[15+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),r[14+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(r.length+1),this._process(),r=(e=this._hash).words,n=0;4>n;n++)i=r[n],r[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return e},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}}),s.MD5=a._createHelper(u),s.HmacMD5=a._createHmacHelper(u)}(Math),function(){var t=y,e=(i=t.lib).WordArray,r=i.Hasher,n=[],i=t.algo.SHA1=r.extend({_doReset:function(){this._hash=new e.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],s=r[1],o=r[2],a=r[3],u=r[4],c=0;80>c;c++){if(16>c)n[c]=0|t[e+c];else{var h=n[c-3]^n[c-8]^n[c-14]^n[c-16];n[c]=h<<1|h>>>31}h=(i<<5|i>>>27)+u+n[c],h=20>c?h+(1518500249+(s&o|~s&a)):40>c?h+(1859775393+(s^o^a)):60>c?h+((s&o|s&a|o&a)-1894007588):h+((s^o^a)-899497514),u=a,a=o,o=s<<30|s>>>2,s=i,i=h}r[0]=r[0]+i|0,r[1]=r[1]+s|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+u|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(n+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});t.SHA1=r._createHelper(i),t.HmacSHA1=r._createHmacHelper(i)}(),function(t){for(var e=y,r=(i=e.lib).WordArray,n=i.Hasher,i=e.algo,s=[],o=[],a=function(t){return 4294967296*(t-(0|t))|0},u=2,c=0;64>c;){var h;t:{h=u;for(var l=t.sqrt(h),f=2;f<=l;f++)if(!(h%f)){h=!1;break t}h=!0}h&&(8>c&&(s[c]=a(t.pow(u,.5))),o[c]=a(t.pow(u,1/3)),c++),u++}var p=[];i=i.SHA256=n.extend({_doReset:function(){this._hash=new r.init(s.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],a=r[3],u=r[4],c=r[5],h=r[6],l=r[7],f=0;64>f;f++){if(16>f)p[f]=0|t[e+f];else{var d=p[f-15],g=p[f-2];p[f]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+p[f-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+p[f-16]}d=l+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&h)+o[f]+p[f],g=((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+(n&i^n&s^i&s),l=h,h=c,c=u,u=a+d|0,a=s,s=i,i=n,n=d+g|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+s|0,r[3]=r[3]+a|0,r[4]=r[4]+u|0,r[5]=r[5]+c|0,r[6]=r[6]+h|0,r[7]=r[7]+l|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}}),e.SHA256=n._createHelper(i),e.HmacSHA256=n._createHmacHelper(i)}(Math),function(){var t=y,e=t.lib.WordArray,r=(n=t.algo).SHA256,n=n.SHA224=r.extend({_doReset:function(){this._hash=new e.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=r._doFinalize.call(this);return t.sigBytes-=4,t}});t.SHA224=r._createHelper(n),t.HmacSHA224=r._createHmacHelper(n)}(),function(){function t(){return n.create.apply(n,arguments)}for(var e=y,r=e.lib.Hasher,n=(s=e.x64).Word,i=s.WordArray,s=e.algo,o=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],a=[],u=0;80>u;u++)a[u]=t();s=s.SHA512=r.extend({_doReset:function(){this._hash=new i.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=(l=this._hash.words)[0],n=l[1],i=l[2],s=l[3],u=l[4],c=l[5],h=l[6],l=l[7],f=r.high,p=r.low,d=n.high,g=n.low,y=i.high,v=i.low,m=s.high,x=s.low,w=u.high,b=u.low,S=c.high,E=c.low,A=h.high,F=h.low,P=l.high,C=l.low,I=f,D=p,T=d,R=g,N=y,O=v,B=m,j=x,H=w,_=b,k=S,L=E,V=A,K=F,q=P,M=C,U=0;80>U;U++){var G=a[U];if(16>U)var z=G.high=0|t[e+2*U],W=G.low=0|t[e+2*U+1];else{z=((W=(z=a[U-15]).high)>>>1|(J=z.low)<<31)^(W>>>8|J<<24)^W>>>7;var J=(J>>>1|W<<31)^(J>>>8|W<<24)^(J>>>7|W<<25),X=((W=(X=a[U-2]).high)>>>19|($=X.low)<<13)^(W<<3|$>>>29)^W>>>6,$=($>>>19|W<<13)^($<<3|W>>>29)^($>>>6|W<<26),Y=(W=a[U-7]).high,Z=(Q=a[U-16]).high,Q=Q.low;z=(z=(z=z+Y+((W=J+W.low)>>>0<J>>>0?1:0))+X+((W+=$)>>>0<$>>>0?1:0))+Z+((W+=Q)>>>0<Q>>>0?1:0),G.high=z,G.low=W}Y=H&k^~H&V,Q=_&L^~_&K,G=I&T^I&N^T&N;var tt=D&R^D&O^R&O,et=(J=(I>>>28|D<<4)^(I<<30|D>>>2)^(I<<25|D>>>7),X=(D>>>28|I<<4)^(D<<30|I>>>2)^(D<<25|I>>>7),($=o[U]).high),rt=$.low;Z=q+((H>>>14|_<<18)^(H>>>18|_<<14)^(H<<23|_>>>9))+(($=M+((_>>>14|H<<18)^(_>>>18|H<<14)^(_<<23|H>>>9)))>>>0<M>>>0?1:0),q=V,M=K,V=k,K=L,k=H,L=_,H=B+(Z=(Z=(Z=Z+Y+(($+=Q)>>>0<Q>>>0?1:0))+et+(($+=rt)>>>0<rt>>>0?1:0))+z+(($+=W)>>>0<W>>>0?1:0))+((_=j+$|0)>>>0<j>>>0?1:0)|0,B=N,j=O,N=T,O=R,T=I,R=D,I=Z+(G=J+G+((W=X+tt)>>>0<X>>>0?1:0))+((D=$+W|0)>>>0<$>>>0?1:0)|0}p=r.low=p+D,r.high=f+I+(p>>>0<D>>>0?1:0),g=n.low=g+R,n.high=d+T+(g>>>0<R>>>0?1:0),v=i.low=v+O,i.high=y+N+(v>>>0<O>>>0?1:0),x=s.low=x+j,s.high=m+B+(x>>>0<j>>>0?1:0),b=u.low=b+_,u.high=w+H+(b>>>0<_>>>0?1:0),E=c.low=E+L,c.high=S+k+(E>>>0<L>>>0?1:0),F=h.low=F+K,h.high=A+V+(F>>>0<K>>>0?1:0),C=l.low=C+M,l.high=P+q+(C>>>0<M>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(n+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32}),e.SHA512=r._createHelper(s),e.HmacSHA512=r._createHmacHelper(s)}(),function(){var t=y,e=(i=t.x64).Word,r=i.WordArray,n=(i=t.algo).SHA512,i=i.SHA384=n.extend({_doReset:function(){this._hash=new r.init([new e.init(3418070365,3238371032),new e.init(1654270250,914150663),new e.init(2438529370,812702999),new e.init(355462360,4144912697),new e.init(1731405415,4290775857),new e.init(2394180231,1750603025),new e.init(3675008525,1694076839),new e.init(1203062813,3204075428)])},_doFinalize:function(){var t=n._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=n._createHelper(i),t.HmacSHA384=n._createHmacHelper(i)}(),function(){var t=y,e=(n=t.lib).WordArray,r=n.Hasher,n=t.algo,i=e.create([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]),s=e.create([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]),o=e.create([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]),a=e.create([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]),u=e.create([0,1518500249,1859775393,2400959708,2840853838]),c=e.create([1352829926,1548603684,1836072691,2053994217,0]);n=n.RIPEMD160=r.extend({_doReset:function(){this._hash=e.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;16>r;r++){var n=t[b=e+r];t[b]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var h,l,f,p,d,g,y,v,m,x,w,b=this._hash.words,S=(n=u.words,c.words),E=i.words,A=s.words,F=o.words,P=a.words;for(g=h=b[0],y=l=b[1],v=f=b[2],m=p=b[3],x=d=b[4],r=0;80>r;r+=1)w=h+t[e+E[r]]|0,w=16>r?w+((l^f^p)+n[0]):32>r?w+((l&f|~l&p)+n[1]):48>r?w+(((l|~f)^p)+n[2]):64>r?w+((l&p|f&~p)+n[3]):w+((l^(f|~p))+n[4]),w=(w=(w|=0)<<F[r]|w>>>32-F[r])+d|0,h=d,d=p,p=f<<10|f>>>22,f=l,l=w,w=g+t[e+A[r]]|0,w=16>r?w+((y^(v|~m))+S[0]):32>r?w+((y&m|v&~m)+S[1]):48>r?w+(((y|~v)^m)+S[2]):64>r?w+((y&v|~y&m)+S[3]):w+((y^v^m)+S[4]),w=(w=(w|=0)<<P[r]|w>>>32-P[r])+x|0,g=x,x=m,m=v<<10|v>>>22,v=y,y=w;w=b[1]+f+m|0,b[1]=b[2]+p+x|0,b[2]=b[3]+d+g|0,b[3]=b[4]+h+y|0,b[4]=b[0]+l+v|0,b[0]=w},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;for(e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process(),e=(t=this._hash).words,r=0;5>r;r++)n=e[r],e[r]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8);return t},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}}),t.RIPEMD160=r._createHelper(n),t.HmacRIPEMD160=r._createHmacHelper(n)}(Math),function(){var t=y,e=t.enc.Utf8;t.algo.HMAC=t.lib.Base.extend({init:function(t,r){t=this._hasher=new t.init,"string"==typeof r&&(r=e.parse(r));var n=t.blockSize,i=4*n;r.sigBytes>i&&(r=t.finalize(r)),r.clamp();for(var s=this._oKey=r.clone(),o=this._iKey=r.clone(),a=s.words,u=o.words,c=0;c<n;c++)a[c]^=1549556828,u[c]^=909522486;s.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher;return t=e.finalize(t),e.reset(),e.finalize(this._oKey.clone().concat(t))}})}(),function(){var t,e=y,r=(t=e.lib).Base,n=t.WordArray,i=(t=e.algo).HMAC,s=t.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:t.SHA1,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){var r=this.cfg,s=i.create(r.hasher,t),o=n.create(),a=n.create([1]),u=o.words,c=a.words,h=r.keySize;for(r=r.iterations;u.length<h;){var l=s.update(e).finalize(a);s.reset();for(var f=l.words,p=f.length,d=l,g=1;g<r;g++){d=s.finalize(d),s.reset();for(var y=d.words,v=0;v<p;v++)f[v]^=y[v]}o.concat(l),c[0]++}return o.sigBytes=4*h,o}});e.PBKDF2=function(t,e,r){return s.create(r).compute(t,e)}}();
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
var v,m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",x="=";function w(t){var e,r,n="";for(e=0;e+3<=t.length;e+=3)r=parseInt(t.substring(e,e+3),16),n+=m.charAt(r>>6)+m.charAt(63&r);if(e+1==t.length?(r=parseInt(t.substring(e,e+1),16),n+=m.charAt(r<<2)):e+2==t.length&&(r=parseInt(t.substring(e,e+2),16),n+=m.charAt(r>>2)+m.charAt((3&r)<<4)),x)for(;(3&n.length)>0;)n+=x;return n}function b(t){var e,r,n,i="",s=0;for(e=0;e<t.length&&t.charAt(e)!=x;++e)(n=m.indexOf(t.charAt(e)))<0||(0==s?(i+=D(n>>2),r=3&n,s=1):1==s?(i+=D(r<<2|n>>4),r=15&n,s=2):2==s?(i+=D(r),i+=D(n>>2),r=3&n,s=3):(i+=D(r<<2|n>>4),i+=D(15&n),s=0));return 1==s&&(i+=D(r<<2)),i}function S(t){var e,r=b(t),n=new Array;for(e=0;2*e<r.length;++e)n[e]=parseInt(r.substring(2*e,2*e+2),16);return n}function E(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function A(){return new E(null)}"Microsoft Internet Explorer"==d.appName?(E.prototype.am=function(t,e,r,n,i,s){for(var o=32767&e,a=e>>15;--s>=0;){var u=32767&this[t],c=this[t++]>>15,h=a*u+c*o;i=((u=o*u+((32767&h)<<15)+r[n]+(1073741823&i))>>>30)+(h>>>15)+a*c+(i>>>30),r[n++]=1073741823&u}return i},v=30):"Netscape"!=d.appName?(E.prototype.am=function(t,e,r,n,i,s){for(;--s>=0;){var o=e*this[t++]+r[n]+i;i=Math.floor(o/67108864),r[n++]=67108863&o}return i},v=26):(E.prototype.am=function(t,e,r,n,i,s){for(var o=16383&e,a=e>>14;--s>=0;){var u=16383&this[t],c=this[t++]>>14,h=a*u+c*o;i=((u=o*u+((16383&h)<<14)+r[n]+i)>>28)+(h>>14)+a*c,r[n++]=268435455&u}return i},v=28),E.prototype.DB=v,E.prototype.DM=(1<<v)-1,E.prototype.DV=1<<v,E.prototype.FV=Math.pow(2,52),E.prototype.F1=52-v,E.prototype.F2=2*v-52;var F,P,C="0123456789abcdefghijklmnopqrstuvwxyz",I=new Array;for(F="0".charCodeAt(0),P=0;P<=9;++P)I[F++]=P;for(F="a".charCodeAt(0),P=10;P<36;++P)I[F++]=P;for(F="A".charCodeAt(0),P=10;P<36;++P)I[F++]=P;function D(t){return C.charAt(t)}function T(t,e){var r=I[t.charCodeAt(e)];return null==r?-1:r}function R(t){var e=A();return e.fromInt(t),e}function N(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function O(t){this.m=t}function B(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function j(t,e){return t&e}function H(t,e){return t|e}function _(t,e){return t^e}function k(t,e){return t&~e}function L(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function V(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function K(){}function q(t){return t}function M(t){this.r2=A(),this.q3=A(),E.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}O.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},O.prototype.revert=function(t){return t},O.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},O.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},O.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},B.prototype.convert=function(t){var e=A();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(E.ZERO)>0&&this.m.subTo(e,e),e},B.prototype.revert=function(t){var e=A();return t.copyTo(e),this.reduce(e),e},B.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},B.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},B.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},E.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},E.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},E.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var o=8==r?255&t[n]:T(t,n);o<0?"-"==t.charAt(n)&&(i=!0):(i=!1,0==s?this[this.t++]=o:s+r>this.DB?(this[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this[this.t++]=o>>this.DB-s):this[this.t-1]|=o<<s,(s+=r)>=this.DB&&(s-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&E.ZERO.subTo(this,this)},E.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},E.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},E.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},E.prototype.lShiftTo=function(t,e){var r,n=t%this.DB,i=this.DB-n,s=(1<<i)-1,o=Math.floor(t/this.DB),a=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)e[r+o+1]=this[r]>>i|a,a=(this[r]&s)<<n;for(r=o-1;r>=0;--r)e[r]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()},E.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,s=(1<<n)-1;e[0]=this[r]>>n;for(var o=r+1;o<this.t;++o)e[o-r-1]|=(this[o]&s)<<i,e[o-r]=this[o]>>n;n>0&&(e[this.t-r-1]|=(this.s&s)<<i),e.t=this.t-r,e.clamp()}},E.prototype.subTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()},E.prototype.multiplyTo=function(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e[i]=0;for(i=0;i<n.t;++i)e[i+r.t]=r.am(0,n[i],e,i,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&E.ZERO.subTo(e,e)},E.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},E.prototype.divRemTo=function(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=e&&e.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=A());var s=A(),o=this.s,a=t.s,u=this.DB-N(n[n.t-1]);u>0?(n.lShiftTo(u,s),i.lShiftTo(u,r)):(n.copyTo(s),i.copyTo(r));var c=s.t,h=s[c-1];if(0!=h){var l=h*(1<<this.F1)+(c>1?s[c-2]>>this.F2:0),f=this.FV/l,p=(1<<this.F1)/l,d=1<<this.F2,g=r.t,y=g-c,v=null==e?A():e;for(s.dlShiftTo(y,v),r.compareTo(v)>=0&&(r[r.t++]=1,r.subTo(v,r)),E.ONE.dlShiftTo(c,v),v.subTo(s,s);s.t<c;)s[s.t++]=0;for(;--y>=0;){var m=r[--g]==h?this.DM:Math.floor(r[g]*f+(r[g-1]+d)*p);if((r[g]+=s.am(0,m,r,y,0,c))<m)for(s.dlShiftTo(y,v),r.subTo(v,r);r[g]<--m;)r.subTo(v,r)}null!=e&&(r.drShiftTo(c,e),o!=a&&E.ZERO.subTo(e,e)),r.t=c,r.clamp(),u>0&&r.rShiftTo(u,r),o<0&&E.ZERO.subTo(r,r)}}},E.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},E.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},E.prototype.exp=function(t,e){if(t>4294967295||t<1)return E.ONE;var r=A(),n=A(),i=e.convert(this),s=N(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<<s)>0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)},E.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,i=!1,s="",o=this.t,a=this.DB-o*this.DB%e;if(o-- >0)for(a<this.DB&&(r=this[o]>>a)>0&&(i=!0,s=D(r));o>=0;)a<e?(r=(this[o]&(1<<a)-1)<<e-a,r|=this[--o]>>(a+=this.DB-e)):(r=this[o]>>(a-=e)&n,a<=0&&(a+=this.DB,--o)),r>0&&(i=!0),i&&(s+=D(r));return i?s:"0"},E.prototype.negate=function(){var t=A();return E.ZERO.subTo(this,t),t},E.prototype.abs=function(){return this.s<0?this.negate():this},E.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},E.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+N(this[this.t-1]^this.s&this.DM)},E.prototype.mod=function(t){var e=A();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(E.ZERO)>0&&t.subTo(e,e),e},E.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new O(e):new B(e),this.exp(t,r)},E.ZERO=R(0),E.ONE=R(1),K.prototype.convert=q,K.prototype.revert=q,K.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},K.prototype.sqrTo=function(t,e){t.squareTo(e)},M.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=A();return t.copyTo(e),this.reduce(e),e},M.prototype.revert=function(t){return t},M.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},M.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},M.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var U=[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],G=(1<<26)/U[U.length-1];
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/function z(){this.i=0,this.j=0,this.S=new Array}E.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},E.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=R(r),i=A(),s=A(),o="";for(this.divRemTo(n,i,s);i.signum()>0;)o=(r+s.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,s);return s.intValue().toString(t)+o},E.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,o=0,a=0;a<t.length;++a){var u=T(t,a);u<0?"-"==t.charAt(a)&&0==this.signum()&&(i=!0):(o=e*o+u,++s>=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(o,0)),i&&E.ZERO.subTo(this,this)},E.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(E.ONE.shiftLeft(t-1),H,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(E.ONE.shiftLeft(t-1),this);else{var n=new Array,i=7&t;n.length=1+(t>>3),e.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},E.prototype.bitwiseTo=function(t,e,r){var n,i,s=Math.min(t.t,this.t);for(n=0;n<s;++n)r[n]=e(this[n],t[n]);if(t.t<this.t){for(i=t.s&this.DM,n=s;n<this.t;++n)r[n]=e(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=s;n<t.t;++n)r[n]=e(i,t[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},E.prototype.changeBit=function(t,e){var r=E.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r},E.prototype.addTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},E.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},E.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},E.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,t[i],r,i,0,this.t);for(n=Math.min(t.t,e);i<n;++i)this.am(0,t[i],r,i,0,e-i);r.clamp()},E.prototype.multiplyUpperTo=function(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},E.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},E.prototype.millerRabin=function(t){var e=this.subtract(E.ONE),r=e.getLowestSetBit();if(r<=0)return!1;var n=e.shiftRight(r);(t=t+1>>1)>U.length&&(t=U.length);for(var i=A(),s=0;s<t;++s){i.fromInt(U[Math.floor(Math.random()*U.length)]);var o=i.modPow(n,this);if(0!=o.compareTo(E.ONE)&&0!=o.compareTo(e)){for(var a=1;a++<r&&0!=o.compareTo(e);)if(0==(o=o.modPowInt(2,this)).compareTo(E.ONE))return!1;if(0!=o.compareTo(e))return!1}}return!0},E.prototype.clone=
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
function(){var t=A();return this.copyTo(t),t},E.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},E.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},E.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},E.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},E.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this[t]&(1<<n)-1)<<8-n,r|=this[--t]>>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},E.prototype.equals=function(t){return 0==this.compareTo(t)},E.prototype.min=function(t){return this.compareTo(t)<0?this:t},E.prototype.max=function(t){return this.compareTo(t)>0?this:t},E.prototype.and=function(t){var e=A();return this.bitwiseTo(t,j,e),e},E.prototype.or=function(t){var e=A();return this.bitwiseTo(t,H,e),e},E.prototype.xor=function(t){var e=A();return this.bitwiseTo(t,_,e),e},E.prototype.andNot=function(t){var e=A();return this.bitwiseTo(t,k,e),e},E.prototype.not=function(){for(var t=A(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},E.prototype.shiftLeft=function(t){var e=A();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},E.prototype.shiftRight=function(t){var e=A();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},E.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+L(this[t]);return this.s<0?this.t*this.DB:-1},E.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=V(this[r]^e);return t},E.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},E.prototype.setBit=function(t){return this.changeBit(t,H)},E.prototype.clearBit=function(t){return this.changeBit(t,k)},E.prototype.flipBit=function(t){return this.changeBit(t,_)},E.prototype.add=function(t){var e=A();return this.addTo(t,e),e},E.prototype.subtract=function(t){var e=A();return this.subTo(t,e),e},E.prototype.multiply=function(t){var e=A();return this.multiplyTo(t,e),e},E.prototype.divide=function(t){var e=A();return this.divRemTo(t,e,null),e},E.prototype.remainder=function(t){var e=A();return this.divRemTo(t,null,e),e},E.prototype.divideAndRemainder=function(t){var e=A(),r=A();return this.divRemTo(t,e,r),new Array(e,r)},E.prototype.modPow=function(t,e){var r,n,i=t.bitLength(),s=R(1);if(i<=0)return s;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new O(e):e.isEven()?new M(e):new B(e);var o=new Array,a=3,u=r-1,c=(1<<r)-1;if(o[1]=n.convert(this),r>1){var h=A();for(n.sqrTo(o[1],h);a<=c;)o[a]=A(),n.mulTo(h,o[a-2],o[a]),a+=2}var l,f,p=t.t-1,d=!0,g=A();for(i=N(t[p])-1;p>=0;){for(i>=u?l=t[p]>>i-u&c:(l=(t[p]&(1<<i+1)-1)<<u-i,p>0&&(l|=t[p-1]>>this.DB+i-u)),a=r;0==(1&l);)l>>=1,--a;if((i-=a)<0&&(i+=this.DB,--p),d)o[l].copyTo(s),d=!1;else{for(;a>1;)n.sqrTo(s,g),n.sqrTo(g,s),a-=2;a>0?n.sqrTo(s,g):(f=s,s=g,g=f),n.mulTo(g,o[l],s)}for(;p>=0&&0==(t[p]&1<<i);)n.sqrTo(s,g),f=s,s=g,g=f,--i<0&&(i=this.DB-1,--p)}return n.revert(s)},E.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return E.ZERO;for(var r=t.clone(),n=this.clone(),i=R(1),s=R(0),o=R(0),a=R(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),e?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),s.subTo(a,s)):(n.subTo(r,n),e&&o.subTo(i,o),a.subTo(s,a))}return 0!=n.compareTo(E.ONE)?E.ZERO:a.compareTo(t)>=0?a.subtract(t):a.signum()<0?(a.addTo(t,a),a.signum()<0?a.add(t):a):a},E.prototype.pow=function(t){return this.exp(t,new K)},E.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)return e;for(i<s&&(s=i),s>0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r},E.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=U[U.length-1]){for(e=0;e<U.length;++e)if(r[0]==U[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<U.length;){for(var n=U[e],i=e+1;i<U.length&&n<G;)n*=U[i++];for(n=r.modInt(n);e<i;)if(n%U[e++]==0)return!1}return r.millerRabin(t)},E.prototype.square=function(){var t=A();return this.squareTo(t),t},z.prototype.init=function(t){var e,r,n;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[r],this.S[r]=n;this.i=0,this.j=0},z.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]};var W,J,X,$=256;
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/function Y(){var t;t=(new Date).getTime(),J[X++]^=255&t,J[X++]^=t>>8&255,J[X++]^=t>>16&255,J[X++]^=t>>24&255,X>=$&&(X-=$)}if(null==J){var Z;if(J=new Array,X=0,void 0!==g&&(void 0!==g.crypto||void 0!==g.msCrypto)){var Q=g.crypto||g.msCrypto;if(Q.getRandomValues){var tt=new Uint8Array(32);for(Q.getRandomValues(tt),Z=0;Z<32;++Z)J[X++]=tt[Z]}else if("Netscape"==d.appName&&d.appVersion<"5"){var et=g.crypto.random(32);for(Z=0;Z<et.length;++Z)J[X++]=255&et.charCodeAt(Z)}}for(;X<$;)Z=Math.floor(65536*Math.random()),J[X++]=Z>>>8,J[X++]=255&Z;X=0,Y()}function rt(){if(null==W){for(Y(),(W=new z).init(J),X=0;X<J.length;++X)J[X]=0;X=0}return W.next()}function nt(){}
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/function it(t,e){return new E(t,e)}function st(t,e,r){for(var n="",i=0;n.length<e;)n+=r(String.fromCharCode.apply(String,t.concat([(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i]))),i+=1;return n}function ot(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function at(t,e,r){for(var n="",i=0;n.length<e;)n+=r(t+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])),i+=1;return n}
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/function ut(t,e){this.x=e,this.q=t}function ct(t,e,r,n){this.curve=t,this.x=e,this.y=r,this.z=null==n?E.ONE:n,this.zinv=null}function ht(t,e,r){this.q=t,this.a=this.fromBigInteger(e),this.b=this.fromBigInteger(r),this.infinity=new ct(this,null,null)}nt.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=rt()},ot.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},ot.prototype.setPublic=function(t,e){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof t)this.n=t,this.e=e;else{if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA public key";this.n=it(t,16),this.e=parseInt(e,16)}},ot.prototype.encrypt=function(t){var e=function(t,e){if(e<t.length+11)throw"Message too long for RSA";for(var r=new Array,n=t.length-1;n>=0&&e>0;){var i=t.charCodeAt(n--);i<128?r[--e]=i:i>127&&i<2048?(r[--e]=63&i|128,r[--e]=i>>6|192):(r[--e]=63&i|128,r[--e]=i>>6&63|128,r[--e]=i>>12|224)}r[--e]=0;for(var s=new nt,o=new Array;e>2;){for(o[0]=0;0==o[0];)s.nextBytes(o);r[--e]=o[0]}return r[--e]=2,r[--e]=0,new E(r)}(t,this.n.bitLength()+7>>3);if(null==e)return null;var r=this.doPublic(e);if(null==r)return null;var n=r.toString(16);return 0==(1&n.length)?n:"0"+n},ot.prototype.encryptOAEP=function(t,e,r){var n=this.n.bitLength()+7>>3,i=function(t,e,r,n){var i=ft.crypto.MessageDigest,s=ft.crypto.Util,o=null;if(r||(r="sha1"),"string"==typeof r&&(o=i.getCanonicalAlgName(r),n=i.getHashLength(o),r=function(t){return Ct(s.hashHex(It(t),o))}),t.length+2*n+2>e)throw"Message too long for RSA";var a,u="";for(a=0;a<e-t.length-2*n-2;a+=1)u+="\0";var c=r("")+u+""+t,h=new Array(n);(new nt).nextBytes(h);var l=st(h,c.length,r),f=[];for(a=0;a<c.length;a+=1)f[a]=c.charCodeAt(a)^l.charCodeAt(a);var p=st(f,h.length,r),d=[0];for(a=0;a<h.length;a+=1)d[a+1]=h[a]^p.charCodeAt(a);return new E(d.concat(f))}(t,n,e,r);if(null==i)return null;var s=this.doPublic(i);if(null==s)return null;for(var o=s.toString(16);o.length<2*n;)o="0"+o;return o},ot.prototype.type="RSA",ot.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),r=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(r)<0;)e=e.add(this.p);return e.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},ot.prototype.setPrivate=function(t,e,r){if(this.isPrivate=!0,"string"!=typeof t)this.n=t,this.e=e,this.d=r;else{if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA private key";this.n=it(t,16),this.e=parseInt(e,16),this.d=it(r,16)}},ot.prototype.setPrivateEx=function(t,e,r,n,i,s,o,a){if(this.isPrivate=!0,this.isPublic=!1,null==t)throw"RSASetPrivateEx N == null";if(null==e)throw"RSASetPrivateEx E == null";if(0==t.length)throw"RSASetPrivateEx N.length == 0";if(0==e.length)throw"RSASetPrivateEx E.length == 0";if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA private key in RSASetPrivateEx";this.n=it(t,16),this.e=parseInt(e,16),this.d=it(r,16),this.p=it(n,16),this.q=it(i,16),this.dmp1=it(s,16),this.dmq1=it(o,16),this.coeff=it(a,16)},ot.prototype.generate=function(t,e){var r=new nt,n=t>>1;this.e=parseInt(e,16);for(var i=new E(e,16),s=t/2-100,o=E.ONE.shiftLeft(s);;){for(;this.p=new E(t-n,1,r),0!=this.p.subtract(E.ONE).gcd(i).compareTo(E.ONE)||!this.p.isProbablePrime(10););for(;this.q=new E(n,1,r),0!=this.q.subtract(E.ONE).gcd(i).compareTo(E.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var a=this.p;this.p=this.q,this.q=a}var u=this.q.subtract(this.p).abs();if(!(u.bitLength()<s||u.compareTo(o)<=0)){var c=this.p.subtract(E.ONE),h=this.q.subtract(E.ONE),l=c.multiply(h);if(0==l.gcd(i).compareTo(E.ONE)&&(this.n=this.p.multiply(this.q),this.n.bitLength()==t)){this.d=i.modInverse(l),this.dmp1=this.d.mod(c),this.dmq1=this.d.mod(h),this.coeff=this.q.modInverse(this.p);break}}}this.isPrivate=!0},ot.prototype.decrypt=function(t){if(t.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var e=it(t,16),r=this.doPrivate(e);return null==r?null:
/*! (c) Tom Wu, Kenji Urushima | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
function(t,e){for(var r=t.toByteArray(),n=0;n<r.length&&0==r[n];)++n;if(r.length-n!=e-1||2!=r[n])return null;for(++n;0!=r[n];)if(++n>=r.length)return null;for(var i="";++n<r.length;){var s=255&r[n];s<128?i+=String.fromCharCode(s):s>191&&s<224?(i+=String.fromCharCode((31&s)<<6|63&r[n+1]),++n):(i+=String.fromCharCode((15&s)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return i}(r,this.n.bitLength()+7>>3)},ot.prototype.decryptOAEP=function(t,e,r){if(t.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var n=it(t,16),i=this.doPrivate(n);return null==i?null:function(t,e,r,n){var i=ft.crypto.MessageDigest,s=ft.crypto.Util,o=null;for(r||(r="sha1"),"string"==typeof r&&(o=i.getCanonicalAlgName(r),n=i.getHashLength(o),r=function(t){return Ct(s.hashHex(It(t),o))}),t=t.toByteArray(),a=0;a<t.length;a+=1)t[a]&=255;for(;t.length<e;)t.unshift(0);if((t=String.fromCharCode.apply(String,t)).length<2*n+2)throw"Cipher too short";var a,u=t.substr(1,n),c=t.substr(n+1),h=at(c,n,r),l=[];for(a=0;a<u.length;a+=1)l[a]=u.charCodeAt(a)^h.charCodeAt(a);var f=at(String.fromCharCode.apply(String,l),t.length-n,r),p=[];for(a=0;a<c.length;a+=1)p[a]=c.charCodeAt(a)^f.charCodeAt(a);if((p=String.fromCharCode.apply(String,p)).substr(0,n)!==r(""))throw"Hash mismatch";var d=(p=p.substr(n)).indexOf("");if((-1!=d?p.substr(0,d).lastIndexOf("\0"):-1)+1!=d)throw"Malformed data";return p.substr(d+1)}(i,this.n.bitLength()+7>>3,e,r)},ut.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.x.equals(t.x)},ut.prototype.toBigInteger=function(){return this.x},ut.prototype.negate=function(){return new ut(this.q,this.x.negate().mod(this.q))},ut.prototype.add=function(t){return new ut(this.q,this.x.add(t.toBigInteger()).mod(this.q))},ut.prototype.subtract=function(t){return new ut(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))},ut.prototype.multiply=function(t){return new ut(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))},ut.prototype.square=function(){return new ut(this.q,this.x.square().mod(this.q))},ut.prototype.divide=function(t){return new ut(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))},ut.prototype.sqrt=function(){return new ut(this.q,this.x.sqrt().mod(this.q))},ct.prototype.getX=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))},ct.prototype.getY=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))},ct.prototype.equals=function(t){return t==this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(E.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(E.ZERO))},ct.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(E.ZERO)&&!this.y.toBigInteger().equals(E.ZERO)},ct.prototype.negate=function(){return new ct(this.curve,this.x,this.y.negate(),this.z)},ct.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),r=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q);if(E.ZERO.equals(r))return E.ZERO.equals(e)?this.twice():this.curve.getInfinity();var n=new E("3"),i=this.x.toBigInteger(),s=this.y.toBigInteger(),o=(t.x.toBigInteger(),t.y.toBigInteger(),r.square()),a=o.multiply(r),u=i.multiply(o),c=e.square().multiply(this.z),h=c.subtract(u.shiftLeft(1)).multiply(t.z).subtract(a).multiply(r).mod(this.curve.q),l=u.multiply(n).multiply(e).subtract(s.multiply(a)).subtract(c.multiply(e)).multiply(t.z).add(e.multiply(a)).mod(this.curve.q),f=a.multiply(this.z).multiply(t.z).mod(this.curve.q);return new ct(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(l),f)},ct.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=new E("3"),e=this.x.toBigInteger(),r=this.y.toBigInteger(),n=r.multiply(this.z),i=n.multiply(r).mod(this.curve.q),s=this.curve.a.toBigInteger(),o=e.square().multiply(t);E.ZERO.equals(s)||(o=o.add(this.z.square().multiply(s)));var a=(o=o.mod(this.curve.q)).square().subtract(e.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(n).mod(this.curve.q),u=o.multiply(t).multiply(e).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(o.square().multiply(o)).mod(this.curve.q),c=n.square().multiply(n).shiftLeft(3).mod(this.curve.q);return new ct(this.curve,this.curve.fromBigInteger(a),this.curve.fromBigInteger(u),c)},ct.prototype.multiply=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,r=t,n=r.multiply(new E("3")),i=this.negate(),s=this,o=this.curve.q.subtract(t),a=o.multiply(new E("3")),u=new ct(this.curve,this.x,this.y),c=u.negate();for(e=n.bitLength()-2;e>0;--e){s=s.twice();var h=n.testBit(e);h!=r.testBit(e)&&(s=s.add(h?this:i))}for(e=a.bitLength()-2;e>0;--e){u=u.twice();var l=a.testBit(e);l!=o.testBit(e)&&(u=u.add(l?u:c))}return s},ct.prototype.multiplyTwo=function(t,e,r){var n;n=t.bitLength()>r.bitLength()?t.bitLength()-1:r.bitLength()-1;for(var i=this.curve.getInfinity(),s=this.add(e);n>=0;)i=i.twice(),t.testBit(n)?i=r.testBit(n)?i.add(s):i.add(this):r.testBit(n)&&(i=i.add(e)),--n;return i},ht.prototype.getQ=function(){return this.q},ht.prototype.getA=function(){return this.a},ht.prototype.getB=function(){return this.b},ht.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)},ht.prototype.getInfinity=function(){return this.infinity},ht.prototype.fromBigInteger=function(t){return new ut(this.q,t)},ht.prototype.decodePointHex=function(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var e=t.substr(0,2),r=(t.substr(2),this.fromBigInteger(new E(a,16))),n=this.getA(),i=this.getB(),s=r.square().add(n).multiply(r).add(i).sqrt();return"03"==e&&(s=s.negate()),new ct(this,r,s);case 4:case 6:case 7:var o=(t.length-2)/2,a=t.substr(2,o),u=t.substr(o+2,o);return new ct(this,this.fromBigInteger(new E(a,16)),this.fromBigInteger(new E(u,16)));default:return null}},
/*! (c) Stefan Thomas | https://github.com/bitcoinjs/bitcoinjs-lib
*/
ut.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},ct.prototype.getEncoded=function(t){var e=function(t,e){var r=t.toByteArrayUnsigned();if(e<r.length)r=r.slice(r.length-e);else for(;e>r.length;)r.unshift(0);return r},r=this.getX().toBigInteger(),n=this.getY().toBigInteger(),i=e(r,32);return t?n.isEven()?i.unshift(2):i.unshift(3):(i.unshift(4),i=i.concat(e(n,32))),i},ct.decodeFrom=function(t,e){e[0];var r=e.length-1,n=e.slice(1,1+r/2),i=e.slice(1+r/2,1+r);n.unshift(0),i.unshift(0);var s=new E(n),o=new E(i);return new ct(t,t.fromBigInteger(s),t.fromBigInteger(o))},ct.decodeFromHex=function(t,e){e.substr(0,2);var r=e.length-2,n=e.substr(2,r/2),i=e.substr(2+r/2,r/2),s=new E(n,16),o=new E(i,16);return new ct(t,t.fromBigInteger(s),t.fromBigInteger(o))},ct.prototype.add2D=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;if(this.x.equals(t.x))return this.y.equals(t.y)?this.twice():this.curve.getInfinity();var e=t.x.subtract(this.x),r=t.y.subtract(this.y).divide(e),n=r.square().subtract(this.x).subtract(t.x),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new ct(this.curve,n,i)},ct.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=this.curve.fromBigInteger(E.valueOf(2)),e=this.curve.fromBigInteger(E.valueOf(3)),r=this.x.square().multiply(e).add(this.curve.a).divide(this.y.multiply(t)),n=r.square().subtract(this.x.multiply(t)),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new ct(this.curve,n,i)},ct.prototype.multiply2D=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,r=t,n=r.multiply(new E("3")),i=this.negate(),s=this;for(e=n.bitLength()-2;e>0;--e){s=s.twice();var o=n.testBit(e);o!=r.testBit(e)&&(s=s.add2D(o?this:i))}return s},ct.prototype.isOnCurve=function(){var t=this.getX().toBigInteger(),e=this.getY().toBigInteger(),r=this.curve.getA().toBigInteger(),n=this.curve.getB().toBigInteger(),i=this.curve.getQ(),s=e.multiply(e).mod(i),o=t.multiply(t).multiply(t).add(r.multiply(t)).add(n).mod(i);return s.equals(o)},ct.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},ct.prototype.validate=function(){var t=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var e=this.getX().toBigInteger(),r=this.getY().toBigInteger();if(e.compareTo(E.ONE)<0||e.compareTo(t.subtract(E.ONE))>0)throw new Error("x coordinate out of bounds");if(r.compareTo(E.ONE)<0||r.compareTo(t.subtract(E.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(t).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};
/*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
*/
var lt=function(){var t=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),e=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),r={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function n(t,e,n){return e?r[e]:String.fromCharCode(parseInt(n,16))}var i=new String(""),s=Object.hasOwnProperty;return function(r,o){var a,u,c=r.match(t),h=c[0],l=!1;"{"===h?a={}:"["===h?a=[]:(a=[],l=!0);for(var f=[a],p=1-l,d=c.length;p<d;++p){var g;switch((h=c[p]).charCodeAt(0)){default:(g=f[0])[u||g.length]=+h,u=void 0;break;case 34:if(-1!==(h=h.substring(1,h.length-1)).indexOf("\\")&&(h=h.replace(e,n)),g=f[0],!u){if(!(g instanceof Array)){u=h||i;break}u=g.length}g[u]=h,u=void 0;break;case 91:g=f[0],f.unshift(g[u||g.length]=[]),u=void 0;break;case 93:case 125:f.shift();break;case 102:(g=f[0])[u||g.length]=!1,u=void 0;break;case 110:(g=f[0])[u||g.length]=null,u=void 0;break;case 116:(g=f[0])[u||g.length]=!0,u=void 0;break;case 123:g=f[0],f.unshift(g[u||g.length]={}),u=void 0}}if(l){if(1!==f.length)throw new Error;a=a[0]}else if(f.length)throw new Error;return o&&(a=function t(e,r){var n=e[r];if(n&&"object"==typeof n){var i=null;for(var a in n)if(s.call(n,a)&&n!==e){var u=t(n,a);void 0!==u?n[a]=u:(i||(i=[]),i.push(a))}if(i)for(var c=i.length;--c>=0;)delete n[i[c]]}return o.call(e,r,n)}({"":a},"")),a}}();void 0!==ft&&ft||(ft={}),void 0!==ft.asn1&&ft.asn1||(ft.asn1={}),ft.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var r=e.substr(1).length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";e=new E(n,16).xor(t).add(E.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return Nt(t,e)},this.newObject=function(t){var e=ft.asn1,r=e.ASN1Object,n=e.DERBoolean,i=e.DERInteger,s=e.DERBitString,o=e.DEROctetString,a=e.DERNull,u=e.DERObjectIdentifier,c=e.DEREnumerated,h=e.DERUTF8String,l=e.DERNumericString,f=e.DERPrintableString,p=e.DERTeletexString,d=e.DERIA5String,g=e.DERUTCTime,y=e.DERGeneralizedTime,v=e.DERVisibleString,m=e.DERBMPString,x=e.DERSequence,w=e.DERSet,b=e.DERTaggedObject,S=e.ASN1Util.newObject;if(t instanceof e.ASN1Object)return t;var E=Object.keys(t);if(1!=E.length)throw new Error("key of param shall be only one.");var A=E[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+A+":"))throw new Error("undefined key: "+A);if("bool"==A)return new n(t[A]);if("int"==A)return new i(t[A]);if("bitstr"==A)return new s(t[A]);if("octstr"==A)return new o(t[A]);if("null"==A)return new a(t[A]);if("oid"==A)return new u(t[A]);if("enum"==A)return new c(t[A]);if("utf8str"==A)return new h(t[A]);if("numstr"==A)return new l(t[A]);if("prnstr"==A)return new f(t[A]);if("telstr"==A)return new p(t[A]);if("ia5str"==A)return new d(t[A]);if("utctime"==A)return new g(t[A]);if("gentime"==A)return new y(t[A]);if("visstr"==A)return new v(t[A]);if("bmpstr"==A)return new m(t[A]);if("asn1"==A)return new r(t[A]);if("seq"==A){for(var F=t[A],P=[],C=0;C<F.length;C++){var I=S(F[C]);P.push(I)}return new x({array:P})}if("set"==A){for(F=t[A],P=[],C=0;C<F.length;C++)I=S(F[C]),P.push(I);return new w({array:P})}if("tag"==A){var D=t[A];if("[object Array]"===Object.prototype.toString.call(D)&&3==D.length){var T=S(D[2]);return new b({tag:D[0],explicit:D[1],obj:T})}return new b(D)}},this.jsonToASN1HEX=function(t){return this.newObject(t).tohex()}},ft.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",r=parseInt(t.substr(0,2),16),n=(e=Math.floor(r/40)+"."+r%40,""),i=2;i<t.length;i+=2){var s=("00000000"+parseInt(t.substr(i,2),16).toString(2)).slice(-8);n+=s.substr(1,7),"0"==s.substr(0,1)&&(e=e+"."+new E(n,2).toString(10),n="")}return e},ft.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",n=new E(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var s="",o=0;o<i;o++)s+="0";for(n=s+n,o=0;o<n.length-1;o+=7){var a=n.substr(o,7);o!=n.length-7&&(a="1"+a),r+=e(parseInt(a,2))}return r};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var n="",i=t.split("."),s=40*parseInt(i[0])+parseInt(i[1]);n+=e(s),i.splice(0,2);for(var o=0;o<i.length;o++)n+=r(i[o]);return n},ft.asn1.ASN1Object=function(t){this.params=null,this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n=0,v="+this.hV);var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var r=e.length/2;if(r>15)throw new Error("ASN.1 length too long to represent by 8x: n = "+t.toString(16));return(128+r).toString(16)+e},this.tohex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.getValueHex=function(){return this.tohex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(t){this.params=t},null!=t&&null!=t.tlv&&(this.hTLV=t.tlv,this.isModified=!1)},ft.asn1.DERAbstractString=function(t){ft.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=At(this.s).toLowerCase()},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},ie(ft.asn1.DERAbstractString,ft.asn1.ASN1Object),ft.asn1.DERAbstractTime=function(t){ft.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){var e=t.getTime()+6e4*t.getTimezoneOffset();return new Date(e)},this.formatDate=function(t,e,r){var n=this.zeroPadding,i=this.localDateToUTC(t),s=String(i.getFullYear());"utc"==e&&(s=s.substr(2,2));var o=s+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var a=i.getMilliseconds();if(0!=a){var u=n(String(a),3);o=o+"."+(u=u.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.setByParam=function(t){this.hV=null,this.hTLV=null,this.params=t},this.getString=function(){},this.setString=function(t){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.str=t},this.setByDate=function(t){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.date=t},this.setByDateValue=function(t,e,r,n,i,s){var o=new Date(Date.UTC(t,e-1,r,n,i,s,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},ie(ft.asn1.DERAbstractTime,ft.asn1.ASN1Object),ft.asn1.DERAbstractStructured=function(t){ft.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},ie(ft.asn1.DERAbstractStructured,ft.asn1.ASN1Object),ft.asn1.DERBoolean=function(t){ft.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==t?"010100":"0101ff"},ie(ft.asn1.DERBoolean,ft.asn1.ASN1Object),ft.asn1.DERInteger=function(t){ft.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.params=null;var e=ft.asn1.ASN1Util.bigIntToMinTwosComplementsHex;this.setByBigInteger=function(t){this.isModified=!0,this.params={bigint:t}},this.setByInteger=function(t){this.isModified=!0,this.params=t},this.setValueHex=function(t){this.isModified=!0,this.params={hex:t}},this.getFreshValueHex=function(){var t=this.params,r=null;if(null==t)throw new Error("value not set");if("object"==typeof t&&null!=t.hex)return this.hV=t.hex,this.hV;if("number"==typeof t)r=new E(String(t),10);else if(null!=t.int)r=new E(String(t.int),10);else{if(null==t.bigint)throw new Error("wrong parameter");r=t.bigint}return this.hV=e(r),this.hV},null!=t&&(this.params=t)},ie(ft.asn1.DERInteger,ft.asn1.ASN1Object),ft.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=ft.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.tohex()}ft.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var r="0"+t;this.hTLV=null,this.isModified=!0,this.hV=r+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0),t+="0000000".substr(0,e);for(var r="",n=0;n<t.length-1;n+=8){var i=t.substr(n,8),s=parseInt(i,2).toString(16);1==s.length&&(s="0"+s),r+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+e+r},this.setByBooleanArray=function(t){for(var e="",r=0;r<t.length;r++)1==t[r]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},ie(ft.asn1.DERBitString,ft.asn1.ASN1Object),ft.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=ft.asn1.ASN1Util.newObject(t.obj);t.hex=e.tohex()}ft.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},ie(ft.asn1.DEROctetString,ft.asn1.DERAbstractString),ft.asn1.DERNull=function(){ft.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},ie(ft.asn1.DERNull,ft.asn1.ASN1Object),ft.asn1.DERObjectIdentifier=function(t){ft.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){var e=$t(t);if(null==e)throw new Error("malformed oid string: "+t);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(t){var e=ft.asn1.x509.OID.name2oid(t);if(""===e)throw new Error("DERObjectIdentifier oidName undefined: "+t);this.setValueOidString(e)},this.setValueNameOrOid=function(t){t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){"string"==typeof t?this.setValueNameOrOid(t):void 0!==t.oid?this.setValueNameOrOid(t.oid):void 0!==t.name?this.setValueNameOrOid(t.name):void 0!==t.hex&&this.setValueHex(t.hex)},void 0!==t&&this.setByParam(t)},ie(ft.asn1.DERObjectIdentifier,ft.asn1.ASN1Object),ft.asn1.DEREnumerated=function(t){ft.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=ft.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new E(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},ie(ft.asn1.DEREnumerated,ft.asn1.ASN1Object),ft.asn1.DERUTF8String=function(t){ft.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},ie(ft.asn1.DERUTF8String,ft.asn1.DERAbstractString),ft.asn1.DERNumericString=function(t){ft.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},ie(ft.asn1.DERNumericString,ft.asn1.DERAbstractString),ft.asn1.DERPrintableString=function(t){ft.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},ie(ft.asn1.DERPrintableString,ft.asn1.DERAbstractString),ft.asn1.DERTeletexString=function(t){ft.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},ie(ft.asn1.DERTeletexString,ft.asn1.DERAbstractString),ft.asn1.DERIA5String=function(t){ft.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},ie(ft.asn1.DERIA5String,ft.asn1.DERAbstractString),ft.asn1.DERVisibleString=function(t){ft.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="1a"},ie(ft.asn1.DERVisibleString,ft.asn1.DERAbstractString),ft.asn1.DERBMPString=function(t){ft.asn1.DERBMPString.superclass.constructor.call(this,t),this.hT="1e"},ie(ft.asn1.DERBMPString,ft.asn1.DERAbstractString),ft.asn1.DERUTCTime=function(t){ft.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.params=void 0,this.getFreshValueHex=function(){var t=this.params;if(null==this.params&&(t={date:new Date}),"string"==typeof t){if(!t.match(/^[0-9]{12}Z$/)&&!t.match(/^[0-9]{12}\.[0-9]+Z$/))throw new Error("malformed string for UTCTime: "+t);this.hV=xt(t)}else if(null!=t.str)this.hV=xt(t.str);else if(null==t.date&&1==t.millis){var e=new Date;this.hV=xt(this.formatDate(e,"utc",!0))}else if(null!=t.date&&t.date instanceof Date){var r=!0===t.millis;this.hV=xt(this.formatDate(t.date,"utc",r))}else t instanceof Date&&(this.hV=xt(this.formatDate(t,"utc")));if(null==this.hV)throw new Error("parameter not specified properly for UTCTime");return this.hV},null!=t&&this.setByParam(t)},ie(ft.asn1.DERUTCTime,ft.asn1.DERAbstractTime),ft.asn1.DERGeneralizedTime=function(t){ft.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.params=t,this.getFreshValueHex=function(){var t=this.params;if(null==this.params&&(t={date:new Date}),"string"==typeof t){if(!t.match(/^[0-9]{14}Z$/)&&!t.match(/^[0-9]{14}\.[0-9]+Z$/))throw new Error("malformed string for GeneralizedTime: "+t);this.hV=xt(t)}else if(null!=t.str)this.hV=xt(t.str);else if(null==t.date&&1==t.millis){var e=new Date;this.hV=xt(this.formatDate(e,"gen",!0))}else if(null!=t.date&&t.date instanceof Date){var r=!0===t.millis;this.hV=xt(this.formatDate(t.date,"gen",r))}else t instanceof Date&&(this.hV=xt(this.formatDate(t,"gen")));if(null==this.hV)throw new Error("parameter not specified properly for GeneralizedTime");return this.hV},null!=t&&this.setByParam(t)},ie(ft.asn1.DERGeneralizedTime,ft.asn1.DERAbstractTime),ft.asn1.DERSequence=function(t){ft.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++)t+=this.asn1Array[e].tohex();return this.hV=t,this.hV}},ie(ft.asn1.DERSequence,ft.asn1.DERAbstractStructured),ft.asn1.DERSet=function(t){ft.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t.push(r.tohex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},ie(ft.asn1.DERSet,ft.asn1.DERAbstractStructured),ft.asn1.DERTaggedObject=function(t){ft.asn1.DERTaggedObject.superclass.constructor.call(this);var e=ft.asn1,r=gt,n=r.getV,i=(r.isASN1HEX,e.ASN1Util.newObject);this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.params={tag:"a0",explicit:!0},this.setASN1Object=function(t,e,r){this.params={tag:e,explicit:t,obj:r}},this.getFreshValueHex=function(){var t=this.params;if(null==t.explicit&&(t.explicit=!0),null!=t.tage&&(t.tag=t.tage,t.explicit=!0),null!=t.tagi&&(t.tag=t.tagi,t.explicit=!1),null!=t.str)this.hV=At(t.str);else if(null!=t.hex)this.hV=t.hex;else{if(null==t.obj)throw new Error("str, hex nor obj not specified");var r;t.obj instanceof e.ASN1Object?r=t.obj.tohex():"object"==typeof t.obj&&(r=i(t.obj).tohex()),t.explicit?this.hV=r:this.hV=n(r,0)}return null==t.tag&&(t.tag="a0"),this.hT=t.tag,this.hTLV=null,this.isModified=!0,this.hV},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},ie(ft.asn1.DERTaggedObject,ft.asn1.ASN1Object);var ft,pt,dt,gt=new function(){};function yt(t){for(var e=new Array,r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}function vt(t){for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e}function mt(t){for(var e="",r=0;r<t.length;r++){var n=t[r].toString(16);1==n.length&&(n="0"+n),e+=n}return e}function xt(t){return mt(yt(t))}function wt(t){return(t=(t=t.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function bt(t){return t.length%4==2?t+="==":t.length%4==3&&(t+="="),(t=t.replace(/-/g,"+")).replace(/_/g,"/")}function St(t){return t.length%2==1&&(t="0"+t),wt(w(t))}function Et(t){return b(bt(t))}function At(t){return _t(zt(t)).toLowerCase()}function Ft(t){try{return decodeURIComponent(kt(t))}catch(t){return null}}function Pt(t){return Ft(function(t){for(var e=t.match(/.{1,2}/g),r=[],n=0;n<e.length;n++){var i=parseInt(e[n],16);161<=i&&i<=191?(r.push("c2"),r.push(e[n])):192<=i&&i<=255?(r.push("c3"),r.push((i-64).toString(16))):r.push(e[n])}return r.join("")}(t))}function Ct(t){for(var e="",r=0;r<t.length-1;r+=2)e+=String.fromCharCode(parseInt(t.substr(r,2),16));return e}function It(t){for(var e="",r=0;r<t.length;r++)e+=("0"+t.charCodeAt(r).toString(16)).slice(-2);return e}function Dt(t){return w(t)}function Tt(t,e){return(t=t.replace(new RegExp("(.{"+e+"})","g"),"$1\r\n")).replace(/\s+$/,"")}function Rt(t){return b(t.replace(/[^0-9A-Za-z\/+=]*/g,""))}function Nt(t,e){return"-----BEGIN "+e+"-----\r\n"+Tt(Dt(t),64)+"\r\n-----END "+e+"-----\r\n"}function Ot(t,e){if(-1==t.indexOf("-----BEGIN "))throw new Error("can't find PEM header");return Rt(t=void 0!==e?(t=t.replace(new RegExp("^[^]*-----BEGIN "+e+"-----"),"")).replace(new RegExp("-----END "+e+"-----[^]*$"),""):(t=t.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Bt(t){var e,r,n,i,s,o,a,u,c,h;if(h=(t=Ht(t)).match(/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return e=parseInt(h[1]),r=parseInt(h[2])-1,n=parseInt(h[3]),i=parseInt(h[4]),s=parseInt(h[5]),o=parseInt(h[6]),a=0,""!==(u=h[7])&&(c=(u.substr(1)+"00").substr(0,3),a=parseInt(c)),Date.UTC(e,r,n,i,s,o,a);throw new Error("unsupported zulu format: "+t)}function jt(t){return Math.round(Bt(t)/1e3)}function Ht(t){return t.match(/^[0-9]{12}Z$/)||t.match(/^[0-9]{12}[.][0-9]*Z$/)?t.match(/^[0-4]/)?"20"+t:"19"+t:t}function _t(t){return t.replace(/%/g,"")}function kt(t){return t.replace(/(..)/g,"%$1")}function Lt(t){var e="malformed IPv6 address";if(!t.match(/^[0-9A-Fa-f:]+$/))throw e;var r=(t=t.toLowerCase()).split(":").length-1;if(r<2)throw e;var n=":".repeat(7-r+2),i=(t=t.replace("::",n)).split(":");if(8!=i.length)throw e;for(var s=0;s<8;s++)i[s]=("0000"+i[s]).slice(-4);return i.join("")}function Vt(t){if(!t.match(/^[0-9A-Fa-f]{32}$/))throw new Error("malformed IPv6 address: "+t);var e=(t=t.toLowerCase()).match(/.{1,4}/g),r=(t=":"+(e=(e=e.map(function(t){return t.replace(/^0+/,"")})).map(function(t){return""==t?"0":t})).join(":")+":").match(/:(0:){2,}/g);if(null==r)return t.slice(1,-1);var n=r.sort().slice(-1)[0];return"::"!=(t=t.replace(n.substr(0,n.length-1),":")).substr(0,2)&&(t=t.substr(1)),"::"!=t.substr(-2,2)&&(t=t.substr(0,t.length-1)),t}function Kt(t){var e=new Error("malformed hex value");if(!t.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw e;if(8==t.length)try{return parseInt(t.substr(0,2),16)+"."+parseInt(t.substr(2,2),16)+"."+parseInt(t.substr(4,2),16)+"."+parseInt(t.substr(6,2),16)}catch(t){throw e}else{if(16!=t.length){if(32==t.length)return Vt(t);if(64==t.length){try{return Vt(t.substr(0,32))+"/"+qt(t.substr(32))}catch(t){throw e}return}return t}try{return Kt(t.substr(0,8))+"/"+qt(t.substr(8))}catch(t){throw e}}}function qt(t){var e,r=new Error("malformed mask");try{e=new E(t,16).toString(2)}catch(t){throw r}if(!e.match(/^1*0*$/))throw r;return e.replace(/0+$/,"").length}function Mt(t){var e=new Error("malformed IP address");if(!(t=t.toLowerCase(t)).match(/^[0-9a-f.:/]+$/))throw e;if(!t.match(/^[0-9.]+$/)){var r;if(t.match(/^[0-9.]+\/[0-9]+$/))return Mt((r=t.split("/"))[0])+Ut(parseInt(r[1]),32);if(t.match(/^[0-9a-f:]+$/)&&-1!==t.indexOf(":"))return Lt(t);if(t.match(/^[0-9a-f:]+\/[0-9]+$/)&&-1!==t.indexOf(":"))return Lt((r=t.split("/"))[0])+Ut(parseInt(r[1]),128);throw e}var n=t.split(".");if(4!==n.length)throw e;var i="";try{for(var s=0;s<4;s++)i+=("0"+parseInt(n[s]).toString(16)).slice(-2);return i}catch(t){throw e}}function Ut(t,e){return 32==e&&0==t?"00000000":128==e&&0==t?"00000000000000000000000000000000":new E(Array(t+1).join("1")+Array(e-t+1).join("0"),2).toString(16)}function Gt(t){return t.match(/.{4}/g).map(function(t){var e=parseInt(t.substr(0,2),16),r=parseInt(t.substr(2),16);if(0==e&r<128)return String.fromCharCode(r);if(e<8){var n=128|63&r;return Ft((192|(7&e)<<3|(192&r)>>6).toString(16)+n.toString(16))}n=128|(15&e)<<2|(192&r)>>6;var i=128|63&r;return Ft((224|(240&e)>>4).toString(16)+n.toString(16)+i.toString(16))}).join("")}function zt(t){for(var e=encodeURIComponent(t),r="",n=0;n<e.length;n++)"%"==e[n]?(r+=e.substr(n,3),n+=2):r=r+"%"+xt(e[n]);return r}function Wt(t){return!(t.length%2!=0||!t.match(/^[0-9a-f]+$/)&&!t.match(/^[0-9A-F]+$/))}function Jt(t){return!!t.match(/^[0-9A-Za-z-_.]+$/)}function Xt(t){return t.length%2==1?"0"+t:t.substr(0,1)>"7"?"00"+t:t}function $t(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",n=parseInt(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var s="",o=0;o<i;o++)s+="0";for(n=s+n,o=0;o<n.length-1;o+=7){var a=n.substr(o,7);o!=n.length-7&&(a="1"+a),r+=e(parseInt(a,2))}return r};try{if(!t.match(/^[0-9.]+$/))return null;var n="",i=t.split("."),s=40*parseInt(i[0],10)+parseInt(i[1],10);n+=e(s),i.splice(0,2);for(var o=0;o<i.length;o++)n+=r(i[o]);return n}catch(t){return null}}function Yt(t){if(!Wt(t))return null;try{var e=[],r=t.substr(0,2),n=parseInt(r,16);e[0]=new String(Math.floor(n/40)),e[1]=new String(n%40);for(var i=t.substr(2),s=[],o=0;o<i.length/2;o++)s.push(parseInt(i.substr(2*o,2),16));var a=[],u="";for(o=0;o<s.length;o++)128&s[o]?u+=Zt((127&s[o]).toString(2),7):(u+=Zt((127&s[o]).toString(2),7),a.push(new String(parseInt(u,2))),u="");var c=e.join(".");return a.length>0&&(c=c+"."+a.join(".")),c}catch(t){return null}}gt.getLblen=function(t,e){if("8"!=t.substr(e+2,1))return 1;var r=parseInt(t.substr(e+3,1));return 0==r?-1:0<r&&r<10?r+1:-2},gt.getL=function(t,e){var r=gt.getLblen(t,e);return r<1?"":t.substr(e+2,2*r)},gt.getVblen=function(t,e){var r;return""==(r=gt.getL(t,e))?-1:("8"===r.substr(0,1)?new E(r.substr(2),16):new E(r,16)).intValue()},gt.getVidx=function(t,e){var r=gt.getLblen(t,e);return r<0?r:e+2*(r+1)},gt.getV=function(t,e){var r=gt.getVidx(t,e),n=gt.getVblen(t,e);return t.substr(r,2*n)},gt.getTLV=function(t,e){return t.substr(e,2)+gt.getL(t,e)+gt.getV(t,e)},gt.getTLVblen=function(t,e){return 2+2*gt.getLblen(t,e)+2*gt.getVblen(t,e)},gt.getNextSiblingIdx=function(t,e){return gt.getVidx(t,e)+2*gt.getVblen(t,e)},gt.getChildIdx=function(t,e){var r,n,i,s=gt,o=[];r=s.getVidx(t,e),n=2*s.getVblen(t,e),"03"==t.substr(e,2)&&(r+=2,n-=2),i=0;for(var a=r;i<=n;){var u=s.getTLVblen(t,a);if((i+=u)<=n&&o.push(a),a+=u,i>=n)break}return o},gt.getNthChildIdx=function(t,e,r){return gt.getChildIdx(t,e)[r]},gt.getIdxbyList=function(t,e,r,n){var i,s,o=gt;return 0==r.length?void 0!==n&&t.substr(e,2)!==n?-1:e:(i=r.shift())>=(s=o.getChildIdx(t,e)).length?-1:o.getIdxbyList(t,s[i],r,n)},gt.getIdxbyListEx=function(t,e,r,n){var i,s,o=gt;if(0==r.length)return void 0!==n&&t.substr(e,2)!==n?-1:e;i=r.shift(),s=o.getChildIdx(t,e);for(var a=0,u=0;u<s.length;u++){var c=t.substr(s[u],2);if("number"==typeof i&&!o.isContextTag(c)&&a==i||"string"==typeof i&&o.isContextTag(c,i))return o.getIdxbyListEx(t,s[u],r,n);o.isContextTag(c)||a++}return-1},gt.getTLVbyList=function(t,e,r,n){var i=gt,s=i.getIdxbyList(t,e,r,n);return-1==s||s>=t.length?null:i.getTLV(t,s)},gt.getTLVbyListEx=function(t,e,r,n){var i=gt,s=i.getIdxbyListEx(t,e,r,n);return-1==s?null:i.getTLV(t,s)},gt.getVbyList=function(t,e,r,n,i){var s,o,a=gt;return-1==(s=a.getIdxbyList(t,e,r,n))||s>=t.length?null:(o=a.getV(t,s),!0===i&&(o=o.substr(2)),o)},gt.getVbyListEx=function(t,e,r,n,i){var s,o,a=gt;return-1==(s=a.getIdxbyListEx(t,e,r,n))?null:(o=a.getV(t,s),"03"==t.substr(s,2)&&!1!==i&&(o=o.substr(2)),o)},gt.getInt=function(t,e,r){null==r&&(r=-1);try{var n=t.substr(e,2);if("02"!=n&&"03"!=n)return r;var i=gt.getV(t,e);return"02"==n?parseInt(i,16):Qt(i)}catch(t){return r}},gt.getOID=function(t,e,r){null==r&&(r=null);try{return"06"!=t.substr(e,2)?r:Yt(gt.getV(t,e))}catch(t){return r}},gt.getOIDName=function(t,e,r){null==r&&(r=null);try{var n=gt.getOID(t,e,r);if(n==r)return r;var i=ft.asn1.x509.OID.oid2name(n);return""==i?n:i}catch(t){return r}},gt.getString=function(t,e,r){null==r&&(r=null);try{return Ct(gt.getV(t,e))}catch(t){return r}},gt.hextooidstr=function(t){var e=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},r=[],n=t.substr(0,2),i=parseInt(n,16);r[0]=new String(Math.floor(i/40)),r[1]=new String(i%40);for(var s=t.substr(2),o=[],a=0;a<s.length/2;a++)o.push(parseInt(s.substr(2*a,2),16));var u=[],c="";for(a=0;a<o.length;a++)128&o[a]?c+=e((127&o[a]).toString(2),7):(c+=e((127&o[a]).toString(2),7),u.push(new String(parseInt(c,2))),c="");var h=r.join(".");return u.length>0&&(h=h+"."+u.join(".")),h},gt.dump=function(t,e,r,n){var i=gt,s=i.getV,o=i.dump,a=i.getChildIdx,u=t;t instanceof ft.asn1.ASN1Object&&(u=t.tohex());var c=function(t,e){return t.length<=2*e?t:t.substr(0,e)+"..(total "+t.length/2+"bytes).."+t.substr(t.length-e,e)};void 0===e&&(e={ommit_long_octet:32}),void 0===r&&(r=0),void 0===n&&(n="");var h,l=e.ommit_long_octet;if("01"==(h=u.substr(r,2)))return"00"==(f=s(u,r))?n+"BOOLEAN FALSE\n":n+"BOOLEAN TRUE\n";if("02"==h)return n+"INTEGER "+c(f=s(u,r),l)+"\n";if("03"==h){var f=s(u,r);return i.isASN1HEX(f.substr(2))?(b=n+"BITSTRING, encapsulates\n")+o(f.substr(2),e,0,n+" "):n+"BITSTRING "+c(f,l)+"\n"}if("04"==h)return f=s(u,r),i.isASN1HEX(f)?(b=n+"OCTETSTRING, encapsulates\n")+o(f,e,0,n+" "):n+"OCTETSTRING "+c(f,l)+"\n";if("05"==h)return n+"NULL\n";if("06"==h){var p=s(u,r),d=ft.asn1.ASN1Util.oidHexToInt(p),g=ft.asn1.x509.OID.oid2name(d),y=d.replace(/\./g," ");return""!=g?n+"ObjectIdentifier "+g+" ("+y+")\n":n+"ObjectIdentifier ("+y+")\n"}if("0a"==h)return n+"ENUMERATED "+parseInt(s(u,r))+"\n";if("0c"==h)return n+"UTF8String '"+Ft(s(u,r))+"'\n";if("13"==h)return n+"PrintableString '"+Ft(s(u,r))+"'\n";if("14"==h)return n+"TeletexString '"+Ft(s(u,r))+"'\n";if("16"==h)return n+"IA5String '"+Ft(s(u,r))+"'\n";if("17"==h)return n+"UTCTime "+Ft(s(u,r))+"\n";if("18"==h)return n+"GeneralizedTime "+Ft(s(u,r))+"\n";if("1a"==h)return n+"VisualString '"+Ft(s(u,r))+"'\n";if("1e"==h)return n+"BMPString '"+Gt(s(u,r))+"'\n";if("30"==h){if("3000"==u.substr(r,4))return n+"SEQUENCE {}\n";b=n+"SEQUENCE\n";var v=e;if((2==(w=a(u,r)).length||3==w.length)&&"06"==u.substr(w[0],2)&&"04"==u.substr(w[w.length-1],2)){g=i.oidname(s(u,w[0]));var m=JSON.parse(JSON.stringify(e));m.x509ExtName=g,v=m}for(var x=0;x<w.length;x++)b+=o(u,v,w[x],n+" ");return b}if("31"==h){b=n+"SET\n";var w=a(u,r);for(x=0;x<w.length;x++)b+=o(u,e,w[x],n+" ");return b}if(0!=(128&(h=parseInt(h,16)))){var b,S=31&h;if(0!=(32&h)){for(b=n+"["+S+"]\n",w=a(u,r),x=0;x<w.length;x++)b+=o(u,e,w[x],n+" ");return b}return f=s(u,r),gt.isASN1HEX(f)?(b=n+"["+S+"]\n")+o(f,e,0,n+" "):(("68747470"==f.substr(0,8)||"subjectAltName"===e.x509ExtName&&2==S)&&(f=Ft(f)),n+"["+S+"] "+f+"\n")}return n+"UNKNOWN("+h+") "+s(u,r)+"\n"},gt.parse=function(t){var e=gt,r=e.parse,n=e.isASN1HEX,i=e.getV,s=e.getTLV,o=e.getChildIdx,a=ft.asn1,u=a.ASN1Util.oidHexToInt,c=a.x509.OID.oid2name,h=Ft,l=Gt,f=Pt,p={"0c":"utf8str",12:"numstr",13:"prnstr",14:"telstr",16:"ia5str",17:"utctime",18:"gentime","1a":"visstr","1e":"bmpstr",30:"seq",31:"set"},d=t.substr(0,2),g={},y=i(t,0);if("01"==d)return"0101ff"==t?{bool:!0}:{bool:!1};if("02"==d)return{int:{hex:y}};if("03"==d)try{if("00"!=y.substr(0,2))throw"not encap";var v=y.substr(2);if(!n(v))throw"not encap";return{bitstr:{obj:r(v)}}}catch(t){var m=null;return y.length<=10&&(m=ee(y)),null==m?{bitstr:{hex:y}}:{bitstr:{bin:m}}}else if("04"==d)try{if(!n(y))throw"not encap";return{octstr:{obj:r(y)}}}catch(t){return{octstr:{hex:y}}}else{if("05"==d)return{null:""};if("06"==d){var x=u(y),w=c(x);return""==w?{oid:x}:{oid:w}}if("0a"==d)return y.length>4?{enum:{hex:y}}:{enum:parseInt(y,16)};if("30"==d||"31"==d)return g[p[d]]=function(t){for(var e=[],n=o(t,0),i=0;i<n.length;i++){var a=n[i],u=s(t,a),c=r(u);e.push(c)}return e}(t),g;if("14"==d){var b=f(y);return g[p[d]]={str:b},g}if("1e"==d)return b=l(y),g[p[d]]={str:b},g;if(-1!=":0c:12:13:16:17:18:1a:".indexOf(d))return b=h(y),g[p[d]]={str:b},g;if(d.match(/^8[0-9]$/))return null==(b=h(y))|""==b||null!=b.match(/[\x00-\x1F\x7F-\x9F]/)||null!=b.match(/[\u0000-\u001F\u0080\u009F]/)?{tag:{tag:d,explicit:!1,hex:y}}:{tag:{tag:d,explicit:!1,str:b}};if(!d.match(/^a[0-9]$/)){var S=new ft.asn1.ASN1Object;return S.hV=y,{asn1:{tlv:d+S.getLengthHexFromValue()+y}}}try{if(!n(y))throw new Error("not encap");return{tag:{tag:d,explicit:!0,obj:r(y)}}}catch(t){return{tag:{tag:d,explicit:!0,hex:y}}}}},gt.isContextTag=function(t,e){var r,n;t=t.toLowerCase();try{r=parseInt(t,16)}catch(t){return-1}if(void 0===e)return 128==(192&r);try{return null!=e.match(/^\[[0-9]+\]$/)&&!((n=parseInt(e.substr(1,e.length-1),10))>31)&&128==(192&r)&&(31&r)==n}catch(t){return!1}},gt.isASN1HEX=function(t){var e=gt;if(t.length%2==1)return!1;var r=e.getVblen(t,0),n=t.substr(0,2),i=e.getL(t,0);return t.length-n.length-i.length==2*r},gt.checkStrictDER=function(t,e,r,n,i){var s=gt;if(void 0===r){if("string"!=typeof t)throw new Error("not hex string");if(t=t.toLowerCase(),!ft.lang.String.isHex(t))throw new Error("not hex string");r=t.length,i=(n=t.length/2)<128?1:Math.ceil(n.toString(16))+1}if(s.getL(t,e).length>2*i)throw new Error("L of TLV too long: idx="+e);var o=s.getVblen(t,e);if(o>n)throw new Error("value of L too long than hex: idx="+e);var a=s.getTLV(t,e),u=a.length-2-s.getL(t,e).length;if(u!==2*o)throw new Error("V string length and L's value not the same:"+u+"/"+2*o);if(0===e&&t.length!=a.length)throw new Error("total length and TLV length unmatch:"+t.length+"!="+a.length);var c=t.substr(e,2);if("02"===c){var h=s.getVidx(t,e);if("00"==t.substr(h,2)&&t.charCodeAt(h+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(c,16)){for(var l=s.getVblen(t,e),f=0,p=s.getChildIdx(t,e),d=0;d<p.length;d++)f+=s.getTLV(t,p[d]).length,s.checkStrictDER(t,p[d],r,n,i);if(2*l!=f)throw new Error("sum of children's TLV length and L unmatch: "+2*l+"!="+f)}},gt.oidname=function(t){var e=ft.asn1;ft.lang.String.isHex(t)&&(t=e.ASN1Util.oidHexToInt(t));var r=e.x509.OID.oid2name(t);return""===r&&(r=t),r},void 0!==ft&&ft||(ft={}),void 0!==ft.asn1&&ft.asn1||(ft.asn1={}),void 0!==ft.asn1.x509&&ft.asn1.x509||(ft.asn1.x509={}),ft.asn1.x509.Certificate=function(t){ft.asn1.x509.Certificate.superclass.constructor.call(this);var e=ft.asn1,r=e.DERBitString,n=e.DERSequence,i=e.x509,s=i.TBSCertificate,o=i.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(t){this.params=t},this.sign=function(){var t=this.params,e=t.sigalg;null!=t.sigalg.name&&(e=t.sigalg.name);var r=t.tbsobj.tohex(),n=new ft.crypto.Signature({alg:e});n.init(t.cakey),n.updateHex(r),t.sighex=n.sign()},this.getPEM=function(){return Nt(this.tohex(),"CERTIFICATE")},this.tohex=function(){var t=this.params;if(null!=t.tbsobj&&null!=t.tbsobj||(t.tbsobj=new s(t)),null==t.sighex&&null!=t.cakey&&this.sign(),null==t.sighex)throw new Error("sighex or cakey parameter not defined");var e=[];return e.push(t.tbsobj),e.push(new o({name:t.sigalg})),e.push(new r({hex:"00"+t.sighex})),new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&(this.params=t)},ie(ft.asn1.x509.Certificate,ft.asn1.ASN1Object),ft.asn1.x509.TBSCertificate=function(t){ft.asn1.x509.TBSCertificate.superclass.constructor.call(this);var e=ft.asn1,r=e.x509,n=e.DERTaggedObject,i=e.DERInteger,s=e.DERSequence,o=r.AlgorithmIdentifier,a=r.Time,u=r.X500Name,c=r.Extensions,h=r.SubjectPublicKeyInfo;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=[],e=this.params;if(null!=e.version||1!=e.version){var r=2;null!=e.version&&(r=e.version-1);var l=new n({obj:new i({int:r})});t.push(l)}return t.push(new i(e.serial)),t.push(new o({name:e.sigalg})),t.push(new u(e.issuer)),t.push(new s({array:[new a(e.notbefore),new a(e.notafter)]})),t.push(new u(e.subject)),t.push(new h(se.getKey(e.sbjpubkey))),void 0!==e.ext&&e.ext.length>0&&t.push(new n({tag:"a3",obj:new c(e.ext)})),new ft.asn1.DERSequence({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},ie(ft.asn1.x509.TBSCertificate,ft.asn1.ASN1Object),ft.asn1.x509.Extensions=function(t){ft.asn1.x509.Extensions.superclass.constructor.call(this);var e=ft.asn1,r=e.DERSequence,n=e.x509;this.aParam=[],this.setByParam=function(t){this.aParam=t},this.tohex=function(){for(var t=[],e=0;e<this.aParam.length;e++){var i=this.aParam[e],s=i.extname,o=null;if(null!=i.extn)o=new n.PrivateExtension(i);else if("subjectKeyIdentifier"==s)o=new n.SubjectKeyIdentifier(i);else if("keyUsage"==s)o=new n.KeyUsage(i);else if("subjectAltName"==s)o=new n.SubjectAltName(i);else if("issuerAltName"==s)o=new n.IssuerAltName(i);else if("basicConstraints"==s)o=new n.BasicConstraints(i);else if("nameConstraints"==s)o=new n.NameConstraints(i);else if("cRLDistributionPoints"==s)o=new n.CRLDistributionPoints(i);else if("certificatePolicies"==s)o=new n.CertificatePolicies(i);else if("policyMappings"==s)o=new n.PolicyMappings(i);else if("policyConstraints"==s)o=new n.PolicyConstraints(i);else if("inhibitAnyPolicy"==s)o=new n.InhibitAnyPolicy(i);else if("authorityKeyIdentifier"==s)o=new n.AuthorityKeyIdentifier(i);else if("extKeyUsage"==s)o=new n.ExtKeyUsage(i);else if("authorityInfoAccess"==s)o=new n.AuthorityInfoAccess(i);else if("cRLNumber"==s)o=new n.CRLNumber(i);else if("cRLReason"==s)o=new n.CRLReason(i);else if("ocspNonce"==s)o=new n.OCSPNonce(i);else if("ocspNoCheck"==s)o=new n.OCSPNoCheck(i);else if("adobeTimeStamp"==s)o=new n.AdobeTimeStamp(i);else{if("subjectDirectoryAttributes"!=s)throw new Error("extension not supported:"+JSON.stringify(i));o=new n.SubjectDirectoryAttributes(i)}null!=o&&t.push(o)}return new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.x509.Extensions,ft.asn1.ASN1Object),ft.asn1.x509.Extension=function(t){ft.asn1.x509.Extension.superclass.constructor.call(this);var e=ft.asn1,r=e.DERObjectIdentifier,n=e.DEROctetString,i=(e.DERBitString,e.DERBoolean),s=e.DERSequence;this.tohex=function(){var t=new r({oid:this.oid}),e=new n({hex:this.getExtnValueHex()}),o=new Array;return o.push(t),this.critical&&o.push(new i),o.push(e),new s({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.critical=!1,void 0!==t&&void 0!==t.critical&&(this.critical=t.critical)},ie(ft.asn1.x509.Extension,ft.asn1.ASN1Object),ft.asn1.x509.KeyUsage=function(t){ft.asn1.x509.KeyUsage.superclass.constructor.call(this,t);var e=Error,r={digitalSignature:0,nonRepudiation:1,keyEncipherment:2,dataEncipherment:3,keyAgreement:4,keyCertSign:5,cRLSign:6,encipherOnly:7,decipherOnly:8};this.getExtnValueHex=function(){var t=this.getBinValue();return this.asn1ExtnValue=new ft.asn1.DERBitString({bin:t}),this.asn1ExtnValue.tohex()},this.getBinValue=function(){var t=this.params;if("object"!=typeof t||"object"!=typeof t.names&&"string"!=typeof t.bin)throw new e("parameter not yet set");if(null!=t.names)return re(t.names,r);if(null!=t.bin)return t.bin;throw new e("parameter not set properly")},this.oid="2.5.29.15",void 0!==t&&(this.params=t)},ie(ft.asn1.x509.KeyUsage,ft.asn1.x509.Extension),ft.asn1.x509.BasicConstraints=function(t){ft.asn1.x509.BasicConstraints.superclass.constructor.call(this,t);var e=ft.asn1,r=e.DERBoolean,n=e.DERInteger,i=e.DERSequence;this.getExtnValueHex=function(){var t=new Array;this.cA&&t.push(new r),this.pathLen>-1&&t.push(new n({int:this.pathLen}));var e=new i({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.tohex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==t&&(void 0!==t.cA&&(this.cA=t.cA),void 0!==t.pathLen&&(this.pathLen=t.pathLen))},ie(ft.asn1.x509.BasicConstraints,ft.asn1.x509.Extension),ft.asn1.x509.CRLDistributionPoints=function(t){ft.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,t);var e=ft.asn1,r=e.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.setByDPArray=function(t){for(var n=[],i=0;i<t.length;i++)if(t[i]instanceof ft.asn1.ASN1Object)n.push(t[i]);else{var s=new r.DistributionPoint(t[i]);n.push(s)}this.asn1ExtnValue=new e.DERSequence({array:n})},this.setByOneURI=function(t){var e=new r.DistributionPoint({fulluri:t});this.setByDPArray([e])},this.oid="2.5.29.31",void 0!==t&&(void 0!==t.array?this.setByDPArray(t.array):void 0!==t.uri&&this.setByOneURI(t.uri))},ie(ft.asn1.x509.CRLDistributionPoints,ft.asn1.x509.Extension),ft.asn1.x509.DistributionPoint=function(t){ft.asn1.x509.DistributionPoint.superclass.constructor.call(this);var e=ft.asn1,r=e.x509.DistributionPointName;this.tohex=function(){var t=new e.DERSequence;if(null!=this.asn1DP){var r=new e.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});t.appendASN1Object(r)}return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.dpobj?this.asn1DP=t.dpobj:void 0!==t.dpname?this.asn1DP=new r(t.dpname):void 0!==t.fulluri&&(this.asn1DP=new r({full:[{uri:t.fulluri}]})))},ie(ft.asn1.x509.DistributionPoint,ft.asn1.ASN1Object),ft.asn1.x509.DistributionPointName=function(t){ft.asn1.x509.DistributionPointName.superclass.constructor.call(this);var e=ft.asn1,r=e.DERTaggedObject;if(this.tohex=function(){if("full"!=this.type)throw new Error("currently type shall be 'full': "+this.type);return this.asn1Obj=new r({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t)if(e.x509.GeneralNames.prototype.isPrototypeOf(t))this.type="full",this.tag="a0",this.asn1V=t;else{if(void 0===t.full)throw new Error("This class supports GeneralNames only as argument");this.type="full",this.tag="a0",this.asn1V=new e.x509.GeneralNames(t.full)}},ie(ft.asn1.x509.DistributionPointName,ft.asn1.ASN1Object),ft.asn1.x509.CertificatePolicies=function(t){ft.asn1.x509.CertificatePolicies.superclass.constructor.call(this,t);var e=ft.asn1,r=e.x509,n=e.DERSequence,i=r.PolicyInformation;this.params=null,this.getExtnValueHex=function(){for(var t=[],e=0;e<this.params.array.length;e++)t.push(new i(this.params.array[e]));var r=new n({array:t});return this.asn1ExtnValue=r,this.asn1ExtnValue.tohex()},this.oid="2.5.29.32",void 0!==t&&(this.params=t)},ie(ft.asn1.x509.CertificatePolicies,ft.asn1.x509.Extension),ft.asn1.x509.PolicyInformation=function(t){ft.asn1.x509.PolicyInformation.superclass.constructor.call(this,t);var e=ft.asn1,r=e.DERSequence,n=e.DERObjectIdentifier,i=e.x509.PolicyQualifierInfo;this.params=null,this.tohex=function(){if(void 0===this.params.policyoid&&void 0===this.params.array)throw new Error("parameter oid and array missing");var t=[new n(this.params.policyoid)];if(void 0!==this.params.array){for(var e=[],s=0;s<this.params.array.length;s++)e.push(new i(this.params.array[s]));e.length>0&&t.push(new r({array:e}))}return new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},ie(ft.asn1.x509.PolicyInformation,ft.asn1.ASN1Object),ft.asn1.x509.PolicyQualifierInfo=function(t){ft.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,t);var e=ft.asn1,r=e.DERSequence,n=e.DERIA5String,i=e.DERObjectIdentifier,s=e.x509.UserNotice;this.params=null,this.tohex=function(){return void 0!==this.params.cps?new r({array:[new i({oid:"1.3.6.1.5.5.7.2.1"}),new n({str:this.params.cps})]}).tohex():null!=this.params.unotice?new r({array:[new i({oid:"1.3.6.1.5.5.7.2.2"}),new s(this.params.unotice)]}).tohex():void 0},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},ie(ft.asn1.x509.PolicyQualifierInfo,ft.asn1.ASN1Object),ft.asn1.x509.UserNotice=function(t){ft.asn1.x509.UserNotice.superclass.constructor.call(this,t);var e=ft.asn1.DERSequence,r=(ft.asn1.DERInteger,ft.asn1.x509.DisplayText),n=ft.asn1.x509.NoticeReference;this.params=null,this.tohex=function(){var t=[];return void 0!==this.params.noticeref&&t.push(new n(this.params.noticeref)),void 0!==this.params.exptext&&t.push(new r(this.params.exptext)),new e({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},ie(ft.asn1.x509.UserNotice,ft.asn1.ASN1Object),ft.asn1.x509.NoticeReference=function(t){ft.asn1.x509.NoticeReference.superclass.constructor.call(this,t);var e=ft.asn1.DERSequence,r=ft.asn1.DERInteger,n=ft.asn1.x509.DisplayText;this.params=null,this.tohex=function(){var t=[];if(void 0!==this.params.org&&t.push(new n(this.params.org)),void 0!==this.params.noticenum){for(var i=[],s=this.params.noticenum,o=0;o<s.length;o++)i.push(new r(s[o]));t.push(new e({array:i}))}if(0==t.length)throw new Error("parameter is empty");return new e({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},ie(ft.asn1.x509.NoticeReference,ft.asn1.ASN1Object),ft.asn1.x509.DisplayText=function(t){ft.asn1.x509.DisplayText.superclass.constructor.call(this,t),this.hT="0c",void 0!==t&&("ia5"===t.type?this.hT="16":"vis"===t.type?this.hT="1a":"bmp"===t.type&&(this.hT="1e"))},ie(ft.asn1.x509.DisplayText,ft.asn1.DERAbstractString),ft.asn1.x509.PolicyMappings=function(t){ft.asn1.x509.PolicyMappings.superclass.constructor.call(this,t);var e=ft.asn1,r=(e.x509,e.ASN1Util.newObject);this.params=null,this.getExtnValueHex=function(){for(var t=this.params,e=[],n=0;n<t.array.length;n++){var i=t.array[n];e.push({seq:[{oid:i[0]},{oid:i[1]}]})}return this.asn1ExtnValue=r({seq:e}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.33",void 0!==t&&(this.params=t)},ie(ft.asn1.x509.PolicyMappings,ft.asn1.x509.Extension),ft.asn1.x509.PolicyConstraints=function(t){ft.asn1.x509.PolicyConstraints.superclass.constructor.call(this,t);var e=ft.asn1,r=(e.x509,e.ASN1Util.newObject);this.params=null,this.getExtnValueHex=function(){var t=this.params,e=[];return null!=t.reqexp&&e.push({tag:{tagi:"80",obj:{int:t.reqexp}}}),null!=t.inhibit&&e.push({tag:{tagi:"81",obj:{int:t.inhibit}}}),this.asn1ExtnValue=r({seq:e}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.36",void 0!==t&&(this.params=t)},ie(ft.asn1.x509.PolicyConstraints,ft.asn1.x509.Extension),ft.asn1.x509.InhibitAnyPolicy=function(t){ft.asn1.x509.InhibitAnyPolicy.superclass.constructor.call(this,t);var e=ft.asn1,r=(e.x509,e.ASN1Util.newObject);this.params=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=r({int:this.params.skip}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.54",void 0!==t&&(this.params=t)},ie(ft.asn1.x509.InhibitAnyPolicy,ft.asn1.x509.Extension),ft.asn1.x509.NameConstraints=function(t){ft.asn1.x509.NameConstraints.superclass.constructor.call(this,t);var e=ft.asn1,r=e.x509,n=e.ASN1Util.newObject,i=r.GeneralSubtree;this.params=null,this.getExtnValueHex=function(){var t=this.params,e=[];if(null!=t.permit&&null!=t.permit.length){for(var r=[],s=0;s<t.permit.length;s++)r.push(new i(t.permit[s]));e.push({tag:{tagi:"a0",obj:{seq:r}}})}if(null!=t.exclude&&null!=t.exclude.length){var o=[];for(s=0;s<t.exclude.length;s++)o.push(new i(t.exclude[s]));e.push({tag:{tagi:"a1",obj:{seq:o}}})}return this.asn1ExtnValue=n({seq:e}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.30",void 0!==t&&(this.params=t)},ie(ft.asn1.x509.NameConstraints,ft.asn1.x509.Extension),ft.asn1.x509.GeneralSubtree=function(t){ft.asn1.x509.GeneralSubtree.superclass.constructor.call(this);var e=ft.asn1,r=e.x509.GeneralName,n=e.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params,e=[new r(t)];return null!=t.min&&e.push({tag:{tagi:"80",obj:{int:t.min}}}),null!=t.max&&e.push({tag:{tagi:"81",obj:{int:t.max}}}),n({seq:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},ie(ft.asn1.x509.GeneralSubtree,ft.asn1.ASN1Object),ft.asn1.x509.ExtKeyUsage=function(t){ft.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,t);var e=ft.asn1;this.setPurposeArray=function(t){this.asn1ExtnValue=new e.DERSequence;for(var r=0;r<t.length;r++){var n=new e.DERObjectIdentifier(t[r]);this.asn1ExtnValue.appendASN1Object(n)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.37",void 0!==t&&void 0!==t.array&&this.setPurposeArray(t.array)},ie(ft.asn1.x509.ExtKeyUsage,ft.asn1.x509.Extension),ft.asn1.x509.AuthorityKeyIdentifier=function(t){ft.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,t);var e=ft,r=e.asn1,n=r.DERTaggedObject,i=r.x509.GeneralNames;e.crypto.Util.isKey,this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var t=new Array;this.asn1KID&&t.push(new n({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&t.push(new n({explicit:!1,tag:"a1",obj:new i([{dn:this.asn1CertIssuer}])})),this.asn1CertSN&&t.push(new n({explicit:!1,tag:"82",obj:this.asn1CertSN}));var e=new r.DERSequence({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(t){if(void 0!==t.str||void 0!==t.hex)this.asn1KID=new ft.asn1.DEROctetString(t);else if("object"==typeof t&&ft.crypto.Util.isKey(t)||"string"==typeof t&&-1!=t.indexOf("BEGIN ")){var e=t;"string"==typeof t&&(e=se.getKey(t));var r=se.getKeyID(e);this.asn1KID=new ft.asn1.DEROctetString({hex:r})}},this.setCertIssuerByParam=function(t){void 0!==t.str||void 0!==t.ldapstr||void 0!==t.hex||void 0!==t.certsubject||void 0!==t.certissuer?this.asn1CertIssuer=new ft.asn1.x509.X500Name(t):"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&-1!=t.indexOf("CERTIFICATE")&&(this.asn1CertIssuer=new ft.asn1.x509.X500Name({certissuer:t}))},this.setCertSNByParam=function(t){if(void 0!==t.str||void 0!==t.bigint||void 0!==t.hex)this.asn1CertSN=new ft.asn1.DERInteger(t);else if("string"==typeof t&&-1!=t.indexOf("BEGIN ")&&t.indexOf("CERTIFICATE")){var e=new ce;e.readCertPEM(t);var r=e.getSerialNumberHex();this.asn1CertSN=new ft.asn1.DERInteger({hex:r})}},this.oid="2.5.29.35",void 0!==t&&(void 0!==t.kid&&this.setKIDByParam(t.kid),void 0!==t.issuer&&this.setCertIssuerByParam(t.issuer),void 0!==t.sn&&this.setCertSNByParam(t.sn),void 0!==t.issuersn&&"string"==typeof t.issuersn&&-1!=t.issuersn.indexOf("BEGIN ")&&t.issuersn.indexOf("CERTIFICATE")&&(this.setCertSNByParam(t.issuersn),this.setCertIssuerByParam(t.issuersn)))},ie(ft.asn1.x509.AuthorityKeyIdentifier,ft.asn1.x509.Extension),ft.asn1.x509.SubjectKeyIdentifier=function(t){ft.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,t);var e=ft.asn1.DEROctetString;this.asn1KID=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=this.asn1KID,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(t){if(void 0!==t.str||void 0!==t.hex)this.asn1KID=new e(t);else if("object"==typeof t&&ft.crypto.Util.isKey(t)||"string"==typeof t&&-1!=t.indexOf("BEGIN")){var r=t;"string"==typeof t&&(r=se.getKey(t));var n=se.getKeyID(r);this.asn1KID=new ft.asn1.DEROctetString({hex:n})}},this.oid="2.5.29.14",void 0!==t&&void 0!==t.kid&&this.setKIDByParam(t.kid)},ie(ft.asn1.x509.SubjectKeyIdentifier,ft.asn1.x509.Extension),ft.asn1.x509.AuthorityInfoAccess=function(t){ft.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,t),this.setAccessDescriptionArray=function(t){for(var e=new Array,r=ft.asn1,n=r.DERSequence,i=r.DERObjectIdentifier,s=r.x509.GeneralName,o=0;o<t.length;o++){var a,u=t[o];if(void 0!==u.ocsp)a=new n({array:[new i({oid:"1.3.6.1.5.5.7.48.1"}),new s({uri:u.ocsp})]});else{if(void 0===u.caissuer)throw new Error("unknown AccessMethod parameter: "+JSON.stringify(u));a=new n({array:[new i({oid:"1.3.6.1.5.5.7.48.2"}),new s({uri:u.caissuer})]})}e.push(a)}this.asn1ExtnValue=new n({array:e})},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.1.1",void 0!==t&&void 0!==t.array&&this.setAccessDescriptionArray(t.array)},ie(ft.asn1.x509.AuthorityInfoAccess,ft.asn1.x509.Extension),ft.asn1.x509.SubjectAltName=function(t){ft.asn1.x509.SubjectAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new ft.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.17",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},ie(ft.asn1.x509.SubjectAltName,ft.asn1.x509.Extension),ft.asn1.x509.IssuerAltName=function(t){ft.asn1.x509.IssuerAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new ft.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.18",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},ie(ft.asn1.x509.IssuerAltName,ft.asn1.x509.Extension),ft.asn1.x509.SubjectDirectoryAttributes=function(t){ft.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,t);var e=ft.asn1,r=e.DERSequence,n=e.ASN1Util.newObject,i=e.x509.OID.name2oid;this.params=null,this.getExtnValueHex=function(){for(var t=[],e=0;e<this.params.array.length;e++){var s=this.params.array[e];if(null==s.attr||null==s.array){var o={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if("dateOfBirth"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={gentime:s.str};else if("placeOfBirth"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={utf8str:s.str};else if("gender"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={prnstr:s.str};else if("countryOfCitizenship"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={prnstr:s.str};else{if("countryOfResidence"!=s.attr)throw new Error("unsupported attribute: "+s.attr);o.seq[0].oid=i(s.attr),o.seq[1].set[0]={prnstr:s.str}}t.push(new n(o))}else{var a={seq:[{oid:s.attr},{set:s.array}]};t.push(n(a))}}var u=new r({array:t});return this.asn1ExtnValue=u,this.asn1ExtnValue.tohex()},this.oid="2.5.29.9",void 0!==t&&(this.params=t)},ie(ft.asn1.x509.SubjectDirectoryAttributes,ft.asn1.x509.Extension),ft.asn1.x509.PrivateExtension=function(t){ft.asn1.x509.PrivateExtension.superclass.constructor.call(this,t);var e=ft,r=e.lang.String.isHex,n=e.asn1,i=n.x509.OID.name2oid,s=n.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.oid=i(t.extname),this.params=t},this.getExtnValueHex=function(){if(null==this.params.extname||null==this.params.extn)throw new Error("extname or extnhex not specified");var t=this.params.extn;if("string"==typeof t&&r(t))return t;if("object"==typeof t)try{return s(t).tohex()}catch(t){}throw new Error("unsupported extn value")},null!=t&&this.setByParam(t)},ie(ft.asn1.x509.PrivateExtension,ft.asn1.x509.Extension),ft.asn1.x509.CRL=function(t){ft.asn1.x509.CRL.superclass.constructor.call(this);var e=ft.asn1,r=e.DERSequence,n=e.DERBitString,i=e.x509,s=i.AlgorithmIdentifier,o=i.TBSCertList;this.params=void 0,this.setByParam=function(t){this.params=t},this.sign=function(){var t=new o(this.params).tohex(),e=new ft.crypto.Signature({alg:this.params.sigalg});e.init(this.params.cakey),e.updateHex(t);var r=e.sign();this.params.sighex=r},this.getPEM=function(){return Nt(this.tohex(),"X509 CRL")},this.tohex=function(){var t=this.params;if(null==t.tbsobj&&(t.tbsobj=new o(t)),null==t.sighex&&null!=t.cakey&&this.sign(),null==t.sighex)throw new Error("sighex or cakey parameter not defined");var e=[];return e.push(t.tbsobj),e.push(new s({name:t.sigalg})),e.push(new n({hex:"00"+t.sighex})),new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&(this.params=t)},ie(ft.asn1.x509.CRL,ft.asn1.ASN1Object),ft.asn1.x509.TBSCertList=function(t){ft.asn1.x509.TBSCertList.superclass.constructor.call(this);var e=ft.asn1,r=e.DERInteger,n=e.DERSequence,i=e.DERTaggedObject,s=(e.DERObjectIdentifier,e.x509),o=s.AlgorithmIdentifier,a=s.Time,u=s.Extensions,c=s.X500Name;this.params=null,this.setByParam=function(t){this.params=t},this.getRevCertSequence=function(){for(var t=[],e=this.params.revcert,i=0;i<e.length;i++){var s=[new r(e[i].sn),new a(e[i].date)];null!=e[i].ext&&s.push(new u(e[i].ext)),t.push(new n({array:s}))}return new n({array:t})},this.tohex=function(){var t=[],e=this.params;if(null!=e.version){var s=e.version-1,h=new r({int:s});t.push(h)}if(t.push(new o({name:e.sigalg})),t.push(new c(e.issuer)),t.push(new a(e.thisupdate)),null!=e.nextupdate&&t.push(new a(e.nextupdate)),null!=e.revcert&&t.push(this.getRevCertSequence()),null!=e.ext){var l=new u(e.ext);t.push(new i({tag:"a0",explicit:!0,obj:l}))}return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},ie(ft.asn1.x509.TBSCertList,ft.asn1.ASN1Object),ft.asn1.x509.CRLEntry=function(t){ft.asn1.x509.CRLEntry.superclass.constructor.call(this);var e=ft.asn1;this.setCertSerial=function(t){this.sn=new e.DERInteger(t)},this.setRevocationDate=function(t){this.time=new e.x509.Time(t)},this.tohex=function(){var t=new e.DERSequence({array:[this.sn,this.time]});return this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.time&&this.setRevocationDate(t.time),void 0!==t.sn&&this.setCertSerial(t.sn))},ie(ft.asn1.x509.CRLEntry,ft.asn1.ASN1Object),ft.asn1.x509.CRLNumber=function(t){ft.asn1.x509.CRLNumber.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ft.asn1.DERInteger(this.params.num),this.asn1ExtnValue.tohex()},this.oid="2.5.29.20",null!=t&&(this.params=t)},ie(ft.asn1.x509.CRLNumber,ft.asn1.x509.Extension),ft.asn1.x509.CRLReason=function(t){ft.asn1.x509.CRLReason.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ft.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.tohex()},this.oid="2.5.29.21",null!=t&&(this.params=t)},ie(ft.asn1.x509.CRLReason,ft.asn1.x509.Extension),ft.asn1.x509.OCSPNonce=function(t){ft.asn1.x509.OCSPNonce.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ft.asn1.DEROctetString(this.params),this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.2",null!=t&&(this.params=t)},ie(ft.asn1.x509.OCSPNonce,ft.asn1.x509.Extension),ft.asn1.x509.OCSPNoCheck=function(t){ft.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ft.asn1.DERNull,this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.5",null!=t&&(this.params=t)},ie(ft.asn1.x509.OCSPNoCheck,ft.asn1.x509.Extension),ft.asn1.x509.AdobeTimeStamp=function(t){ft.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,t);var e=ft.asn1,r=e.DERInteger,n=e.DERBoolean,i=e.DERSequence,s=e.x509.GeneralName;this.params=null,this.getExtnValueHex=function(){var t=this.params,e=[new r(1)];return e.push(new s({uri:t.uri})),null!=t.reqauth&&e.push(new n(t.reqauth)),this.asn1ExtnValue=new i({array:e}),this.asn1ExtnValue.tohex()},this.oid="1.2.840.113583.1.1.9.1",void 0!==t&&this.setByParam(t)},ie(ft.asn1.x509.AdobeTimeStamp,ft.asn1.x509.Extension),ft.asn1.x509.X500Name=function(t){ft.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var e=ft.asn1,r=e.x509,n=r.RDN;this.setByString=function(t,e){void 0!==e&&(this.sRule=e);var r=t.split("/");r.shift();for(var i=[],s=0;s<r.length;s++)if(r[s].match(/^[^=]+=.+$/))i.push(r[s]);else{var o=i.length-1;i[o]=i[o]+"/"+r[s]}for(s=0;s<i.length;s++)this.asn1Array.push(new n({str:i[s],rule:this.sRule}))},this.setByLdapString=function(t,e){void 0!==e&&(this.sRule=e);var n=r.X500Name.ldapToCompat(t);this.setByString(n,e)},this.setByObject=function(t,e){for(var r in void 0!==e&&(this.sRule=e),t)if(t.hasOwnProperty(r)){var i=new n({str:r+"="+t[r],rule:this.sRule});this.asn1Array?this.asn1Array.push(i):this.asn1Array=[i]}},this.setByParam=function(t){var e;void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.array?this.paramArray=t.array:void 0!==t.str?this.setByString(t.str):void 0!==t.ldapstr?this.setByLdapString(t.ldapstr):void 0!==t.hex?this.hTLV=t.hex:void 0!==t.certissuer?((e=new ce).readCertPEM(t.certissuer),this.hTLV=e.getIssuerHex()):void 0!==t.certsubject?((e=new ce).readCertPEM(t.certsubject),this.hTLV=e.getSubjectHex()):"object"==typeof t&&void 0===t.certsubject&&void 0===t.certissuer&&this.setByObject(t)},this.tohex=function(){if("string"==typeof this.hTLV)return this.hTLV;if(0==this.asn1Array.length&&this.paramArray.length>0)for(var t=0;t<this.paramArray.length;t++){var r={array:this.paramArray[t]};"utf8"!=this.sRule&&(r.rule=this.sRule);var i=new n(r);this.asn1Array.push(i)}var s=new e.DERSequence({array:this.asn1Array});return this.hTLV=s.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},ie(ft.asn1.x509.X500Name,ft.asn1.ASN1Object),ft.asn1.x509.X500Name.compatToLDAP=function(t){if("/"!==t.substr(0,1))throw"malformed input";var e=(t=t.substr(1)).split("/");return e.reverse(),(e=e.map(function(t){return t.replace(/,/,"\\,")})).join(",")},ft.asn1.x509.X500Name.onelineToLDAP=function(t){return ft.asn1.x509.X500Name.compatToLDAP(t)},ft.asn1.x509.X500Name.ldapToCompat=function(t){for(var e=t.split(","),r=!1,n=[],i=0;e.length>0;i++){var s=e.shift();if(!0===r){var o=(n.pop()+","+s).replace(/\\,/g,",");n.push(o),r=!1}else n.push(s);"\\"===s.substr(-1,1)&&(r=!0)}return(n=n.map(function(t){return t.replace("/","\\/")})).reverse(),"/"+n.join("/")},ft.asn1.x509.X500Name.ldapToOneline=function(t){return ft.asn1.x509.X500Name.ldapToCompat(t)},ft.asn1.x509.RDN=function(t){ft.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var e=ft.asn1.x509.AttributeTypeAndValue;this.setByParam=function(t){void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.str&&this.addByMultiValuedString(t.str),void 0!==t.array&&(this.paramArray=t.array)},this.addByString=function(t){this.asn1Array.push(new ft.asn1.x509.AttributeTypeAndValue({str:t,rule:this.sRule}))},this.addByMultiValuedString=function(t){for(var e=ft.asn1.x509.RDN.parseString(t),r=0;r<e.length;r++)this.addByString(e[r])},this.tohex=function(){if(0==this.asn1Array.length&&this.paramArray.length>0)for(var t=0;t<this.paramArray.length;t++){var r=this.paramArray[t];void 0!==r.rule&&"utf8"!=this.sRule&&(r.rule=this.sRule);var n=new e(r);this.asn1Array.push(n)}var i=new ft.asn1.DERSet({array:this.asn1Array});return this.TLV=i.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},ie(ft.asn1.x509.RDN,ft.asn1.ASN1Object),ft.asn1.x509.RDN.parseString=function(t){for(var e=t.split(/\+/),r=!1,n=[],i=0;e.length>0;i++){var s=e.shift();if(!0===r){var o=(n.pop()+"+"+s).replace(/\\\+/g,"+");n.push(o),r=!1}else n.push(s);"\\"===s.substr(-1,1)&&(r=!0)}var a=!1,u=[];for(i=0;n.length>0;i++){if(s=n.shift(),!0===a){var c=u.pop();s.match(/"$/)?(o=(c+"+"+s).replace(/^([^=]+)="(.*)"$/,"$1=$2"),u.push(o),a=!1):u.push(c+"+"+s)}else u.push(s);s.match(/^[^=]+="/)&&(a=!0)}return u},ft.asn1.x509.AttributeTypeAndValue=function(t){ft.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var e=ft,r=e.asn1,n=r.DERSequence,i=r.DERUTF8String,s=r.DERPrintableString,o=r.DERTeletexString,a=r.DERIA5String,u=r.DERVisibleString,c=r.DERBMPString,h=e.lang.String.isMail,l=e.lang.String.isPrintable;this.setByParam=function(t){if(void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.ds&&(this.dsType=t.ds),void 0===t.value&&void 0!==t.str){var e=t.str.match(/^([^=]+)=(.+)$/);if(!e)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.sType=e[1],this.sValue=e[2]}else this.sType=t.type,this.sValue=t.value},this.setByString=function(t,e){void 0!==e&&(this.sRule=e);var r=t.match(/^([^=]+)=(.+)$/);if(!r)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.setByAttrTypeAndValueStr(r[1],r[2])},this._getDsType=function(){var t=this.sType,e=this.sValue,r=this.sRule;return"prn"===r?"CN"==t&&h(e)?"ia5":l(e)?"prn":"utf8":"utf8"===r?"CN"==t&&h(e)?"ia5":"C"==t?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(t,e,r){void 0!==r&&(this.sRule=r),this.sType=t,this.sValue=e},this.getValueObj=function(t,e){if("utf8"==t)return new i({str:e});if("prn"==t)return new s({str:e});if("tel"==t)return new o({str:e});if("ia5"==t)return new a({str:e});if("vis"==t)return new u({str:e});if("bmp"==t)return new c({str:e});throw new Error("unsupported directory string type: type="+t+" value="+e)},this.tohex=function(){null==this.dsType&&(this.dsType=this._getDsType());var t=ft.asn1.x509.OID.atype2obj(this.sType),e=this.getValueObj(this.dsType,this.sValue),r=new n({array:[t,e]});return this.TLV=r.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},ie(ft.asn1.x509.AttributeTypeAndValue,ft.asn1.ASN1Object),ft.asn1.x509.SubjectPublicKeyInfo=function(t){ft.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var e=ft,r=e.asn1,n=r.DERInteger,i=r.DERBitString,s=r.DERObjectIdentifier,o=r.DERSequence,a=r.ASN1Util.newObject,u=r.x509.AlgorithmIdentifier,c=e.crypto;c.ECDSA,c.DSA,this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new o({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.tohex=function(){var t=this.getASN1Object();return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.setPubKey=function(t){try{if(t instanceof ot){var e=a({seq:[{int:{bigint:t.n}},{int:{int:t.e}}]}).tohex();this.asn1AlgId=new u({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+e})}}catch(t){}try{if(t instanceof ft.crypto.ECDSA){var r=new s({name:t.curveName});this.asn1AlgId=new u({name:"ecPublicKey",asn1params:r}),this.asn1SubjPKey=new i({hex:"00"+t.pubKeyHex})}}catch(t){}try{if(t instanceof ft.crypto.DSA){r=new a({seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]}),this.asn1AlgId=new u({name:"dsa",asn1params:r});var o=new n({bigint:t.y});this.asn1SubjPKey=new i({hex:"00"+o.tohex()})}}catch(t){}},void 0!==t&&this.setPubKey(t)},ie(ft.asn1.x509.SubjectPublicKeyInfo,ft.asn1.ASN1Object),ft.asn1.x509.Time=function(t){ft.asn1.x509.Time.superclass.constructor.call(this);var e=ft.asn1,r=e.DERUTCTime,n=e.DERGeneralizedTime;this.params=null,this.type=null,this.setTimeParams=function(t){this.timeParams=t},this.setByParam=function(t){this.params=t},this.getType=function(t){return t.match(/^[0-9]{12}Z$/)?"utc":t.match(/^[0-9]{14}Z$/)?"gen":t.match(/^[0-9]{12}\.[0-9]+Z$/)?"utc":t.match(/^[0-9]{14}\.[0-9]+Z$/)?"gen":null},this.tohex=function(){var t=this.params,e=null;if("string"==typeof t&&(t={str:t}),null==t||!t.str||null!=t.type&&null!=t.type||(t.type=this.getType(t.str)),null!=t&&t.str?("utc"==t.type&&(e=new r(t.str)),"gen"==t.type&&(e=new n(t.str))):e="gen"==this.type?new n:new r,null==e)throw new Error("wrong setting for Time");return this.TLV=e.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ft.asn1.x509.Time_bak=function(t){ft.asn1.x509.Time_bak.superclass.constructor.call(this);var e=ft.asn1,r=e.DERUTCTime,n=e.DERGeneralizedTime;this.setTimeParams=function(t){this.timeParams=t},this.tohex=function(){var t=null;return t=null!=this.timeParams?"utc"==this.type?new r(this.timeParams):new n(this.timeParams):"utc"==this.type?new r:new n,this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},this.type="utc",void 0!==t&&(void 0!==t.type?this.type=t.type:void 0!==t.str&&(t.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),t.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=t)},ie(ft.asn1.x509.Time,ft.asn1.ASN1Object),ft.asn1.x509.AlgorithmIdentifier=function(t){ft.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var e=ft.asn1,r=e.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.tohex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw new Error("algorithm not specified");if(null!==this.nameAlg){var t=null;for(var n in r)n===this.nameAlg&&(t=r[n]);if(null!==t)return this.hTLV=t,this.hTLV}null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=e.x509.OID.name2obj(this.nameAlg));var i=[this.asn1Alg];null!==this.asn1Params&&i.push(this.asn1Params);var s=new e.DERSequence({array:i});return this.hTLV=s.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.name&&(this.nameAlg=t.name),void 0!==t.asn1params&&(this.asn1Params=t.asn1params),void 0!==t.paramempty&&(this.paramEmpty=t.paramempty)),null===this.asn1Params&&!1===this.paramEmpty&&null!==this.nameAlg){void 0!==this.nameAlg.name&&(this.nameAlg=this.nameAlg.name);var n=this.nameAlg.toLowerCase();"withdsa"!==n.substr(-7,7)&&"withecdsa"!==n.substr(-9,9)&&(this.asn1Params=new e.DERNull)}},ie(ft.asn1.x509.AlgorithmIdentifier,ft.asn1.ASN1Object),ft.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},ft.asn1.x509.GeneralName=function(t){ft.asn1.x509.GeneralName.superclass.constructor.call(this);var e=ft.asn1,r=e.x509,n=r.X500Name,i=r.OtherName,s=e.DERIA5String,o=(e.DERPrintableString,e.DEROctetString),a=e.DERTaggedObject,u=e.ASN1Object,c=Error;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t,e,r=this.params,h=!1;if(void 0!==r.other)t="a0",e=new i(r.other);else if(void 0!==r.rfc822)t="81",e=new s({str:r.rfc822});else if(void 0!==r.dns)t="82",e=new s({str:r.dns});else if(void 0!==r.dn)t="a4",h=!0,e="string"==typeof r.dn?new n({str:r.dn}):r.dn instanceof ft.asn1.x509.X500Name?r.dn:new n(r.dn);else if(void 0!==r.ldapdn)t="a4",h=!0,e=new n({ldapstr:r.ldapdn});else if(void 0!==r.certissuer||void 0!==r.certsubj){var l,f;t="a4",h=!0;var p=null;if(void 0!==r.certsubj?(l=!1,f=r.certsubj):(l=!0,f=r.certissuer),f.match(/^[0-9A-Fa-f]+$/),-1!=f.indexOf("-----BEGIN ")&&(p=Ot(f)),null==p)throw new Error("certsubj/certissuer not cert");var d,g=new ce;g.hex=p,d=l?g.getIssuerHex():g.getSubjectHex(),(e=new u).hTLV=d}else if(void 0!==r.uri)t="86",e=new s({str:r.uri});else{if(void 0===r.ip)throw new c("improper params");var y;t="87";var v=r.ip;try{if(v.match(/^[0-9a-f]+$/)){var m=v.length;if(8!=m&&16!=m&&32!=m&&64!=m)throw"err";y=v}else y=Mt(v)}catch(t){throw new c("malformed IP address: "+r.ip+":"+t.message)}e=new o({hex:y})}return new a({tag:t,explicit:h,obj:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},ie(ft.asn1.x509.GeneralName,ft.asn1.ASN1Object),ft.asn1.x509.GeneralNames=function(t){ft.asn1.x509.GeneralNames.superclass.constructor.call(this);var e=ft.asn1;this.setByParamArray=function(t){for(var r=0;r<t.length;r++){var n=new e.x509.GeneralName(t[r]);this.asn1Array.push(n)}},this.tohex=function(){return new e.DERSequence({array:this.asn1Array}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.asn1Array=new Array,void 0!==t&&this.setByParamArray(t)},ie(ft.asn1.x509.GeneralNames,ft.asn1.ASN1Object),ft.asn1.x509.OtherName=function(t){ft.asn1.x509.OtherName.superclass.constructor.call(this);var e=ft.asn1,r=e.DERObjectIdentifier,n=e.DERSequence,i=e.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if(null==t.oid||null==t.value)throw new Error("oid or value not specified");var e=new r({oid:t.oid}),s=i({tag:{tag:"a0",explicit:!0,obj:t.value}});return new n({array:[e,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},ie(ft.asn1.x509.OtherName,ft.asn1.ASN1Object),ft.asn1.x509.OID=new function(){var t=ft.asn1.DERObjectIdentifier;this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",policyMappings:"2.5.29.33",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",inhibitAnyPolicy:"2.5.29.54",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",smtpUTF8Mailbox:"1.3.6.1.5.5.7.8.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",secp521r1:"1.3.132.0.35",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1",smimeMailboxLegacy:"2.23.140.1.5.1.1",smimeMailboxMulti:"2.23.140.1.5.1.2",smimeMailboxStrict:"2.23.140.1.5.1.3",smimeOrganizationLegacy:"2.23.140.1.5.2.1",smimeOrganizationMulti:"2.23.140.1.5.2.2",smimeOrganizationStrict:"2.23.140.1.5.2.3",smimeSponsorLegacy:"2.23.140.1.5.3.1",smimeSponsorMulti:"2.23.140.1.5.3.2",smimeSponsorStrict:"2.23.140.1.5.3.3",smimeIndividualLegacy:"2.23.140.1.5.4.1",smimeIndividualMulti:"2.23.140.1.5.4.2",smimeIndividualStrict:"2.23.140.1.5.4.3"},this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",GN:"2.5.4.42",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.objCache={},this.name2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];if(void 0===this.name2oidList[e])throw"Name of ObjectIdentifier not defined: "+e;var r=this.name2oidList[e],n=new t({oid:r});return this.objCache[e]=n,n},this.atype2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];var r;if(e.match(/^\d+\.\d+\.[0-9.]+$/))r=e;else if(void 0!==this.atype2oidList[e])r=this.atype2oidList[e];else{if(void 0===this.name2oidList[e])throw new Error("AttributeType name undefined: "+e);r=this.name2oidList[e]}var n=new t({oid:r});return this.objCache[e]=n,n},this.registerOIDs=function(t){if(this.checkOIDs(t))for(var e in t)this.name2oidList[e]=t[e]},this.checkOIDs=function(t){try{var e=Object.keys(t);return 0!=e.length&&(e.map(function(t,e,r){if(!this[t].match(/^[0-2]\.[0-9.]+$/))throw new Error("value is not OID")},t),!0)}catch(t){return!1}}},ft.asn1.x509.OID.oid2name=function(t){var e=ft.asn1.x509.OID.name2oidList;for(var r in e)if(e[r]==t)return r;return""},ft.asn1.x509.OID.oid2atype=function(t){var e=ft.asn1.x509.OID.atype2oidList;for(var r in e)if(e[r]==t)return r;return t},ft.asn1.x509.OID.name2oid=function(t){if(t.match(/^[0-9.]+$/))return t;var e=ft.asn1.x509.OID.name2oidList;return void 0===e[t]?"":e[t]},ft.asn1.x509.X509Util={},ft.asn1.x509.X509Util.newCertPEM=function(t){var e=ft.asn1.x509;return e.TBSCertificate,new(0,e.Certificate)(t).getPEM()},void 0!==ft&&ft||(ft={}),void 0!==ft.asn1&&ft.asn1||(ft.asn1={}),void 0!==ft.asn1.cms&&ft.asn1.cms||(ft.asn1.cms={}),ft.asn1.cms.Attribute=function(t){var e=Error,r=ft.asn1,n=r.DERSequence,i=r.DERSet,s=r.DERObjectIdentifier;this.params=null,this.typeOid=null,this.setByParam=function(t){this.params=t},this.getValueArray=function(){throw new e("not yet implemented abstract")},this.tohex=function(){var t=new s({oid:this.typeOid}),e=new i({array:this.getValueArray()});return new n({array:[t,e]}).tohex()},this.getEncodedHex=function(){return this.tohex()}},ie(ft.asn1.cms.Attribute,ft.asn1.ASN1Object),ft.asn1.cms.ContentType=function(t){var e=ft.asn1;e.cms.ContentType.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.3",this.getValueArray=function(){return[new e.DERObjectIdentifier(this.params.type)]},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.ContentType,ft.asn1.cms.Attribute),ft.asn1.cms.MessageDigest=function(t){var e=ft.asn1,r=e.DEROctetString;e.cms.MessageDigest.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.4",this.getValueArray=function(){return[new r(this.params)]},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.MessageDigest,ft.asn1.cms.Attribute),ft.asn1.cms.SigningTime=function(t){var e=ft.asn1;e.cms.SigningTime.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.5",this.getValueArray=function(){return[new e.x509.Time(this.params)]},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.SigningTime,ft.asn1.cms.Attribute),ft.asn1.cms.SigningCertificate=function(t){var e=Error,r=ft,n=r.asn1,i=n.DERSequence,s=n.cms,o=s.ESSCertID;r.crypto,s.SigningCertificate.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.12",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new e("parameter 'array' not specified");for(var r=this.params.array,n=[],s=0;s<r.length;s++){var a=r[s];0!=t.hasis||"string"!=typeof a||-1==a.indexOf("-----BEGIN")&&!gt.isASN1HEX(a)||(a={cert:a}),0!=a.hasis&&0==t.hasis&&(a.hasis=!1),n.push(new o(a))}var u=new i({array:n});return[new i({array:[u]})]},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.SigningCertificate,ft.asn1.cms.Attribute),ft.asn1.cms.ESSCertID=function(t){ft.asn1.cms.ESSCertID.superclass.constructor.call(this);var e=Error,r=ft,n=r.asn1,i=n.DEROctetString,s=n.DERSequence,o=n.cms.IssuerSerial;this.params=null,this.getCertHash=function(t,n){if(null!=t.hash)return t.hash;if("string"==typeof t&&-1==t.indexOf("-----BEGIN")&&!gt.isASN1HEX(t))return t;var i,s,o;if("string"==typeof t)i=t;else{if(null==t.cert)throw new e("hash nor cert unspecified");i=t.cert}if(s=-1!=i.indexOf("-----BEGIN")?Ot(i):i,"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?s=Ot(t):gt.isASN1HEX(t)&&(s=t)),null!=t.alg)o=t.alg;else{if(null==n)throw new e("hash alg unspecified");o=n}return r.crypto.Util.hashHex(s,o)},this.tohex=function(){var t=this.params,e=this.getCertHash(t,"sha1"),r=[];return r.push(new i({hex:e})),("string"==typeof t&&-1!=t.indexOf("-----BEGIN")||null!=t.cert&&0!=t.hasis||null!=t.issuer&&null!=t.serial)&&r.push(new o(t)),new s({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.ESSCertID,ft.asn1.ASN1Object),ft.asn1.cms.SigningCertificateV2=function(t){var e=Error,r=ft,n=r.asn1,i=n.DERSequence,s=(n.x509,n.cms),o=s.ESSCertIDv2;r.crypto,s.SigningCertificateV2.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.47",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new e("parameter 'array' not specified");for(var r=this.params.array,n=[],s=0;s<r.length;s++){var a=r[s];null==t.alg&&0!=t.hasis||"string"!=typeof a||-1==a.indexOf("-----BEGIN")&&!gt.isASN1HEX(a)||(a={cert:a}),null==a.alg&&null!=t.alg&&(a.alg=t.alg),0!=a.hasis&&0==t.hasis&&(a.hasis=!1),n.push(new o(a))}var u=new i({array:n});return[new i({array:[u]})]},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.SigningCertificateV2,ft.asn1.cms.Attribute),ft.asn1.cms.ESSCertIDv2=function(t){ft.asn1.cms.ESSCertIDv2.superclass.constructor.call(this),Error;var e=ft.asn1,r=e.DEROctetString,n=e.DERSequence,i=e.cms.IssuerSerial,s=e.x509.AlgorithmIdentifier;this.params=null,this.tohex=function(){var t=this.params,e=this.getCertHash(t,"sha256"),o=[];return null!=t.alg&&"sha256"!=t.alg&&o.push(new s({name:t.alg})),o.push(new r({hex:e})),("string"==typeof t&&-1!=t.indexOf("-----BEGIN")||null!=t.cert&&0!=t.hasis||null!=t.issuer&&null!=t.serial)&&o.push(new i(t)),new n({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.ESSCertIDv2,ft.asn1.cms.ESSCertID),ft.asn1.cms.IssuerSerial=function(t){var e=Error,r=ft.asn1,n=r.DERInteger,i=r.DERSequence,s=r.cms,o=r.x509.GeneralNames,a=ce;s.IssuerSerial.superclass.constructor.call(this),this.setByParam=function(t){this.params=t},this.tohex=function(){var t,r,s=this.params;if("string"==typeof s&&-1!=s.indexOf("-----BEGIN")||null!=s.cert){var u;u=null!=s.cert?s.cert:s;var c=new a;c.readCertPEM(u),t=c.getIssuer(),r={hex:c.getSerialNumberHex()}}else{if(null==s.issuer||!s.serial)throw new e("cert or issuer and serial parameter not specified");t=s.issuer,r=s.serial}var h=new o([{dn:t}]),l=new n(r);return new i({array:[h,l]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.IssuerSerial,ft.asn1.ASN1Object),ft.asn1.cms.SignerIdentifier=function(t){var e=ft.asn1,r=(e.DERInteger,e.DERSequence,e.cms),n=r.IssuerAndSerialNumber,i=r.SubjectKeyIdentifier;e.x509.X500Name,Error,r.SignerIdentifier.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if("isssn"==t.type)return new n(t).tohex();if("skid"==t.type)return new i(t).tohex();throw new Error("wrong property for isssn or skid")},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.SignerIdentifier,ft.asn1.ASN1Object),ft.asn1.cms.IssuerAndSerialNumber=function(t){var e=ft.asn1,r=e.DERInteger,n=e.DERSequence,i=e.cms,s=e.x509.X500Name,o=ce,a=Error;i.IssuerAndSerialNumber.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t,e,i=this.params;if("string"==typeof i&&-1!=i.indexOf("-----BEGIN")||null!=i.cert){var u;u=null!=i.cert?i.cert:i;var c=new o;c.readCertPEM(u),t=c.getIssuer(),e={hex:c.getSerialNumberHex()}}else{if(null==i.issuer||!i.serial)throw new a("cert or issuer and serial parameter not specified");t=i.issuer,e=i.serial}var h=new s(t),l=new r(e);return new n({array:[h,l]}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.IssuerAndSerialNumber,ft.asn1.ASN1Object),ft.asn1.cms.SubjectKeyIdentifier=function(t){var e=ft.asn1,r=(e.DERInteger,e.DERSequence,e.ASN1Util.newObject),n=e.cms,i=(n.IssuerAndSerialName,n.SubjectKeyIdentifier,e.x509.X500Name,ce),s=Error;n.SubjectKeyIdentifier.superclass.constructor.call(this),this.tohex=function(){var t,e=this.params;if(null==e.cert&&null==e.skid)throw new s("property cert nor skid undefined");return null!=e.cert?t=new i(e.cert).getExtSubjectKeyIdentifier().kid.hex:null!=e.skid&&(t=e.skid),r({tag:{tage:"a0",obj:{octstr:{hex:t}}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.SubjectKeyIdentifier,ft.asn1.ASN1Object),ft.asn1.cms.AttributeList=function(t){var e=Error,r=ft.asn1,n=r.DERSet,i=r.cms;i.AttributeList.superclass.constructor.call(this),this.params=null,this.hTLV=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if(null!=this.hTLV)return this.hTLV;var r=!0;null!=t.sortflag&&(r=t.sortflag);for(var s=t.array,o=[],a=0;a<s.length;a++){var u=s[a],c=u.attr;if("contentType"==c)o.push(new i.ContentType(u));else if("messageDigest"==c)o.push(new i.MessageDigest(u));else if("signingTime"==c)o.push(new i.SigningTime(u));else if("signingCertificate"==c)o.push(new i.SigningCertificate(u));else if("signingCertificateV2"==c)o.push(new i.SigningCertificateV2(u));else if("signaturePolicyIdentifier"==c)o.push(new ft.asn1.cades.SignaturePolicyIdentifier(u));else{if("signatureTimeStamp"!=c&&"timeStampToken"!=c)throw new e("unknown attr: "+c);o.push(new ft.asn1.cades.SignatureTimeStamp(u))}}var h=new n({array:o,sortflag:r});return this.hTLV=h.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.AttributeList,ft.asn1.ASN1Object),ft.asn1.cms.SignerInfo=function(t){var e=Error,r=ft,n=r.asn1,i=n.DERInteger,s=n.DEROctetString,o=n.DERSequence,a=n.DERTaggedObject,u=n.cms,c=u.SignerIdentifier,h=u.AttributeList,l=(u.ContentType,u.EncapsulatedContentInfo,u.MessageDigest,u.SignedData,n.x509.AlgorithmIdentifier),f=r.crypto,p=se;u.SignerInfo.superclass.constructor.call(this),this.params=null,this.sign=function(){var t=this.params,e=t.sigalg,r=new h(t.sattrs).tohex(),n=p.getKey(t.signkey),i=new f.Signature({alg:e});i.init(n),i.updateHex(r);var s=i.sign();t.sighex=s},this.tohex=function(){var t=this.params,r=[];if(r.push(new i({int:t.version})),r.push(new c(t.id)),r.push(new l({name:t.hashalg})),null!=t.sattrs){var n=new h(t.sattrs);try{r.push(new a({tag:"a0",explicit:!1,obj:n}))}catch(t){throw new e("si sattr error: "+t)}}if(null!=t.sigalgfield?r.push(new l({name:t.sigalgfield})):r.push(new l({name:t.sigalg})),null==t.sighex&&null!=t.signkey&&this.sign(),r.push(new s({hex:t.sighex})),null!=t.uattrs){n=new h(t.uattrs);try{r.push(new a({tag:"a1",explicit:!1,obj:n}))}catch(t){throw new e("si uattr error: "+t)}}return new o({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.SignerInfo,ft.asn1.ASN1Object),ft.asn1.cms.EncapsulatedContentInfo=function(t){var e=ft.asn1,r=e.DERTaggedObject,n=e.DERSequence,i=e.DERObjectIdentifier,s=e.DEROctetString;e.cms.EncapsulatedContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];if(e.push(new i(t.type)),null!=t.content&&(null!=t.content.hex||null!=t.content.str)&&1!=t.isDetached){var o=new s(t.content),a=new r({tag:"a0",explicit:!0,obj:o});e.push(a)}return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.EncapsulatedContentInfo,ft.asn1.ASN1Object),ft.asn1.cms.ContentInfo=function(t){var e=ft.asn1,r=e.DERTaggedObject,n=e.DERSequence,i=e.DERObjectIdentifier;e.x509.OID.name2obj,ft.asn1.cms.ContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];e.push(new i(t.type));var s=new r({tag:"a0",explicit:!0,obj:t.obj});return e.push(s),new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.ContentInfo,ft.asn1.ASN1Object),ft.asn1.cms.SignedData=function(t){Error;var e=ft.asn1,r=(e.ASN1Object,e.DERInteger),n=e.DERSet,i=e.DERSequence,s=(e.DERTaggedObject,e.cms),o=s.EncapsulatedContentInfo,a=s.SignerInfo,u=s.ContentInfo,c=s.CertificateSet,h=s.RevocationInfoChoices,l=e.x509.AlgorithmIdentifier;ft.asn1.cms.SignedData.superclass.constructor.call(this),this.params=null,this.checkAndFixParam=function(){var t=this.params;this._setDigestAlgs(t),this._setContentTypeByEContent(t),this._setMessageDigestByEContent(t),this._setSignerInfoVersion(t),this._setSignedDataVersion(t)},this._setDigestAlgs=function(t){for(var e={},r=t.sinfos,n=0;n<r.length;n++)e[r[n].hashalg]=1;t.hashalgs=Object.keys(e).sort()},this._setContentTypeByEContent=function(t){for(var e=t.econtent.type,r=t.sinfos,n=0;n<r.length;n++){var i=r[n];this._getAttrParamByName(i,"contentType").type=e}},this._setMessageDigestByEContent=function(t){var e=t.econtent,r=(t.econtent.type,e.content.hex);null==r&&"data"==e.type&&null!=e.content.str&&(r=It(e.content.str));for(var n=t.sinfos,i=0;i<n.length;i++){var s=n[i],o=s.hashalg,a=this._getAttrParamByName(s,"messageDigest"),u=ft.crypto.Util.hashHex(r,o);a.hex=u}},this._getAttrParamByName=function(t,e){for(var r=t.sattrs.array,n=0;n<r.length;n++)if(r[n].attr==e)return r[n]},this._setSignerInfoVersion=function(t){for(var e=t.sinfos,r=0;r<e.length;r++){var n=e[r],i=1;"skid"==n.id.type&&(i=3),n.version=i}},this._setSignedDataVersion=function(t){var e=this._getSignedDataVersion(t);t.version=e},this._getSignedDataVersion=function(t){if(null!=t.revinfos)for(var e=t.revinfos,r=0;r<e.length;r++)if(null!=e[r].ocsp)return 5;var n=t.sinfos;for(r=0;r<n.length;r++)if(3==t.sinfos[r].version)return 3;return"data"!=t.econtent.type?3:1},this.tohex=function(){var t=this.params;null!=this.getEncodedHexPrepare&&this.getEncodedHexPrepare(),1!=t.fixed&&this.checkAndFixParam();var e=[];e.push(new r({int:t.version}));for(var s=[],u=0;u<t.hashalgs.length;u++){var f=t.hashalgs[u];s.push(new l({name:f}))}e.push(new n({array:s})),e.push(new o(t.econtent)),null!=t.certs&&e.push(new c(t.certs)),null!=t.revinfos&&e.push(new h(t.revinfos));var p=[];for(u=0;u<t.sinfos.length;u++){var d=t.sinfos[u];p.push(new a(d))}return e.push(new n({array:p})),new i({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.getContentInfo=function(){return new u({type:"signed-data",obj:this})},this.getContentInfoEncodedHex=function(){return this.getContentInfo().tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.SignedData,ft.asn1.ASN1Object),ft.asn1.cms.CertificateSet=function(t){ft.asn1.cms.CertificateSet.superclass.constructor.call(this);var e=Error,r=ft.asn1,n=r.DERTaggedObject,i=r.DERSet,s=r.ASN1Object;this.params=null,this.tohex=function(){var t,r=this.params,o=[];if(r instanceof Array)t=r;else{if(null==r.array)throw new e("cert array not specified");t=r.array}for(var a=0;a<t.length;a++){var u=Ot(t[a]),c=new s;c.hTLV=u,o.push(c)}var h={array:o};0==r.sortflag&&(h.sortflag=!1);var l=new i(h);return new n({tag:"a0",explicit:!1,obj:l}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.CertificateSet,ft.asn1.ASN1Object),ft.asn1.cms.RevocationInfoChoices=function(t){ft.asn1.cms.RevocationInfoChoices.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(!t instanceof Array)throw new Error("params is not array");for(var e=[],r=0;r<t.length;r++)e.push(new ft.asn1.cms.RevocationInfoChoice(t[r]));return ft.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:{set:e}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.RevocationInfoChoices,ft.asn1.ASN1Object),ft.asn1.cms.RevocationInfoChoice=function(t){ft.asn1.cms.RevocationInfoChoice.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(null!=t.crl&&"string"==typeof t.crl){var e=t.crl;return-1!=t.crl.indexOf("-----BEGIN")&&(e=Ot(t.crl)),e}if(null!=t.ocsp)return ft.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:new ft.asn1.cms.OtherRevocationFormat(t)}}).tohex();throw new Error("property crl or ocsp undefined")},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.RevocationInfoChoice,ft.asn1.ASN1Object),ft.asn1.cms.OtherRevocationFormat=function(t){ft.asn1.cms.OtherRevocationFormat.superclass.constructor.call(this);var e=Error,r=ft,n=r.asn1.ASN1Util.newObject,i=r.lang.String.isHex;this.params=null,this.tohex=function(){var t=this.params;if(null==t.ocsp)throw new e("property ocsp not specified");if(!i(t.ocsp)||!gt.isASN1HEX(t.ocsp))throw new e("ocsp value not ASN.1 hex string");return n({seq:[{oid:"1.3.6.1.5.5.7.16.2"},{asn1:{tlv:t.ocsp}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cms.OtherRevocationFormat,ft.asn1.ASN1Object),ft.asn1.cms.CMSUtil=new function(){},ft.asn1.cms.CMSUtil.newSignedData=function(t){return new ft.asn1.cms.SignedData(t)},ft.asn1.cms.CMSUtil.verifySignedData=function(t){var e=ft,r=e.asn1,n=r.cms,i=(n.SignerInfo,n.SignedData,n.SigningTime,n.SigningCertificate,n.SigningCertificateV2,r.cades.SignaturePolicyIdentifier,e.lang.String.isHex),s=gt,o=s.getVbyList,a=s.getTLVbyList,u=s.getIdxbyList,c=s.getChildIdx,h=s.getTLV,l=s.oidname,f=e.crypto.Util.hashHex;void 0===t.cms&&i(t.cms);var p=t.cms,d=function(t,e){var r=e.idx;e.signerid_issuer1=a(t,r,[1,0],"30"),e.signerid_serial1=o(t,r,[1,1],"02"),e.hashalg=l(o(t,r,[2,0],"06"));var n=u(t,r,[3],"a0");e.idxSignedAttrs=n,g(t,e,n);var i=c(t,r).length;if(i<6)throw"malformed SignerInfo";e.sigalg=l(o(t,r,[i-2,0],"06")),e.sigval=o(t,r,[i-1],"04")},g=function(t,e,r){var n=c(t,r);e.signedAttrIdxList=n;for(var i=0;i<n.length;i++){var s,a=n[i],u=o(t,a,[0],"06");"2a864886f70d010905"===u?(s=Ft(o(t,a,[1,0])),e.saSigningTime=s):"2a864886f70d010904"===u&&(s=o(t,a,[1,0],"04"),e.saMessageDigest=s)}},y=function(t,e,r,n){r.verifyDetail={};var i=r.verifyDetail,s=e.parse.econtent,o=r.hashalg,a=r.saMessageDigest;i.validMessageDigest=!1,f(s,o)===a&&(i.validMessageDigest=!0),function(t,e,r,n){var i,s=e.parse.certsIdx;if(void 0===e.certs){i=[],e.certkeys=[];for(var o=c(t,s),a=0;a<o.length;a++){var u=h(t,o[a]),l=new ce;l.readCertHex(u),i[a]=l,e.certkeys[a]=l.getPublicKey()}e.certs=i}else i=e.certs;for(e.cccc=i.length,e.cccci=o.length,a=0;a<i.length;a++){var f=l.getIssuerHex(),p=l.getSerialNumberHex();r.signerid_issuer1===f&&r.signerid_serial1===p&&(r.certkey_idx=a)}}(t,e,r),i.validSignatureValue=!1;var u=r.sigalg,l="31"+h(t,r.idxSignedAttrs).substr(2);r.signedattrshex=l;var p=e.certs[r.certkey_idx].getPublicKey(),d=new ft.crypto.Signature({alg:u});d.init(p),d.updateHex(l);var g=d.verify(r.sigval);i.validSignatureValue_isValid=g,!0===g&&(i.validSignatureValue=!0),r.isValid=!1,i.validMessageDigest&&i.validSignatureValue&&(r.isValid=!0)},v={isValid:!1,parse:{}};return function(t,e){if("2a864886f70d010702"!==o(t,0,[0],"06"))return e;e.cmsType="signedData",e.econtent=o(t,0,[1,0,2,1,0]),function(t,e){for(var r,n=3;n<6;n++)if(void 0!==(r=u(t,0,[1,0,n]))){var i=t.substr(r,2);"a0"===i&&(e.certsIdx=r),"a1"===i&&(e.revinfosIdx=r),"31"===i&&(e.signerinfosIdx=r)}}(t,e),e.signerInfos=[],function(t,e){var r=e.signerinfosIdx;if(void 0!==r){var n=c(t,r);e.signerInfoIdxList=n;for(var i=0;i<n.length;i++){var s={idx:n[i]};d(t,s),e.signerInfos.push(s)}}}(t,e)}(p,v.parse),function(t,e){for(var r=e.parse.signerInfos,n=r.length,i=!0,s=0;s<n;s++){var o=r[s];y(t,e,o),o.isValid||(i=!1)}e.isValid=i}(p,v),v},ft.asn1.cms.CMSParser=function(){var t=Error,e=ce,r=new e,n=gt,i=n.getV,s=n.getTLV,o=(n.getIdxbyList,n.getTLVbyList),a=n.getTLVbyListEx,u=n.getVbyList,c=n.getVbyListEx,h=n.getChildIdx;this.getCMSSignedData=function(t){var e=o(t,0,[1,0]);return this.getSignedData(e)},this.getSignedData=function(t){var e=h(t,0),r={},n=i(t,e[0]),o=parseInt(n,16);r.version=o;var u=s(t,e[1]);r.hashalgs=this.getHashAlgArray(u);var c=s(t,e[2]);r.econtent=this.getEContent(c);var l=a(t,0,["[0]"]);null!=l&&(r.certs=this.getCertificateSet(l)),a(t,0,["[1]"]);var f=a(t,0,[3]);return r.sinfos=this.getSignerInfos(f),r},this.getHashAlgArray=function(t){for(var r=h(t,0),n=new e,i=[],o=0;o<r.length;o++){var a=s(t,r[o]),u=n.getAlgorithmIdentifierName(a);i.push(u)}return i},this.getEContent=function(t){var e={},r=u(t,0,[0]),n=u(t,0,[1,0]);return e.type=ft.asn1.x509.OID.oid2name(gt.hextooidstr(r)),e.content={hex:n},e},this.getSignerInfos=function(t){for(var e=[],r=h(t,0),n=0;n<r.length;n++){var i=s(t,r[n]),o=this.getSignerInfo(i);e.push(o)}return e},this.getSignerInfo=function(t){var e={},i=h(t,0),o=n.getInt(t,i[0],-1);-1!=o&&(e.version=o);var u=s(t,i[1]),l=this.getIssuerAndSerialNumber(u);e.id=l;var f=s(t,i[2]),p=r.getAlgorithmIdentifierName(f);e.hashalg=p;var d=a(t,0,["[0]"]);if(null!=d){var g=this.getAttributeList(d);e.sattrs=g}var y=a(t,0,[3]),v=r.getAlgorithmIdentifierName(y);e.sigalg=v;var m=c(t,0,[4]);e.sighex=m;var x=a(t,0,["[1]"]);if(null!=x){var w=this.getAttributeList(x);e.uattrs=w}return e},this.getSignerIdentifier=function(t){if("30"==t.substr(0,2))return this.getIssuerAndSerialNumber(t);throw new Error("SKID of signerIdentifier not supported")},this.getIssuerAndSerialNumber=function(t){var e={type:"isssn"},n=h(t,0),o=s(t,n[0]);e.issuer=r.getX500Name(o);var a=i(t,n[1]);return e.serial={hex:a},e},this.getAttributeList=function(t){for(var e=[],r=h(t,0),n=0;n<r.length;n++){var i=s(t,r[n]),o=this.getAttribute(i);e.push(o)}return{array:e}},this.getAttribute=function(t){var e={},r=h(t,0),i=n.getOID(t,r[0]),o=ft.asn1.x509.OID.oid2name(i);e.attr=o;var a=s(t,r[1]),u=h(a,0);if(1==u.length)e.valhex=s(a,u[0]);else{for(var c=[],l=0;l<u.length;l++)c.push(s(a,u[l]));e.valhex=c}return"contentType"==o?this.setContentType(e):"messageDigest"==o?this.setMessageDigest(e):"signingTime"==o?this.setSigningTime(e):"signingCertificate"==o?this.setSigningCertificate(e):"signingCertificateV2"==o?this.setSigningCertificateV2(e):"signaturePolicyIdentifier"==o&&this.setSignaturePolicyIdentifier(e),e},this.setContentType=function(t){var e=n.getOIDName(t.valhex,0,null);null!=e&&(t.type=e,delete t.valhex)},this.setSigningTime=function(t){var e=Ft(i(t.valhex,0));t.str=e,delete t.valhex},this.setMessageDigest=function(t){var e=i(t.valhex,0);t.hex=e,delete t.valhex},this.setSigningCertificate=function(t){var e=h(t.valhex,0);if(e.length>0){for(var r=s(t.valhex,e[0]),n=h(r,0),i=[],o=0;o<n.length;o++){var a=s(r,n[o]),u=this.getESSCertID(a);i.push(u)}t.array=i}if(e.length>1){var c=s(t.valhex,e[1]);t.polhex=c}delete t.valhex},this.setSignaturePolicyIdentifier=function(t){var r=h(t.valhex,0);if(r.length>0){var o=n.getOID(t.valhex,r[0]);t.oid=o}if(r.length>1){var a=new e,u=h(t.valhex,r[1]),c=s(t.valhex,u[0]),l=a.getAlgorithmIdentifierName(c);t.alg=l;var f=i(t.valhex,u[1]);t.hash=f}delete t.valhex},this.setSigningCertificateV2=function(t){var e=h(t.valhex,0);if(e.length>0){for(var r=s(t.valhex,e[0]),n=h(r,0),i=[],o=0;o<n.length;o++){var a=s(r,n[o]),u=this.getESSCertIDv2(a);i.push(u)}t.array=i}if(e.length>1){var c=s(t.valhex,e[1]);t.polhex=c}delete t.valhex},this.getESSCertID=function(t){var e={},r=h(t,0);if(r.length>0){var n=i(t,r[0]);e.hash=n}if(r.length>1){var o=s(t,r[1]),a=this.getIssuerSerial(o);null!=a.serial&&(e.serial=a.serial),null!=a.issuer&&(e.issuer=a.issuer)}return e},this.getESSCertIDv2=function(e){var n={},o=h(e,0);if(o.length<1||3<o.length)throw new t("wrong number of elements");var a=0;if("30"==e.substr(o[0],2)){var u=s(e,o[0]);n.alg=r.getAlgorithmIdentifierName(u),a++}else n.alg="sha256";var c=i(e,o[a]);if(n.hash=c,o.length>a+1){var l=s(e,o[a+1]),f=this.getIssuerSerial(l);n.issuer=f.issuer,n.serial=f.serial}return n},this.getIssuerSerial=function(t){var e={},n=h(t,0),o=s(t,n[0]),a=r.getGeneralNames(o)[0].dn;e.issuer=a;var u=i(t,n[1]);return e.serial={hex:u},e},this.getCertificateSet=function(t){for(var e=h(t,0),r=[],n=0;n<e.length;n++){var i=s(t,e[n]);if("30"==i.substr(0,2)){var o=Nt(i,"CERTIFICATE");r.push(o)}}return{array:r,sortflag:!1}}},void 0!==ft&&ft||(ft={}),void 0!==ft.asn1&&ft.asn1||(ft.asn1={}),void 0!==ft.asn1.tsp&&ft.asn1.tsp||(ft.asn1.tsp={}),ft.asn1.tsp.TimeStampToken=function(t){var e=ft.asn1.tsp;e.TimeStampToken.superclass.constructor.call(this),this.params=null,this.getEncodedHexPrepare=function(){var t=new e.TSTInfo(this.params.econtent.content);this.params.econtent.content.hex=t.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.tsp.TimeStampToken,ft.asn1.cms.SignedData),ft.asn1.tsp.TSTInfo=function(t){Error;var e=ft.asn1,r=e.DERSequence,n=e.DERInteger,i=e.DERBoolean,s=e.DERGeneralizedTime,o=e.DERObjectIdentifier,a=e.DERTaggedObject,u=e.tsp,c=u.MessageImprint,h=u.Accuracy,l=(e.x509.X500Name,e.x509.GeneralName);if(u.TSTInfo.superclass.constructor.call(this),this.dVersion=new n({int:1}),this.dPolicy=null,this.dMessageImprint=null,this.dSerial=null,this.dGenTime=null,this.dAccuracy=null,this.dOrdering=null,this.dNonce=null,this.dTsa=null,this.tohex=function(){var t=[this.dVersion];if(null==this.dPolicy)throw new Error("policy shall be specified.");if(t.push(this.dPolicy),null==this.dMessageImprint)throw new Error("messageImprint shall be specified.");if(t.push(this.dMessageImprint),null==this.dSerial)throw new Error("serialNumber shall be specified.");if(t.push(this.dSerial),null==this.dGenTime)throw new Error("genTime shall be specified.");t.push(this.dGenTime),null!=this.dAccuracy&&t.push(this.dAccuracy),null!=this.dOrdering&&t.push(this.dOrdering),null!=this.dNonce&&t.push(this.dNonce),null!=this.dTsa&&t.push(this.dTsa);var e=new r({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t){if("string"==typeof t.policy){if(!t.policy.match(/^[0-9.]+$/))throw"policy shall be oid like 0.1.4.134";this.dPolicy=new o({oid:t.policy})}void 0!==t.messageImprint&&(this.dMessageImprint=new c(t.messageImprint)),void 0!==t.serial&&(this.dSerial=new n(t.serial)),void 0!==t.genTime&&(this.dGenTime=new s(t.genTime)),void 0!==t.accuracy&&(this.dAccuracy=new h(t.accuracy)),void 0!==t.ordering&&1==t.ordering&&(this.dOrdering=new i),void 0!==t.nonce&&(this.dNonce=new n(t.nonce)),void 0!==t.tsa&&(this.dTsa=new a({tag:"a0",explicit:!0,obj:new l({dn:t.tsa})}))}},ie(ft.asn1.tsp.TSTInfo,ft.asn1.ASN1Object),ft.asn1.tsp.Accuracy=function(t){var e=ft.asn1,r=e.ASN1Util.newObject;e.tsp.Accuracy.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return null!=t.seconds&&"number"==typeof t.seconds&&e.push({int:t.seconds}),null!=t.millis&&"number"==typeof t.millis&&e.push({tag:{tagi:"80",obj:{int:t.millis}}}),null!=t.micros&&"number"==typeof t.micros&&e.push({tag:{tagi:"81",obj:{int:t.micros}}}),r({seq:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.tsp.Accuracy,ft.asn1.ASN1Object),ft.asn1.tsp.MessageImprint=function(t){var e=ft.asn1,r=e.DERSequence,n=e.DEROctetString,i=e.x509.AlgorithmIdentifier;e.tsp.MessageImprint.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=new i({name:t.alg}),s=new n({hex:t.hash});return new r({array:[e,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},ie(ft.asn1.tsp.MessageImprint,ft.asn1.ASN1Object),ft.asn1.tsp.TimeStampReq=function(t){var e=ft.asn1,r=e.DERSequence,n=e.DERInteger,i=e.DERBoolean,s=(e.ASN1Object,e.DERObjectIdentifier),o=e.tsp,a=o.MessageImprint;o.TimeStampReq.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return e.push(new n({int:1})),t.messageImprint instanceof ft.asn1.ASN1Object?e.push(t.messageImprint):e.push(new a(t.messageImprint)),null!=t.policy&&e.push(new s(t.policy)),null!=t.nonce&&e.push(new n(t.nonce)),1==t.certreq&&e.push(new i),new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.tsp.TimeStampReq,ft.asn1.ASN1Object),ft.asn1.tsp.TimeStampResp=function(t){var e=ft.asn1,r=e.DERSequence,n=(e.ASN1Object,e.tsp),i=n.PKIStatusInfo;n.TimeStampResp.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,s=[];if(null!=t.econtent||null!=t.tst)if(null!=t.statusinfo?s.push(new i(t.statusinfo)):s.push(new i("granted")),null!=t.econtent)s.push(new n.TimeStampToken(t).getContentInfo());else{if(!(t.tst instanceof e.ASN1Object))throw new Error("improper member tst value");s.push(t.tst)}else{if(null==t.statusinfo)throw new Error("parameter for token nor statusinfo not specified");s.push(new i(t.statusinfo))}return new r({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.tsp.TimeStampResp,ft.asn1.ASN1Object),ft.asn1.tsp.PKIStatusInfo=function(t){var e=Error,r=ft.asn1,n=r.DERSequence,i=r.tsp,s=i.PKIStatus,o=i.PKIFreeText,a=i.PKIFailureInfo;i.PKIStatusInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,r=[];if("string"==typeof t)r.push(new s(t));else{if(null==t.status)throw new e("property 'status' unspecified");r.push(new s(t.status)),null!=t.statusstr&&r.push(new o(t.statusstr)),null!=t.failinfo&&r.push(new a(t.failinfo))}return new n({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.tsp.PKIStatusInfo,ft.asn1.ASN1Object),ft.asn1.tsp.PKIStatus=function(t){var e=Error,r=ft.asn1,n=r.DERInteger;r.tsp.PKIStatus.superclass.constructor.call(this);var i={granted:0,grantedWithMods:1,rejection:2,waiting:3,revocationWarning:4,revocationNotification:5};this.params=null,this.tohex=function(){var t,r=this.params;if("string"==typeof r)try{t=i[r]}catch(t){throw new e("undefined name: "+r)}else{if("number"!=typeof r)throw new e("unsupported params");t=r}return new n({int:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.tsp.PKIStatus,ft.asn1.ASN1Object),ft.asn1.tsp.PKIFreeText=function(t){var e=Error,r=ft.asn1,n=r.DERSequence,i=r.DERUTF8String;r.tsp.PKIFreeText.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(!t instanceof Array)throw new e("wrong params: not array");for(var r=[],s=0;s<t.length;s++)r.push(new i({str:t[s]}));return new n({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.tsp.PKIFreeText,ft.asn1.ASN1Object),ft.asn1.tsp.PKIFailureInfo=function(t){var e=Error,r=ft.asn1,n=r.DERBitString,i={badAlg:0,badRequest:2,badDataFormat:5,timeNotAvailable:14,unacceptedPolicy:15,unacceptedExtension:16,addInfoNotAvailable:17,systemFailure:25};r.tsp.PKIFailureInfo.superclass.constructor.call(this),this.params=null,this.getBinValue=function(){var t=this.params,r=0;if("number"==typeof t&&0<=t&&t<=25){for(var n=(r|=1<<t).toString(2),s="",o=n.length-1;o>=0;o--)s+=n[o];return s}if("string"==typeof t&&null!=i[t])return re([t],i);if("object"==typeof t&&null!=t.length)return re(t,i);throw new e("wrong params")},this.tohex=function(){this.params;var t=this.getBinValue();return new n({bin:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.tsp.PKIFailureInfo,ft.asn1.ASN1Object),ft.asn1.tsp.AbstractTSAAdapter=function(t){this.getTSTHex=function(t,e){throw"not implemented yet"}},ft.asn1.tsp.SimpleTSAAdapter=function(t){var e=ft,r=e.asn1.tsp,n=e.crypto.Util.hashHex;r.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(t,e){var i=n(t,e);this.params.econtent.content.messageImprint={alg:e,hash:i},this.params.econtent.content.serial={int:this.serial++};var s=Math.floor(1e9*Math.random());return this.params.econtent.content.nonce={int:s},new r.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==t&&(this.params=t)},ie(ft.asn1.tsp.SimpleTSAAdapter,ft.asn1.tsp.AbstractTSAAdapter),ft.asn1.tsp.FixedTSAAdapter=function(t){var e=ft,r=e.asn1.tsp,n=e.crypto.Util.hashHex;r.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(t,e){var i=n(t,e);return this.params.econtent.content.messageImprint={alg:e,hash:i},new r.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==t&&(this.params=t)},ie(ft.asn1.tsp.FixedTSAAdapter,ft.asn1.tsp.AbstractTSAAdapter),ft.asn1.tsp.TSPUtil=new function(){},ft.asn1.tsp.TSPUtil.newTimeStampToken=function(t){return new ft.asn1.tsp.TimeStampToken(t)},ft.asn1.tsp.TSPUtil.parseTimeStampReq=function(t){return(new ft.asn1.tsp.TSPParser).getTimeStampReq(t)},ft.asn1.tsp.TSPUtil.parseMessageImprint=function(t){return(new ft.asn1.tsp.TSPParser).getMessageImprint(t)},ft.asn1.tsp.TSPParser=function(){Error;var t=new ce,e=gt,r=e.getV,n=e.getTLV,i=e.getIdxbyList,s=(e.getTLVbyListEx,e.getChildIdx),o=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],a={0:"badAlg",2:"badRequest",5:"badDataFormat",14:"timeNotAvailable",15:"unacceptedPolicy",16:"unacceptedExtension",17:"addInfoNotAvailable",25:"systemFailure"};this.getResponse=function(t){var e=s(t,0);if(1==e.length)return this.getPKIStatusInfo(n(t,e[0]));if(e.length>1){var r=this.getPKIStatusInfo(n(t,e[0])),i=n(t,e[1]),o=this.getToken(i);return o.statusinfo=r,o}},this.getToken=function(t){var e=(new ft.asn1.cms.CMSParser).getCMSSignedData(t);return this.setTSTInfo(e),e},this.setTSTInfo=function(t){var e=t.econtent;if("tstinfo"==e.type){var r=e.content.hex,n=this.getTSTInfo(r);e.content=n}},this.getTSTInfo=function(e){var i={},o=s(e,0),a=r(e,o[1]);i.policy=Yt(a);var u=n(e,o[2]);i.messageImprint=this.getMessageImprint(u);var c=r(e,o[3]);i.serial={hex:c};var h=r(e,o[4]);i.genTime={str:Ft(h)};var l=0;if(o.length>5&&"30"==e.substr(o[5],2)){var f=n(e,o[5]);i.accuracy=this.getAccuracy(f),l++}if(o.length>5+l&&"01"==e.substr(o[5+l],2)&&("ff"==r(e,o[5+l])&&(i.ordering=!0),l++),o.length>5+l&&"02"==e.substr(o[5+l],2)){var p=r(e,o[5+l]);i.nonce={hex:p},l++}if(o.length>5+l&&"a0"==e.substr(o[5+l],2)){var d=n(e,o[5+l]);d="30"+d.substr(2),pGeneralNames=t.getGeneralNames(d);var g=pGeneralNames[0].dn;i.tsa=g,l++}if(o.length>5+l&&"a1"==e.substr(o[5+l],2)){var y=n(e,o[5+l]);y="30"+y.substr(2);var v=t.getExtParamArray(y);i.ext=v,l++}return i},this.getAccuracy=function(t){for(var e={},n=s(t,0),i=0;i<n.length;i++){var o=t.substr(n[i],2),a=r(t,n[i]),u=parseInt(a,16);"02"==o?e.seconds=u:"80"==o?e.millis=u:"81"==o&&(e.micros=u)}return e},this.getMessageImprint=function(t){if("30"!=t.substr(0,2))throw new Error("head of messageImprint hex shall be x30");var n={},o=(s(t,0),i(t,0,[0,0])),a=r(t,o),u=e.hextooidstr(a),c=ft.asn1.x509.OID.oid2name(u);if(""==c)throw new Error("hashAlg name undefined: "+u);var h=c,l=i(t,0,[1]);return n.alg=h,n.hash=r(t,l),n},this.getPKIStatusInfo=function(t){var e={},i=s(t,0),a=0;try{var u=r(t,i[0]),c=parseInt(u,16);e.status=o[c]}catch(t){}if(i.length>1&&"30"==t.substr(i[1],2)){var h=n(t,i[1]);e.statusstr=this.getPKIFreeText(h),a++}if(i.length>a&&"03"==t.substr(i[1+a],2)){var l=n(t,i[1+a]);e.failinfo=this.getPKIFailureInfo(l)}return e},this.getPKIFreeText=function(t){for(var r=[],n=s(t,0),i=0;i<n.length;i++)r.push(e.getString(t,n[i]));return r},this.getPKIFailureInfo=function(t){var r=e.getInt(t,0);return null!=a[r]?a[r]:r},this.getTimeStampReq=function(t){var i={certreq:!1},o=s(t,0);if(o.length<2)throw new Error("TimeStampReq must have at least 2 items");var a=n(t,o[1]);i.messageImprint=ft.asn1.tsp.TSPUtil.parseMessageImprint(a);for(var u=2;u<o.length;u++){var c=o[u],h=t.substr(c,2);if("06"==h){var l=r(t,c);i.policy=e.hextooidstr(l)}"02"==h&&(i.nonce=r(t,c)),"01"==h&&(i.certreq=!0)}return i}},void 0!==ft&&ft||(ft={}),void 0!==ft.asn1&&ft.asn1||(ft.asn1={}),void 0!==ft.asn1.cades&&ft.asn1.cades||(ft.asn1.cades={}),ft.asn1.cades.SignaturePolicyIdentifier=function(t){var e=ft.asn1.cades,r=e.SignaturePolicyId;e.SignaturePolicyIdentifier.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.15",this.params=null,this.getValueArray=function(){return[new r(this.params)]},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},ie(ft.asn1.cades.SignaturePolicyIdentifier,ft.asn1.cms.Attribute),ft.asn1.cades.SignaturePolicyId=function(t){var e=ft.asn1,r=e.DERSequence,n=e.DERObjectIdentifier,i=(e.x509.AlgorithmIdentifier,e.cades),s=i.SignaturePolicyId,o=i.OtherHashAlgAndValue;s.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return e.push(new n(t.oid)),e.push(new o(t)),new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},ie(ft.asn1.cades.SignaturePolicyId,ft.asn1.ASN1Object),ft.asn1.cades.OtherHashAlgAndValue=function(t){var e=Error,r=ft.asn1,n=r.DERSequence,i=r.DEROctetString,s=r.x509.AlgorithmIdentifier;r.cades.OtherHashAlgAndValue.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(null==t.alg)throw new e("property 'alg' not specified");if(null==t.hash&&null==t.cert)throw new e("property 'hash' nor 'cert' not specified");var r=null;if(null!=t.hash)r=t.hash;else if(null!=t.cert){if("string"!=typeof t.cert)throw new e("cert not string");var o=t.cert;-1!=t.cert.indexOf("-----BEGIN")&&(o=Ot(t.cert)),r=ft.crypto.Util.hashHex(o,t.alg)}var a=[];return a.push(new s({name:t.alg})),a.push(new i({hex:r})),new n({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cades.OtherHashAlgAndValue,ft.asn1.ASN1Object),ft.asn1.cades.OtherHashValue=function(t){ft.asn1.cades.OtherHashValue.superclass.constructor.call(this);var e=Error,r=ft,n=(r.lang.String.isHex,r.asn1.DEROctetString);r.crypto.Util.hashHex,this.params=null,this.tohex=function(){var t=this.params;if(null==t.hash&&null==t.cert)throw new e("hash or cert not specified");var r=null;if(null!=t.hash)r=t.hash;else if(null!=t.cert){if("string"!=typeof t.cert)throw new e("cert not string");var i=t.cert;-1!=t.cert.indexOf("-----BEGIN")&&(i=Ot(t.cert)),r=ft.crypto.Util.hashHex(i,"sha1")}return new n({hex:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cades.OtherHashValue,ft.asn1.ASN1Object),ft.asn1.cades.SignatureTimeStamp=function(t){var e=Error,r=ft,n=r.lang.String.isHex,i=r.asn1,s=i.ASN1Object;i.x509,i.cades.SignatureTimeStamp.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.14",this.params=null,this.getValueArray=function(){var t=this.params;if(null!=t.tst){if(n(t.tst))return(r=new s).hTLV=t.tst,[r];if(t.tst instanceof s)return[t.tst];throw new e("params.tst has wrong value")}if(null!=t.res){var r,i=t.res;if(i instanceof s&&(i=i.tohex()),"string"!=typeof i||!n(i))throw new e("params.res has wrong value");return gt.getTLVbyList(i,0,[1]),(r=new s).hTLV=t.tst,[r]}},null!=t&&this.setByParam(t)},ie(ft.asn1.cades.SignatureTimeStamp,ft.asn1.cms.Attribute),ft.asn1.cades.CompleteCertificateRefs=function(t){var e=Error,r=ft,n=r.asn1,i=n.DERSequence,s=n.cades,o=s.OtherCertID,a=r.lang.String.isHex;s.CompleteCertificateRefs.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.21",this.params=null,this.getValueArray=function(){for(var t=this.params,r=[],n=0;n<t.array.length;n++){var s=t.array[n];if("string"==typeof s)if(-1!=s.indexOf("-----BEGIN"))s={cert:s};else{if(!a(s))throw new e("unsupported value: "+s);s={hash:s}}null!=t.alg&&null==s.alg&&(s.alg=t.alg),null!=t.hasis&&null==s.hasis&&(s.hasis=t.hasis);var u=new o(s);r.push(u)}return[new i({array:r})]},null!=t&&this.setByParam(t)},ie(ft.asn1.cades.CompleteCertificateRefs,ft.asn1.cms.Attribute),ft.asn1.cades.OtherCertID=function(t){var e=ft.asn1,r=e.DERSequence,n=e.cms.IssuerSerial,i=e.cades,s=i.OtherHashValue,o=i.OtherHashAlgAndValue;i.OtherCertID.superclass.constructor.call(this),this.params=t,this.tohex=function(){var t=this.params;"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?t={cert:t}:_isHex(t)&&(t={hash:t}));var e,i=[];if(e=null!=t.alg?new o(t):new s(t),i.push(e),null!=t.cert&&1==t.hasis||null!=t.issuer&&null!=t.serial){var a=new n(t);i.push(a)}return new r({array:i}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cades.OtherCertID,ft.asn1.ASN1Object),ft.asn1.cades.OtherHash=function(t){Error;var e=ft,r=e.asn1,n=(r.cms,r.cades),i=n.OtherHashAlgAndValue,s=n.OtherHashValue,o=(e.crypto.Util.hashHex,e.lang.String.isHex);n.OtherHash.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;return"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?t={cert:t}:o(t)&&(t={hash:t})),(null!=t.alg?new i(t):new s(t)).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.cades.OtherHash,ft.asn1.ASN1Object),ft.asn1.cades.CAdESUtil=new function(){},ft.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(t){return(new ft.asn1.cms.CMSParser).getCMSSignedData(t)},ft.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(t,e,r){var n=gt,i=n.getChildIdx,s=n.getTLV,o=n.getV,a=ft.asn1,u=a.ASN1Object,c=a.cms,h=c.AttributeList,l=c.SignerInfo,f={},p=i(t,e);if(6!=p.length)throw"not supported items for SignerInfo (!=6)";var d=p.shift();f.version=s(t,d);var g=p.shift();f.si=s(t,g);var y=p.shift();f.digalg=s(t,y);var v=p.shift();f.sattrs=s(t,v);var m=p.shift();f.sigalg=s(t,m);var x=p.shift();f.sig=s(t,x),f.sigval=o(t,x);var w=null;return f.obj=new l,(w=new u).hTLV=f.version,f.obj.dCMSVersion=w,(w=new u).hTLV=f.si,f.obj.dSignerIdentifier=w,(w=new u).hTLV=f.digalg,f.obj.dDigestAlgorithm=w,(w=new u).hTLV=f.sattrs,f.obj.dSignedAttrs=w,(w=new u).hTLV=f.sigalg,f.obj.dSigAlg=w,(w=new u).hTLV=f.sig,f.obj.dSig=w,f.obj.dUnsignedAttrs=new h,f},void 0!==ft.asn1.csr&&ft.asn1.csr||(ft.asn1.csr={}),ft.asn1.csr.CertificationRequest=function(t){var e=ft.asn1,r=e.DERBitString,n=e.DERSequence,i=e.csr,s=(e.x509,i.CertificationRequestInfo);i.CertificationRequest.superclass.constructor.call(this),this.setByParam=function(t){this.params=t},this.sign=function(){var t=new s(this.params).tohex(),e=new ft.crypto.Signature({alg:this.params.sigalg});e.init(this.params.sbjprvkey),e.updateHex(t);var r=e.sign();this.params.sighex=r},this.getPEM=function(){return Nt(this.tohex(),"CERTIFICATE REQUEST")},this.tohex=function(){var t=this.params,e=new ft.asn1.csr.CertificationRequestInfo(this.params),i=new ft.asn1.x509.AlgorithmIdentifier({name:t.sigalg});if(null==t.sighex&&null!=t.sbjprvkey&&this.sign(),null==t.sighex)throw new Error("sighex or sbjprvkey parameter not defined");var s=new r({hex:"00"+t.sighex});return new n({array:[e,i,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},ie(ft.asn1.csr.CertificationRequest,ft.asn1.ASN1Object),ft.asn1.csr.CertificationRequestInfo=function(t){var e=ft.asn1,r=(e.DERBitString,e.DERSequence),n=e.DERInteger,i=e.DERUTF8String,s=e.DERTaggedObject,o=e.ASN1Util.newObject,a=e.csr,u=e.x509,c=u.X500Name,h=u.Extensions,l=u.SubjectPublicKeyInfo;a.AttributeList,a.CertificationRequestInfo.superclass.constructor.call(this),this.params=null,this.setByParam=function(t){null!=t&&(this.params=t)},this.tohex=function(){var t=this.params,e=[];if(e.push(new n({int:0})),e.push(new c(t.subject)),e.push(new l(se.getKey(t.sbjpubkey))),null!=t.attrs){var a=function(t){for(var e=Error,r=ft.asn1.x509.Extensions,n=[],i=0;i<t.length;i++){var s=t[i],o=s.attr;if("extensionRequest"==o){var a={seq:[{oid:"1.2.840.113549.1.9.14"},{set:[new r(s.ext)]}]};n.push(a)}else if("unstructuredName"==o)a={seq:[{oid:"1.2.840.113549.1.9.2"},{set:s.names}]},n.push(a);else{if("challengePassword"!=o)throw new e("unknown CSR attribute");a={seq:[{oid:"1.2.840.113549.1.9.7"},{set:[{utf8str:s.password}]}]},n.push(a)}}return{set:n}}(t.attrs),u=o({tag:{tage:"a0",obj:a}});e.push(u)}else if(null!=t.extreq){var f=new h(t.extreq);u=o({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[f]}]}}}),e.push(u)}else e.push(new s({tag:"a0",explicit:!1,obj:new i({str:""})}));return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ie(ft.asn1.csr.CertificationRequestInfo,ft.asn1.ASN1Object),ft.asn1.csr.AttributeList=function(t){},ie(ft.asn1.csr.AttributeList,ft.asn1.ASN1Object),ft.asn1.csr.CSRUtil=new function(){},ft.asn1.csr.CSRUtil.newCSRPEM=function(t){return new ft.asn1.csr.CertificationRequest(t).getPEM()},ft.asn1.csr.CSRUtil.getParam=function(t,e){var r=gt,n=r.getV,i=r.getIdxbyList,s=r.getTLVbyList,o=r.getTLVbyListEx,a=r.getVbyListEx,u={};if(-1==t.indexOf("-----BEGIN CERTIFICATE REQUEST"))throw new Error("argument is not PEM file");var c=Ot(t,"CERTIFICATE REQUEST");e&&(u.tbs=s(c,0,[0]));try{var h=o(c,0,[0,1]);if("3000"==h)u.subject={};else{var l=new ce;u.subject=l.getX500Name(h)}}catch(t){}var f=o(c,0,[0,2]),p=se.getKey(f,null,"pkcs8pub");u.sbjpubkey=se.getPEM(p,"PKCS8PUB");var d=function(t){var e=i(t,0,[0,3,0,0],"06");return"2a864886f70d01090e"!=n(t,e)?null:s(t,0,[0,3,0,1,0],"30")}(c);l=new ce,null!=d&&(u.extreq=l.getExtParamArray(d));try{var g=o(c,0,[1],"30");l=new ce,u.sigalg=l.getAlgorithmIdentifierName(g)}catch(t){}try{var y=a(c,0,[2]);u.sighex=y}catch(t){}return u},ft.asn1.csr.CSRUtil.verifySignature=function(t){try{var e=null;if("string"==typeof t&&-1!=t.indexOf("-----BEGIN CERTIFICATE REQUEST")?e=ft.asn1.csr.CSRUtil.getParam(t,!0):"object"==typeof t&&null!=t.sbjpubkey&&null!=t.sigalg&&null!=t.sighex&&null!=t.tbs&&(e=t),null==e)return!1;var r=new ft.crypto.Signature({alg:e.sigalg});return r.init(e.sbjpubkey),r.updateHex(e.tbs),r.verify(e.sighex)}catch(t){return alert(t),!1}},void 0!==ft&&ft||(ft={}),void 0!==ft.asn1&&ft.asn1||(ft.asn1={}),void 0!==ft.asn1.ocsp&&ft.asn1.ocsp||(ft.asn1.ocsp={}),ft.asn1.ocsp.DEFAULT_HASH="sha1",ft.asn1.ocsp.OCSPResponse=function(t){ft.asn1.ocsp.OCSPResponse.superclass.constructor.call(this),ft.asn1.DEREnumerated;var e=ft.asn1.ASN1Util.newObject,r=ft.asn1.ocsp.ResponseBytes,n=["successful","malformedRequest","internalError","tryLater","_not_used_","sigRequired","unauthorized"];this.params=null,this._getStatusCode=function(){var t=this.params.resstatus;return"number"==typeof t?t:"string"!=typeof t?-1:n.indexOf(t)},this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params,n=this._getStatusCode();if(-1==n)throw new Error("responseStatus not supported: "+t.resstatus);if(0!=n)return e({seq:[{enum:{int:n}}]}).tohex();var i=new r(t);return e({seq:[{enum:{int:0}},{tag:{tag:"a0",explicit:!0,obj:i}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},ie(ft.asn1.ocsp.OCSPResponse,ft.asn1.ASN1Object),ft.asn1.ocsp.ResponseBytes=function(t){ft.asn1.ocsp.ResponseBytes.superclass.constructor.call(this);var e=ft.asn1,r=e.DERSequence,n=e.DERObjectIdentifier,i=e.DEROctetString,s=e.ocsp.BasicOCSPResponse;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if("ocspBasic"!=t.restype)throw new Error("not supported responseType: "+t.restype);var e=new s(t),o=[];return o.push(new n({name:"ocspBasic"})),o.push(new i({hex:e.tohex()})),new r({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},ie(ft.asn1.ocsp.ResponseBytes,ft.asn1.ASN1Object),ft.asn1.ocsp.BasicOCSPResponse=function(t){ft.asn1.ocsp.BasicOCSPResponse.superclass.constructor.call(this);var e=Error,r=ft.asn1,n=r.ASN1Object,i=r.DERSequence,s=(r.DERGeneralizedTime,r.DERTaggedObject),o=r.DERBitString,a=(r.x509.Extensions,r.x509.AlgorithmIdentifier),u=r.ocsp;u.ResponderID,_SingleResponseList=u.SingleResponseList,_ResponseData=u.ResponseData,this.params=null,this.setByParam=function(t){this.params=t},this.sign=function(){var t=this.params,e=t.tbsresp.tohex(),r=new ft.crypto.Signature({alg:t.sigalg});r.init(t.reskey),r.updateHex(e),t.sighex=r.sign()},this.tohex=function(){var t=this.params;null==t.tbsresp&&(t.tbsresp=new _ResponseData(t)),null==t.sighex&&null!=t.reskey&&this.sign();var r=[];if(r.push(t.tbsresp),r.push(new a({name:t.sigalg})),r.push(new o({hex:"00"+t.sighex})),null!=t.certs&&null!=t.certs.length){for(var u=[],c=0;c<t.certs.length;c++){var h=t.certs[c],l=null;if(gt.isASN1HEX(h))l=h;else{if(!h.match(/-----BEGIN/))throw new e("certs["+c+"] not hex or PEM");l=Ot(h)}u.push(new n({tlv:l}))}var f=new i({array:u});r.push(new s({tag:"a0",explicit:!0,obj:f}))}return new i({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},ie(ft.asn1.ocsp.BasicOCSPResponse,ft.asn1.ASN1Object),ft.asn1.ocsp.ResponseData=function(t){ft.asn1.ocsp.ResponseData.superclass.constructor.call(this);var e=Error,r=ft.asn1,n=r.DERSequence,i=r.DERGeneralizedTime,s=r.DERTaggedObject,o=r.x509.Extensions,a=r.ocsp,u=a.ResponderID;_SingleResponseList=a.SingleResponseList,this.params=null,this.tohex=function(){var t=this.params;null!=t.respid&&new e("respid not specified"),null!=t.prodat&&new e("prodat not specified"),null!=t.array&&new e("array not specified");var r=[];if(r.push(new u(t.respid)),r.push(new i(t.prodat)),r.push(new _SingleResponseList(t.array)),null!=t.ext){var a=new o(t.ext);r.push(new s({tag:"a1",explicit:!0,obj:a}))}return new n({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},ie(ft.asn1.ocsp.ResponseData,ft.asn1.ASN1Object),ft.asn1.ocsp.ResponderID=function(t){ft.asn1.ocsp.ResponderID.superclass.constructor.call(this);var e=ft,r=e.asn1,n=r.ASN1Util.newObject,i=r.x509.X500Name,s=e.lang.String.isHex,o=Error;this.params=null,this.tohex=function(){var t=this.params;if(null!=t.key){var e,r=null;if("string"==typeof t.key?(s(t.key)&&(r=t.key),t.key.match(/-----BEGIN CERTIFICATE/)&&null!=(e=new ce(t.key).getExtSubjectKeyIdentifier())&&(r=e.kid.hex)):t.key instanceof ce&&null!=(e=t.key.getExtSubjectKeyIdentifier())&&(r=e.kid.hex),null==r)throw new o("wrong key member value");return n({tag:{tag:"a2",explicit:!0,obj:{octstr:{hex:r}}}}).tohex()}if(null!=t.name){var a=null;if("string"==typeof t.name&&t.name.match(/-----BEGIN CERTIFICATE/)?a=new ce(t.name).getSubject():t.name instanceof ce?a=t.name.getSubject():"object"!=typeof t.name||null==t.name.array&&null==t.name.str||(a=t.name),null==a)throw new o("wrong name member value");return n({tag:{tag:"a1",explicit:!0,obj:new i(a)}}).tohex()}throw new o("key or name not specified")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},ie(ft.asn1.ocsp.ResponderID,ft.asn1.ASN1Object),ft.asn1.ocsp.SingleResponseList=function(t){ft.asn1.ocsp.SingleResponseList.superclass.constructor.call(this);var e=ft.asn1,r=e.DERSequence,n=e.ocsp.SingleResponse;this.params=null,this.tohex=function(){var t=this.params;if("object"!=typeof t||null==t.length)throw new Error("params not specified properly");for(var e=[],i=0;i<t.length;i++)e.push(new n(t[i]));return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},ie(ft.asn1.ocsp.SingleResponseList,ft.asn1.ASN1Object),ft.asn1.ocsp.SingleResponse=function(t){var e=Error,r=ft.asn1,n=r.DERSequence,i=r.DERGeneralizedTime,s=r.DERTaggedObject,o=r.ocsp,a=o.CertID,u=o.CertStatus,c=r.x509.Extensions;o.SingleResponse.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,r=[];if(null==t.certid)throw new e("certid unspecified");if(null==t.status)throw new e("status unspecified");if(null==t.thisupdate)throw new e("thisupdate unspecified");if(r.push(new a(t.certid)),r.push(new u(t.status)),r.push(new i(t.thisupdate)),null!=t.nextupdate){var o=new i(t.nextupdate);r.push(new s({tag:"a0",explicit:!0,obj:o}))}if(null!=t.ext){var h=new c(t.ext);r.push(new s({tag:"a1",explicit:!0,obj:h}))}return new n({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},ie(ft.asn1.ocsp.SingleResponse,ft.asn1.ASN1Object),ft.asn1.ocsp.CertID=function(t){var e=ft,r=e.asn1,n=r.DEROctetString,i=r.DERInteger,s=r.DERSequence,o=r.x509.AlgorithmIdentifier,a=r.ocsp,u=(a.DEFAULT_HASH,e.crypto.Util.hashHex),c=ce,h=gt.getVbyList;a.CertID.superclass.constructor.call(this),this.DEFAULT_HASH="sha1",this.params=null,this.setByValue=function(t,e,r,n){null==n&&(n=this.DEFAULT_HASH),this.params={alg:n,issname:t,isskey:e,sbjsn:r}},this.setByCert=function(t,e,r){null==r&&(r=this.DEFAULT_HASH),this.params={alg:r,issuerCert:t,subjectCert:e}},this.getParamByCerts=function(t,e,r){null==r&&(r=this.DEFAULT_HASH);var n=new c(t),i=new c(e),s=u(n.getSubjectHex(),r),o=n.getPublicKeyHex();return{alg:r,issname:s,isskey:u(h(o,0,[1],"03",!0),r),sbjsn:i.getSerialNumberHex()}},this.tohex=function(){if("object"!=typeof this.params)throw new Error("params not set");var t,e,r,a,u=this.params;if(a=null==u.alg?this.DEFAULT_HASH:u.alg,null!=u.issuerCert&&null!=u.subjectCert){var c=this.getParamByCerts(u.issuerCert,u.subjectCert,a);t=c.issname,e=c.isskey,r=c.sbjsn}else{if(null==u.issname||null==u.isskey||null==u.sbjsn)throw new Error("required param members not defined");t=u.issname,e=u.isskey,r=u.sbjsn}var h=new o({name:a}),l=new n({hex:t}),f=new n({hex:e}),p=new i({hex:r}),d=new s({array:[h,l,f,p]});return this.hTLV=d.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},ie(ft.asn1.ocsp.CertID,ft.asn1.ASN1Object),ft.asn1.ocsp.CertStatus=function(t){ft.asn1.ocsp.CertStatus.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if("good"==t.status)return"8000";if("unknown"==t.status)return"8200";if("revoked"==t.status){var e=[{gentime:{str:t.time}}];null!=t.reason&&e.push({tag:{tag:"a0",explicit:!0,obj:{enum:{int:t.reason}}}});var r={tag:"a1",explicit:!1,obj:{seq:e}};return ft.asn1.ASN1Util.newObject({tag:r}).tohex()}throw new Error("bad status")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},ie(ft.asn1.ocsp.CertStatus,ft.asn1.ASN1Object),ft.asn1.ocsp.Request=function(t){var e=ft.asn1,r=e.DERSequence,n=e.ocsp;if(n.Request.superclass.constructor.call(this),this.dReqCert=null,this.dExt=null,this.tohex=function(){var t=[];if(null===this.dReqCert)throw"reqCert not set";t.push(this.dReqCert);var e=new r({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t){var i=new n.CertID(t);this.dReqCert=i}},ie(ft.asn1.ocsp.Request,ft.asn1.ASN1Object),ft.asn1.ocsp.TBSRequest=function(t){var e=ft.asn1,r=e.DERSequence,n=e.ocsp;n.TBSRequest.superclass.constructor.call(this),this.version=0,this.dRequestorName=null,this.dRequestList=[],this.dRequestExt=null,this.setRequestListByParam=function(t){for(var e=[],r=0;r<t.length;r++){var i=new n.Request(t[0]);e.push(i)}this.dRequestList=e},this.tohex=function(){var t=[];if(0!==this.version)throw"not supported version: "+this.version;if(null!==this.dRequestorName)throw"requestorName not supported";var e=new r({array:this.dRequestList});if(t.push(e),null!==this.dRequestExt)throw"requestExtensions not supported";var n=new r({array:t});return this.hTLV=n.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&void 0!==t.reqList&&this.setRequestListByParam(t.reqList)},ie(ft.asn1.ocsp.TBSRequest,ft.asn1.ASN1Object),ft.asn1.ocsp.OCSPRequest=function(t){var e=ft.asn1,r=e.DERSequence,n=e.ocsp;if(n.OCSPRequest.superclass.constructor.call(this),this.dTbsRequest=null,this.dOptionalSignature=null,this.tohex=function(){var t=[];if(null===this.dTbsRequest)throw"tbsRequest not set";if(t.push(this.dTbsRequest),null!==this.dOptionalSignature)throw"optionalSignature not supported";var e=new r({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&void 0!==t.reqList){var i=new n.TBSRequest(t);this.dTbsRequest=i}},ie(ft.asn1.ocsp.OCSPRequest,ft.asn1.ASN1Object),ft.asn1.ocsp.OCSPUtil={},ft.asn1.ocsp.OCSPUtil.getRequestHex=function(t,e,r){var n=ft.asn1.ocsp;void 0===r&&(r=n.DEFAULT_HASH);var i={alg:r,issuerCert:t,subjectCert:e};return new n.OCSPRequest({reqList:[i]}).tohex()},ft.asn1.ocsp.OCSPUtil.getOCSPResponseInfo=function(t){var e=gt,r=e.getVbyList,n=e.getVbyListEx,i=e.getIdxbyList,s=(e.getIdxbyListEx,e.getV),o={};try{var a=n(t,0,[0],"0a");o.responseStatus=parseInt(a,16)}catch(t){}if(0!==o.responseStatus)return o;try{var u=i(t,0,[1,0,1,0,0,2,0,1]);"80"===t.substr(u,2)?o.certStatus="good":"a1"===t.substr(u,2)?(o.certStatus="revoked",o.revocationTime=Ft(r(t,u,[0]))):"82"===t.substr(u,2)&&(o.certStatus="unknown")}catch(t){}try{var c=i(t,0,[1,0,1,0,0,2,0,2]);o.thisUpdate=Ft(s(t,c))}catch(t){}try{var h=i(t,0,[1,0,1,0,0,2,0,3]);"a0"===t.substr(h,2)&&(o.nextUpdate=Ft(r(t,h,[0])))}catch(t){}return o},ft.asn1.ocsp.OCSPParser=function(){var t=Error,e=ce,r=new e,n=gt,i=n.getV,s=n.getTLV,o=n.getIdxbyList,a=n.getVbyList,u=n.getTLVbyList,c=n.getVbyListEx,h=n.getTLVbyListEx,l=n.getChildIdx;this.getOCSPRequest=function(e){var r=l(e,0);if(1!=r.length&&2!=r.length)throw new t("wrong number elements: "+r.length);return this.getTBSRequest(s(e,r[0]))},this.getTBSRequest=function(t){var e={},n=h(t,0,[0],"30");e.array=this.getRequestList(n);var i=h(t,0,["[2]",0],"30");return null!=i&&(e.ext=r.getExtParamArray(i)),e},this.getRequestList=function(t){for(var e=[],r=l(t,0),n=0;n<r.length;n++)t=s(t,r[n]),e.push(this.getRequest(t));return e},this.getRequest=function(e){var n=l(e,0);if(1!=n.length&&2!=n.length)throw new t("wrong number elements: "+n.length);var i=this.getCertID(s(e,n[0]));if(2==n.length){var a=o(e,0,[1,0]);i.ext=r.getExtParamArray(s(e,a))}return i},this.getCertID=function(r){var n=l(r,0);if(4!=n.length)throw new t("wrong number elements: "+n.length);var o=new e,a={};return a.alg=o.getAlgorithmIdentifierName(s(r,n[0])),a.issname=i(r,n[1]),a.isskey=i(r,n[2]),a.sbjsn=i(r,n[3]),a},this.getOCSPResponse=function(t){var e,r=l(t,0),n=i(t,r[0]),s=parseInt(n);if(1==r.length)return{resstatus:s};var o=u(t,0,[1,0]);return(e=this.getResponseBytes(o)).resstatus=s,e},this.getResponseBytes=function(t){var e,r=l(t,0),n=u(t,0,[1,0]);e=this.getBasicOCSPResponse(n);var s=i(t,r[0]);return e.restype=ft.asn1.x509.OID.oid2name(Yt(s)),e},this.getBasicOCSPResponse=function(t){var e,r=l(t,0);e=this.getResponseData(s(t,r[0]));var n=new ce;e.alg=n.getAlgorithmIdentifierName(s(t,r[1]));var o=i(t,r[2]);e.sighex=o.substr(2);var a=c(t,0,["[0]"]);if(null!=a){for(var u=l(a,0),h=[],f=0;f<u.length;f++){var p=s(a,u[f]);h.push(p)}e.certs=h}return e},this.getResponseData=function(t){var e=l(t,0),r=e.length,n={},o=0;"a0"==t.substr(e[0],2)&&o++,n.respid=this.getResponderID(s(t,e[o++]));var a=i(t,e[o++]);if(n.prodat=Ft(a),n.array=this.getSingleResponseList(s(t,e[o++])),"a1"==t.substr(e[r-1],2)){var c=u(t,e[r-1],[0]),h=new ce;n.ext=h.getExtParamArray(c)}return n},this.getResponderID=function(t){var e={};if("a2"==t.substr(0,2)){var r=a(t,0,[0]);e.key=r}if("a1"==t.substr(0,2)){var n=u(t,0,[0]),i=new ce;e.name=i.getX500Name(n)}return e},this.getSingleResponseList=function(t){for(var e=l(t,0),r=[],n=0;n<e.length;n++){var i=this.getSingleResponse(s(t,e[n]));r.push(i)}return r},this.getSingleResponse=function(t){var e=l(t,0),r={},n=this.getCertID(s(t,e[0]));r.certid=n;var o=this.getCertStatus(s(t,e[1]));if(r.status=o,"18"==t.substr(e[2],2)){var c=i(t,e[2]);r.thisupdate=Ft(c)}for(var h=3;h<e.length;h++){if("a0"==t.substr(e[h],2)){var f=a(t,e[h],[0],"18");r.nextupdate=Ft(f)}if("a1"==t.substr(e[h],2)){var p=new ce,d=u(t,0,[h,0]);r.ext=p.getExtParamArray(d)}}return r},this.getCertStatus=function(t){var e={};if("8000"==t)return{status:"good"};if("8200"==t)return{status:"unknown"};if("a1"==t.substr(0,2)){e.status="revoked";var r=Ft(a(t,0,[0]));e.time=r}return e}},void 0!==ft&&ft||(ft={}),void 0!==ft.lang&&ft.lang||(ft.lang={}),ft.lang.String=function(){},"function"==typeof e?(pt=function(t){return wt(e.from(t,"utf8").toString("base64"))},dt=function(t){return e.from(bt(t),"base64").toString("utf8")}):(pt=function(t){return St(_t(zt(t)))},dt=function(t){return decodeURIComponent(kt(Et(t)))}),ft.lang.String.isInteger=function(t){return!!t.match(/^[0-9]+$/)||!!t.match(/^-[0-9]+$/)},ft.lang.String.isHex=function(t){return Wt(t)},ft.lang.String.isBase64=function(t){return!(!(t=t.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||t.length%4!=0)},ft.lang.String.isBase64URL=function(t){return!t.match(/[+/=]/)&&(t=bt(t),ft.lang.String.isBase64(t))},ft.lang.String.isIntegerArray=function(t){return!!(t=t.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},ft.lang.String.isPrintable=function(t){return null!==t.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},ft.lang.String.isIA5=function(t){return null!==t.match(/^[\x20-\x21\x23-\x7f]*$/)},ft.lang.String.isMail=function(t){return null!==t.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};var Zt=function(t,e,r){return null==r&&(r="0"),t.length>=e?t:new Array(e-t.length+1).join(r)+t};function Qt(t){if(t.length%2!=0)return-1;if(null==(t=t.toLowerCase()).match(/^[0-9a-f]+$/))return-1;try{var e=t.substr(0,2);if("00"==e)return parseInt(t.substr(2),16);var r=parseInt(e,16);if(r>7)return-1;var n=t.substr(2),i=parseInt(n,16).toString(2);"0"==i&&(i="00000000"),i=i.slice(0,0-r);var s=parseInt(i,2);return NaN==s?-1:s}catch(t){return-1}}function te(t){if("number"!=typeof t)return null;if(t<0)return null;var e=Number(t).toString(2),r=8-e.length%8;8==r&&(r=0),e+=Zt("",r,"0");var n=parseInt(e,2).toString(16);return n.length%2==1&&(n="0"+n),"0"+r+n}function ee(t){if("string"!=typeof t)return null;if(t.length%2!=0)return null;if(!t.match(/^[0-9a-f]+$/))return null;try{var e=parseInt(t.substr(0,2),16);if(e<0||7<e)return null;for(var r=t.substr(2),n="",i=0;i<r.length;i+=2){var s=r.substr(i,2),o=parseInt(s,16).toString(2);n+=o=("0000000"+o).slice(-8)}return n.substr(0,n.length-e)}catch(t){return null}}function re(t,e){for(var r=0,n=0;n<t.length;n++)r|=1<<e[t[n]];var i=r.toString(2),s="";for(n=i.length-1;n>=0;n--)s+=i[n];return s}function ne(t,e,r){if("object"==typeof t){e=String(e).split(".");for(var n=0;n<e.length&&t;n++){var i=e[n];i.match(/^[0-9]+$/)&&(i=parseInt(i)),t=t[i]}return t||!1===t?t:r}}function ie(t,e){var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e)}void 0!==ft&&ft||(ft={}),void 0!==ft.crypto&&ft.crypto||(ft.crypto={}),ft.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:y.algo.MD5,sha1:y.algo.SHA1,sha224:y.algo.SHA224,sha256:y.algo.SHA256,sha384:y.algo.SHA384,sha512:y.algo.SHA512,ripemd160:y.algo.RIPEMD160},this.getDigestInfoHex=function(t,e){if(void 0===this.DIGESTINFOHEAD[e])throw"alg not supported in Util.DIGESTINFOHEAD: "+e;return this.DIGESTINFOHEAD[e]+t},this.getPaddedDigestInfoHex=function(t,e,r){var n=this.getDigestInfoHex(t,e),i=r/4;if(n.length+22>i)throw"key is too short for SigAlg: keylen="+r+","+e;for(var s="00"+n,o="",a=i-4-s.length,u=0;u<a;u+=2)o+="ff";return"0001"+o+s},this.hashString=function(t,e){return new ft.crypto.MessageDigest({alg:e}).digestString(t)},this.hashHex=function(t,e){return new ft.crypto.MessageDigest({alg:e}).digestHex(t)},this.sha1=function(t){return this.hashString(t,"sha1")},this.sha256=function(t){return this.hashString(t,"sha256")},this.sha256Hex=function(t){return this.hashHex(t,"sha256")},this.sha512=function(t){return this.hashString(t,"sha512")},this.sha512Hex=function(t){return this.hashHex(t,"sha512")},this.isKey=function(t){return t instanceof ot||t instanceof ft.crypto.DSA||t instanceof ft.crypto.ECDSA}},ft.crypto.Util.md5=function(t){return new ft.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(t)},ft.crypto.Util.ripemd160=function(t){return new ft.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(t)},ft.crypto.Util.SECURERANDOMGEN=new nt,ft.crypto.Util.getRandomHexOfNbytes=function(t){var e=new Array(t);return ft.crypto.Util.SECURERANDOMGEN.nextBytes(e),mt(e)},ft.crypto.Util.getRandomBigIntegerOfNbytes=function(t){return new E(ft.crypto.Util.getRandomHexOfNbytes(t),16)},ft.crypto.Util.getRandomHexOfNbits=function(t){var e=t%8,r=new Array((t-e)/8+1);return ft.crypto.Util.SECURERANDOMGEN.nextBytes(r),r[0]=(255<<e&255^255)&r[0],mt(r)},ft.crypto.Util.getRandomBigIntegerOfNbits=function(t){return new E(ft.crypto.Util.getRandomHexOfNbits(t),16)},ft.crypto.Util.getRandomBigIntegerZeroToMax=function(t){for(var e=t.bitLength();;){var r=ft.crypto.Util.getRandomBigIntegerOfNbits(e);if(-1!=t.compareTo(r))return r}},ft.crypto.Util.getRandomBigIntegerMinToMax=function(t,e){var r=t.compareTo(e);if(1==r)throw"biMin is greater than biMax";if(0==r)return t;var n=e.subtract(t);return ft.crypto.Util.getRandomBigIntegerZeroToMax(n).add(t)},ft.crypto.MessageDigest=function(t){this.setAlgAndProvider=function(t,e){if(null!==(t=ft.crypto.MessageDigest.getCanonicalAlgName(t))&&void 0===e&&(e=ft.crypto.Util.DEFAULTPROVIDER[t]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)&&"cryptojs"==e){try{this.md=ft.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=y.enc.Hex.parse(t);this.md.update(e)},this.digest=function(){return this.md.finalize().toString(y.enc.Hex)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}if(-1!=":sha256:".indexOf(t)&&"sjcl"==e){try{this.md=new sjcl.hash.sha256}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=sjcl.codec.hex.toBits(t);this.md.update(e)},this.digest=function(){var t=this.md.finalize();return sjcl.codec.hex.fromBits(t)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==t&&void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=ft.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},ft.crypto.MessageDigest.getCanonicalAlgName=function(t){return"string"==typeof t&&(t=(t=t.toLowerCase()).replace(/-/,"")),t},ft.crypto.MessageDigest.getHashLength=function(t){var e=ft.crypto.MessageDigest,r=e.getCanonicalAlgName(t);if(void 0===e.HASHLENGTH[r])throw"not supported algorithm: "+t;return e.HASHLENGTH[r]},ft.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},ft.crypto.Mac=function(t){this.setAlgAndProvider=function(t,e){if(null==(t=t.toLowerCase())&&(t="hmacsha1"),"hmac"!=(t=t.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+t;void 0===e&&(e=ft.crypto.Util.DEFAULTPROVIDER[t]),this.algProv=t+"/"+e;var r=t.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(r)&&"cryptojs"==e){try{var n=ft.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[r];this.mac=y.algo.HMAC.create(n,this.pass)}catch(t){throw"setAlgAndProvider hash alg set fail hashAlg="+r+"/"+t}this.updateString=function(t){this.mac.update(t)},this.updateHex=function(t){var e=y.enc.Hex.parse(t);this.mac.update(e)},this.doFinal=function(){return this.mac.finalize().toString(y.enc.Hex)},this.doFinalString=function(t){return this.updateString(t),this.doFinal()},this.doFinalHex=function(t){return this.updateHex(t),this.doFinal()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(t){if("string"==typeof t){var e=t;return t.length%2!=1&&t.match(/^[0-9A-Fa-f]+$/)||(e=It(t)),void(this.pass=y.enc.Hex.parse(e))}if("object"!=typeof t)throw"KJUR.crypto.Mac unsupported password type: "+t;if(e=null,void 0!==t.hex){if(t.hex.length%2!=0||!t.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+t.hex;e=t.hex}if(void 0!==t.utf8&&(e=At(t.utf8)),void 0!==t.rstr&&(e=It(t.rstr)),void 0!==t.b64&&(e=b(t.b64)),void 0!==t.b64u&&(e=Et(t.b64u)),null==e)throw"KJUR.crypto.Mac unsupported password type: "+t;this.pass=y.enc.Hex.parse(e)},void 0!==t&&(void 0!==t.pass&&this.setPassword(t.pass),void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=ft.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},ft.crypto.Signature=function(t){var e=null;if(this._setAlgNames=function(){var t=this.algName.match(/^(.+)with(.+)$/);t&&(this.mdAlgName=t[1].toLowerCase(),this.pubkeyAlgName=t[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(t,e){for(var r="",n=e/4-t.length,i=0;i<n;i++)r+="0";return r+t},this.setAlgAndProvider=function(t,e){if(this._setAlgNames(),"cryptojs/jsrsa"!=e)throw new Error("provider not supported: "+e);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new ft.crypto.MessageDigest({alg:this.mdAlgName})}catch(t){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+t)}this.init=function(t,e){var r=null;try{r=void 0===e?se.getKey(t):se.getKey(t,e)}catch(t){throw"init failed:"+t}if(!0===r.isPrivate)this.prvKey=r,this.state="SIGN";else{if(!0!==r.isPublic)throw"init failed.:"+r;this.pubKey=r,this.state="VERIFY"}},this.updateString=function(t){this.md.updateString(t)},this.updateHex=function(t){this.md.updateHex(t)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==ft.crypto.ECDSA&&(this.prvKey=new ft.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof ot&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof ot&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof ft.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof ft.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(t){return this.updateString(t),this.sign()},this.signHex=function(t){return this.updateHex(t),this.sign()},this.verify=function(t){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==ft.crypto.ECDSA&&(this.pubKey=new ft.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof ot&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,t,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof ot&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==ft.crypto.ECDSA&&this.pubKey instanceof ft.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==ft.crypto.DSA&&this.pubKey instanceof ft.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(t,e){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(t){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(t){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(t){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(t){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=t,void 0!==t&&(void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov?this.provName=ft.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=t.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==t.psssaltlen&&(this.pssSaltLen=t.psssaltlen),void 0!==t.prvkeypem)){if(void 0!==t.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{e=se.getKey(t.prvkeypem),this.init(e)}catch(t){throw"fatal error to load pem private key: "+t}}},ft.crypto.Cipher=function(t){},ft.crypto.Cipher.encrypt=function(t,e,r){if(e instanceof ot&&e.isPublic){var n=ft.crypto.Cipher.getAlgByKeyAndName(e,r);if("RSA"===n)return e.encrypt(t);if("RSAOAEP"===n)return e.encryptOAEP(t,"sha1");var i=n.match(/^RSAOAEP(\d+)$/);if(null!==i)return e.encryptOAEP(t,"sha"+i[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+r}throw"Cipher.encrypt: unsupported key or algorithm"},ft.crypto.Cipher.decrypt=function(t,e,r){if(e instanceof ot&&e.isPrivate){var n=ft.crypto.Cipher.getAlgByKeyAndName(e,r);if("RSA"===n)return e.decrypt(t);if("RSAOAEP"===n)return e.decryptOAEP(t,"sha1");var i=n.match(/^RSAOAEP(\d+)$/);if(null!==i)return e.decryptOAEP(t,"sha"+i[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+r}throw"Cipher.decrypt: unsupported key or algorithm"},ft.crypto.Cipher.getAlgByKeyAndName=function(t,e){if(t instanceof ot){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(e))return e;if(null==e)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+e}throw"getAlgByKeyAndName: not supported algorithm name: "+e},ft.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040022":"secp384r1","2b81040023":"secp521r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},void 0!==ft&&ft||(ft={}),void 0!==ft.crypto&&ft.crypto||(ft.crypto={}),ft.crypto.ECDSA=function(t){var e=Error,r=E,n=ct,i=ft.crypto.ECDSA,s=ft.crypto.ECParameterDB,o=i.getName,a=gt,u=a.getVbyListEx,c=a.isASN1HEX,h=new nt;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(t){return new r(t.bitLength(),h).mod(t.subtract(r.ONE)).add(r.ONE)},this.setNamedCurve=function(t){this.ecparams=s.getByName(t),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=t},this.setPrivateKeyHex=function(t){this.isPrivate=!0,this.prvKeyHex=t},this.setPublicKeyHex=function(t){this.isPublic=!0,this.pubKeyHex=t},this.getPublicKeyXYHex=function(){var t=this.pubKeyHex;if("04"!==t.substr(0,2))throw"this method supports uncompressed format(04) only";var e=this.ecparams.keycharlen;if(t.length!==2+2*e)throw"malformed public key hex length";var r={};return r.x=t.substr(2,e),r.y=t.substr(2+e),r},this.getShortNISTPCurveName=function(){var t=this.curveName;return"secp256r1"===t||"NIST P-256"===t||"P-256"===t||"prime256v1"===t?"P-256":"secp384r1"===t||"NIST P-384"===t||"P-384"===t?"P-384":"secp521r1"===t||"NIST P-521"===t||"P-521"===t?"P-521":null},this.generateKeyPairHex=function(){var t=this.ecparams.n,e=this.getBigRandom(t),r=this.ecparams.keycharlen,n=("0000000000"+e.toString(16)).slice(-r);return this.setPrivateKeyHex(n),{ecprvhex:n,ecpubhex:this.generatePublicKeyHex()}},this.generatePublicKeyHex=function(){var t=new r(this.prvKeyHex,16),e=this.ecparams.G.multiply(t),n=e.getX().toBigInteger(),i=e.getY().toBigInteger(),s=this.ecparams.keycharlen,o="04"+("0000000000"+n.toString(16)).slice(-s)+("0000000000"+i.toString(16)).slice(-s);return this.setPublicKeyHex(o),o},this.signWithMessageHash=function(t){return this.signHex(t,this.prvKeyHex)},this.signHex=function(t,e){var n=new r(e,16),s=this.ecparams.n,o=new r(t.substring(0,this.ecparams.keycharlen),16);do{var a=this.getBigRandom(s),u=this.ecparams.G.multiply(a).getX().toBigInteger().mod(s)}while(u.compareTo(r.ZERO)<=0);var c=a.modInverse(s).multiply(o.add(n.multiply(u))).mod(s);return i.biRSSigToASN1Sig(u,c)},this.sign=function(t,e){var n=e,i=this.ecparams.n,s=r.fromByteArrayUnsigned(t);do{var o=this.getBigRandom(i),a=this.ecparams.G.multiply(o).getX().toBigInteger().mod(i)}while(a.compareTo(E.ZERO)<=0);var u=o.modInverse(i).multiply(s.add(n.multiply(a))).mod(i);return this.serializeSig(a,u)},this.verifyWithMessageHash=function(t,e){return this.verifyHex(t,e,this.pubKeyHex)},this.verifyHex=function(t,e,s){try{var o,a,u=i.parseSigHex(e);o=u.r,a=u.s;var c=n.decodeFromHex(this.ecparams.curve,s),h=new r(t.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(h,o,a,c)}catch(t){return!1}},this.verify=function(t,e,i){var s,o,a;if(Bitcoin.Util.isArray(e)){var u=this.parseSig(e);s=u.r,o=u.s}else{if("object"!=typeof e||!e.r||!e.s)throw"Invalid value for signature";s=e.r,o=e.s}if(i instanceof ct)a=i;else{if(!Bitcoin.Util.isArray(i))throw"Invalid format for pubkey value, must be byte array or ECPointFp";a=n.decodeFrom(this.ecparams.curve,i)}var c=r.fromByteArrayUnsigned(t);return this.verifyRaw(c,s,o,a)},this.verifyRaw=function(t,e,n,i){var s=this.ecparams.n,o=this.ecparams.G;if(e.compareTo(r.ONE)<0||e.compareTo(s)>=0)return!1;if(n.compareTo(r.ONE)<0||n.compareTo(s)>=0)return!1;var a=n.modInverse(s),u=t.multiply(a).mod(s),c=e.multiply(a).mod(s);return o.multiply(u).add(i.multiply(c)).getX().toBigInteger().mod(s).equals(e)},this.serializeSig=function(t,e){var r=t.toByteArraySigned(),n=e.toByteArraySigned(),i=[];return i.push(2),i.push(r.length),(i=i.concat(r)).push(2),i.push(n.length),(i=i.concat(n)).unshift(i.length),i.unshift(48),i},this.parseSig=function(t){var e;if(48!=t[0])throw new Error("Signature not a valid DERSequence");if(2!=t[e=2])throw new Error("First element in signature must be a DERInteger");var n=t.slice(e+2,e+2+t[e+1]);if(2!=t[e+=2+t[e+1]])throw new Error("Second element in signature must be a DERInteger");var i=t.slice(e+2,e+2+t[e+1]);return e+=2+t[e+1],{r:r.fromByteArrayUnsigned(n),s:r.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(t){if(65!==t.length)throw"Signature has the wrong length";var e=t[0]-27;if(e<0||e>7)throw"Invalid signature type";var n=this.ecparams.n;return{r:r.fromByteArrayUnsigned(t.slice(1,33)).mod(n),s:r.fromByteArrayUnsigned(t.slice(33,65)).mod(n),i:e}},this.readPKCS5PrvKeyHex=function(t){if(!1===c(t))throw new Error("not ASN.1 hex string");var e,r,n;try{e=u(t,0,["[0]",0],"06"),r=u(t,0,[1],"04");try{n=u(t,0,["[1]",0],"03")}catch(t){}}catch(t){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=o(e),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(n),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var r,n,i;try{u(t,0,[1,0],"06"),r=u(t,0,[1,1],"06"),n=u(t,0,[2,0,1],"04");try{i=u(t,0,[2,0,"[1]",0],"03")}catch(t){}}catch(t){throw new e("malformed PKCS#8 plain ECC private key")}if(this.curveName=o(r),void 0===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PubKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var r,n;try{u(t,0,[0,0],"06"),r=u(t,0,[0,1],"06"),n=u(t,0,[1],"03")}catch(t){throw new e("malformed PKCS#8 ECC public key")}if(this.curveName=o(r),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(n)},this.readCertPubKeyHex=function(t,r){if(!1===c(t))throw new e("not ASN.1 hex string");var n,i;try{n=u(t,0,[0,5,0,1],"06"),i=u(t,0,[0,5,1],"03")}catch(t){throw new e("malformed X.509 certificate ECC public key")}if(this.curveName=o(n),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==t&&void 0!==t.curve&&(this.curveName=t.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==t&&(void 0!==t.prv&&this.setPrivateKeyHex(t.prv),void 0!==t.pub&&this.setPublicKeyHex(t.pub))},ft.crypto.ECDSA.parseSigHex=function(t){var e=ft.crypto.ECDSA.parseSigHexInHexRS(t);return{r:new E(e.r,16),s:new E(e.s,16)}},ft.crypto.ECDSA.parseSigHexInHexRS=function(t){var e=gt,r=e.getChildIdx,n=e.getV;if(e.checkStrictDER(t,0),"30"!=t.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=r(t,0);if(2!=i.length)throw new Error("signature shall have two elements");var s=i[0],o=i[1];if("02"!=t.substr(s,2))throw new Error("1st item not ASN.1 integer");if("02"!=t.substr(o,2))throw new Error("2nd item not ASN.1 integer");return{r:n(t,s),s:n(t,o)}},ft.crypto.ECDSA.asn1SigToConcatSig=function(t){var e=ft.crypto.ECDSA.parseSigHexInHexRS(t),r=e.r,n=e.s;if(r.length>=130&&r.length<=134){if(r.length%2!=0)throw Error("unknown ECDSA sig r length error");if(n.length%2!=0)throw Error("unknown ECDSA sig s length error");"00"==r.substr(0,2)&&(r=r.substr(2)),"00"==n.substr(0,2)&&(n=n.substr(2));var i=Math.max(r.length,n.length);return(r=("000000"+r).slice(-i))+("000000"+n).slice(-i)}if("00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),"00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),r.length%32==30&&(r="00"+r),n.length%32==30&&(n="00"+n),r.length%32!=0)throw Error("unknown ECDSA sig r length error");if(n.length%32!=0)throw Error("unknown ECDSA sig s length error");return r+n},ft.crypto.ECDSA.concatSigToASN1Sig=function(t){if(t.length%4!=0)throw Error("unknown ECDSA concatinated r-s sig length error");var e=t.substr(0,t.length/2),r=t.substr(t.length/2);return ft.crypto.ECDSA.hexRSSigToASN1Sig(e,r)},ft.crypto.ECDSA.hexRSSigToASN1Sig=function(t,e){var r=new E(t,16),n=new E(e,16);return ft.crypto.ECDSA.biRSSigToASN1Sig(r,n)},ft.crypto.ECDSA.biRSSigToASN1Sig=function(t,e){var r=ft.asn1,n=new r.DERInteger({bigint:t}),i=new r.DERInteger({bigint:e});return new r.DERSequence({array:[n,i]}).tohex()},ft.crypto.ECDSA.getName=function(t){return"2b8104001f"===t?"secp192k1":"2a8648ce3d030107"===t?"secp256r1":"2b8104000a"===t?"secp256k1":"2b81040021"===t?"secp224r1":"2b81040022"===t?"secp384r1":"2b81040023"===t?"secp521r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(t)?"secp256r1":-1!=="|secp256k1|".indexOf(t)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(t)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(t)?"secp384r1":-1!=="|secp521r1|NIST P-521|P-521|".indexOf(t)?"secp521r1":null},void 0!==ft&&ft||(ft={}),void 0!==ft.crypto&&ft.crypto||(ft.crypto={}),ft.crypto.ECParameterDB=new function(){var t={},e={};function r(t){return new E(t,16)}this.getByName=function(r){var n=r;if(void 0!==e[n]&&(n=e[r]),void 0!==t[n])return t[n];throw"unregistered EC curve name: "+n},this.regist=function(n,i,s,o,a,u,c,h,l,f,p,d){t[n]={};var g=r(s),y=r(o),v=r(a),m=r(u),x=r(c),w=new ht(g,y,v),b=w.decodePointHex("04"+h+l);t[n].name=n,t[n].keylen=i,t[n].keycharlen=2*Math.ceil(i/8),t[n].curve=w,t[n].G=b,t[n].n=m,t[n].h=x,t[n].oid=p,t[n].info=d;for(var S=0;S<f.length;S++)e[f[S]]=n}},ft.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),ft.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),ft.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),ft.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),ft.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),ft.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),ft.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),ft.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),ft.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),ft.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]),void 0!==ft&&ft||(ft={}),void 0!==ft.crypto&&ft.crypto||(ft.crypto={}),ft.crypto.DSA=function(){var t=gt,e=(t.getVbyList,t.getVbyListEx),r=t.isASN1HEX,n=E;this.p=null,this.q=null,this.g=null,this.y=null,this.x=null,this.type="DSA",this.isPrivate=!1,this.isPublic=!1,this.setPrivate=function(t,e,r,n,i){this.isPrivate=!0,this.p=t,this.q=e,this.g=r,this.y=n,this.x=i},this.setPrivateHex=function(t,e,r,n,i){var s,o,a,u,c;s=new E(t,16),o=new E(e,16),a=new E(r,16),u="string"==typeof n&&n.length>1?new E(n,16):null,c=new E(i,16),this.setPrivate(s,o,a,u,c)},this.setPublic=function(t,e,r,n){this.isPublic=!0,this.p=t,this.q=e,this.g=r,this.y=n,this.x=null},this.setPublicHex=function(t,e,r,n){var i,s,o,a;i=new E(t,16),s=new E(e,16),o=new E(r,16),a=new E(n,16),this.setPublic(i,s,o,a)},this.signWithMessageHash=function(t){var e=this.p,r=this.q,n=this.g,i=(this.y,this.x),s=ft.crypto.Util.getRandomBigIntegerMinToMax(E.ONE.add(E.ONE),r.subtract(E.ONE)),o=new E(t.substr(0,r.bitLength()/4),16),a=n.modPow(s,e).mod(r),u=s.modInverse(r).multiply(o.add(i.multiply(a))).mod(r);return ft.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:a}},{int:{bigint:u}}]})},this.verifyWithMessageHash=function(t,e){var r=this.p,n=this.q,i=this.g,s=this.y,o=this.parseASN1Signature(e),a=o[0],u=o[1],c=new E(t.substr(0,n.bitLength()/4),16);if(E.ZERO.compareTo(a)>0||a.compareTo(n)>0)throw"invalid DSA signature";if(E.ZERO.compareTo(u)>=0||u.compareTo(n)>0)throw"invalid DSA signature";var h=u.modInverse(n),l=c.multiply(h).mod(n),f=a.multiply(h).mod(n);return 0==i.modPow(l,r).multiply(s.modPow(f,r)).mod(r).mod(n).compareTo(a)},this.parseASN1Signature=function(t){try{return[new n(e(t,0,[0],"02"),16),new n(e(t,0,[1],"02"),16)]}catch(t){throw new Error("malformed ASN.1 DSA signature")}},this.readPKCS5PrvKeyHex=function(t){var n,i,s,o,a;if(!1===r(t))throw new Error("not ASN.1 hex string");try{n=e(t,0,[1],"02"),i=e(t,0,[2],"02"),s=e(t,0,[3],"02"),o=e(t,0,[4],"02"),a=e(t,0,[5],"02")}catch(t){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(n,i,s,o,a)},this.readPKCS8PrvKeyHex=function(t){var n,i,s,o;if(!1===r(t))throw new Error("not ASN.1 hex string");try{n=e(t,0,[1,1,0],"02"),i=e(t,0,[1,1,1],"02"),s=e(t,0,[1,1,2],"02"),o=e(t,0,[2,0],"02")}catch(t){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(n,i,s,null,o)},this.readPKCS8PubKeyHex=function(t){var n,i,s,o;if(!1===r(t))throw new Error("not ASN.1 hex string");try{n=e(t,0,[0,1,0],"02"),i=e(t,0,[0,1,1],"02"),s=e(t,0,[0,1,2],"02"),o=e(t,0,[1,0],"02")}catch(t){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(n,i,s,o)},this.readCertPubKeyHex=function(t,n){var i,s,o,a;if(!1===r(t))throw new Error("not ASN.1 hex string");try{i=e(t,0,[0,5,0,1,0],"02"),s=e(t,0,[0,5,0,1,1],"02"),o=e(t,0,[0,5,0,1,2],"02"),a=e(t,0,[0,5,1,0],"02")}catch(t){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(i,s,o,a)}};var se=function(){var t=function(t,r,n){return e(y.AES,t,r,n)},e=function(t,e,r,n){var i=y.enc.Hex.parse(e),s=y.enc.Hex.parse(r),o=y.enc.Hex.parse(n),a={};a.key=s,a.iv=o,a.ciphertext=i;var u=t.decrypt(a,s,{iv:o});return y.enc.Hex.stringify(u)},r=function(t,e,r){return n(y.AES,t,e,r)},n=function(t,e,r,n){var i=y.enc.Hex.parse(e),s=y.enc.Hex.parse(r),o=y.enc.Hex.parse(n),a=t.encrypt(i,s,{iv:o}),u=y.enc.Hex.parse(a.toString());return y.enc.Base64.stringify(u)},i={"AES-256-CBC":{proc:t,eproc:r,keylen:32,ivlen:16},"AES-192-CBC":{proc:t,eproc:r,keylen:24,ivlen:16},"AES-128-CBC":{proc:t,eproc:r,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(t,r,n){return e(y.TripleDES,t,r,n)},eproc:function(t,e,r){return n(y.TripleDES,t,e,r)},keylen:24,ivlen:8},"DES-CBC":{proc:function(t,r,n){return e(y.DES,t,r,n)},eproc:function(t,e,r){return n(y.DES,t,e,r)},keylen:8,ivlen:8}},s=function(t){var e={},r=t.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));r&&(e.cipher=r[1],e.ivsalt=r[2]);var n=t.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));n&&(e.type=n[1]);var i=-1,s=0;-1!=t.indexOf("\r\n\r\n")&&(i=t.indexOf("\r\n\r\n"),s=2),-1!=t.indexOf("\n\n")&&(i=t.indexOf("\n\n"),s=1);var o=t.indexOf("-----END");if(-1!=i&&-1!=o){var a=t.substring(i+2*s,o-s);a=a.replace(/\s+/g,""),e.data=a}return e},o=function(t,e,r){for(var n=r.substring(0,16),s=y.enc.Hex.parse(n),o=y.enc.Utf8.parse(e),a=i[t].keylen+i[t].ivlen,u="",c=null;;){var h=y.algo.MD5.create();if(null!=c&&h.update(c),h.update(o),h.update(s),c=h.finalize(),(u+=y.enc.Hex.stringify(c)).length>=2*a)break}var l={};return l.keyhex=u.substr(0,2*i[t].keylen),l.ivhex=u.substr(2*i[t].keylen,2*i[t].ivlen),l},a=function(t,e,r,n){var s=y.enc.Base64.parse(t),o=y.enc.Hex.stringify(s);return(0,i[e].proc)(o,r,n)};return{version:"1.0.0",parsePKCS5PEM:function(t){return s(t)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(t,e,r){return o(t,e,r)},decryptKeyB64:function(t,e,r,n){return a(t,e,r,n)},getDecryptedKeyHex:function(t,e){var r=s(t),n=(r.type,r.cipher),i=r.ivsalt,u=r.data,c=o(n,e,i).keyhex;return a(u,n,c,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(t,e,r,n,s){var a="";if(void 0!==n&&null!=n||(n="AES-256-CBC"),void 0===i[n])throw new Error("KEYUTIL unsupported algorithm: "+n);void 0!==s&&null!=s||(s=function(t){var e=y.lib.WordArray.random(t);return y.enc.Hex.stringify(e)}(i[n].ivlen).toUpperCase());return a="-----BEGIN "+t+" PRIVATE KEY-----\r\n",a+="Proc-Type: 4,ENCRYPTED\r\n",a+="DEK-Info: "+n+","+s+"\r\n",a+="\r\n",(a+=function(t,e,r,n){return(0,i[e].eproc)(t,r,n)}(e,n,o(n,r,s).keyhex,s).replace(/(.{64})/g,"$1\r\n"))+"\r\n-----END "+t+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(t){var e=gt,r=e.getChildIdx,n=e.getV,i={},s=r(t,0);if(2!=s.length)throw new Error("malformed format: SEQUENCE(0).items != 2: "+s.length);i.ciphertext=n(t,s[1]);var o=r(t,s[0]);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+o.length);if("2a864886f70d01050d"!=n(t,o[0]))throw new Error("this only supports pkcs5PBES2");var a=r(t,o[1]);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+a.length);var u=r(t,a[1]);if(2!=u.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+u.length);if("2a864886f70d0307"!=n(t,u[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=n(t,u[1]);var c=r(t,a[0]);if(2!=c.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length);if("2a864886f70d01050c"!=n(t,c[0]))throw new Error("this only supports pkcs5PBKDF2");var h=r(t,c[1]);if(h.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+h.length);i.pbkdf2Salt=n(t,h[0]);var l=n(t,h[1]);try{i.pbkdf2Iter=parseInt(l,16)}catch(t){throw new Error("malformed format pbkdf2Iter: "+l)}return i},getPBKDF2KeyHexFromParam:function(t,e){var r=y.enc.Hex.parse(t.pbkdf2Salt),n=t.pbkdf2Iter,i=y.PBKDF2(e,r,{keySize:6,iterations:n});return y.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(t,e){var r=Ot(t,"ENCRYPTED PRIVATE KEY"),n=this.parseHexOfEncryptedPKCS8(r),i=se.getPBKDF2KeyHexFromParam(n,e),s={};s.ciphertext=y.enc.Hex.parse(n.ciphertext);var o=y.enc.Hex.parse(i),a=y.enc.Hex.parse(n.encryptionSchemeIV),u=y.TripleDES.decrypt(s,o,{iv:a});return y.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(t,e){var r=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(t,e);return this.getKeyFromPlainPrivatePKCS8Hex(r)},parsePlainPrivatePKCS8Hex:function(t){var e=gt,r=e.getChildIdx,n=e.getV,i={algparam:null};if("30"!=t.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var s=r(t,0);if(s.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=t.substr(s[1],2))throw new Error("malformed PKCS8 private key(code:003)");var o=r(t,s[1]);if(2!=o.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=t.substr(o[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=n(t,o[0]),"06"==t.substr(o[1],2)&&(i.algparam=n(t,o[1])),"04"!=t.substr(s[2],2))throw new Error("malformed PKCS8 private key(code:006)");return i.keyidx=e.getVidx(t,s[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(t){var e=Ot(t,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(e)},getKeyFromPlainPrivatePKCS8Hex:function(t){var e,r=this.parsePlainPrivatePKCS8Hex(t);if("2a864886f70d010101"==r.algoid)e=new ot;else if("2a8648ce380401"==r.algoid)e=new ft.crypto.DSA;else{if("2a8648ce3d0201"!=r.algoid)throw new Error("unsupported private key algorithm");e=new ft.crypto.ECDSA}return e.readPKCS8PrvKeyHex(t),e},_getKeyFromPublicPKCS8Hex:function(t){var e,r=gt.getVbyList(t,0,[0,0],"06");if("2a864886f70d010101"===r)e=new ot;else if("2a8648ce380401"===r)e=new ft.crypto.DSA;else{if("2a8648ce3d0201"!==r)throw new Error("unsupported PKCS#8 public key hex");e=new ft.crypto.ECDSA}return e.readPKCS8PubKeyHex(t),e},parsePublicRawRSAKeyHex:function(t){var e=gt,r=e.getChildIdx,n=e.getV,i={};if("30"!=t.substr(0,2))throw new Error("malformed RSA key(code:001)");var s=r(t,0);if(2!=s.length)throw new Error("malformed RSA key(code:002)");if("02"!=t.substr(s[0],2))throw new Error("malformed RSA key(code:003)");if(i.n=n(t,s[0]),"02"!=t.substr(s[1],2))throw new Error("malformed RSA key(code:004)");return i.e=n(t,s[1]),i},parsePublicPKCS8Hex:function(t){var e=gt,r=e.getChildIdx,n=e.getV,i={algparam:null},s=r(t,0);if(2!=s.length)throw new Error("outer DERSequence shall have 2 elements: "+s.length);var o=s[0];if("30"!=t.substr(o,2))throw new Error("malformed PKCS8 public key(code:001)");var a=r(t,o);if(2!=a.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=t.substr(a[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(i.algoid=n(t,a[0]),"06"==t.substr(a[1],2)?i.algparam=n(t,a[1]):"30"==t.substr(a[1],2)&&(i.algparam={},i.algparam.p=e.getVbyList(t,a[1],[0],"02"),i.algparam.q=e.getVbyList(t,a[1],[1],"02"),i.algparam.g=e.getVbyList(t,a[1],[2],"02")),"03"!=t.substr(s[1],2))throw new Error("malformed PKCS8 public key(code:004)");return i.key=n(t,s[1]).substr(2),i}}}();function oe(t,e){for(var r="",n=e/4-t.length,i=0;i<n;i++)r+="0";return r+t}function ae(t,e,r){for(var n="",i=0;n.length<e;)n+=Ct(r(It(t+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return n}function ue(t){for(var e in ft.crypto.Util.DIGESTINFOHEAD){var r=ft.crypto.Util.DIGESTINFOHEAD[e],n=r.length;if(t.substring(0,n)==r)return[e,t.substring(n)]}return[]}function ce(t){var e,r=gt,n=r.getChildIdx,i=r.getV,s=(r.dump,r.parse),o=r.getTLV,a=r.getVbyList,u=r.getVbyListEx,c=r.getTLVbyList,h=r.getTLVbyListEx,l=r.getIdxbyList,f=r.getIdxbyListEx,p=r.getVidx,d=r.getInt,g=r.oidname,y=r.hextooidstr,v=Ot,m=Error;try{e=ft.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(t){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var t=c(this.hex,0,[0,0]);if("a0"==t.substr(0,2)){var e=c(t,0,[0]),r=d(e,0);if(r<0||2<r)throw new Error("malformed version field");return this.version=r+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return u(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var t=h(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(t)},this.getAlgorithmIdentifierName=function(t){for(var r in e)if(t===e[r])return r;return g(u(t,0,[0],"06"))},this.getIssuer=function(t,e){return this.getX500Name(this.getIssuerHex(),t,e)},this.getIssuerHex=function(){return c(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return this.getIssuer().str},this.getSubject=function(t,e){return this.getX500Name(this.getSubjectHex(),t,e)},this.getSubjectHex=function(){return c(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var t=a(this.hex,0,[0,4+this.foffset,0]);return t=t.replace(/(..)/g,"%$1"),decodeURIComponent(t)},this.getNotAfter=function(){var t=a(this.hex,0,[0,4+this.foffset,1]);return t=t.replace(/(..)/g,"%$1"),decodeURIComponent(t)},this.getPublicKeyHex=function(){return this.getSPKI()},this.getSPKI=function(){return c(this.hex,0,[0,6+this.foffset],"30")},this.getSPKIValue=function(){var t=this.getSPKI();return null==t?null:a(t,0,[1],"03",!0)},this.getPublicKeyIdx=function(){return l(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var t=this.getPublicKeyIdx();return l(this.hex,t,[1,0],"30")},this.getPublicKey=function(){return se.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var t=c(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(t)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(t){var e=this.getSignatureAlgorithmField(),r=this.getSignatureValueHex(),n=c(this.hex,0,[0],"30"),i=new ft.crypto.Signature({alg:e});return i.init(t),i.updateHex(n),i.verify(r)},this.parseExt=function(t){var e,s,o;if(void 0===t){if(o=this.hex,3!==this.version)return-1;e=l(o,0,[0,7,0],"30"),s=n(o,e)}else{o=Ot(t);var u=l(o,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=i(o,u))return void(this.aExtInfo=new Array);e=l(o,0,[0,3,0,1,0],"30"),s=n(o,e),this.hex=o}this.aExtInfo=new Array;for(var c=0;c<s.length;c++){var h={critical:!1},f=0;3===n(o,s[c]).length&&(h.critical=!0,f=1),h.oid=r.hextooidstr(a(o,s[c],[0],"06"));var d=l(o,s[c],[1+f]);h.vidx=p(o,d),this.aExtInfo.push(h)}},this.getExtInfo=function(t){var e=this.aExtInfo,r=t;if(t.match(/^[0-9.]+$/)||(r=ft.asn1.x509.OID.name2oid(t)),""!==r)for(var n=0;n<e.length;n++)if(e[n].oid===r)return e[n]},this.getCriticalExtV=function(t,e,r){if(null!=e)return[e,r];var n=this.getExtInfo(t);return null==n?[null,null]:[o(this.hex,n.vidx),n.critical]},this.getExtBasicConstraints=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("basicConstraints");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var n={extname:"basicConstraints"};if(e&&(n.critical=!0),"3000"===t)return n;if("30030101ff"===t)return n.cA=!0,n;if("30060101ff02"===t.substr(0,12)){var s=i(t,10),a=parseInt(s,16);return n.cA=!0,n.pathLen=a,n}throw new Error("hExtV parse error: "+t)},this.getExtNameConstraints=function(t,e){var r=this.getCriticalExtV("nameConstraints",t,e);if(t=r[0],e=r[1],null!=t){var i={extname:"nameConstraints"};e&&(i.critical=!0);for(var s=n(t,0),a=0;a<s.length;a++){for(var u=[],c=n(t,s[a]),h=0;h<c.length;h++){var l=o(t,c[h]),f=this.getGeneralSubtree(l);u.push(f)}var p=t.substr(s[a],2);"a0"==p?i.permit=u:"a1"==p&&(i.exclude=u)}return i}},this.getGeneralSubtree=function(t){var e=n(t,0),r=e.length;if(r<1||2<r)throw new Error("wrong num elements");for(var s=this.getGeneralName(o(t,e[0])),a=1;a<r;a++){var u=t.substr(e[a],2),c=i(t,e[a]),h=parseInt(c,16);"80"==u&&(s.min=h),"81"==u&&(s.max=h)}return s},this.getExtKeyUsage=function(t,e){var r=this.getCriticalExtV("keyUsage",t,e);if(t=r[0],e=r[1],null!=t){var n={extname:"keyUsage"};return e&&(n.critical=!0),n.names=this.getExtKeyUsageString(t).split(","),n}},this.getExtKeyUsageBin=function(t){if(void 0===t){var e=this.getExtInfo("keyUsage");if(void 0===e)return"";t=o(this.hex,e.vidx)}if(8!=t.length&&10!=t.length)throw new Error("malformed key usage value: "+t);var r="000000000000000"+parseInt(t.substr(6),16).toString(2);return 8==t.length&&(r=r.slice(-8)),10==t.length&&(r=r.slice(-16)),""==(r=r.replace(/0+$/,""))&&(r="0"),r},this.getExtKeyUsageString=function(t){for(var e=this.getExtKeyUsageBin(t),r=new Array,n=0;n<e.length;n++)"1"==e.substr(n,1)&&r.push(ce.KEYUSAGE_NAME[n]);return r.join(",")},this.getExtSubjectKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("subjectKeyIdentifier");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var n={extname:"subjectKeyIdentifier"};e&&(n.critical=!0);var s=i(t,0);return n.kid={hex:s},n},this.getExtAuthorityKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("authorityKeyIdentifier");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var s={extname:"authorityKeyIdentifier"};e&&(s.critical=!0);for(var a=n(t,0),u=0;u<a.length;u++){var c=t.substr(a[u],2);if("80"===c&&(s.kid={hex:i(t,a[u])}),"a1"===c){var h=o(t,a[u]),l=this.getGeneralNames(h);s.issuer=l[0].dn}"82"===c&&(s.sn={hex:i(t,a[u])})}return s},this.getExtExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("extKeyUsage");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var s={extname:"extKeyUsage",array:[]};e&&(s.critical=!0);for(var a=n(t,0),u=0;u<a.length;u++)s.array.push(g(i(t,a[u])));return s},this.getExtExtKeyUsageName=function(){var t=this.getExtInfo("extKeyUsage");if(void 0===t)return t;var e=new Array,r=o(this.hex,t.vidx);if(""===r)return e;for(var s=n(r,0),a=0;a<s.length;a++)e.push(g(i(r,s[a])));return e},this.getExtSubjectAltName=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("subjectAltName");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var n={extname:"subjectAltName",array:[]};return e&&(n.critical=!0),n.array=this.getGeneralNames(t),n},this.getExtIssuerAltName=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("issuerAltName");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var n={extname:"issuerAltName",array:[]};return e&&(n.critical=!0),n.array=this.getGeneralNames(t),n},this.getGeneralNames=function(t){for(var e=n(t,0),r=[],i=0;i<e.length;i++){var s=this.getGeneralName(o(t,e[i]));void 0!==s&&r.push(s)}return r},this.getGeneralName=function(t){var e=t.substr(0,2),r=i(t,0),n=Ct(r);return"81"==e?{rfc822:n}:"82"==e?{dns:n}:"86"==e?{uri:n}:"87"==e?{ip:Kt(r)}:"a4"==e?{dn:this.getX500Name(r)}:"a0"==e?{other:this.getOtherName(t)}:void 0},this.getExtSubjectAltName2=function(){var t,e,r,s=this.getExtInfo("subjectAltName");if(void 0===s)return s;for(var a=new Array,u=o(this.hex,s.vidx),c=n(u,0),h=0;h<c.length;h++)r=u.substr(c[h],2),t=i(u,c[h]),"81"===r&&(e=Ft(t),a.push(["MAIL",e])),"82"===r&&(e=Ft(t),a.push(["DNS",e])),"84"===r&&(e=ce.hex2dn(t,0),a.push(["DN",e])),"86"===r&&(e=Ft(t),a.push(["URI",e])),"87"===r&&(e=Kt(t),a.push(["IP",e]));return a},this.getExtCRLDistributionPoints=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("cRLDistributionPoints");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var i={extname:"cRLDistributionPoints",array:[]};e&&(i.critical=!0);for(var s=n(t,0),a=0;a<s.length;a++){var u=o(t,s[a]);i.array.push(this.getDistributionPoint(u))}return i},this.getDistributionPoint=function(t){for(var e={},r=n(t,0),i=0;i<r.length;i++){var s=t.substr(r[i],2),a=o(t,r[i]);"a0"==s&&(e.dpname=this.getDistributionPointName(a))}return e},this.getDistributionPointName=function(t){for(var e={},r=n(t,0),i=0;i<r.length;i++){var s=t.substr(r[i],2),a=o(t,r[i]);"a0"==s&&(e.full=this.getGeneralNames(a))}return e},this.getExtCRLDistributionPointsURI=function(){var t=this.getExtCRLDistributionPoints();if(null==t)return t;for(var e=t.array,r=[],n=0;n<e.length;n++)try{null!=e[n].dpname.full[0].uri&&r.push(e[n].dpname.full[0].uri)}catch(t){}return r},this.getExtAIAInfo=function(){var t=this.getExtInfo("authorityInfoAccess");if(void 0===t)return t;for(var e={ocsp:[],caissuer:[]},r=n(this.hex,t.vidx),i=0;i<r.length;i++){var s=a(this.hex,r[i],[0],"06"),o=a(this.hex,r[i],[1],"86");"2b06010505073001"===s&&e.ocsp.push(Ft(o)),"2b06010505073002"===s&&e.caissuer.push(Ft(o))}return e},this.getExtAuthorityInfoAccess=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("authorityInfoAccess");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var i={extname:"authorityInfoAccess",array:[]};e&&(i.critical=!0);for(var s=n(t,0),c=0;c<s.length;c++){var h=u(t,s[c],[0],"06"),l=Ft(a(t,s[c],[1],"86"));if("2b06010505073001"==h)i.array.push({ocsp:l});else{if("2b06010505073002"!=h)throw new Error("unknown method: "+h);i.array.push({caissuer:l})}}return i},this.getExtCertificatePolicies=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("certificatePolicies");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var i={extname:"certificatePolicies",array:[]};e&&(i.critical=!0);for(var s=n(t,0),a=0;a<s.length;a++){var u=o(t,s[a]),c=this.getPolicyInformation(u);i.array.push(c)}return i},this.getPolicyInformation=function(t){var e={},r=a(t,0,[0],"06");e.policyoid=g(r);var i=f(t,0,[1],"30");if(-1!=i){e.array=[];for(var s=n(t,i),u=0;u<s.length;u++){var c=o(t,s[u]),h=this.getPolicyQualifierInfo(c);e.array.push(h)}}return e},this.getOtherName=function(t){var e={},r=n(t,0),i=a(t,r[0],[],"06"),o=a(t,r[1],[]);return e.oid=g(i),e.value=s(o),e},this.getPolicyQualifierInfo=function(t){var e={},r=a(t,0,[0],"06");if("2b06010505070201"===r){var n=u(t,0,[1],"16");e.cps=Ct(n)}else if("2b06010505070202"===r){var i=c(t,0,[1],"30");e.unotice=this.getUserNotice(i)}return e},this.getUserNotice=function(t){var e=null;try{return e=r.parse(t),this._asn1ToUnotice(e)}catch(t){return}},this._asn1ToUnotice=function(t){try{for(var e={},r=ne(t,"seq"),n=0;n<r.length;n++){var i=this._asn1ToNoticeRef(r[n]);null!=i&&(e.noticeref=i);var s=this.asn1ToDisplayText(r[n]);null!=s&&(e.exptext=s)}return Object.keys(e).length>0?e:void 0}catch(t){return}},this._asn1ToNoticeRef=function(t){try{for(var e={},r=ne(t,"seq"),n=0;n<r.length;n++){var i=this._asn1ToNoticeNum(r[n]);null!=i&&(e.noticenum=i);var s=this.asn1ToDisplayText(r[n]);null!=s&&(e.org=s)}return Object.keys(e).length>0?e:void 0}catch(t){return}},this._asn1ToNoticeNum=function(t){try{for(var e=ne(t,"seq"),r=[],n=0;n<e.length;n++){var i=e[n];r.push(parseInt(ne(i,"int.hex"),16))}return r}catch(t){return}},this.getDisplayText=function(t){var e={};return e.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[t.substr(0,2)],e.str=Ct(i(t,0)),e},this.asn1ToDisplayText=function(t){return null!=t.utf8str?{type:"utf8",str:t.utf8str.str}:null!=t.ia5str?{type:"ia5",str:t.ia5str.str}:null!=t.visstr?{type:"vis",str:t.visstr.str}:null!=t.bmpstr?{type:"bmp",str:t.bmpstr.str}:null!=t.prnstr?{type:"prn",str:t.prnstr.str}:void 0},this.getExtPolicyMappings=function(t,e){var r=this.getCriticalExtV("policyMappings",t,e);if(t=r[0],e=r[1],null!=t){var n={extname:"policyMappings"};e&&(n.critical=!0);try{for(var i=s(t).seq,o=[],a=0;a<i.length;a++){var u=i[a].seq;o.push([u[0].oid,u[1].oid])}n.array=o}catch(t){throw new m("malformed policyMappings")}return n}},this.getExtPolicyConstraints=function(t,e){var r=this.getCriticalExtV("policyConstraints",t,e);if(t=r[0],e=r[1],null!=t){var n={extname:"policyConstraints"};e&&(n.critical=!0);var i=s(t);try{for(var o=i.seq,a=0;a<o.length;a++){var u=o[a].tag;0==u.explicit&&("80"==u.tag&&(n.reqexp=parseInt(u.hex,16)),"81"==u.tag&&(n.inhibit=parseInt(u.hex,16)))}}catch(t){return new m("malformed policyConstraints value")}return n}},this.getExtInhibitAnyPolicy=function(t,e){var r=this.getCriticalExtV("inhibitAnyPolicy",t,e);if(t=r[0],e=r[1],null!=t){var n={extname:"inhibitAnyPolicy"};e&&(n.critical=!0);var i=d(t,0);return-1==i?new m("wrong value"):(n.skip=i,n)}},this.getExtCRLNumber=function(t,e){var r={extname:"cRLNumber"};if(e&&(r.critical=!0),"02"==t.substr(0,2))return r.num={hex:i(t,0)},r;throw new m("hExtV parse error: "+t)},this.getExtCRLReason=function(t,e){var r={extname:"cRLReason"};if(e&&(r.critical=!0),"0a"==t.substr(0,2))return r.code=parseInt(i(t,0),16),r;throw new Error("hExtV parse error: "+t)},this.getExtOcspNonce=function(t,e){var r={extname:"ocspNonce"};e&&(r.critical=!0);var n=i(t,0);return r.hex=n,r},this.getExtOcspNoCheck=function(t,e){var r={extname:"ocspNoCheck"};return e&&(r.critical=!0),r},this.getExtAdobeTimeStamp=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("adobeTimeStamp");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var i={extname:"adobeTimeStamp"};e&&(i.critical=!0);var s=n(t,0);if(s.length>1){var a=o(t,s[1]),u=this.getGeneralName(a);null!=u.uri&&(i.uri=u.uri)}if(s.length>2){var c=o(t,s[2]);"0101ff"==c&&(i.reqauth=!0),"010100"==c&&(i.reqauth=!1)}return i},this.getExtSubjectDirectoryAttributes=function(t,e){if(void 0===t&&void 0===e){var r=this.getExtInfo("subjectDirectoryAttributes");if(void 0===r)return;t=o(this.hex,r.vidx),e=r.critical}var n={extname:"subjectDirectoryAttributes"};e&&(n.critical=!0);try{for(var i=s(t),a=[],u=0;u<i.seq.length;u++){var c=i.seq[u],h=ne(c,"seq.0.oid"),l=ne(c,"seq.1.set");if(null==h||null==l)throw"error";a.push({attr:h,array:l})}return n.array=a,n}catch(t){throw new Error("malformed subjectDirectoryAttributes extension value")}};var x=function(t){var e={};try{var r=t.seq[0].oid,n=ft.asn1.x509.OID.name2oid(r);e.type=ft.asn1.x509.OID.oid2atype(n);var i=t.seq[1];if(null!=i.utf8str)e.ds="utf8",e.value=i.utf8str.str;else if(null!=i.numstr)e.ds="num",e.value=i.numstr.str;else if(null!=i.telstr)e.ds="tel",e.value=i.telstr.str;else if(null!=i.prnstr)e.ds="prn",e.value=i.prnstr.str;else if(null!=i.ia5str)e.ds="ia5",e.value=i.ia5str.str;else if(null!=i.visstr)e.ds="vis",e.value=i.visstr.str;else{if(null==i.bmpstr)throw"error";e.ds="bmp",e.value=i.bmpstr.str}return e}catch(t){throw new Erorr("improper ASN.1 parsed AttrTypeAndValue")}},w=function(t){try{return t.set.map(function(t){return x(t)})}catch(t){throw new Error("improper ASN.1 parsed RDN: "+t)}};this.getX500NameRule=function(t){for(var e=null,r=[],n=0;n<t.length;n++)for(var i=t[n],s=0;s<i.length;s++)r.push(i[s]);for(n=0;n<r.length;n++){var o=r[n],a=o.ds,u=o.value,c=o.type;if("prn"!=a&&"utf8"!=a&&"ia5"!=a)return"mixed";if("ia5"==a){if("CN"!=c)return"mixed";if(ft.lang.String.isMail(u))continue;return"mixed"}if("C"==c){if("prn"==a)continue;return"mixed"}if(null==e)e=a;else if(e!==a)return"mixed"}return null==e?"prn":e},this.getAttrTypeAndValue=function(t){var e=s(t);return x(e)},this.getRDN=function(t){var e=s(t);return w(e)},this.getX500NameArray=function(t){return function(t){try{return t.seq.map(function(t){return w(t)})}catch(t){throw new Error("improper ASN.1 parsed X500Name: "+t)}}(s(t))},this.getX500Name=function(t,e,r){var n=this.getX500NameArray(t),i={str:this.dnarraytostr(n)};return i.array=n,1==r&&(i.hex=t),1==e&&(i.canon=this.c14nRDNArray(n)),i},this.readCertPEM=function(t){this.readCertHex(v(t))},this.readCertHex=function(t){this.hex=t,this.getVersion();try{l(this.hex,0,[0,7],"a3"),this.parseExt()}catch(t){}},this.getParam=function(t){var e={};return null==t&&(t={}),e.version=this.getVersion(),e.serial={hex:this.getSerialNumberHex()},e.sigalg=this.getSignatureAlgorithmField(),e.issuer=this.getIssuer(t.dncanon,t.dnhex),e.notbefore=this.getNotBefore(),e.notafter=this.getNotAfter(),e.subject=this.getSubject(t.dncanon,t.dnhex),e.sbjpubkey=Nt(this.getPublicKeyHex(),"PUBLIC KEY"),null!=this.aExtInfo&&this.aExtInfo.length>0&&(e.ext=this.getExtParamArray()),e.sighex=this.getSignatureValueHex(),1==t.tbshex&&(e.tbshex=c(this.hex,0,[0])),1==t.nodnarray&&(delete e.issuer.array,delete e.subject.array),e},this.getExtParamArray=function(t){null==t&&-1!=f(this.hex,0,[0,"[3]"])&&(t=h(this.hex,0,[0,"[3]",0],"30"));for(var e=[],r=n(t,0),i=0;i<r.length;i++){var s=o(t,r[i]),a=this.getExtParam(s);null!=a&&e.push(a)}return e},this.getExtParam=function(t){var e=n(t,0).length;if(2!=e&&3!=e)throw new Error("wrong number elements in Extension: "+e+" "+t);var r=y(a(t,0,[0],"06")),i=!1;3==e&&"0101ff"==c(t,0,[1])&&(i=!0);var o=c(t,0,[e-1,0]),u=void 0;if("2.5.29.14"==r?u=this.getExtSubjectKeyIdentifier(o,i):"2.5.29.15"==r?u=this.getExtKeyUsage(o,i):"2.5.29.17"==r?u=this.getExtSubjectAltName(o,i):"2.5.29.18"==r?u=this.getExtIssuerAltName(o,i):"2.5.29.19"==r?u=this.getExtBasicConstraints(o,i):"2.5.29.30"==r?u=this.getExtNameConstraints(o,i):"2.5.29.31"==r?u=this.getExtCRLDistributionPoints(o,i):"2.5.29.32"==r?u=this.getExtCertificatePolicies(o,i):"2.5.29.33"==r?u=this.getExtPolicyMappings(o,i):"2.5.29.35"==r?u=this.getExtAuthorityKeyIdentifier(o,i):"2.5.29.36"==r?u=this.getExtPolicyConstraints(o,i):"2.5.29.37"==r?u=this.getExtExtKeyUsage(o,i):"2.5.29.54"==r?u=this.getExtInhibitAnyPolicy(o,i):"1.3.6.1.5.5.7.1.1"==r?u=this.getExtAuthorityInfoAccess(o,i):"2.5.29.20"==r?u=this.getExtCRLNumber(o,i):"2.5.29.21"==r?u=this.getExtCRLReason(o,i):"2.5.29.9"==r?u=this.getExtSubjectDirectoryAttributes(o,i):"1.3.6.1.5.5.7.48.1.2"==r?u=this.getExtOcspNonce(o,i):"1.3.6.1.5.5.7.48.1.5"==r?u=this.getExtOcspNoCheck(o,i):"1.2.840.113583.1.1.9.1"==r?u=this.getExtAdobeTimeStamp(o,i):null!=ce.EXT_PARSER[r]&&(u=ce.EXT_PARSER[r](r,i,o)),null!=u)return u;var h={extname:r,extn:o};try{h.extn=s(o)}catch(t){}return i&&(h.critical=!0),h},this.findExt=function(t,e){for(var r=0;r<t.length;r++)if(t[r].extname==e)return t[r];return null},this.updateExtCDPFullURI=function(t,e){var r=this.findExt(t,"cRLDistributionPoints");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)if(null!=n[i].dpname&&null!=n[i].dpname.full)for(var s=n[i].dpname.full,o=0;o<s.length;o++){var a=s[i];null!=a.uri&&(a.uri=e)}},this.updateExtAIAOCSP=function(t,e){var r=this.findExt(t,"authorityInfoAccess");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)null!=n[i].ocsp&&(n[i].ocsp=e)},this.updateExtAIACAIssuer=function(t,e){var r=this.findExt(t,"authorityInfoAccess");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)null!=n[i].caissuer&&(n[i].caissuer=e)},this.dnarraytostr=function(t){return"/"+t.map(function(t){return function(t){return t.map(function(t){return function(t){return t.type+"="+t.value}(t).replace(/\+/,"\\+")}).join("+")}(t).replace(/\//,"\\/")}).join("/")},this.setCanonicalizedDN=function(t){var e;if(null!=t.str&&null==t.array){var r=new ft.asn1.x509.X500Name({str:t.str}).tohex();e=this.getX500NameArray(r)}else e=t.array;null==t.canon&&(t.canon=this.c14nRDNArray(e))},this.c14nRDNArray=function(t){for(var e=[],r=0;r<t.length;r++){for(var n=t[r],i=[],s=0;s<n.length;s++){var o=n[s],a=o.value;a=(a=(a=(a=a.replace(/^\s*/,"")).replace(/\s*$/,"")).replace(/\s+/g," ")).toLowerCase(),i.push(o.type.toLowerCase()+"="+a)}e.push(i.join("+"))}return"/"+e.join("/")},this.getInfo=function(){var t,e,r,n=function(t){for(var e="",r=" ",n="\n",i=t.array,s=0;s<i.length;s++){var o=i[s];null!=o.dn&&(e+=r+"dn: "+o.dn.str+n),null!=o.ip&&(e+=r+"ip: "+o.ip+n),null!=o.rfc822&&(e+=r+"rfc822: "+o.rfc822+n),null!=o.dns&&(e+=r+"dns: "+o.dns+n),null!=o.uri&&(e+=r+"uri: "+o.uri+n),null!=o.other&&(e+=r+"other: "+o.other.oid+"="+JSON.stringify(o.other.value).replace(/\"/g,"")+n)}return e.replace(/\n$/,"")},i=function(t){for(var e="",r=t.array,n=0;n<r.length;n++){var i=r[n];if(e+=" policy oid: "+i.policyoid+"\n",void 0!==i.array)for(var s=0;s<i.array.length;s++){var o=i.array[s];void 0!==o.cps&&(e+=" cps: "+o.cps+"\n")}}return e},s=function(t){for(var e="",r=t.array,n=0;n<r.length;n++){var i=r[n];try{void 0!==i.dpname.full[0].uri&&(e+=" "+i.dpname.full[0].uri+"\n")}catch(t){}try{void 0!==i.dname.full[0].dn.hex&&(e+=" "+ce.hex2dn(i.dpname.full[0].dn.hex)+"\n")}catch(t){}}return e},o=function(t){for(var e="",r=t.array,n=0;n<r.length;n++){var i=r[n];void 0!==i.caissuer&&(e+=" caissuer: "+i.caissuer+"\n"),void 0!==i.ocsp&&(e+=" ocsp: "+i.ocsp+"\n")}return e};if(t="Basic Fields\n",t+=" serial number: "+this.getSerialNumberHex()+"\n",t+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",t+=" issuer: "+this.getIssuerString()+"\n",t+=" notBefore: "+this.getNotBefore()+"\n",t+=" notAfter: "+this.getNotAfter()+"\n",t+=" subject: "+this.getSubjectString()+"\n",t+=" subject public key info: \n",t+=" key algorithm: "+(e=this.getPublicKey()).type+"\n","RSA"===e.type&&(t+=" n="+Xt(e.n.toString(16)).substr(0,16)+"...\n",t+=" e="+Xt(e.e.toString(16))+"\n"),null!=(r=this.aExtInfo)){t+="X509v3 Extensions:\n";for(var a=0;a<r.length;a++){var u=r[a],c=ft.asn1.x509.OID.oid2name(u.oid);""===c&&(c=u.oid);var h="";if(!0===u.critical&&(h="CRITICAL"),t+=" "+c+" "+h+":\n","basicConstraints"===c){var l=this.getExtBasicConstraints();void 0===l.cA?t+=" {}\n":(t+=" cA=true",void 0!==l.pathLen&&(t+=", pathLen="+l.pathLen),t+="\n")}else{var f;if("policyMappings"==c)t+=" "+this.getExtPolicyMappings().array.map(function(t){var e=t;return e[0]+":"+e[1]}).join(", ")+"\n";else if("policyConstraints"==c)t+=" ",null!=(f=this.getExtPolicyConstraints()).reqexp&&(t+=" reqexp="+f.reqexp),null!=f.inhibit&&(t+=" inhibit="+f.inhibit),t+="\n";else if("inhibitAnyPolicy"==c)t+=" skip="+(f=this.getExtInhibitAnyPolicy()).skip+"\n";else if("keyUsage"==c)t+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"==c)t+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"==c){var p=this.getExtAuthorityKeyIdentifier();void 0!==p.kid&&(t+=" kid="+p.kid.hex+"\n")}else"extKeyUsage"==c?t+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n":"subjectAltName"==c?t+=n(this.getExtSubjectAltName())+"\n":"cRLDistributionPoints"==c?t+=s(this.getExtCRLDistributionPoints()):"authorityInfoAccess"==c?t+=o(this.getExtAuthorityInfoAccess()):"certificatePolicies"==c&&(t+=i(this.getExtCertificatePolicies()))}}}return(t+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n")+"signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?this.readCertPEM(t):ft.lang.String.isHex(t)&&this.readCertHex(t))}se.getKey=function(t,e,r){var n,i=(v=gt).getChildIdx,s=(v.getV,v.getVbyList),o=ft.crypto,a=o.ECDSA,u=o.DSA,c=ot,h=Ot,l=se;if(void 0!==c&&t instanceof c)return t;if(void 0!==a&&t instanceof a)return t;if(void 0!==u&&t instanceof u)return t;if(void 0!==t.curve&&void 0!==t.xy&&void 0===t.d)return new a({pub:t.xy,curve:t.curve});if(void 0!==t.curve&&void 0!==t.d)return new a({prv:t.d,curve:t.curve});if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(D=new c).setPublic(t.n,t.e),D;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.co&&void 0===t.qi)return(D=new c).setPrivateEx(t.n,t.e,t.d,t.p,t.q,t.dp,t.dq,t.co),D;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0===t.p)return(D=new c).setPrivate(t.n,t.e,t.d),D;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0===t.x)return(D=new u).setPublic(t.p,t.q,t.g,t.y),D;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0!==t.x)return(D=new u).setPrivate(t.p,t.q,t.g,t.y,t.x),D;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(D=new c).setPublic(Et(t.n),Et(t.e)),D;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.qi)return(D=new c).setPrivateEx(Et(t.n),Et(t.e),Et(t.d),Et(t.p),Et(t.q),Et(t.dp),Et(t.dq),Et(t.qi)),D;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d)return(D=new c).setPrivate(Et(t.n),Et(t.e),Et(t.d)),D;if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0===t.d){var f=(I=new a({curve:t.crv})).ecparams.keycharlen,p="04"+("0000000000"+Et(t.x)).slice(-f)+("0000000000"+Et(t.y)).slice(-f);return I.setPublicKeyHex(p),I}if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0!==t.d){f=(I=new a({curve:t.crv})).ecparams.keycharlen,p="04"+("0000000000"+Et(t.x)).slice(-f)+("0000000000"+Et(t.y)).slice(-f);var d=("0000000000"+Et(t.d)).slice(-f);return I.setPublicKeyHex(p),I.setPrivateKeyHex(d),I}if("pkcs5prv"===r){var g,y=t,v=gt;if(9===(g=i(y,0)).length)(D=new c).readPKCS5PrvKeyHex(y);else if(6===g.length)(D=new u).readPKCS5PrvKeyHex(y);else{if(!(g.length>2&&"04"===y.substr(g[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(D=new a).readPKCS5PrvKeyHex(y)}return D}if("pkcs8prv"===r)return l.getKeyFromPlainPrivatePKCS8Hex(t);if("pkcs8pub"===r)return l._getKeyFromPublicPKCS8Hex(t);if("x509pub"===r)return ce.getPublicKeyFromCertHex(t);if(-1!=t.indexOf("-END CERTIFICATE-",0)||-1!=t.indexOf("-END X509 CERTIFICATE-",0)||-1!=t.indexOf("-END TRUSTED CERTIFICATE-",0))return ce.getPublicKeyFromCertPEM(t);if(-1!=t.indexOf("-END PUBLIC KEY-")){var m=Ot(t,"PUBLIC KEY");return l._getKeyFromPublicPKCS8Hex(m)}if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var x=h(t,"RSA PRIVATE KEY");return l.getKey(x,null,"pkcs5prv")}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var w=s(n=h(t,"DSA PRIVATE KEY"),0,[1],"02"),b=s(n,0,[2],"02"),S=s(n,0,[3],"02"),A=s(n,0,[4],"02"),F=s(n,0,[5],"02");return(D=new u).setPrivate(new E(w,16),new E(b,16),new E(S,16),new E(A,16),new E(F,16)),D}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED"))return x=h(t,"EC PRIVATE KEY"),l.getKey(x,null,"pkcs5prv");if(-1!=t.indexOf("-END PRIVATE KEY-"))return l.getKeyFromPlainPrivatePKCS8PEM(t);if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var P=l.getDecryptedKeyHex(t,e),C=new ot;return C.readPKCS5PrvKeyHex(P),C}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var I,D=s(n=l.getDecryptedKeyHex(t,e),0,[1],"04"),T=s(n,0,[2,0],"06"),R=s(n,0,[3,0],"03").substr(2);if(void 0===ft.crypto.OID.oidhex2name[T])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+T);return(I=new a({curve:ft.crypto.OID.oidhex2name[T]})).setPublicKeyHex(R),I.setPrivateKeyHex(D),I.isPublic=!1,I}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED"))return w=s(n=l.getDecryptedKeyHex(t,e),0,[1],"02"),b=s(n,0,[2],"02"),S=s(n,0,[3],"02"),A=s(n,0,[4],"02"),F=s(n,0,[5],"02"),(D=new u).setPrivate(new E(w,16),new E(b,16),new E(S,16),new E(A,16),new E(F,16)),D;if(-1!=t.indexOf("-END ENCRYPTED PRIVATE KEY-"))return l.getKeyFromEncryptedPKCS8PEM(t,e);throw new Error("not supported argument")},se.generateKeypair=function(t,e){if("RSA"==t){var r=e;(o=new ot).generate(r,"10001"),o.isPrivate=!0,o.isPublic=!0;var n=new ot,i=o.n.toString(16),s=o.e.toString(16);return n.setPublic(i,s),n.isPrivate=!1,n.isPublic=!0,(a={}).prvKeyObj=o,a.pubKeyObj=n,a}if("EC"==t){var o,a,u=e,c=new ft.crypto.ECDSA({curve:u}).generateKeyPairHex();return(o=new ft.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),o.setPrivateKeyHex(c.ecprvhex),o.isPrivate=!0,o.isPublic=!1,(n=new ft.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),n.isPrivate=!1,n.isPublic=!0,(a={}).prvKeyObj=o,a.pubKeyObj=n,a}throw new Error("unknown algorithm: "+t)},se.getPEM=function(t,e,r,n,i,s){var o=ft,a=o.asn1,u=a.DERObjectIdentifier,c=a.DERInteger,h=a.ASN1Util.newObject,l=a.x509.SubjectPublicKeyInfo,f=o.crypto,p=f.DSA,d=f.ECDSA,g=ot;function v(t){return h({seq:[{int:0},{int:{bigint:t.n}},{int:t.e},{int:{bigint:t.d}},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.dmp1}},{int:{bigint:t.dmq1}},{int:{bigint:t.coeff}}]})}function m(t){return h({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a0",!0,{oid:{name:t.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]})}function x(t){return h({seq:[{int:0},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}},{int:{bigint:t.y}},{int:{bigint:t.x}}]})}if((void 0!==g&&t instanceof g||void 0!==p&&t instanceof p||void 0!==d&&t instanceof d)&&1==t.isPublic&&(void 0===e||"PKCS8PUB"==e))return Nt(E=new l(t).tohex(),"PUBLIC KEY");if("PKCS1PRV"==e&&void 0!==g&&t instanceof g&&(void 0===r||null==r)&&1==t.isPrivate)return Nt(E=v(t).tohex(),"RSA PRIVATE KEY");if("PKCS1PRV"==e&&void 0!==d&&t instanceof d&&(void 0===r||null==r)&&1==t.isPrivate){var w=new u({name:t.curveName}).tohex(),b=m(t).tohex(),S="";return(S+=Nt(w,"EC PARAMETERS"))+Nt(b,"EC PRIVATE KEY")}if("PKCS1PRV"==e&&void 0!==p&&t instanceof p&&(void 0===r||null==r)&&1==t.isPrivate)return Nt(E=x(t).tohex(),"DSA PRIVATE KEY");if("PKCS5PRV"==e&&void 0!==g&&t instanceof g&&void 0!==r&&null!=r&&1==t.isPrivate){var E=v(t).tohex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",E,r,n,s)}if("PKCS5PRV"==e&&void 0!==d&&t instanceof d&&void 0!==r&&null!=r&&1==t.isPrivate)return E=m(t).tohex(),void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",E,r,n,s);if("PKCS5PRV"==e&&void 0!==p&&t instanceof p&&void 0!==r&&null!=r&&1==t.isPrivate)return E=x(t).tohex(),void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",E,r,n,s);var A=function(t,e){var r=F(t,e);return new h({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:r.pbkdf2Salt}},{int:r.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:r.encryptionSchemeIV}}]}]}]},{octstr:{hex:r.ciphertext}}]}).tohex()},F=function(t,e){var r=y.lib.WordArray.random(8),n=y.lib.WordArray.random(8),i=y.PBKDF2(e,r,{keySize:6,iterations:100}),s=y.enc.Hex.parse(t),o=y.TripleDES.encrypt(s,i,{iv:n})+"",a={};return a.ciphertext=o,a.pbkdf2Salt=y.enc.Hex.stringify(r),a.pbkdf2Iter=100,a.encryptionSchemeAlg="DES-EDE3-CBC",a.encryptionSchemeIV=y.enc.Hex.stringify(n),a};if("PKCS8PRV"==e&&null!=g&&t instanceof g&&1==t.isPrivate){var P=v(t).tohex();return E=h({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:P}}]}).tohex(),void 0===r||null==r?Nt(E,"PRIVATE KEY"):Nt(b=A(E,r),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&void 0!==d&&t instanceof d&&1==t.isPrivate){var C={seq:[{int:1},{octstr:{hex:t.prvKeyHex}}]};return"string"==typeof t.pubKeyHex&&C.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}),P=new h(C).tohex(),E=h({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:t.curveName}}]},{octstr:{hex:P}}]}).tohex(),void 0===r||null==r?Nt(E,"PRIVATE KEY"):Nt(b=A(E,r),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&void 0!==p&&t instanceof p&&1==t.isPrivate)return P=new c({bigint:t.x}).tohex(),E=h({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]}]},{octstr:{hex:P}}]}).tohex(),void 0===r||null==r?Nt(E,"PRIVATE KEY"):Nt(b=A(E,r),"ENCRYPTED PRIVATE KEY");throw new Error("unsupported object nor format")},se.getKeyFromCSRPEM=function(t){var e=Ot(t,"CERTIFICATE REQUEST");return se.getKeyFromCSRHex(e)},se.getKeyFromCSRHex=function(t){var e=se.parseCSRHex(t);return se.getKey(e.p8pubkeyhex,null,"pkcs8pub")},se.parseCSRHex=function(t){var e=gt,r=e.getChildIdx,n=e.getTLV,i={},s=t;if("30"!=s.substr(0,2))throw new Error("malformed CSR(code:001)");var o=r(s,0);if(o.length<1)throw new Error("malformed CSR(code:002)");if("30"!=s.substr(o[0],2))throw new Error("malformed CSR(code:003)");var a=r(s,o[0]);if(a.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=n(s,a[2]),i},se.getKeyID=function(t){var e=se,r=gt;"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&(t=e.getKey(t));var n=Ot(e.getPEM(t)),i=r.getIdxbyList(n,0,[1]),s=r.getV(n,i).substring(2);return ft.crypto.Util.hashHex(s,"sha1")},se.getJWK=function(t,e,r,n,i){var s,o,a={},u=ft.crypto.Util.hashHex;if("string"==typeof t)s=se.getKey(t),-1!=t.indexOf("CERTIFICATE")&&(o=Ot(t));else{if("object"!=typeof t)throw new Error("unsupported keyinfo type");t instanceof ce?(s=t.getPublicKey(),o=t.hex):s=t}if(s instanceof ot&&s.isPrivate)a.kty="RSA",a.n=St(s.n.toString(16)),a.e=St(s.e.toString(16)),a.d=St(s.d.toString(16)),a.p=St(s.p.toString(16)),a.q=St(s.q.toString(16)),a.dp=St(s.dmp1.toString(16)),a.dq=St(s.dmq1.toString(16)),a.qi=St(s.coeff.toString(16));else if(s instanceof ot&&s.isPublic)a.kty="RSA",a.n=St(s.n.toString(16)),a.e=St(s.e.toString(16));else if(s instanceof ft.crypto.ECDSA&&s.isPrivate){if("P-256"!==(h=s.getShortNISTPCurveName())&&"P-384"!==h&&"P-521"!==h)throw new Error("unsupported curve name for JWT: "+h);var c=s.getPublicKeyXYHex();a.kty="EC",a.crv=h,a.x=St(c.x),a.y=St(c.y),a.d=St(s.prvKeyHex)}else if(s instanceof ft.crypto.ECDSA&&s.isPublic){var h;if("P-256"!==(h=s.getShortNISTPCurveName())&&"P-384"!==h&&"P-521"!==h)throw new Error("unsupported curve name for JWT: "+h);c=s.getPublicKeyXYHex(),a.kty="EC",a.crv=h,a.x=St(c.x),a.y=St(c.y)}if(null==a.kty)throw new Error("unsupported keyinfo");return s.isPrivate||1==e||(a.kid=ft.jws.JWS.getJWKthumbprint(a)),null!=o&&1!=r&&(a.x5c=[w(o)]),null!=o&&1!=n&&(a.x5t=wt(w(u(o,"sha1")))),null!=o&&1!=i&&(a["x5t#S256"]=wt(w(u(o,"sha256")))),a},se.getJWKFromKey=function(t){return se.getJWK(t,!0,!0,!0,!0)},ot.getPosArrayOfChildrenFromHex=function(t){return gt.getChildIdx(t,0)},ot.getHexValueArrayOfChildrenFromHex=function(t){var e,r=gt.getV,n=r(t,(e=ot.getPosArrayOfChildrenFromHex(t))[0]),i=r(t,e[1]),s=r(t,e[2]),o=r(t,e[3]),a=r(t,e[4]),u=r(t,e[5]),c=r(t,e[6]),h=r(t,e[7]),l=r(t,e[8]);return(e=new Array).push(n,i,s,o,a,u,c,h,l),e},ot.prototype.readPrivateKeyFromPEMString=function(t){var e=Ot(t),r=ot.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])},ot.prototype.readPKCS5PrvKeyHex=function(t){var e=ot.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},ot.prototype.readPKCS8PrvKeyHex=function(t){var e,r,n,i,s,o,a,u,c=gt,h=c.getVbyListEx;if(!1===c.isASN1HEX(t))throw new Error("not ASN.1 hex string");try{e=h(t,0,[2,0,1],"02"),r=h(t,0,[2,0,2],"02"),n=h(t,0,[2,0,3],"02"),i=h(t,0,[2,0,4],"02"),s=h(t,0,[2,0,5],"02"),o=h(t,0,[2,0,6],"02"),a=h(t,0,[2,0,7],"02"),u=h(t,0,[2,0,8],"02")}catch(t){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(e,r,n,i,s,o,a,u)},ot.prototype.readPKCS5PubKeyHex=function(t){var e=gt,r=e.getV;if(!1===e.isASN1HEX(t))throw new Error("keyHex is not ASN.1 hex string");var n=e.getChildIdx(t,0);if(2!==n.length||"02"!==t.substr(n[0],2)||"02"!==t.substr(n[1],2))throw new Error("wrong hex for PKCS#5 public key");var i=r(t,n[0]),s=r(t,n[1]);this.setPublic(i,s)},ot.prototype.readPKCS8PubKeyHex=function(t){var e=gt;if(!1===e.isASN1HEX(t))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==e.getTLVbyListEx(t,0,[0,0]))throw new Error("not PKCS8 RSA public key");var r=e.getTLVbyListEx(t,0,[1,0]);this.readPKCS5PubKeyHex(r)},ot.prototype.readCertPubKeyHex=function(t,e){var r,n;(r=new ce).readCertHex(t),n=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)},ot.prototype.sign=function(t,e){var r=function(t){return ft.crypto.Util.hashString(t,e)}(t);return this.signWithMessageHash(r,e)},ot.prototype.signWithMessageHash=function(t,e){var r=it(ft.crypto.Util.getPaddedDigestInfoHex(t,e,this.n.bitLength()),16);return oe(this.doPrivate(r).toString(16),this.n.bitLength())},ot.prototype.signPSS=function(t,e,r){var n,i=(n=It(t),ft.crypto.Util.hashHex(n,e));return void 0===r&&(r=-1),this.signWithMessageHashPSS(i,e,r)},ot.prototype.signWithMessageHashPSS=function(t,e,r){var n,i=Ct(t),s=i.length,o=this.n.bitLength()-1,a=Math.ceil(o/8),u=function(t){return ft.crypto.Util.hashHex(t,e)};if(-1===r||void 0===r)r=s;else if(-2===r)r=a-s-2;else if(r<-2)throw new Error("invalid salt length");if(a<s+r+2)throw new Error("data too long");var c="";r>0&&(c=new Array(r),(new nt).nextBytes(c),c=String.fromCharCode.apply(String,c));var h=Ct(u(It("\0\0\0\0\0\0\0\0"+i+c))),l=[];for(n=0;n<a-r-s-2;n+=1)l[n]=0;var f=String.fromCharCode.apply(String,l)+""+c,p=ae(h,f.length,u),d=[];for(n=0;n<f.length;n+=1)d[n]=f.charCodeAt(n)^p.charCodeAt(n);var g=65280>>8*a-o&255;for(d[0]&=~g,n=0;n<s;n++)d.push(h.charCodeAt(n));return d.push(188),oe(this.doPrivate(new E(d)).toString(16),this.n.bitLength())},ot.prototype.verify=function(t,e){if(null==(e=e.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var r=it(e,16),n=this.n.bitLength();if(r.bitLength()>n)return!1;var i=this.doPublic(r).toString(16);if(i.length+3!=n/4)return!1;var s=ue(i.replace(/^1f+00/,""));if(0==s.length)return!1;var o=s[0];return s[1]==function(t){return ft.crypto.Util.hashString(t,o)}(t)},ot.prototype.verifyWithMessageHash=function(t,e){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var r=it(e,16);if(r.bitLength()>this.n.bitLength())return 0;var n=ue(this.doPublic(r).toString(16).replace(/^1f+00/,""));return 0!=n.length&&(n[0],n[1]==t)},ot.prototype.verifyPSS=function(t,e,r,n){var i,s=(i=It(t),ft.crypto.Util.hashHex(i,r));return void 0===n&&(n=-1),this.verifyWithMessageHashPSS(s,e,r,n)},ot.prototype.verifyWithMessageHashPSS=function(t,e,r,n){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,s=new E(e,16),o=function(t){return ft.crypto.Util.hashHex(t,r)},a=Ct(t),u=a.length,c=this.n.bitLength()-1,h=Math.ceil(c/8);if(-1===n||void 0===n)n=u;else if(-2===n)n=h-u-2;else if(n<-2)throw new Error("invalid salt length");if(h<u+n+2)throw new Error("data too long");var l=this.doPublic(s).toByteArray();for(i=0;i<l.length;i+=1)l[i]&=255;for(;l.length<h;)l.unshift(0);if(188!==l[h-1])throw new Error("encoded message does not end in 0xbc");var f=(l=String.fromCharCode.apply(String,l)).substr(0,h-u-1),p=l.substr(f.length,u),d=65280>>8*h-c&255;if(0!=(f.charCodeAt(0)&d))throw new Error("bits beyond keysize not zero");var g=ae(p,f.length,o),y=[];for(i=0;i<f.length;i+=1)y[i]=f.charCodeAt(i)^g.charCodeAt(i);y[0]&=~d;var v=h-u-n-2;for(i=0;i<v;i+=1)if(0!==y[i])throw new Error("leftmost octets not zero");if(1!==y[v])throw new Error("0x01 marker not found");return p===Ct(o(It("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,y.slice(-n)))))},ot.SALT_LEN_HLEN=-1,ot.SALT_LEN_MAX=-2,ot.SALT_LEN_RECOVER=-2,ce.EXT_PARSER={},ce.registExtParser=function(t,e){ce.EXT_PARSER[t]=e},ce.hex2dn=function(t,e){void 0===e&&(e=0);var r=new ce;return gt.getTLV(t,e),r.getX500Name(t).str},ce.hex2rdn=function(t,e){if(void 0===e&&(e=0),"31"!==t.substr(e,2))throw new Error("malformed RDN");for(var r=new Array,n=gt.getChildIdx(t,e),i=0;i<n.length;i++)r.push(ce.hex2attrTypeValue(t,n[i]));return(r=r.map(function(t){return t.replace("+","\\+")})).join("+")},ce.hex2attrTypeValue=function(t,e){var r=gt,n=r.getV;if(void 0===e&&(e=0),"30"!==t.substr(e,2))throw new Error("malformed attribute type and value");var i=r.getChildIdx(t,e);2!==i.length||t.substr(i[0],2);var s=n(t,i[0]),o=ft.asn1.ASN1Util.oidHexToInt(s);return ft.asn1.x509.OID.oid2atype(o)+"="+Ct(n(t,i[1]))},ce.getPublicKeyFromCertHex=function(t){var e=new ce;return e.readCertHex(t),e.getPublicKey()},ce.getPublicKeyFromCertPEM=function(t){var e=new ce;return e.readCertPEM(t),e.getPublicKey()},ce.getPublicKeyInfoPropOfCertPEM=function(t){var e,r,n=gt.getVbyList,i={algparam:null};return(e=new ce).readCertPEM(t),r=e.getPublicKeyHex(),i.keyhex=n(r,0,[1],"03").substr(2),i.algoid=n(r,0,[0,0],"06"),"2a8648ce3d0201"===i.algoid&&(i.algparam=n(r,0,[0,1],"06")),i},ce.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"],void 0!==ft&&ft||(ft={}),void 0!==ft.jws&&ft.jws||(ft.jws={}),ft.jws.JWS=function(){var t=ft.jws.JWS.isSafeJSONString;this.parseJWS=function(e,r){if(void 0===this.parsedJWS||!r&&void 0===this.parsedJWS.sigvalH){var n=e.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==n)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=n[1],s=n[2],o=n[3],a=i+"."+s;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=s,this.parsedJWS.sigvalB64U=o,this.parsedJWS.si=a,!r){var u=Et(o),c=it(u,16);this.parsedJWS.sigvalH=u,this.parsedJWS.sigvalBI=c}var h=dt(i),l=dt(s);if(this.parsedJWS.headS=h,this.parsedJWS.payloadS=l,!t(h,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+h}}},ft.jws.JWS.sign=function(t,e,r,n,i){var s,o,a,u=ft,c=u.jws.JWS,h=c.readSafeJSONString,l=c.isSafeJSONString,f=u.crypto,p=(f.ECDSA,f.Mac),d=f.Signature,g=JSON;if("string"!=typeof e&&"object"!=typeof e)throw"spHeader must be JSON string or object: "+e;if("object"==typeof e&&(o=e,s=g.stringify(o)),"string"==typeof e){if(!l(s=e))throw"JWS Head is not safe JSON string: "+s;o=h(s)}if(a=r,"object"==typeof r&&(a=g.stringify(r)),""!=t&&null!=t||void 0===o.alg||(t=o.alg),""!=t&&null!=t&&void 0===o.alg&&(o.alg=t,s=g.stringify(o)),t!==o.alg)throw"alg and sHeader.alg doesn't match: "+t+"!="+o.alg;var y=null;if(void 0===c.jwsalg2sigalg[t])throw"unsupported alg name: "+t;y=c.jwsalg2sigalg[t];var v=pt(s)+"."+pt(a),m="";if("Hmac"==y.substr(0,4)){if(void 0===n)throw"mac key shall be specified for HS* alg";var x=new p({alg:y,prov:"cryptojs",pass:n});x.updateString(v),m=x.doFinal()}else if(-1!=y.indexOf("withECDSA")){(b=new d({alg:y})).init(n,i),b.updateString(v);var w=b.sign();m=ft.crypto.ECDSA.asn1SigToConcatSig(w)}else{var b;"none"!=y&&((b=new d({alg:y})).init(n,i),b.updateString(v),m=b.sign())}return v+"."+St(m)},ft.jws.JWS.verify=function(t,e,r){var n,i=ft,s=i.jws.JWS,o=s.readSafeJSONString,a=i.crypto,u=a.ECDSA,c=a.Mac,h=a.Signature;if(n=ot,!Jt(t))return!1;var l=t.split(".");if(3!==l.length)return!1;var f,p,d=l[0]+"."+l[1],g=Et(l[2]),y=o(dt(l[0]));if(void 0===y.alg)throw"algorithm not specified in header";if(p=(f=y.alg).substr(0,2),null!=r&&"[object Array]"===Object.prototype.toString.call(r)&&r.length>0&&-1==(":"+r.join(":")+":").indexOf(":"+f+":"))throw"algorithm '"+f+"' not accepted in the list";if("none"!=f&&null===e)throw"key shall be specified to verify.";if("string"==typeof e&&-1!=e.indexOf("-----BEGIN ")&&(e=se.getKey(e)),!("RS"!=p&&"PS"!=p||e instanceof n))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==p&&!(e instanceof u))throw"key shall be a ECDSA obj for ES* algs";var v=null;if(void 0===s.jwsalg2sigalg[y.alg])throw"unsupported alg name: "+f;if("none"==(v=s.jwsalg2sigalg[f]))throw"not supported";if("Hmac"==v.substr(0,4)){if(void 0===e)throw"hexadecimal key shall be specified for HMAC";var m=new c({alg:v,pass:e});return m.updateString(d),g==m.doFinal()}if(-1!=v.indexOf("withECDSA")){var x,w=null;try{w=u.concatSigToASN1Sig(g)}catch(t){return!1}return(x=new h({alg:v})).init(e),x.updateString(d),x.verify(w)}return(x=new h({alg:v})).init(e),x.updateString(d),x.verify(g)},ft.jws.JWS.parse=function(t){var e,r,n,i=t.split("."),s={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return e=i[0],r=i[1],3==i.length&&(n=i[2]),s.headerObj=ft.jws.JWS.readSafeJSONString(dt(e)),s.payloadObj=ft.jws.JWS.readSafeJSONString(dt(r)),s.headerPP=JSON.stringify(s.headerObj,null," "),null==s.payloadObj?s.payloadPP=dt(r):s.payloadPP=JSON.stringify(s.payloadObj,null," "),void 0!==n&&(s.sigHex=Et(n)),s},ft.jws.JWS.verifyJWT=function(t,e,r){var n=ft.jws,i=n.JWS,s=i.readSafeJSONString,o=i.inArray,a=i.includedArray;if(!Jt(t))return!1;var u=t.split(".");if(3!=u.length)return!1;var c=u[0],h=u[1],l=(Et(u[2]),s(dt(c))),f=s(dt(h));if(void 0===l.alg)return!1;if(void 0===r.alg)throw"acceptField.alg shall be specified";if(!o(l.alg,r.alg))return!1;if(void 0!==f.iss&&"object"==typeof r.iss&&!o(f.iss,r.iss))return!1;if(void 0!==f.sub&&"object"==typeof r.sub&&!o(f.sub,r.sub))return!1;if(void 0!==f.aud&&"object"==typeof r.aud)if("string"==typeof f.aud){if(!o(f.aud,r.aud))return!1}else if("object"==typeof f.aud&&!a(f.aud,r.aud))return!1;var p=n.IntDate.getNow();return void 0!==r.verifyAt&&"number"==typeof r.verifyAt&&(p=r.verifyAt),void 0!==r.gracePeriod&&"number"==typeof r.gracePeriod||(r.gracePeriod=0),!(void 0!==f.exp&&"number"==typeof f.exp&&f.exp+r.gracePeriod<p||void 0!==f.nbf&&"number"==typeof f.nbf&&p<f.nbf-r.gracePeriod||void 0!==f.iat&&"number"==typeof f.iat&&p<f.iat-r.gracePeriod||void 0!==f.jti&&void 0!==r.jti&&f.jti!==r.jti||!i.verify(t,e,r.alg))},ft.jws.JWS.includedArray=function(t,e){var r=ft.jws.JWS.inArray;if(null===t)return!1;if("object"!=typeof t)return!1;if("number"!=typeof t.length)return!1;for(var n=0;n<t.length;n++)if(!r(t[n],e))return!1;return!0},ft.jws.JWS.inArray=function(t,e){if(null===e)return!1;if("object"!=typeof e)return!1;if("number"!=typeof e.length)return!1;for(var r=0;r<e.length;r++)if(e[r]==t)return!0;return!1},ft.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",ES512:"SHA512withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},ft.jws.JWS.isSafeJSONString=function(t,e,r){var n=null;try{return"object"!=typeof(n=lt(t))||n.constructor===Array?0:(e&&(e[r]=n),1)}catch(t){return 0}},ft.jws.JWS.readSafeJSONString=function(t){var e=null;try{return"object"!=typeof(e=lt(t))||e.constructor===Array?null:e}catch(t){return null}},ft.jws.JWS.getEncodedSignatureValueFromJWS=function(t){var e=t.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==e)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return e[1]},ft.jws.JWS.getJWKthumbprint=function(t){if("RSA"!==t.kty&&"EC"!==t.kty&&"oct"!==t.kty)throw"unsupported algorithm for JWK Thumprint";var e="{";if("RSA"===t.kty){if("string"!=typeof t.n||"string"!=typeof t.e)throw"wrong n and e value for RSA key";e+='"e":"'+t.e+'",',e+='"kty":"'+t.kty+'",',e+='"n":"'+t.n+'"}'}else if("EC"===t.kty){if("string"!=typeof t.crv||"string"!=typeof t.x||"string"!=typeof t.y)throw"wrong crv, x and y value for EC key";e+='"crv":"'+t.crv+'",',e+='"kty":"'+t.kty+'",',e+='"x":"'+t.x+'",',e+='"y":"'+t.y+'"}'}else if("oct"===t.kty){if("string"!=typeof t.k)throw"wrong k value for oct(symmetric) key";e+='"kty":"'+t.kty+'",',e+='"k":"'+t.k+'"}'}var r=It(e);return St(ft.crypto.Util.hashHex(r,"sha256"))},ft.jws.IntDate={},ft.jws.IntDate.get=function(t){var e=ft.jws.IntDate,r=e.getNow,n=e.getZulu;if("now"==t)return r();if("now + 1hour"==t)return r()+3600;if("now + 1day"==t)return r()+86400;if("now + 1month"==t)return r()+2592e3;if("now + 1year"==t)return r()+31536e3;if(t.match(/Z$/))return n(t);if(t.match(/^[0-9]+$/))return parseInt(t);throw"unsupported format: "+t},ft.jws.IntDate.getZulu=function(t){return jt(t)},ft.jws.IntDate.getNow=function(){return~~(new Date/1e3)},ft.jws.IntDate.intDate2UTCString=function(t){return new Date(1e3*t).toUTCString()},ft.jws.IntDate.intDate2Zulu=function(t){var e=new Date(1e3*t);return("0000"+e.getUTCFullYear()).slice(-4)+("00"+(e.getUTCMonth()+1)).slice(-2)+("00"+e.getUTCDate()).slice(-2)+("00"+e.getUTCHours()).slice(-2)+("00"+e.getUTCMinutes()).slice(-2)+("00"+e.getUTCSeconds()).slice(-2)+"Z"},void 0!==ft&&ft||(ft={}),void 0!==ft.jws&&ft.jws||(ft.jws={}),ft.jws.JWSJS=function(){var t=ft.jws.JWS,e=t.readSafeJSONString;this.aHeader=[],this.sPayload="",this.aSignature=[],this.init=function(){this.aHeader=[],this.sPayload=void 0,this.aSignature=[]},this.initWithJWS=function(t){this.init();var e=t.split(".");if(3!=e.length)throw"malformed input JWS";this.aHeader.push(e[0]),this.sPayload=e[1],this.aSignature.push(e[2])},this.addSignature=function(t,e,r,n){if(void 0===this.sPayload||null===this.sPayload)throw"there's no JSON-JS signature to add.";var i=this.aHeader.length;if(this.aHeader.length!=this.aSignature.length)throw"aHeader.length != aSignature.length";try{var s=ft.jws.JWS.sign(t,e,this.sPayload,r,n).split(".");s[0],s[2],this.aHeader.push(s[0]),this.aSignature.push(s[2])}catch(t){throw this.aHeader.length>i&&this.aHeader.pop(),this.aSignature.length>i&&this.aSignature.pop(),"addSignature failed: "+t}},this.verifyAll=function(t){if(this.aHeader.length!==t.length||this.aSignature.length!==t.length)return!1;for(var e=0;e<t.length;e++){var r=t[e];if(2!==r.length)return!1;if(!1===this.verifyNth(e,r[0],r[1]))return!1}return!0},this.verifyNth=function(e,r,n){if(this.aHeader.length<=e||this.aSignature.length<=e)return!1;var i=this.aHeader[e],s=this.aSignature[e],o=i+"."+this.sPayload+"."+s,a=!1;try{a=t.verify(o,r,n)}catch(t){return!1}return a},this.readJWSJS=function(t){if("string"==typeof t){var r=e(t);if(null==r)throw"argument is not safe JSON object string";this.aHeader=r.headers,this.sPayload=r.payload,this.aSignature=r.signatures}else try{if(!(t.headers.length>0))throw"malformed header";if(this.aHeader=t.headers,"string"!=typeof t.payload)throw"malformed signatures";if(this.sPayload=t.payload,!(t.signatures.length>0))throw"malformed signatures";this.aSignature=t.signatures}catch(t){throw"malformed JWS-JS JSON object: "+t}},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return 0==this.aHeader.length?1:0}},r.SecureRandom=nt,r.rng_seed_time=Y,r.BigInteger=E,r.RSAKey=ot,r.ECDSA=ft.crypto.ECDSA,r.DSA=ft.crypto.DSA,r.Signature=ft.crypto.Signature,r.MessageDigest=ft.crypto.MessageDigest,r.Mac=ft.crypto.Mac,r.Cipher=ft.crypto.Cipher,r.KEYUTIL=se,r.ASN1HEX=gt,r.X509=ce,r.X509CRL=function(t){var e=ft.lang.String.isHex,r=gt,n=r.getV,i=r.getTLV,s=r.getVbyList,o=r.getTLVbyList,a=r.getTLVbyListEx,u=r.getIdxbyList,c=r.getIdxbyListEx,h=r.getChildIdx,l=new ce;this.hex=null,this.posSigAlg=null,this.posRevCert=null,this.parsed=null,this._setPos=function(){var t=u(this.hex,0,[0,0]),e=this.hex.substr(t,2);if("02"==e)this.posSigAlg=1;else{if("30"!=e)throw new Error("malformed 1st item of TBSCertList: "+e);this.posSigAlg=0}var r,n=u(this.hex,0,[0,this.posSigAlg+3]),i=this.hex.substr(n,2);if("17"==i||"18"==i)r=u(this.hex,0,[0,this.posSigAlg+4]),this.posRevCert=null,-1!=r&&"30"==this.hex.substr(r,2)&&(this.posRevCert=this.posSigAlg+4);else if("30"==i)this.posRevCert=this.posSigAlg+3;else{if("a0"!=i)throw new Error("malformed nextUpdate or revCert tag: "+i);this.posRevCert=null}},this.getVersion=function(){return 0==this.posSigAlg?null:parseInt(s(this.hex,0,[0,0],"02"),16)+1},this.getSignatureAlgorithmField=function(){var t=o(this.hex,0,[0,this.posSigAlg],"30");return l.getAlgorithmIdentifierName(t)},this.getIssuer=function(){return l.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return o(this.hex,0,[0,this.posSigAlg+1],"30")},this.getThisUpdate=function(){var t=s(this.hex,0,[0,this.posSigAlg+2]);return result=Ct(t)},this.getNextUpdate=function(){var t=u(this.hex,0,[0,this.posSigAlg+3]),e=this.hex.substr(t,2);return"17"!=e&&"18"!=e?null:Ct(n(this.hex,t))},this.getRevCertArray=function(){if(null==this.posRevCert)return null;for(var t=[],e=u(this.hex,0,[0,this.posRevCert]),r=h(this.hex,e),n=0;n<r.length;n++){var s=i(this.hex,r[n]);t.push(this.getRevCert(s))}return t},this.getRevCert=function(t){var e={},r=h(t,0);return e.sn={hex:s(t,0,[0],"02")},e.date=Ct(s(t,0,[1])),3==r.length&&(e.ext=l.getExtParamArray(o(t,0,[2]))),e},this.findRevCert=function(t){var e=new ce(t).getSerialNumberHex();return this.findRevCertBySN(e)},this.findRevCertBySN=function(t){if(null==this.parsed&&this.getParam(),null==this.parsed.revcert)return null;for(var e=this.parsed.revcert,r=0;r<e.length;r++)if(t==e[r].sn.hex)return e[r];return null},this.getSignatureValueHex=function(){return s(this.hex,0,[2],"03",!0)},this.verifySignature=function(t){var e=this.getSignatureAlgorithmField(),r=this.getSignatureValueHex(),n=o(this.hex,0,[0],"30"),i=new ft.crypto.Signature({alg:e});return i.init(t),i.updateHex(n),i.verify(r)},this.getParam=function(t){var e={},r=this.getVersion();null!=r&&(e.version=r),e.sigalg=this.getSignatureAlgorithmField(),e.issuer=this.getIssuer(),e.thisupdate=this.getThisUpdate();var n=this.getNextUpdate();null!=n&&(e.nextupdate=n);var i=this.getRevCertArray();if(null!=i&&(e.revcert=i),-1!=c(this.hex,0,[0,"[0]"])){var s=a(this.hex,0,[0,"[0]",0]);e.ext=l.getExtParamArray(s)}return e.sighex=this.getSignatureValueHex(),this.parsed=e,"object"==typeof t&&(1==t.tbshex&&(e.tbshex=o(this.hex,0,[0])),1==t.nodnarray&&delete e.issuer.array),e},"string"==typeof t&&(e(t)?this.hex=t:t.match(/-----BEGIN X509 CRL/)&&(this.hex=Ot(t)),this._setPos())},r.CryptoJS=y,r.b64tohex=b,r.b64toBA=S,r.ECFieldElementFp=ut,r.ECPointFp=ct,r.ECCurveFp=ht,r.stoBA=yt,r.BAtos=vt,r.BAtohex=mt,r.stohex=xt,r.stob64=function(t){return w(xt(t))},r.stob64u=function(t){return wt(w(xt(t)))},r.b64utos=function(t){return vt(S(bt(t)))},r.b64tob64u=wt,r.b64utob64=bt,r.hex2b64=w,r.hextob64u=St,r.b64utohex=Et,r.utf8tob64u=pt,r.b64utoutf8=dt,r.utf8tob64=function(t){return w(_t(zt(t)))},r.b64toutf8=function(t){return decodeURIComponent(kt(b(t)))},r.utf8tohex=At,r.hextoutf8=Ft,r.hextorstr=Ct,r.rstrtohex=It,r.hextob64=Dt,r.hextob64nl=function(t){return Tt(Dt(t),64)},r.b64nltohex=Rt,r.hextopem=Nt,r.pemtohex=Ot,r.hextoArrayBuffer=function(t){if(t.length%2!=0)throw"input is not even length";if(null==t.match(/^[0-9A-Fa-f]+$/))throw"input is not hexadecimal";for(var e=new ArrayBuffer(t.length/2),r=new DataView(e),n=0;n<t.length/2;n++)r.setUint8(n,parseInt(t.substr(2*n,2),16));return e},r.ArrayBuffertohex=function(t){for(var e="",r=new DataView(t),n=0;n<t.byteLength;n++)e+=("00"+r.getUint8(n).toString(16)).slice(-2);return e},r.zulutomsec=Bt,r.msectozulu=function(t){var e=new Date(t),r=("0000"+e.getUTCFullYear()).slice(-4),n=("00"+(e.getUTCMonth()+1)).slice(-2),i=("00"+e.getUTCDate()).slice(-2),s=("00"+e.getUTCHours()).slice(-2),o=("00"+e.getUTCMinutes()).slice(-2),a=("00"+e.getUTCSeconds()).slice(-2),u=("000"+e.getUTCMilliseconds()).slice(-3);return r+n+i+s+o+a+(u=""!=(u=u.replace(/0+$/,""))?"."+u:u)+"Z"},r.zulutosec=jt,r.zulutodate=function(t){return new Date(Bt(t))},r.datetozulu=function(t,e,r){var n,i=t.getUTCFullYear();if(e){if(i<1950||2049<i)throw"not proper year for UTCTime: "+i;n=(""+i).slice(-2)}else n=("000"+i).slice(-4);if(n+=("0"+(t.getUTCMonth()+1)).slice(-2),n+=("0"+t.getUTCDate()).slice(-2),n+=("0"+t.getUTCHours()).slice(-2),n+=("0"+t.getUTCMinutes()).slice(-2),n+=("0"+t.getUTCSeconds()).slice(-2),r){var s=t.getUTCMilliseconds();0!==s&&(n+="."+(s=(s=("00"+s).slice(-3)).replace(/0+$/g,"")))}return n+"Z"},r.uricmptohex=_t,r.hextouricmp=kt,r.ipv6tohex=Lt,r.hextoipv6=Vt,r.hextoip=Kt,r.iptohex=Mt,r.ucs2hextoutf8=Gt,r.encodeURIComponentAll=zt,r.newline_toUnix=function(t){return t.replace(/\r\n/gm,"\n")},r.newline_toDos=function(t){return(t=t.replace(/\r\n/gm,"\n")).replace(/\n/gm,"\r\n")},r.hextoposhex=Xt,r.intarystrtohex=function(t){t=(t=(t=t.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return t.split(/,/).map(function(t,e,r){var n=parseInt(t);if(n<0||255<n)throw"integer not in range 0-255";return("00"+n.toString(16)).slice(-2)}).join("")}catch(t){throw"malformed integer array string: "+t}},r.strdiffidx=function(t,e){var r=t.length;t.length>e.length&&(r=e.length);for(var n=0;n<r;n++)if(t.charCodeAt(n)!=e.charCodeAt(n))return n;return t.length!=e.length?r:-1},r.oidtohex=$t,r.hextooid=Yt,r.strpad=Zt,r.bitstrtoint=Qt,r.inttobitstr=te,r.bitstrtobinstr=ee,r.binstrtobitstr=function(t){if("string"!=typeof t)return null;if(null==t.match(/^[01]+$/))return null;try{return te(parseInt(t,2))}catch(t){return null}},r.isBase64URLDot=Jt,r.namearraytobinstr=re,r.extendClass=ie,r.foldnl=Tt,r.b64topem=function(t,e){return"-----BEGIN "+e+"-----\r\n"+Tt(t,64)+"\r\n-----END "+e+"-----\r\n"},r.pemtob64=function(t){return-1==t.indexOf("-----BEGIN ")||-1==t.indexOf("-----END ")?null:(t=(t=(t=t.replace(/^[\s\S]*?-----BEGIN [^-]+-----/m,"")).replace(/-----END [\s\S]+$/m,"")).replace(/\s+/g,"")).match(/^[0-9a-zA-Z+/=]+$/)?t:null},r.timeogen=Ht,r.aryval=ne,r.KJUR=ft,r.crypto=ft.crypto,r.asn1=ft.asn1,r.jws=ft.jws,r.lang=ft.lang,r.VERSION="10.8.6",r.VERSION_FULL="jsrsasign(all) 10.8.6 (2023-04-26) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license"},294:function(t,e,r){var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,s=n&&i&&"function"==typeof i.get?i.get:null,o=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=a&&u&&"function"==typeof u.get?u.get:null,h=a&&Set.prototype.forEach,l="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,g=Object.prototype.toString,y=Function.prototype.toString,v=String.prototype.match,m=String.prototype.slice,x=String.prototype.replace,w=String.prototype.toUpperCase,b=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,F=Array.prototype.slice,P=Math.floor,C="function"==typeof BigInt?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,R="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,O=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function B(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-P(-t):P(t);if(n!==t){var i=String(n),s=m.call(e,i.length+1);return x.call(i,r,"$&_")+"."+x.call(x.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return x.call(e,r,"$&_")}var j=r(710),H=j.custom,_=q(H)?H:null;function k(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function L(t){return x.call(String(t),/"/g,"&quot;")}function V(t){return!("[object Array]"!==G(t)||R&&"object"==typeof t&&R in t)}function K(t){return!("[object RegExp]"!==G(t)||R&&"object"==typeof t&&R in t)}function q(t){if(T)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!D)return!1;try{return D.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,i){var a=r||{};if(U(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(U(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!U(a,"customInspect")||a.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(U(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(U(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var g=a.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return W(e,a);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var w=String(e);return g?B(e,w):w}if("bigint"==typeof e){var S=String(e)+"n";return g?B(e,S):S}var P=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=P&&P>0&&"object"==typeof e)return V(e)?"[Array]":"[Object]";var I=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(a,n);if(void 0===i)i=[];else if(z(i,e)>=0)return"[Circular]";function H(e,r,s){if(r&&(i=F.call(i)).push(r),s){var o={depth:a.depth};return U(a,"quoteStyle")&&(o.quoteStyle=a.quoteStyle),t(e,o,n+1,i)}return t(e,a,n+1,i)}if("function"==typeof e&&!K(e)){var M=function(t){if(t.name)return t.name;var e=v.call(y.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),J=Q(e,H);return"[Function"+(M?": "+M:" (anonymous)")+"]"+(J.length>0?" { "+A.call(J,", ")+" }":"")}if(q(e)){var tt=T?x.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):D.call(e);return"object"!=typeof e||T?tt:X(tt)}if(function(t){return!(!t||"object"!=typeof t)&&("undefined"!=typeof HTMLElement&&t instanceof HTMLElement||"string"==typeof t.nodeName&&"function"==typeof t.getAttribute)}(e)){for(var et="<"+b.call(String(e.nodeName)),rt=e.attributes||[],nt=0;nt<rt.length;nt++)et+=" "+rt[nt].name+"="+k(L(rt[nt].value),"double",a);return et+=">",e.childNodes&&e.childNodes.length&&(et+="..."),et+"</"+b.call(String(e.nodeName))+">"}if(V(e)){if(0===e.length)return"[]";var it=Q(e,H);return I&&!function(t){for(var e=0;e<t.length;e++)if(z(t[e],"\n")>=0)return!1;return!0}(it)?"["+Z(it,I)+"]":"[ "+A.call(it,", ")+" ]"}if(function(t){return!("[object Error]"!==G(t)||R&&"object"==typeof t&&R in t)}(e)){var st=Q(e,H);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===st.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(st,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+H(e.cause),st),", ")+" }"}if("object"==typeof e&&u){if(_&&"function"==typeof e[_]&&j)return j(e,{depth:P-n});if("symbol"!==u&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{c.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ot=[];return o&&o.call(e,function(t,r){ot.push(H(r,e,!0)+" => "+H(t,e))}),Y("Map",s.call(e),ot,I)}if(function(t){if(!c||!t||"object"!=typeof t)return!1;try{c.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var at=[];return h&&h.call(e,function(t){at.push(H(t,e))}),Y("Set",c.call(e),at,I)}if(function(t){if(!l||!t||"object"!=typeof t)return!1;try{l.call(t,l);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return $("WeakMap");if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{l.call(t,l)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return $("WeakSet");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{return p.call(t),!0}catch(t){}return!1}(e))return $("WeakRef");if(function(t){return!("[object Number]"!==G(t)||R&&"object"==typeof t&&R in t)}(e))return X(H(Number(e)));if(function(t){if(!t||"object"!=typeof t||!C)return!1;try{return C.call(t),!0}catch(t){}return!1}(e))return X(H(C.call(e)));if(function(t){return!("[object Boolean]"!==G(t)||R&&"object"==typeof t&&R in t)}(e))return X(d.call(e));if(function(t){return!("[object String]"!==G(t)||R&&"object"==typeof t&&R in t)}(e))return X(H(String(e)));if(!function(t){return!("[object Date]"!==G(t)||R&&"object"==typeof t&&R in t)}(e)&&!K(e)){var ut=Q(e,H),ct=O?O(e)===Object.prototype:e instanceof Object||e.constructor===Object,ht=e instanceof Object?"":"null prototype",lt=!ct&&R&&Object(e)===e&&R in e?m.call(G(e),8,-1):ht?"Object":"",ft=(ct||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(lt||ht?"["+A.call(E.call([],lt||[],ht||[]),": ")+"] ":"");return 0===ut.length?ft+"{}":I?ft+"{"+Z(ut,I)+"}":ft+"{ "+A.call(ut,", ")+" }"}return String(e)};var M=Object.prototype.hasOwnProperty||function(t){return t in this};function U(t,e){return M.call(t,e)}function G(t){return g.call(t)}function z(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function W(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return W(m.call(t,0,e.maxStringLength),e)+n}return k(x.call(x.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,J),"single",e)}function J(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function X(t){return"Object("+t+")"}function $(t){return t+" { ? }"}function Y(t,e,r,n){return t+" ("+e+") {"+(n?Z(r,n):A.call(r,", "))+"}"}function Z(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Q(t,e){var r=V(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=U(t,i)?e(t[i],t):""}var s,o="function"==typeof I?I(t):[];if(T){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var u in t)U(t,u)&&(r&&String(Number(u))===u&&u<t.length||T&&s["$"+u]instanceof Symbol||(S.call(/[^\w$]/,u)?n.push(e(u,t)+": "+e(t[u],t)):n.push(u+": "+e(t[u],t))));if("function"==typeof I)for(var c=0;c<o.length;c++)N.call(t,o[c])&&n.push("["+e(o[c])+"]: "+e(t[o[c]],t));return n}},704:function(t){"use strict";var e=String.prototype.replace,r=/%20/g,n="RFC3986";t.exports={default:n,formatters:{RFC1738:function(t){return e.call(t,r,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:n}},407:function(t,e,r){"use strict";var n=r(639),i=r(676),s=r(704);t.exports={formats:s,parse:i,stringify:n}},676:function(t,e,r){"use strict";var n=r(147),i=Object.prototype.hasOwnProperty,s=Array.isArray,o={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(t){return t.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},u=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},c=function(t,e,r,n){if(t){var s=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(s),c=a?s.slice(0,a.index):s,h=[];if(c){if(!r.plainObjects&&i.call(Object.prototype,c)&&!r.allowPrototypes)return;h.push(c)}for(var l=0;r.depth>0&&null!==(a=o.exec(s))&&l<r.depth;){if(l+=1,!r.plainObjects&&i.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;h.push(a[1])}return a&&h.push("["+s.slice(a.index)+"]"),function(t,e,r,n){for(var i=n?e:u(e,r),s=t.length-1;s>=0;--s){var o,a=t[s];if("[]"===a&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,h=parseInt(c,10);r.parseArrays||""!==c?!isNaN(h)&&a!==c&&String(h)===c&&h>=0&&r.parseArrays&&h<=r.arrayLimit?(o=[])[h]=i:"__proto__"!==c&&(o[c]=i):o={0:i}}i=o}return i}(h,e,r,n)}};t.exports=function(t,e){var r=function(t){if(!t)return o;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?o.charset:t.charset;return{allowDots:void 0===t.allowDots?o.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:o.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:o.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:o.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:o.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:o.comma,decoder:"function"==typeof t.decoder?t.decoder:o.decoder,delimiter:"string"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:o.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:o.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:o.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:o.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:o.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var h="string"==typeof t?function(t,e){var r,c={__proto__:null},h=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,l=e.parameterLimit===1/0?void 0:e.parameterLimit,f=h.split(e.delimiter,l),p=-1,d=e.charset;if(e.charsetSentinel)for(r=0;r<f.length;++r)0===f[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[r]?d="utf-8":"utf8=%26%2310003%3B"===f[r]&&(d="iso-8859-1"),p=r,r=f.length);for(r=0;r<f.length;++r)if(r!==p){var g,y,v=f[r],m=v.indexOf("]="),x=-1===m?v.indexOf("="):m+1;-1===x?(g=e.decoder(v,o.decoder,d,"key"),y=e.strictNullHandling?null:""):(g=e.decoder(v.slice(0,x),o.decoder,d,"key"),y=n.maybeMap(u(v.slice(x+1),e),function(t){return e.decoder(t,o.decoder,d,"value")})),y&&e.interpretNumericEntities&&"iso-8859-1"===d&&(y=a(y)),v.indexOf("[]=")>-1&&(y=s(y)?[y]:y),i.call(c,g)?c[g]=n.combine(c[g],y):c[g]=y}return c}(t,r):t,l=r.plainObjects?Object.create(null):{},f=Object.keys(h),p=0;p<f.length;++p){var d=f[p],g=c(d,h[d],r,"string"==typeof t);l=n.merge(l,g,r)}return!0===r.allowSparse?l:n.compact(l)}},639:function(t,e,r){"use strict";var n=r(556),i=r(147),s=r(704),o=Object.prototype.hasOwnProperty,a={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},u=Array.isArray,c=Array.prototype.push,h=function(t,e){c.apply(t,u(e)?e:[e])},l=Date.prototype.toISOString,f=s.default,p={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:i.encode,encodeValuesOnly:!1,format:f,formatter:s.formatters[f],indices:!1,serializeDate:function(t){return l.call(t)},skipNulls:!1,strictNullHandling:!1},d={},g=function t(e,r,s,o,a,c,l,f,g,y,v,m,x,w,b,S){for(var E,A=e,F=S,P=0,C=!1;void 0!==(F=F.get(d))&&!C;){var I=F.get(e);if(P+=1,void 0!==I){if(I===P)throw new RangeError("Cyclic object value");C=!0}void 0===F.get(d)&&(P=0)}if("function"==typeof f?A=f(r,A):A instanceof Date?A=v(A):"comma"===s&&u(A)&&(A=i.maybeMap(A,function(t){return t instanceof Date?v(t):t})),null===A){if(a)return l&&!w?l(r,p.encoder,b,"key",m):r;A=""}if("string"==typeof(E=A)||"number"==typeof E||"boolean"==typeof E||"symbol"==typeof E||"bigint"==typeof E||i.isBuffer(A))return l?[x(w?r:l(r,p.encoder,b,"key",m))+"="+x(l(A,p.encoder,b,"value",m))]:[x(r)+"="+x(String(A))];var D,T=[];if(void 0===A)return T;if("comma"===s&&u(A))w&&l&&(A=i.maybeMap(A,l)),D=[{value:A.length>0?A.join(",")||null:void 0}];else if(u(f))D=f;else{var R=Object.keys(A);D=g?R.sort(g):R}for(var N=o&&u(A)&&1===A.length?r+"[]":r,O=0;O<D.length;++O){var B=D[O],j="object"==typeof B&&void 0!==B.value?B.value:A[B];if(!c||null!==j){var H=u(A)?"function"==typeof s?s(N,B):N:N+(y?"."+B:"["+B+"]");S.set(e,P);var _=n();_.set(d,S),h(T,t(j,H,s,o,a,c,"comma"===s&&w&&u(A)?null:l,f,g,y,v,m,x,w,b,_))}}return T};t.exports=function(t,e){var r,i=t,c=function(t){if(!t)return p;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||p.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=s.default;if(void 0!==t.format){if(!o.call(s.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=s.formatters[r],i=p.filter;return("function"==typeof t.filter||u(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:p.addQueryPrefix,allowDots:void 0===t.allowDots?p.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:p.charsetSentinel,delimiter:void 0===t.delimiter?p.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:p.encode,encoder:"function"==typeof t.encoder?t.encoder:p.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:p.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:p.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:p.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:p.strictNullHandling}}(e);"function"==typeof c.filter?i=(0,c.filter)("",i):u(c.filter)&&(r=c.filter);var l,f=[];if("object"!=typeof i||null===i)return"";l=e&&e.arrayFormat in a?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var d=a[l];if(e&&"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var y="comma"===d&&e&&e.commaRoundTrip;r||(r=Object.keys(i)),c.sort&&r.sort(c.sort);for(var v=n(),m=0;m<r.length;++m){var x=r[m];c.skipNulls&&null===i[x]||h(f,g(i[x],x,d,y,c.strictNullHandling,c.skipNulls,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,v))}var w=f.join(c.delimiter),b=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?b+="utf8=%26%2310003%3B&":b+="utf8=%E2%9C%93&"),w.length>0?b+w:""}},147:function(t,e,r){"use strict";var n=r(704),i=Object.prototype.hasOwnProperty,s=Array.isArray,o=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),a=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(r[n]=t[n]);return r};t.exports={arrayToObject:a,assign:function(t,e){return Object.keys(e).reduce(function(t,r){return t[r]=e[r],t},t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],n=0;n<e.length;++n)for(var i=e[n],o=i.obj[i.prop],a=Object.keys(o),u=0;u<a.length;++u){var c=a[u],h=o[c];"object"==typeof h&&null!==h&&-1===r.indexOf(h)&&(e.push({obj:o,prop:c}),r.push(h))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(s(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,r){var n=t.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,r,i,s){if(0===t.length)return t;var a=t;if("symbol"==typeof t?a=Symbol.prototype.toString.call(t):"string"!=typeof t&&(a=String(t)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"});for(var u="",c=0;c<a.length;++c){var h=a.charCodeAt(c);45===h||46===h||95===h||126===h||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||s===n.RFC1738&&(40===h||41===h)?u+=a.charAt(c):h<128?u+=o[h]:h<2048?u+=o[192|h>>6]+o[128|63&h]:h<55296||h>=57344?u+=o[224|h>>12]+o[128|h>>6&63]+o[128|63&h]:(c+=1,h=65536+((1023&h)<<10|1023&a.charCodeAt(c)),u+=o[240|h>>18]+o[128|h>>12&63]+o[128|h>>6&63]+o[128|63&h])}return u},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(s(t)){for(var r=[],n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)},merge:function t(e,r,n){if(!r)return e;if("object"!=typeof r){if(s(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!i.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var o=e;return s(e)&&!s(r)&&(o=a(e,n)),s(e)&&s(r)?(r.forEach(function(r,s){if(i.call(e,s)){var o=e[s];o&&"object"==typeof o&&r&&"object"==typeof r?e[s]=t(o,r,n):e.push(r)}else e[s]=r}),e):Object.keys(r).reduce(function(e,s){var o=r[s];return i.call(e,s)?e[s]=t(e[s],o,n):e[s]=o,e},o)}}},556:function(t,e,r){"use strict";var n=r(2),i=r(553),s=r(294),o=n("%TypeError%"),a=n("%WeakMap%",!0),u=n("%Map%",!0),c=i("WeakMap.prototype.get",!0),h=i("WeakMap.prototype.set",!0),l=i("WeakMap.prototype.has",!0),f=i("Map.prototype.get",!0),p=i("Map.prototype.set",!0),d=i("Map.prototype.has",!0),g=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new o("Side channel does not contain "+s(t))},get:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(t)return c(t,n)}else if(u){if(e)return f(e,n)}else if(r)return function(t,e){var r=g(t,n);return r&&r.value}(r)},has:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(t)return l(t,n)}else if(u){if(e)return d(e,n)}else if(r)return!!g(r,n);return!1},set:function(n,i){a&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new a),h(t,n,i)):u?(e||(e=new u),p(e,n,i)):(r||(r={key:{},next:null}),function(t,e,r){var n=g(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,i))}};return n}},226:function(t){"use strict";function e(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function n(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"].forEach(function(t){n.prototype[t]=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this._defaults.push({fn:t,args:r}),this}}),n.prototype._setDefaults=function(t){this._defaults.forEach(function(r){t[r.fn].apply(t,e(r.args))})},t.exports=n},445:function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i;i="undefined"!=typeof window?window:"undefined"==typeof self?void 0:self;var s=r(760),o=r(306),a=r(407),u=r(757),c=r(456),h=r(862),l=r(226);function f(){}t.exports=function(t,r){return"function"==typeof r?new e.Request("GET",t).end(r):1===arguments.length?new e.Request("GET",t):new e.Request(t,r)};var p=e=t.exports;e.Request=w,p.getXHR=function(){if(i.XMLHttpRequest&&(!i.location||"file:"!==i.location.protocol||!i.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw new Error("Browser-only version of superagent could not find XHR")};var d="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function g(t){if(!c(t))return t;var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&y(e,r,t[r]);return e.join("&")}function y(t,e,r){if(void 0!==r)if(null!==r)if(Array.isArray(r))r.forEach(function(r){y(t,e,r)});else if(c(r))for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&y(t,"".concat(e,"[").concat(n,"]"),r[n]);else t.push(encodeURI(e)+"="+encodeURIComponent(r));else t.push(encodeURI(e))}function v(t){for(var e,r,n={},i=t.split("&"),s=0,o=i.length;s<o;++s)-1===(r=(e=i[s]).indexOf("="))?n[decodeURIComponent(e)]="":n[decodeURIComponent(e.slice(0,r))]=decodeURIComponent(e.slice(r+1));return n}function m(t){return/[/+]json($|[^-\w])/i.test(t)}function x(t){this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var e=this.xhr.status;1223===e&&(e=204),this._setStatusProperties(e),this.headers=function(t){for(var e,r,n,i,s=t.split(/\r?\n/),o={},a=0,u=s.length;a<u;++a)-1!==(e=(r=s[a]).indexOf(":"))&&(n=r.slice(0,e).toLowerCase(),i=d(r.slice(e+1)),o[n]=i);return o}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&t._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function w(t,e){var r=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",function(){var t,e=null,n=null;try{n=new x(r)}catch(t){return(e=new Error("Parser is unable to parse the response")).parse=!0,e.original=t,r.xhr?(e.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,e.status=r.xhr.status?r.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),r.callback(e)}r.emit("response",n);try{r._isResponseOK(n)||(t=new Error(n.statusText||n.text||"Unsuccessful HTTP response"))}catch(e){t=e}t?(t.original=e,t.response=n,t.status=n.status,r.callback(t,n)):r.callback(null,n)})}function b(t,e,r){var n=p("DELETE",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}p.serializeObject=g,p.parseString=v,p.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},p.serialize={"application/x-www-form-urlencoded":a.stringify,"application/json":o},p.parse={"application/x-www-form-urlencoded":v,"application/json":JSON.parse},h(x.prototype),x.prototype._parseBody=function(t){var e=p.parse[this.type];return this.req._parser?this.req._parser(this,t):(!e&&m(this.type)&&(e=p.parse["application/json"]),e&&t&&(t.length>0||t instanceof Object)?e(t):null)},x.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot ".concat(e," ").concat(r," (").concat(this.status,")"),i=new Error(n);return i.status=this.status,i.method=e,i.url=r,i},p.Response=x,s(w.prototype),u(w.prototype),w.prototype.type=function(t){return this.set("Content-Type",p.types[t]||t),this},w.prototype.accept=function(t){return this.set("Accept",p.types[t]||t),this},w.prototype.auth=function(t,e,r){return 1===arguments.length&&(e=""),"object"===n(e)&&null!==e&&(r=e,e=""),r||(r={type:"function"==typeof btoa?"basic":"auto"}),this._auth(t,e,r,function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")})},w.prototype.query=function(t){return"string"!=typeof t&&(t=g(t)),t&&this._query.push(t),this},w.prototype.attach=function(t,e,r){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},w.prototype._getFormData=function(){return this._formData||(this._formData=new i.FormData),this._formData},w.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},w.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},w.prototype.agent=function(){return this},w.prototype.ca=w.prototype.agent,w.prototype.buffer=w.prototype.ca,w.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},w.prototype.pipe=w.prototype.write,w.prototype._isHost=function(t){return t&&"object"===n(t)&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},w.prototype.end=function(t){this._endCalled,this._endCalled=!0,this._callback=t||f,this._finalizeQueryString(),this._end()},w.prototype._setUploadTimeout=function(){var t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout(function(){t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")},this._uploadTimeout))},w.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var t=this;this.xhr=p.getXHR();var e=this.xhr,r=this._formData||this._data;this._setTimeouts(),e.onreadystatechange=function(){var r=e.readyState;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4===r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(t._uploadTimeoutTimer)),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.addEventListener("progress",n.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",n.bind(null,"upload"))}catch(t){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var i=this._header["content-type"],s=this._serializer||p.serialize[i?i.split(";")[0]:""];!s&&m(i)&&(s=p.serialize["application/json"]),s&&(r=s(r))}for(var o in this.header)null!==this.header[o]&&Object.prototype.hasOwnProperty.call(this.header,o)&&e.setRequestHeader(o,this.header[o]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===r?null:r)},p.agent=function(){return new l},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(t){l.prototype[t.toLowerCase()]=function(e,r){var n=new p.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}}),l.prototype.del=l.prototype.delete,p.get=function(t,e,r){var n=p("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},p.head=function(t,e,r){var n=p("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},p.options=function(t,e,r){var n=p("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},p.del=b,p.delete=b,p.patch=function(t,e,r){var n=p("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},p.post=function(t,e,r){var n=p("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},p.put=function(t,e,r){var n=p("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}},456:function(t){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return null!==t&&"object"===e(t)}},757:function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(456);function s(t){if(t)return function(t){for(var e in s.prototype)Object.prototype.hasOwnProperty.call(s.prototype,e)&&(t[e]=s.prototype[e]);return t}(t)}t.exports=s,s.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},s.prototype.parse=function(t){return this._parser=t,this},s.prototype.responseType=function(t){return this._responseType=t,this},s.prototype.serialize=function(t){return this._serializer=t,this},s.prototype.timeout=function(t){if(!t||"object"!==n(t))return this._timeout=t,this._responseTimeout=0,this._uploadTimeout=0,this;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;case"upload":this._uploadTimeout=t.upload}return this},s.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};var o=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),a=new Set([408,413,429,500,502,503,504,521,522,524]);s.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){}if(e&&e.status&&a.has(e.status))return!0;if(t){if(t.code&&o.has(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},s.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},s.prototype.then=function(t,e){var r=this;if(!this._fullfilledPromise){var n=this;this._endCalled,this._fullfilledPromise=new Promise(function(t,e){n.on("abort",function(){if(!(r._maxRetries&&r._maxRetries>r._retries))if(r.timedout&&r.timedoutError)e(r.timedoutError);else{var t=new Error("Aborted");t.code="ABORTED",t.status=r.status,t.method=r.method,t.url=r.url,e(t)}}),n.end(function(r,n){r?e(r):t(n)})})}return this._fullfilledPromise.then(t,e)},s.prototype.catch=function(t){return this.then(void 0,t)},s.prototype.use=function(t){return t(this),this},s.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},s.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},s.prototype.get=function(t){return this._header[t.toLowerCase()]},s.prototype.getHeader=s.prototype.get,s.prototype.set=function(t,e){if(i(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},s.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},s.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(i(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.field(r,t[r]);return this}if(Array.isArray(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.field(t,e[n]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=String(e)),this._getFormData().append(t,e),this},s.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},s.prototype._auth=function(t,e,r,n){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(t,":").concat(e))));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(t))}return this},s.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},s.prototype.redirects=function(t){return this._maxRedirects=t,this},s.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},s.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},s.prototype.send=function(t){var e=i(t),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&i(this._data))for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this._data[n]=t[n]);else"string"==typeof t?(r||this.type("form"),(r=this._header["content-type"])&&(r=r.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===r?this._data?"".concat(this._data,"&").concat(t):t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||r||this.type("json"),this},s.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},s.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.includes("?")?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.slice(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,e)+"?"+r.join("&")}}},s.prototype._appendQueryString=function(){},s.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error("".concat(t+e,"ms exceeded"));n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}},s.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},862:function(t,e,r){"use strict";var n=r(541);function i(t){if(t)return function(t){for(var e in i.prototype)Object.prototype.hasOwnProperty.call(i.prototype,e)&&(t[e]=i.prototype[e]);return t}(t)}t.exports=i,i.prototype.get=function(t){return this.header[t.toLowerCase()]},i.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=n.type(e);var r=n.params(e);for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(this[i]=r[i]);this.links={};try{t.link&&(this.links=n.parseLinks(t.link))}catch(t){}},i.prototype._setStatusProperties=function(t){var e=t/100|0;this.statusCode=t,this.status=this.statusCode,this.statusType=e,this.info=1===e,this.ok=2===e,this.redirect=3===e,this.clientError=4===e,this.serverError=5===e,this.error=(4===e||5===e)&&this.toError(),this.created=201===t,this.accepted=202===t,this.noContent=204===t,this.badRequest=400===t,this.unauthorized=401===t,this.notAcceptable=406===t,this.forbidden=403===t,this.notFound=404===t,this.unprocessableEntity=422===t}},541:function(t,e){"use strict";function r(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,s=function(){};return{s:s,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}e.type=function(t){return t.split(/ *; */).shift()},e.params=function(t){var e,n={},i=r(t.split(/ *; */));try{for(i.s();!(e=i.n()).done;){var s=e.value.split(/ *= */),o=s.shift(),a=s.shift();o&&a&&(n[o]=a)}}catch(t){i.e(t)}finally{i.f()}return n},e.parseLinks=function(t){var e,n={},i=r(t.split(/ *, */));try{for(i.s();!(e=i.n()).done;){var s=e.value.split(/ *; */),o=s[0].slice(1,-1);n[s[1].split(/ *= */)[1].slice(1,-1)]=o}}catch(t){i.e(t)}finally{i.f()}return n},e.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&(delete t.authorization,delete t.cookie),t}},211:function(t,e,r){var n;!function(i,s){"use strict";var o="function",a="undefined",u="object",c="string",h="major",l="model",f="name",p="type",d="vendor",g="version",y="architecture",v="console",m="mobile",x="tablet",w="smarttv",b="wearable",S="embedded",E="Amazon",A="Apple",F="ASUS",P="BlackBerry",C="Browser",I="Chrome",D="Firefox",T="Google",R="Huawei",N="LG",O="Microsoft",B="Motorola",j="Opera",H="Samsung",_="Sharp",k="Sony",L="Xiaomi",V="Zebra",K="Facebook",q="Chromium OS",M="Mac OS",U=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},G=function(t,e){return typeof t===c&&-1!==z(e).indexOf(z(t))},z=function(t){return t.toLowerCase()},W=function(t,e){if(typeof t===c)return t=t.replace(/^\s\s*/,""),typeof e===a?t:t.substring(0,350)},J=function(t,e){for(var r,n,i,a,c,h,l=0;l<e.length&&!c;){var f=e[l],p=e[l+1];for(r=n=0;r<f.length&&!c&&f[r];)if(c=f[r++].exec(t))for(i=0;i<p.length;i++)h=c[++n],typeof(a=p[i])===u&&a.length>0?2===a.length?typeof a[1]==o?this[a[0]]=a[1].call(this,h):this[a[0]]=a[1]:3===a.length?typeof a[1]!==o||a[1].exec&&a[1].test?this[a[0]]=h?h.replace(a[1],a[2]):s:this[a[0]]=h?a[1].call(this,h,a[2]):s:4===a.length&&(this[a[0]]=h?a[3].call(this,h.replace(a[1],a[2])):s):this[a]=h||s;l+=2}},X=function(t,e){for(var r in e)if(typeof e[r]===u&&e[r].length>0){for(var n=0;n<e[r].length;n++)if(G(e[r][n],t))return"?"===r?s:r}else if(G(e[r],t))return"?"===r?s:r;return t},$={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2000:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Y={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[f,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,g],[/opios[\/ ]+([\w\.]+)/i],[g,[f,j+" Mini"]],[/\bopr\/([\w\.]+)/i],[g,[f,j]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[f,g],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[f,"UC"+C]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[g,[f,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[g,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[g,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[f,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[f,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure "+C],g],[/\bfocus\/([\w\.]+)/i],[g,[f,D+" Focus"]],[/\bopt\/([\w\.]+)/i],[g,[f,j+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[g,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[g,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[g,[f,j+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[g,[f,"MIUI "+C]],[/fxios\/([-\w\.]+)/i],[g,[f,D]],[/\bqihu|(qi?ho?o?|360)browser/i],[[f,"360 "+C]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1 "+C],g],[/(comodo_dragon)\/([\w\.]+)/i],[[f,/_/g," "],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[f,g],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,K],g],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[f,g],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[f,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[g,[f,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[f,I+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,I+" WebView"],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[f,"Android "+C]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,g],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[g,[f,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[g,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[g,X,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[f,g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[f,D+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[f,g],[/(cobalt)\/([\w\.]+)/i],[f,[g,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[y,"amd64"]],[/(ia32(?=;))/i],[[y,z]],[/((?:i[346]|x)86)[;\)]/i],[[y,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[y,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[y,"armhf"]],[/windows (ce|mobile); ppc;/i],[[y,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[y,/ower/,"",z]],[/(sun4\w)[;\)]/i],[[y,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[y,z]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[d,H],[p,x]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[d,H],[p,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[d,A],[p,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[d,A],[p,x]],[/(macintosh);/i],[l,[d,A]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[d,_],[p,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[d,R],[p,x]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[d,R],[p,m]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[d,L],[p,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[d,L],[p,x]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[d,"OPPO"],[p,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[d,"Vivo"],[p,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[d,"Realme"],[p,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[d,B],[p,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[d,B],[p,x]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[d,N],[p,x]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[d,N],[p,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[d,"Lenovo"],[p,x]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[d,"Nokia"],[p,m]],[/(pixel c)\b/i],[l,[d,T],[p,x]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[d,T],[p,m]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[d,k],[p,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[d,k],[p,x]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[d,"OnePlus"],[p,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[d,E],[p,x]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[d,E],[p,m]],[/(playbook);[-\w\),; ]+(rim)/i],[l,d,[p,x]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[d,P],[p,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[d,F],[p,x]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[d,F],[p,m]],[/(nexus 9)/i],[l,[d,"HTC"],[p,x]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[l,/_/g," "],[p,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[d,"Acer"],[p,x]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[d,"Meizu"],[p,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,l,[p,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,l,[p,x]],[/(surface duo)/i],[l,[d,O],[p,x]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[d,"Fairphone"],[p,m]],[/(u304aa)/i],[l,[d,"AT&T"],[p,m]],[/\bsie-(\w*)/i],[l,[d,"Siemens"],[p,m]],[/\b(rct\w+) b/i],[l,[d,"RCA"],[p,x]],[/\b(venue[\d ]{2,7}) b/i],[l,[d,"Dell"],[p,x]],[/\b(q(?:mv|ta)\w+) b/i],[l,[d,"Verizon"],[p,x]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[d,"Barnes & Noble"],[p,x]],[/\b(tm\d{3}\w+) b/i],[l,[d,"NuVision"],[p,x]],[/\b(k88) b/i],[l,[d,"ZTE"],[p,x]],[/\b(nx\d{3}j) b/i],[l,[d,"ZTE"],[p,m]],[/\b(gen\d{3}) b.+49h/i],[l,[d,"Swiss"],[p,m]],[/\b(zur\d{3}) b/i],[l,[d,"Swiss"],[p,x]],[/\b((zeki)?tb.*\b) b/i],[l,[d,"Zeki"],[p,x]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],l,[p,x]],[/\b(ns-?\w{0,9}) b/i],[l,[d,"Insignia"],[p,x]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[d,"NextBook"],[p,x]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],l,[p,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],l,[p,m]],[/\b(ph-1) /i],[l,[d,"Essential"],[p,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[d,"Envizen"],[p,x]],[/\b(trio[-\w\. ]+) b/i],[l,[d,"MachSpeed"],[p,x]],[/\btu_(1491) b/i],[l,[d,"Rotor"],[p,x]],[/(shield[\w ]+) b/i],[l,[d,"Nvidia"],[p,x]],[/(sprint) (\w+)/i],[d,l,[p,m]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[d,O],[p,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[d,V],[p,x]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[d,V],[p,m]],[/smart-tv.+(samsung)/i],[d,[p,w]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[d,H],[p,w]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,N],[p,w]],[/(apple) ?tv/i],[d,[l,A+" TV"],[p,w]],[/crkey/i],[[l,I+"cast"],[d,T],[p,w]],[/droid.+aft(\w)( bui|\))/i],[l,[d,E],[p,w]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[d,_],[p,w]],[/(bravia[\w ]+)( bui|\))/i],[l,[d,k],[p,w]],[/(mitv-\w{5}) bui/i],[l,[d,L],[p,w]],[/Hbbtv.*(technisat) (.*);/i],[d,l,[p,w]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,W],[l,W],[p,w]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,w]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,l,[p,v]],[/droid.+; (shield) bui/i],[l,[d,"Nvidia"],[p,v]],[/(playstation [345portablevi]+)/i],[l,[d,k],[p,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[d,O],[p,v]],[/((pebble))app/i],[d,l,[p,b]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[d,A],[p,b]],[/droid.+; (glass) \d/i],[l,[d,T],[p,b]],[/droid.+; (wt63?0{2,3})\)/i],[l,[d,V],[p,b]],[/(quest( 2| pro)?)/i],[l,[d,K],[p,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[p,S]],[/(aeobc)\b/i],[l,[d,E],[p,S]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[p,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[p,x]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,x]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,m]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[f,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[f,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[f,g],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,g],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[f,[g,X,$]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,"Windows"],[g,X,$]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,M],[g,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[g,f],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[f,g],[/\(bb(10);/i],[g,[f,P]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[g,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[f,D+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[g,[f,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[f,"watchOS"]],[/crkey\/([\d\.]+)/i],[g,[f,I+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,q],g],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[f,g],[/(sunos) ?([\w\.\d]*)/i],[[f,"Solaris"],g],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,g]]},Z=function t(e,r){if(typeof e===u&&(r=e,e=s),!(this instanceof t))return new t(e,r).getResult();var n=typeof i!==a&&i.navigator?i.navigator:s,v=e||(n&&n.userAgent?n.userAgent:""),w=n&&n.userAgentData?n.userAgentData:s,b=r?function(t,e){var r={};for(var n in t)e[n]&&e[n].length%2==0?r[n]=e[n].concat(t[n]):r[n]=t[n];return r}(Y,r):Y,S=n&&n.userAgent==v;return this.getBrowser=function(){var t,e={};return e[f]=s,e[g]=s,J.call(e,v,b.browser),e[h]=typeof(t=e[g])===c?t.replace(/[^\d\.]/g,"").split(".")[0]:s,S&&n&&n.brave&&typeof n.brave.isBrave==o&&(e[f]="Brave"),e},this.getCPU=function(){var t={};return t[y]=s,J.call(t,v,b.cpu),t},this.getDevice=function(){var t={};return t[d]=s,t[l]=s,t[p]=s,J.call(t,v,b.device),S&&!t[p]&&w&&w.mobile&&(t[p]=m),S&&"Macintosh"==t[l]&&n&&typeof n.standalone!==a&&n.maxTouchPoints&&n.maxTouchPoints>2&&(t[l]="iPad",t[p]=x),t},this.getEngine=function(){var t={};return t[f]=s,t[g]=s,J.call(t,v,b.engine),t},this.getOS=function(){var t={};return t[f]=s,t[g]=s,J.call(t,v,b.os),S&&!t[f]&&w&&"Unknown"!=w.platform&&(t[f]=w.platform.replace(/chrome os/i,q).replace(/macos/i,M)),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(t){return v=typeof t===c&&t.length>350?W(t,350):t,this},this.setUA(v),this};Z.VERSION="1.0.35",Z.BROWSER=U([f,g,h]),Z.CPU=U([y]),Z.DEVICE=U([l,d,p,v,m,w,x,b,S]),Z.ENGINE=Z.OS=U([f,g]),typeof e!==a?(t.exports&&(e=t.exports=Z),e.UAParser=Z):r.amdO?(n=function(){return Z}.call(e,r,e,t))===s||(t.exports=n):typeof i!==a&&(i.UAParser=Z);var Q=typeof i!==a&&(i.jQuery||i.Zepto);if(Q&&!Q.ua){var tt=new Z;Q.ua=tt.getResult(),Q.ua.get=function(){return tt.getUA()},Q.ua.set=function(t){tt.setUA(t);var e=tt.getResult();for(var r in e)Q.ua[r]=e[r]}}}("object"==typeof window?window:this)},342:function(){},710:function(){}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var s=r[e]={exports:{}};return t[e].call(s.exports,s,s.exports,n),s.exports}n.amdO={},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return function(){"use strict";n.r(i),n.d(i,{default:function(){return Y}});var t=["env"],e={test:"https://pre-article.xxptcs.com/h5_gray/",prod:"https://themis-oss.xuexi.cn/h5_gray/"},r="_gray_sign",s="_FINGER_PRINT_KEY";function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function h(t,e,r,i){var s=e&&e.prototype instanceof p?e:p,o=Object.create(s.prototype),a=new F(i||[]);return n(o,"_invoke",{value:function(t,e,r){var n="suspendedStart";return function(i,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw s;return{value:void 0,done:!0}}for(r.method=i,r.arg=s;;){var o=r.delegate;if(o){var a=S(o,r);if(a){if(a===f)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a)}),o}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var f={};function p(){}function d(){}function g(){}var y={};c(y,s,function(){return this});var v=Object.getPrototypeOf,m=v&&v(v(P([])));m&&m!==e&&r.call(m,s)&&(y=m);var x=g.prototype=p.prototype=Object.create(y);function w(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function b(t,e){function i(n,s,o,a){var u=l(t[n],t,s);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then(function(t){i("next",t,o,a)},function(t){i("throw",t,o,a)}):e.resolve(h).then(function(t){c.value=t,o(c)},function(t){return i("throw",t,o,a)})}a(u.arg)}var s;n(this,"_invoke",{value:function(t,r){function n(){return new e(function(e,n){i(t,r,e,n)})}return s=s?s.then(n,n):n()}})}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=l(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var s=i.arg;return s?s.done?(e[t.resultName]=s.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):s:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:C}}function C(){return{value:void 0,done:!0}}return d.prototype=g,n(x,"constructor",{value:g,configurable:!0}),n(g,"constructor",{value:d,configurable:!0}),d.displayName=c(g,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},w(b.prototype),c(b.prototype,a,function(){return this}),t.AsyncIterator=b,t.async=function(e,r,n,i,s){void 0===s&&(s=Promise);var o=new b(h(e,r,n,i),s);return t.isGeneratorFunction(r)?o:o.next().then(function(t){return t.done?t.value:o.next()})},w(x),c(x,u,"Generator"),c(x,s,function(){return this}),c(x,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=P,F.prototype={constructor:F,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return o.type="throw",o.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var a=r.call(s,"catchLoc"),u=r.call(s,"finallyLoc");if(a&&u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(a){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=t,o.arg=e,s?(this.method="next",this.next=s.finallyLoc,f):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function a(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return u(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function c(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function h(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(t){c(s,n,i,o,a,"next",t)}function a(t){c(s,n,i,o,a,"throw",t)}o(void 0)})}}n(310);var l=function(){var t=h(o().mark(function t(e,r){var n,i,s,u,c,h,l,f;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=a(e.apps),t.prev=1,n.s();case 3:if((i=n.n()).done){t.next=21;break}return s=i.value,u=Object.assign({},e,s),t.next=8,r(u);case 8:if(c=t.sent,h=c.isSwitchOn,l=c.apiError,f=c.isGray,!h||l){t.next=18;break}if(!f){t.next=15;break}return t.abrupt("return",Object.assign({},u,c));case 15:return t.abrupt("continue",19);case 16:t.next=19;break;case 18:return t.abrupt("return",Object.assign({},u,c));case 19:t.next=3;break;case 21:t.next=26;break;case 23:t.prev=23,t.t0=t.catch(1),n.e(t.t0);case 26:return t.prev=26,n.f(),t.finish(26);case 29:return e.debug,t.abrupt("return",{isSwitchOn:!0,isGray:!1,isNonMatch:!0});case 31:case"end":return t.stop()}},t,null,[[1,23,26,29]])}));return function(e,r){return t.apply(this,arguments)}}(),f=("undefined"!=typeof window&&window.navigator.userAgent.indexOf("XueXi"),function t(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4?arguments[4]:void 0,o=new XMLHttpRequest;if(o.open("GET",e,!0),s)for(var a in s)o.setRequestHeader(a,s[a]);o.onreadystatechange=function(){if(4===o.readyState)if(200===o.status)try{r(null,JSON.parse(o.responseText))}catch(t){r(t)}else i>0?t(e,r,n,--i):r(new Error("HTTP request failed"))},o.onerror=function(){i>0?t(e,r,n,--i):r(new Error("HTTP request failed"))},o.send(n)}),p=function(e){e.appName||(e.appName=window.GRAY_INJECTOR&&window.GRAY_INJECTOR.appName),e.attach||(e.attach={}),e.attach.appVer||(e.attach.appVer=window.GRAY_INJECTOR&&window.GRAY_INJECTOR.version),e.attach.htmlVer||(e.attach.htmlVer=window.GRAY_INJECTOR&&window.GRAY_INJECTOR.localStorageKey),!e.attach.pageName&&e.pageName&&(e.attach.pageName=e.pageName),e.attach.sign||(e.attach.sign=localStorage.getItem(r)),function(e){var r,n=a(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(!e||!e[i])throw new Error("".concat(i,"为必填参数"))}}catch(t){n.e(t)}finally{n.f()}}(e)},d=function(t,e,r){var n,i;return e&&(n=t,i=window.GRAY_INJECTOR&&window.GRAY_INJECTOR.localStorageKey||"1",n&&n.chunks&&["headChunks","bodyChunks"].forEach(function(t){n.chunks[t]&&n.chunks[t].forEach(function(t){["src","href"].forEach(function(e){t.attributes&&t.attributes[e]&&(t.attributes[e].includes("?")?t.attributes[e]+="&k=".concat(i):t.attributes[e]+="?k=".concat(i))})})})),window.GRAY_INJECTOR.updateGrayConfig(t),{isSwitchOn:!0,isGray:!0,grayData:t}},g=function(t,e){var r=e.appName,n=e.pageName,i=e.isValidAppName,s=(e.debug,e.isAddQuery),o=e.validReg;if(n){var a=t.pages&&t.pages.find(function(t){return t.app===n});return a?d(a,s):(window.GRAY_INJECTOR.removeGrayConfig(),{isSwitchOn:!0,isGray:!1,isNonMatch:!0})}return!i||(o?o.test(t.app):t.app===r)?d(t,s):(window.GRAY_INJECTOR.removeGrayConfig(),{isSwitchOn:!0,isGray:!1,isNonMatch:!0})};function y(t,e){return function(){return h(o().mark(function t(e,r){return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t){f(e,function(e,n){e?(r.debug,t({apiError:e})):t(g(n,r))})}));case 1:case"end":return t.stop()}},t)})).apply(this,arguments)}.apply(this,arguments)}var v=function(){var t=h(o().mark(function t(e,n){var i;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n.debug,!n.isOnlyGetInfo){t.next=3;break}return t.abrupt("return",{isSwitchOn:!0,isGray:e&&e.isGray,grayData:e.payload});case 3:if(!(e&&e.isGray&&e.payload)){t.next=15;break}if(localStorage.setItem(r,e.sign),"normal"!==e.format){t.next=10;break}return i=JSON.parse(e.payload),t.abrupt("return",g(i,n));case 10:return t.next=12,y(e.payload,n);case 12:return t.abrupt("return",t.sent);case 13:t.next=18;break;case 15:return n.debug,window.GRAY_INJECTOR.removeGrayConfig(),t.abrupt("return",{isSwitchOn:!0,isGray:!1});case 18:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}();function m(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */m=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,i){var s=e&&e.prototype instanceof f?e:f,o=Object.create(s.prototype),a=new F(i||[]);return n(o,"_invoke",{value:function(t,e,r){var n="suspendedStart";return function(i,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw s;return{value:void 0,done:!0}}for(r.method=i,r.arg=s;;){var o=r.delegate;if(o){var a=S(o,r);if(a){if(a===l)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=h(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a)}),o}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l={};function f(){}function p(){}function d(){}var g={};u(g,s,function(){return this});var y=Object.getPrototypeOf,v=y&&y(y(P([])));v&&v!==e&&r.call(v,s)&&(g=v);var x=d.prototype=f.prototype=Object.create(g);function w(t){["next","throw","return"].forEach(function(e){u(t,e,function(t){return this._invoke(e,t)})})}function b(t,e){function i(n,s,o,a){var u=h(t[n],t,s);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then(function(t){i("next",t,o,a)},function(t){i("throw",t,o,a)}):e.resolve(l).then(function(t){c.value=t,o(c)},function(t){return i("throw",t,o,a)})}a(u.arg)}var s;n(this,"_invoke",{value:function(t,r){function n(){return new e(function(e,n){i(t,r,e,n)})}return s=s?s.then(n,n):n()}})}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),l;var i=h(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,l;var s=i.arg;return s?s.done?(e[t.resultName]=s.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):s:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:C}}function C(){return{value:void 0,done:!0}}return p.prototype=d,n(x,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=u(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,a,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},w(b.prototype),u(b.prototype,o,function(){return this}),t.AsyncIterator=b,t.async=function(e,r,n,i,s){void 0===s&&(s=Promise);var o=new b(c(e,r,n,i),s);return t.isGeneratorFunction(r)?o:o.next().then(function(t){return t.done?t.value:o.next()})},w(x),u(x,a,"Generator"),u(x,s,function(){return this}),u(x,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=P,F.prototype={constructor:F,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return o.type="throw",o.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var a=r.call(s,"catchLoc"),u=r.call(s,"finallyLoc");if(a&&u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(a){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=t,o.arg=e,s?(this.method="next",this.next=s.finallyLoc,l):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function x(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}var w=function(t){var r=t.env,n=t.appName;return new Promise(function(t,i){f("".concat(e[r]).concat(n,".json"),function(e,r){e?i(e):t(r)})})},b=function(){var t,e=(t=m().mark(function t(e){var r,n;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,w(e);case 3:n=t.sent,r=n&&n.h5GrayEnabled,e.debug,t.next=12;break;case 8:return t.prev=8,t.t0=t.catch(0),e.debug,t.abrupt("return",{switchError:t.t0});case 12:if(r){t.next=16;break}return e.debug,window.GRAY_INJECTOR.removeGrayConfig(),t.abrupt("return",{isSwitchOn:!1});case 16:case"end":return t.stop()}},t,null,[[0,8]])}),function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(t){x(s,n,i,o,a,"next",t)}function a(t){x(s,n,i,o,a,"throw",t)}o(void 0)})});return function(t){return e.apply(this,arguments)}}();function S(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */S=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,i){var s=e&&e.prototype instanceof f?e:f,o=Object.create(s.prototype),a=new F(i||[]);return n(o,"_invoke",{value:function(t,e,r){var n="suspendedStart";return function(i,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw s;return{value:void 0,done:!0}}for(r.method=i,r.arg=s;;){var o=r.delegate;if(o){var a=b(o,r);if(a){if(a===l)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=h(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a)}),o}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l={};function f(){}function p(){}function d(){}var g={};u(g,s,function(){return this});var y=Object.getPrototypeOf,v=y&&y(y(P([])));v&&v!==e&&r.call(v,s)&&(g=v);var m=d.prototype=f.prototype=Object.create(g);function x(t){["next","throw","return"].forEach(function(e){u(t,e,function(t){return this._invoke(e,t)})})}function w(t,e){function i(n,s,o,a){var u=h(t[n],t,s);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then(function(t){i("next",t,o,a)},function(t){i("throw",t,o,a)}):e.resolve(l).then(function(t){c.value=t,o(c)},function(t){return i("throw",t,o,a)})}a(u.arg)}var s;n(this,"_invoke",{value:function(t,r){function n(){return new e(function(e,n){i(t,r,e,n)})}return s=s?s.then(n,n):n()}})}function b(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),l;var i=h(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,l;var s=i.arg;return s?s.done?(e[t.resultName]=s.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):s:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:C}}function C(){return{value:void 0,done:!0}}return p.prototype=d,n(m,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=u(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,a,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},x(w.prototype),u(w.prototype,o,function(){return this}),t.AsyncIterator=w,t.async=function(e,r,n,i,s){void 0===s&&(s=Promise);var o=new w(c(e,r,n,i),s);return t.isGeneratorFunction(r)?o:o.next().then(function(t){return t.done?t.value:o.next()})},x(m),u(m,a,"Generator"),u(m,s,function(){return this}),u(m,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=P,F.prototype={constructor:F,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return o.type="throw",o.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var a=r.call(s,"catchLoc"),u=r.call(s,"finallyLoc");if(a&&u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(a){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=t,o.arg=e,s?(this.method="next",this.next=s.finallyLoc,l):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function E(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}var A=function(t){localStorage.setItem(s,t)},F=function(){var t,e=(t=S().mark(function t(e){var r,n;return S().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=3;break}return A(e),t.abrupt("return",e);case 3:if(!(r=localStorage.getItem(s))){t.next=6;break}return t.abrupt("return",r);case 6:return n="".concat(+new Date).concat(parseInt(1e10*Math.random())),A(n),t.abrupt("return",n);case 9:case"end":return t.stop()}},t)}),function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(t){E(s,n,i,o,a,"next",t)}function a(t){E(s,n,i,o,a,"throw",t)}o(void 0)})});return function(t){return e.apply(this,arguments)}}(),P=n(411),C=n.n(P),I=n(618),D=n.n(I),T=n(445),R=n.n(T),N="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),O=new Uint8Array(16);for(var B=[],j=0;j<256;++j)B[j]=(j+256).toString(16).substr(1);var H=function(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var i=(t=t||{}).random||(t.rng||function(){if(!N)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return N(O)})();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e)for(var s=0;s<16;++s)e[n+s]=i[s];return e||function(t,e){var r=e||0,n=B;return[n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]]].join("")}(i)},_=n(211),k=n(911);function L(t){var e={};return Object.keys(t).forEach(function(r){e[r]=t[r]}),e}function V(t){var e,r=t.addr,n=t.pathPre;return"".concat(r,"/").concat(n,"/").concat(K(t),"?").concat((e=function(t){var e=t._aop_timestamp,r=t.apiQuery,n=t.uuid;return Object.assign({uuid:n,_aop_timestamp:e,_aop_signature:function(t){var e=t._aop_timestamp,r=t.appSecret,n=t.uuid,i=t.apiQuery,s=K(t),o=Object.assign({_aop_timestamp:e,uuid:n},i),a="".concat(s).concat(function(t){return Object.keys(t).filter(function(e){return void 0!==t[e]}).map(function(e){return"".concat(e).concat("object"==typeof t[e]?JSON.stringify(L(t[e])):t[e])}).sort(function(t,e){return t<e?-1:1}).join("")}(o)),u=r+n;return C()(a,u).toString(D()).toUpperCase()}(t)},r)}(t),Object.keys(e).filter(function(t){return void 0!==e[t]}).map(function(t){return"".concat(t,"=").concat("object"==typeof e[t]?encodeURIComponent(JSON.stringify(L(e[t]))):e[t])}).join("&")))}function K(t){var e=t.param,r=t.apiVersion,n=t.namespace,i=t.apiName,s=t.appKey;return"".concat(e,"/").concat(r,"/").concat(n,"/").concat(i,"/").concat(s)}function q(t,e,r){var n=t.publicKey,i=(r||{}).appVersion;return R().get(V(t)).timeout({response:15e3}).set({"y-open-ua":function(t){var e=function(){var t=window.navigator,e=t.userAgent,r=void 0===e?"":e,n=t.language,i=void 0===n?"":n,s=(new _.UAParser).getResult(),o=r.toLowerCase(),a=/DingTalk/i.test(o),u=/MicroMessenger/gi.test(o);return s.language=i,/xuexi/.test(r.toLowerCase())&&(s.xuexi={version:getXuexiVersion()}),a&&(s.isDing=a),u&&(s.isWX=u),window._MICRO_USER_AGENT=s,s}(),r=e.os,n=e.device,i=e.language,s=r.name,o=void 0===s?"":s,a=r.version,u=void 0===a?"":a,c=n.vendor,h=void 0===c?"":c,l=n.model,f=void 0===l?"":l,p=t.appVersion,d=void 0===p?"2.23.0":p;return"TorchApp/1.0 OSType/".concat(o," XueXi/").concat(d," Device/XXQGSpecialTopic ").concat(o,"/").concat(u,"(").concat(h," ").concat(f,";").concat(i,") lang/").concat(i," SpecialTopic/847fe0bd6859050347fba977f1784d66 Scene/NotInXXQG")}({appVersion:i}),"y-open-did":function(){var t,e="xxqg_st_did";if(localStorage&&(t=localStorage.getItem(e)),t)return t;var r=H().replace(/-/g,"");return t=r.slice(0,8)+r.slice(16,32),localStorage&&(t=localStorage.setItem(e,t)),t}(),"gateway-channel":"inner_https"}).then(function(t){return function(t){if(!t||!t.text)throw new Error("没有获取到数据");var e,r=t.text.match(/"response":(\{.*\})((,"sign":)|\})/),i=r&&r[1]?r[1]:"";if(t.body.sign&&!function(t,e,r){var n="-----BEGIN PUBLIC KEY-----\n".concat(e,"\n-----END PUBLIC KEY-----"),i=k.KEYUTIL.getKey(n),s=new k.KJUR.crypto.Signature({alg:"SHA256withRSA"});s.init(i),s.updateString(t);var o=k.b64utohex(r);return s.verify(o)}(i,n,t.body.sign))throw new Error("验签失败");if(!i)throw new Error("没有获取到数据");try{e=JSON.parse(i)}catch(t){e={}}var s=e,o=s.data,a=s.code;if(200!==a)throw new Error("接口异常:"+a);return o.isGray=o.is_gray,o}(t)})}function M(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */M=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,i){var s=e&&e.prototype instanceof f?e:f,o=Object.create(s.prototype),a=new A(i||[]);return n(o,"_invoke",{value:function(t,e,r){var n="suspendedStart";return function(i,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw s;return{value:void 0,done:!0}}for(r.method=i,r.arg=s;;){var o=r.delegate;if(o){var a=b(o,r);if(a){if(a===l)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=h(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a)}),o}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l={};function f(){}function p(){}function d(){}var g={};u(g,s,function(){return this});var y=Object.getPrototypeOf,v=y&&y(y(F([])));v&&v!==e&&r.call(v,s)&&(g=v);var m=d.prototype=f.prototype=Object.create(g);function x(t){["next","throw","return"].forEach(function(e){u(t,e,function(t){return this._invoke(e,t)})})}function w(t,e){function i(n,s,o,a){var u=h(t[n],t,s);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then(function(t){i("next",t,o,a)},function(t){i("throw",t,o,a)}):e.resolve(l).then(function(t){c.value=t,o(c)},function(t){return i("throw",t,o,a)})}a(u.arg)}var s;n(this,"_invoke",{value:function(t,r){function n(){return new e(function(e,n){i(t,r,e,n)})}return s=s?s.then(n,n):n()}})}function b(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),l;var i=h(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,l;var s=i.arg;return s?s.done?(e[t.resultName]=s.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):s:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function F(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return p.prototype=d,n(m,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=u(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,a,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},x(w.prototype),u(w.prototype,o,function(){return this}),t.AsyncIterator=w,t.async=function(e,r,n,i,s){void 0===s&&(s=Promise);var o=new w(c(e,r,n,i),s);return t.isGeneratorFunction(r)?o:o.next().then(function(t){return t.done?t.value:o.next()})},x(m),u(m,a,"Generator"),u(m,s,function(){return this}),u(m,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=F,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return o.type="throw",o.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var a=r.call(s,"catchLoc"),u=r.call(s,"finallyLoc");if(a&&u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(a){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=t,o.arg=e,s?(this.method="next",this.next=s.finallyLoc,l):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:F(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function U(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}var G=function(){var t,e=(t=M().mark(function t(e,r,n){var i,s,o,a,u,c,h,l;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.appName,e.debug,s=e.env,o=e.fpId,a=e.attach,t.prev=1,u=function(t,e){var r=H().replace(/-/g,""),n=c.addr,i=c.appKey,s=c.appSecret,o=c.publicKey;return{addr:n,pathPre:"api",param:"param2",apiVersion:"1",namespace:"xuexi.open",apiName:t,appKey:i,appSecret:s,uuid:r,_aop_timestamp:Date.now(),apiQuery:e,publicKey:o}},c="prod"===s?{addr:"https://open-h5.xuexi.cn",appKey:"1001003190359573",appSecret:"ywtWw8zDGoS",publicKey:"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbSc0H34qLlhe1Uwo/dPOq3ThRv/CH+aFt6LV+f9j+Ho3r/K3LDrOA1u8Puc+k8XGIOR7+WopPEt99kJDYlB0/5nvVI0JXS9JP5Scwh8CoTBrt19m0PMcdpJgD6D8ENBurbYrHP8ExdRMqm8xEhLbKX34/T282dDYM8y49mByGKQIDAQAB",content:"themis.h5.h5Gray",comments:"iflow.comment.getComments"}:{addr:"https://opengw-pre.xxptcs.com",appKey:"1001001959918449",appSecret:"FW4CnciUcXL",publicKey:"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2RGXP3fnsPYwLgNesZgj0tU46dLNpcGLOL/2t6V/mTdkja9e6gKGLK9U8Mow/N552uJt+9/sq9DuCgRggEIkqX+kXTiULf+qTTMyPGjZASwfGDYNN/CNyS0twhu39i4L3bdOABmTz5lWuWo43glfMB8F6Ilt4JkHC5xq3T7e40QIDAQAB",content:"themis.h5Gray",comments:"iflow.comment.getComments"},t.next=6,F(o);case 6:return h=t.sent,l={fp_id:h,app_code:i,attach:a},t.t0=r,t.next=12,q(u(c.content,l));case 12:t.t1=t.sent,(0,t.t0)(t.t1),t.next=19;break;case 16:t.prev=16,t.t2=t.catch(1),n(t.t2);case 19:case"end":return t.stop()}},t,null,[[1,16]])}),function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(t){U(s,n,i,o,a,"next",t)}function a(t){U(s,n,i,o,a,"throw",t)}o(void 0)})});return function(t,r,n){return e.apply(this,arguments)}}(),z=function(t){return new Promise(function(e,r){G(t,e,r)})};function W(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */W=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,i){var s=e&&e.prototype instanceof f?e:f,o=Object.create(s.prototype),a=new A(i||[]);return n(o,"_invoke",{value:function(t,e,r){var n="suspendedStart";return function(i,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw s;return{value:void 0,done:!0}}for(r.method=i,r.arg=s;;){var o=r.delegate;if(o){var a=b(o,r);if(a){if(a===l)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=h(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a)}),o}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l={};function f(){}function p(){}function d(){}var g={};u(g,s,function(){return this});var y=Object.getPrototypeOf,v=y&&y(y(F([])));v&&v!==e&&r.call(v,s)&&(g=v);var m=d.prototype=f.prototype=Object.create(g);function x(t){["next","throw","return"].forEach(function(e){u(t,e,function(t){return this._invoke(e,t)})})}function w(t,e){function i(n,s,o,a){var u=h(t[n],t,s);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then(function(t){i("next",t,o,a)},function(t){i("throw",t,o,a)}):e.resolve(l).then(function(t){c.value=t,o(c)},function(t){return i("throw",t,o,a)})}a(u.arg)}var s;n(this,"_invoke",{value:function(t,r){function n(){return new e(function(e,n){i(t,r,e,n)})}return s=s?s.then(n,n):n()}})}function b(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),l;var i=h(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,l;var s=i.arg;return s?s.done?(e[t.resultName]=s.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):s:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function F(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return p.prototype=d,n(m,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=u(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,a,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},x(w.prototype),u(w.prototype,o,function(){return this}),t.AsyncIterator=w,t.async=function(e,r,n,i,s){void 0===s&&(s=Promise);var o=new w(c(e,r,n,i),s);return t.isGeneratorFunction(r)?o:o.next().then(function(t){return t.done?t.value:o.next()})},x(m),u(m,a,"Generator"),u(m,s,function(){return this}),u(m,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=F,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return o.type="throw",o.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var a=r.call(s,"catchLoc"),u=r.call(s,"finallyLoc");if(a&&u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(a){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=t,o.arg=e,s?(this.method="next",this.next=s.finallyLoc,l):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:F(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function J(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function X(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(t){J(s,n,i,o,a,"next",t)}function a(t){J(s,n,i,o,a,"throw",t)}o(void 0)})}}function $(t){return function(){return X(W().mark(function t(e){var r,n;return W().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return p(e),t.next=3,b(e);case 3:if(!(r=t.sent)){t.next=6;break}return t.abrupt("return",r);case 6:return t.prev=6,t.next=9,z(e);case 9:return n=t.sent,t.next=12,v(n,e);case 12:return t.abrupt("return",t.sent);case 15:return t.prev=15,t.t0=t.catch(6),e.debug,t.abrupt("return",{apiError:t.t0});case 19:case"end":return t.stop()}},t,null,[[6,15]])})).apply(this,arguments)}.apply(this,arguments)}var Y=function(){var t=X(W().mark(function t(e){return W().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.apps){t.next=7;break}return e.debug,t.next=4,l(e,$);case 4:case 9:return t.abrupt("return",t.sent);case 7:return t.next=9,$(e);case 10:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()}(),i}()},t.exports=r()}).call(e,r("EuP9").Buffer)}});