@digital-blueprint/esign-app
Version:
[GitHub Repository](https://github.com/digital-blueprint/esign-app) | [npmjs package](https://www.npmjs.com/package/@digital-blueprint/esign-app) | [Unpkg CDN](https://unpkg.com/browse/@digital-blueprint/esign-app/) | [Esign Bundle](https://gitlab.tugraz.
102 lines • 2.9 MB
JavaScript
const _excluded=["ext","key_ops","alg","use"],_excluded2=["encryptedKey"],_excluded3=["encryptedKey"];let _2=e=>e,_t2,_t3,_PixelsPerInch,_ImageManager,_AltText,_AnnotationEditor,_TextLayer,_FreeTextEditor,_FreeOutliner,_ColorPicker,_HighlightEditor,_InkEditor,_StampEditor,_AnnotationEditorLayer,_DrawLayer,_t4,_t5,_t6,_t7,_t8,_t9,_t10,_t11,_t12,_Clipboard,_TableRegistry,_t13,_t14,_t15,_t16,_t17,_t18,_t19,_t20,_t21,_t22,_t23,_t24,_t25,_t26,_t27,_t28,_t29,_t30,_t31,_t32,_t33,_t34,_t35,_t36,_t37,_t38,_t39,_t40,_t41,_t42,_t43,_t44,_t45,_t46,_t47,_t48,_t49,_t50,_t51,_t52,_t53,_t54,_t55,_t56,_t57,_t58,_t59,_t60,_t61,_t62,_t63,_t64,_t65,_t66,_t67,_t68,_t69,_t70,_t71,_t72,_t73,_t74;function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var i={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;i[r]=e[r]}return i}function _classPrivateFieldLooseBase(e,t){if(!{}.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var id=0;function _classPrivateFieldLooseKey(e){return"__private_"+id+++"_"+e}function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},_extends.apply(null,arguments)
/*!
* License: LGPL-2.1-or-later
* Dependencies:
*
* @webcomponents/scoped-custom-element-registry: BSD-3-Clause
* @dbp-toolkit/app-shell: LGPL-2.1-or-later
* @dbp-toolkit/common: LGPL-2.1-or-later
* @dbp-toolkit/language-select: LGPL-2.1-or-later
* @dbp-toolkit/auth: LGPL-2.1-or-later
* @dbp-toolkit/notification: LGPL-2.1-or-later
* @dbp-toolkit/theme-switcher: LGPL-2.1-or-later
* path-to-regexp: MIT
* universal-router: MIT
* generateUrls: MIT
* @dbp-toolkit/matomo: LGPL-2.1-or-later
* @tugraz/web-components: LGPL-2.1-or-later
* @digital-blueprint/annotpdf: MIT
* lit-html: BSD-3-Clause
* pdfjs-dist: Apache-2.0
* @popperjs/core: MIT
* tippy.js: MIT
* @dbp-toolkit/tooltip: LGPL-2.1-or-later
* @dbp-toolkit/file-handling: LGPL-2.1-or-later
* @dbp-toolkit/tabulator-table: LGPL-2.1-or-later
* webdav: MIT
* tabulator-tables: MIT
* jose: MIT
* file-saver: MIT
* jquery: MIT
* select2: MIT
* @dbp-toolkit/resource-select: LGPL-2.1-or-later
* xlsx: Apache-2.0
* @babel/runtime: MIT
* fflate: MIT
* jspdf: MIT
* jspdf-autotable: MIT
*/}import{c as createInstance$3}from"./activity.VnYC76Eo.es.js";import{k as ke,D as DBPLitElement,q as asyncObjectForEach,i as i$2,r,n as humanFileSize,t as e,u as i$3,v as t,R as R$1,w as D$1,S as ScopedElementsMixin,I as Icon,M as MiniSpinner,o as getAssetURL,b as getGeneralCSS,e as getButtonCSS,g as getThemeCSS,c as createInstance$4,x as getTextUtilities,y as getModalDialogCSS,z as getRadioAndCheckboxCss,A as AdapterLitElement,C as asyncArrayForEach,E as getMimeTypeOfFile,F as getBaseName,G as getFileExtension,H as makeId,d as getNotificationCSS,J as getSelect2CSS}from"./modal.DTvHO8c1.es.js";import{s as send,R as Rt$1,c as commonjsGlobal,g as getDefaultExportFromCjs,b as getAugmentedNamespace}from"./notification.DeyWnWpq.es.js";var pdfAnnotate={exports:{}};(function(module,exports){var factory;window,factory=function(){return function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s="./src/index.ts")}({"./node_modules/asn1.js/lib/asn1.js":
/*!******************************************!*\
!*** ./node_modules/asn1.js/lib/asn1.js ***!
\******************************************/
/*! no static exports found */function(e,t,i){var r=t;r.bignum=i(/*! bn.js */"./node_modules/bn.js/lib/bn.js"),r.define=i(/*! ./asn1/api */"./node_modules/asn1.js/lib/asn1/api.js").define,r.base=i(/*! ./asn1/base */"./node_modules/asn1.js/lib/asn1/base/index.js"),r.constants=i(/*! ./asn1/constants */"./node_modules/asn1.js/lib/asn1/constants/index.js"),r.decoders=i(/*! ./asn1/decoders */"./node_modules/asn1.js/lib/asn1/decoders/index.js"),r.encoders=i(/*! ./asn1/encoders */"./node_modules/asn1.js/lib/asn1/encoders/index.js")},"./node_modules/asn1.js/lib/asn1/api.js":
/*!**********************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/api.js ***!
\**********************************************/
/*! no static exports found */function(e,t,i){var r=i(/*! ../asn1 */"./node_modules/asn1.js/lib/asn1.js"),n=i(/*! inherits */"./node_modules/inherits/inherits_browser.js");function s(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new s(e,t)},s.prototype._createNamed=function(e){var t;try{t=i(/*! vm */"./node_modules/vm-browserify/index.js").runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){t=function(e){this._initNamed(e)}}return n(t,e),t.prototype._initNamed=function(t){e.call(this,t)},new t(this)},s.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(r.decoders[e])),this.decoders[e]},s.prototype.decode=function(e,t,i){return this._getDecoder(t).decode(e,i)},s.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(r.encoders[e])),this.encoders[e]},s.prototype.encode=function(e,t,i){return this._getEncoder(t).encode(e,i)}},"./node_modules/asn1.js/lib/asn1/base/buffer.js":
/*!******************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/base/buffer.js ***!
\******************************************************/
/*! no static exports found */function(e,t,i){var r=i(/*! inherits */"./node_modules/inherits/inherits_browser.js"),n=i(/*! ../base */"./node_modules/asn1.js/lib/asn1/base/index.js").Reporter,s=i(/*! buffer */"./node_modules/buffer/index.js").Buffer;function a(e,t){n.call(this,t),s.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function o(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return e instanceof o||(e=new o(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=s.byteLength(e);else{if(!s.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}r(a,n),t.DecoderBuffer=a,a.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},a.prototype.restore=function(e){var t=new a(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,n.prototype.restore.call(this,e.reporter),t},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},a.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var i=new a(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+e,this.offset+=e,i},a.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.EncoderBuffer=o,o.prototype.join=function(e,t){return e||(e=new s(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(i){i.join(e,t),t+=i.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):s.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},"./node_modules/asn1.js/lib/asn1/base/index.js":
/*!*****************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/base/index.js ***!
\*****************************************************/
/*! no static exports found */function(e,t,i){var r=t;r.Reporter=i(/*! ./reporter */"./node_modules/asn1.js/lib/asn1/base/reporter.js").Reporter,r.DecoderBuffer=i(/*! ./buffer */"./node_modules/asn1.js/lib/asn1/base/buffer.js").DecoderBuffer,r.EncoderBuffer=i(/*! ./buffer */"./node_modules/asn1.js/lib/asn1/base/buffer.js").EncoderBuffer,r.Node=i(/*! ./node */"./node_modules/asn1.js/lib/asn1/base/node.js")},"./node_modules/asn1.js/lib/asn1/base/node.js":
/*!****************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/base/node.js ***!
\****************************************************/
/*! no static exports found */function(e,t,i){var r=i(/*! ../base */"./node_modules/asn1.js/lib/asn1/base/index.js").Reporter,n=i(/*! ../base */"./node_modules/asn1.js/lib/asn1/base/index.js").EncoderBuffer,s=i(/*! ../base */"./node_modules/asn1.js/lib/asn1/base/index.js").DecoderBuffer,a=i(/*! minimalistic-assert */"./node_modules/minimalistic-assert/index.js"),o=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],l=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o);function c(e,t){var i={};this._baseState=i,i.enc=e,i.parent=t||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}e.exports=c;var d=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){var e=this._baseState,t={};d.forEach((function(i){t[i]=e[i]}));var i=new this.constructor(t.parent);return i._baseState=t,i},c.prototype._wrap=function(){var e=this._baseState;l.forEach((function(t){this[t]=function(){var i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}}),this)},c.prototype._init=function(e){var t=this._baseState;a(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),a.equal(t.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(e){var t=this._baseState,i=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==i.length&&(a(null===t.children),t.children=i,i.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(a(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach((function(i){i==(0|i)&&(i|=0);var r=e[i];t[r]=i})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){c.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),o.forEach((function(e){c.prototype[e]=function(){var t=this._baseState,i=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(i),this}})),c.prototype.use=function(e){a(e);var t=this._baseState;return a(null===t.use),t.use=e,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(e){var t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},c.prototype.explicit=function(e){var t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},c.prototype.implicit=function(e){var t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},c.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},c.prototype.key=function(e){var t=this._baseState;return a(null===t.key),t.key=e,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(e){var t=this._baseState;return a(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},c.prototype.contains=function(e){var t=this._baseState;return a(null===t.use),t.contains=e,this},c.prototype._decode=function(e,t){var i=this._baseState;if(null===i.parent)return e.wrapResult(i.children[0]._decode(e,t));var r,n=i.default,a=!0,o=null;if(null!==i.key&&(o=e.enterKey(i.key)),i.optional){var l=null;if(null!==i.explicit?l=i.explicit:null!==i.implicit?l=i.implicit:null!==i.tag&&(l=i.tag),null!==l||i.any){if(a=this._peekTag(e,l,i.any),e.isError(a))return a}else{var c=e.save();try{null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t),a=!0}catch(e){a=!1}e.restore(c)}}if(i.obj&&a&&(r=e.enterObject()),a){if(null!==i.explicit){var d=this._decodeTag(e,i.explicit);if(e.isError(d))return d;e=d}var h=e.offset;if(null===i.use&&null===i.choice){i.any&&(c=e.save());var u=this._decodeTag(e,null!==i.implicit?i.implicit:i.tag,i.any);if(e.isError(u))return u;i.any?n=e.raw(c):e=u}if(t&&t.track&&null!==i.tag&&t.track(e.path(),h,e.length,"tagged"),t&&t.track&&null!==i.tag&&t.track(e.path(),e.offset,e.length,"content"),i.any||(n=null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t)),e.isError(n))return n;if(i.any||null!==i.choice||null===i.children||i.children.forEach((function(i){i._decode(e,t)})),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){var f=new s(n);n=this._getUse(i.contains,e._reporterState.obj)._decode(f,t)}}return i.obj&&a&&(n=e.leaveObject(r)),null===i.key||null===n&&!0!==a?null!==o&&e.exitKey(o):e.leaveKey(o,i.key,n),n},c.prototype._decodeGeneric=function(e,t,i){var r=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,r.args[0],i):/str$/.test(e)?this._decodeStr(t,e,i):"objid"===e&&r.args?this._decodeObjid(t,r.args[0],r.args[1],i):"objid"===e?this._decodeObjid(t,null,null,i):"gentime"===e||"utctime"===e?this._decodeTime(t,e,i):"null_"===e?this._decodeNull(t,i):"bool"===e?this._decodeBool(t,i):"objDesc"===e?this._decodeStr(t,e,i):"int"===e||"enum"===e?this._decodeInt(t,r.args&&r.args[0],i):null!==r.use?this._getUse(r.use,t._reporterState.obj)._decode(t,i):t.error("unknown tag: "+e)},c.prototype._getUse=function(e,t){var i=this._baseState;return i.useDecoder=this._use(e,t),a(null===i.useDecoder._baseState.parent),i.useDecoder=i.useDecoder._baseState.children[0],i.implicit!==i.useDecoder._baseState.implicit&&(i.useDecoder=i.useDecoder.clone(),i.useDecoder._baseState.implicit=i.implicit),i.useDecoder},c.prototype._decodeChoice=function(e,t){var i=this._baseState,r=null,n=!1;return Object.keys(i.choice).some((function(s){var a=e.save(),o=i.choice[s];try{var l=o._decode(e,t);if(e.isError(l))return!1;r={type:s,value:l},n=!0}catch(t){return e.restore(a),!1}return!0}),this),n?r:e.error("Choice not matched")},c.prototype._createEncoderBuffer=function(e){return new n(e,this.reporter)},c.prototype._encode=function(e,t,i){var r=this._baseState;if(null===r.default||r.default!==e){var n=this._encodeValue(e,t,i);if(void 0!==n&&!this._skipDefault(n,t,i))return n}},c.prototype._encodeValue=function(e,t,i){var n=this._baseState;if(null===n.parent)return n.children[0]._encode(e,t||new r);var s=null;if(this.reporter=t,n.optional&&void 0===e){if(null===n.default)return;e=n.default}var a=null,o=!1;if(n.any)s=this._createEncoderBuffer(e);else if(n.choice)s=this._encodeChoice(e,t);else if(n.contains)a=this._getUse(n.contains,i)._encode(e,t),o=!0;else if(n.children)a=n.children.map((function(i){if("null_"===i._baseState.tag)return i._encode(null,t,e);if(null===i._baseState.key)return t.error("Child should have a key");var r=t.enterKey(i._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");var n=i._encode(e[i._baseState.key],t,e);return t.leaveKey(r),n}),this).filter((function(e){return e})),a=this._createEncoderBuffer(a);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return t.error("Too many args for : "+n.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var l=this.clone();l._baseState.implicit=null,a=this._createEncoderBuffer(e.map((function(i){var r=this._baseState;return this._getUse(r.args[0],e)._encode(i,t)}),l))}else null!==n.use?s=this._getUse(n.use,i)._encode(e,t):(a=this._encodePrimitive(n.tag,e),o=!0);if(!n.any&&null===n.choice){var c=null!==n.implicit?n.implicit:n.tag,d=null===n.implicit?"universal":"context";null===c?null===n.use&&t.error("Tag could be omitted only for .use()"):null===n.use&&(s=this._encodeComposite(c,o,d,a))}return null!==n.explicit&&(s=this._encodeComposite(n.explicit,!1,"context",s)),s},c.prototype._encodeChoice=function(e,t){var i=this._baseState,r=i.choice[e.type];return r||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(i.choice))),r._encode(e.value,t)},c.prototype._encodePrimitive=function(e,t){var i=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&i.args)return this._encodeObjid(t,i.reverseArgs[0],i.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,i.args&&i.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},c.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},c.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},"./node_modules/asn1.js/lib/asn1/base/reporter.js":
/*!********************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/base/reporter.js ***!
\********************************************************/
/*! no static exports found */function(e,t,i){var r=i(/*! inherits */"./node_modules/inherits/inherits_browser.js");function n(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function s(e,t){this.path=e,this.rethrow(t)}t.Reporter=n,n.prototype.isError=function(e){return e instanceof s},n.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},n.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},n.prototype.enterKey=function(e){return this._reporterState.path.push(e)},n.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},n.prototype.leaveKey=function(e,t,i){var r=this._reporterState;this.exitKey(e),null!==r.obj&&(r.obj[t]=i)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},n.prototype.leaveObject=function(e){var t=this._reporterState,i=t.obj;return t.obj=e,i},n.prototype.error=function(e){var t,i=this._reporterState,r=e instanceof s;if(t=r?e:new s(i.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!i.options.partial)throw t;return r||i.errors.push(t),t},n.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},r(s,Error),s.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,s),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},"./node_modules/asn1.js/lib/asn1/constants/der.js":
/*!********************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/constants/der.js ***!
\********************************************************/
/*! no static exports found */function(e,t,i){var r=i(/*! ../constants */"./node_modules/asn1.js/lib/asn1/constants/index.js");t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=r._reverse(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=r._reverse(t.tag)},"./node_modules/asn1.js/lib/asn1/constants/index.js":
/*!**********************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/constants/index.js ***!
\**********************************************************/
/*! no static exports found */function(e,t,i){var r=t;r._reverse=function(e){var t={};return Object.keys(e).forEach((function(i){(0|i)==i&&(i|=0);var r=e[i];t[r]=i})),t},r.der=i(/*! ./der */"./node_modules/asn1.js/lib/asn1/constants/der.js")},"./node_modules/asn1.js/lib/asn1/decoders/der.js":
/*!*******************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/decoders/der.js ***!
\*******************************************************/
/*! no static exports found */function(e,t,i){var r=i(/*! inherits */"./node_modules/inherits/inherits_browser.js"),n=i(/*! ../../asn1 */"./node_modules/asn1.js/lib/asn1.js"),s=n.base,a=n.bignum,o=n.constants.der;function l(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){s.Node.call(this,"der",e)}function d(e,t){var i=e.readUInt8(t);if(e.isError(i))return i;var r=o.tagClass[i>>6],n=!(32&i);if(31&~i)i&=31;else{var s=i;for(i=0;!(128&~s);){if(s=e.readUInt8(t),e.isError(s))return s;i<<=7,i|=127&s}}return{cls:r,primitive:n,tag:i,tagStr:o.tag[i]}}function h(e,t,i){var r=e.readUInt8(i);if(e.isError(r))return r;if(!t&&128===r)return null;if(!(128&r))return r;var n=127&r;if(n>4)return e.error("length octect is too long");r=0;for(var s=0;s<n;s++){r<<=8;var a=e.readUInt8(i);if(e.isError(a))return a;r|=a}return r}e.exports=l,l.prototype.decode=function(e,t){return e instanceof s.DecoderBuffer||(e=new s.DecoderBuffer(e,t)),this.tree._decode(e,t)},r(c,s.Node),c.prototype._peekTag=function(e,t,i){if(e.isEmpty())return!1;var r=e.save(),n=d(e,'Failed to peek tag: "'+t+'"');return e.isError(n)?n:(e.restore(r),n.tag===t||n.tagStr===t||n.tagStr+"of"===t||i)},c.prototype._decodeTag=function(e,t,i){var r=d(e,'Failed to decode tag of "'+t+'"');if(e.isError(r))return r;var n=h(e,r.primitive,'Failed to get length of "'+t+'"');if(e.isError(n))return n;if(!i&&r.tag!==t&&r.tagStr!==t&&r.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(r.primitive||null!==n)return e.skip(n,'Failed to match body of: "'+t+'"');var s=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(n=e.offset-s.offset,e.restore(s),e.skip(n,'Failed to match body of: "'+t+'"'))},c.prototype._skipUntilEnd=function(e,t){for(;;){var i=d(e,t);if(e.isError(i))return i;var r,n=h(e,i.primitive,t);if(e.isError(n))return n;if(r=i.primitive||null!==n?e.skip(n):this._skipUntilEnd(e,t),e.isError(r))return r;if("end"===i.tagStr)break}},c.prototype._decodeList=function(e,t,i,r){for(var n=[];!e.isEmpty();){var s=this._peekTag(e,"end");if(e.isError(s))return s;var a=i.decode(e,"der",r);if(e.isError(a)&&s)break;n.push(a)}return n},c.prototype._decodeStr=function(e,t){if("bitstr"===t){var i=e.readUInt8();return e.isError(i)?i:{unused:i,data:e.raw()}}if("bmpstr"===t){var r=e.raw();if(r.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");for(var n="",s=0;s<r.length/2;s++)n+=String.fromCharCode(r.readUInt16BE(2*s));return n}if("numstr"===t){var a=e.raw().toString("ascii");return this._isNumstr(a)?a:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){var o=e.raw().toString("ascii");return this._isPrintstr(o)?o:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},c.prototype._decodeObjid=function(e,t,i){for(var r,n=[],s=0;!e.isEmpty();){var a=e.readUInt8();s<<=7,s|=127&a,128&a||(n.push(s),s=0)}128&a&&n.push(s);var o=n[0]/40|0,l=n[0]%40;if(r=i?n:[o,l].concat(n.slice(1)),t){var c=t[r.join(" ")];void 0===c&&(c=t[r.join(".")]),void 0!==c&&(r=c)}return r},c.prototype._decodeTime=function(e,t){var i=e.raw().toString();if("gentime"===t)var r=0|i.slice(0,4),n=0|i.slice(4,6),s=0|i.slice(6,8),a=0|i.slice(8,10),o=0|i.slice(10,12),l=0|i.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");r=0|i.slice(0,2),n=0|i.slice(2,4),s=0|i.slice(4,6),a=0|i.slice(6,8),o=0|i.slice(8,10),l=0|i.slice(10,12),r=r<70?2e3+r:1900+r}return Date.UTC(r,n-1,s,a,o,l,0)},c.prototype._decodeNull=function(e){return null},c.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},c.prototype._decodeInt=function(e,t){var i=e.raw(),r=new a(i);return t&&(r=t[r.toString(10)]||r),r},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},"./node_modules/asn1.js/lib/asn1/decoders/index.js":
/*!*********************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/decoders/index.js ***!
\*********************************************************/
/*! no static exports found */function(e,t,i){var r=t;r.der=i(/*! ./der */"./node_modules/asn1.js/lib/asn1/decoders/der.js"),r.pem=i(/*! ./pem */"./node_modules/asn1.js/lib/asn1/decoders/pem.js")},"./node_modules/asn1.js/lib/asn1/decoders/pem.js":
/*!*******************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/decoders/pem.js ***!
\*******************************************************/
/*! no static exports found */function(e,t,i){var r=i(/*! inherits */"./node_modules/inherits/inherits_browser.js"),n=i(/*! buffer */"./node_modules/buffer/index.js").Buffer,s=i(/*! ./der */"./node_modules/asn1.js/lib/asn1/decoders/der.js");function a(e){s.call(this,e),this.enc="pem"}r(a,s),e.exports=a,a.prototype.decode=function(e,t){for(var i=e.toString().split(/[\r\n]+/g),r=t.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,l=-1,c=0;c<i.length;c++){var d=i[c].match(a);if(null!==d&&d[2]===r){if(-1!==o){if("END"!==d[1])break;l=c;break}if("BEGIN"!==d[1])break;o=c}}if(-1===o||-1===l)throw new Error("PEM section not found for: "+r);var h=i.slice(o+1,l).join("");h.replace(/[^a-z0-9\+\/=]+/gi,"");var u=new n(h,"base64");return s.prototype.decode.call(this,u,t)}},"./node_modules/asn1.js/lib/asn1/encoders/der.js":
/*!*******************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/encoders/der.js ***!
\*******************************************************/
/*! no static exports found */function(e,t,i){var r=i(/*! inherits */"./node_modules/inherits/inherits_browser.js"),n=i(/*! buffer */"./node_modules/buffer/index.js").Buffer,s=i(/*! ../../asn1 */"./node_modules/asn1.js/lib/asn1.js"),a=s.base,o=s.constants.der;function l(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){a.Node.call(this,"der",e)}function d(e){return e<10?"0"+e:e}e.exports=l,l.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},r(c,a.Node),c.prototype._encodeComposite=function(e,t,i,r){var s,a=function(e,t,i,r){var n;if("seqof"===e?e="seq":"setof"===e&&(e="set"),o.tagByName.hasOwnProperty(e))n=o.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return r.error("Unknown tag: "+e);n=e}return n>=31?r.error("Multi-octet tag encoding unsupported"):(t||(n|=32),n|=o.tagClassByName[i||"universal"]<<6)}(e,t,i,this.reporter);if(r.length<128)return(s=new n(2))[0]=a,s[1]=r.length,this._createEncoderBuffer([s,r]);for(var l=1,c=r.length;c>=256;c>>=8)l++;(s=new n(2+l))[0]=a,s[1]=128|l,c=1+l;for(var d=r.length;d>0;c--,d>>=8)s[c]=255&d;return this._createEncoderBuffer([s,r])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var i=new n(2*e.length),r=0;r<e.length;r++)i.writeUInt16BE(e.charCodeAt(r),2*r);return this._createEncoderBuffer(i)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},c.prototype._encodeObjid=function(e,t,i){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s\.]+/g);for(var r=0;r<e.length;r++)e[r]|=0}else if(Array.isArray(e))for(e=e.slice(),r=0;r<e.length;r++)e[r]|=0;if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!i){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var s=0;for(r=0;r<e.length;r++){var a=e[r];for(s++;a>=128;a>>=7)s++}var o=new n(s),l=o.length-1;for(r=e.length-1;r>=0;r--)for(a=e[r],o[l--]=127&a;(a>>=7)>0;)o[l--]=128|127&a;return this._createEncoderBuffer(o)},c.prototype._encodeTime=function(e,t){var i,r=new Date(e);return"gentime"===t?i=[d(r.getFullYear()),d(r.getUTCMonth()+1),d(r.getUTCDate()),d(r.getUTCHours()),d(r.getUTCMinutes()),d(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?i=[d(r.getFullYear()%100),d(r.getUTCMonth()+1),d(r.getUTCDate()),d(r.getUTCHours()),d(r.getUTCMinutes()),d(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(i,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!n.isBuffer(e)){var i=e.toArray();!e.sign&&128&i[0]&&i.unshift(0),e=new n(i)}if(n.isBuffer(e)){var r=e.length;0===e.length&&r++;var s=new n(r);return e.copy(s),0===e.length&&(s[0]=0),this._createEncoderBuffer(s)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);r=1;for(var a=e;a>=256;a>>=8)r++;for(a=(s=new Array(r)).length-1;a>=0;a--)s[a]=255&e,e>>=8;return 128&s[0]&&s.unshift(0),this._createEncoderBuffer(new n(s))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,i){var r,n=this._baseState;if(null===n.default)return!1;var s=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,i).join()),s.length!==n.defaultBuffer.length)return!1;for(r=0;r<s.length;r++)if(s[r]!==n.defaultBuffer[r])return!1;return!0}},"./node_modules/asn1.js/lib/asn1/encoders/index.js":
/*!*********************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/encoders/index.js ***!
\*********************************************************/
/*! no static exports found */function(e,t,i){var r=t;r.der=i(/*! ./der */"./node_modules/asn1.js/lib/asn1/encoders/der.js"),r.pem=i(/*! ./pem */"./node_modules/asn1.js/lib/asn1/encoders/pem.js")},"./node_modules/asn1.js/lib/asn1/encoders/pem.js":
/*!*******************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/encoders/pem.js ***!
\*******************************************************/
/*! no static exports found */function(e,t,i){var r=i(/*! inherits */"./node_modules/inherits/inherits_browser.js"),n=i(/*! ./der */"./node_modules/asn1.js/lib/asn1/encoders/der.js");function s(e){n.call(this,e),this.enc="pem"}r(s,n),e.exports=s,s.prototype.encode=function(e,t){for(var i=n.prototype.encode.call(this,e).toString("base64"),r=["-----BEGIN "+t.label+"-----"],s=0;s<i.length;s+=64)r.push(i.slice(s,s+64));return r.push("-----END "+t.label+"-----"),r.join("\n")}},"./node_modules/base64-js/index.js":
/*!*****************************************!*\
!*** ./node_modules/base64-js/index.js ***!
\*****************************************/
/*! no static exports found */function(e,t,i){t.byteLength=function(e){var t=l(e),i=t[0],r=t[1];return 3*(i+r)/4-r},t.toByteArray=function(e){var t,i,r=l(e),a=r[0],o=r[1],c=new s(function(e,t,i){return 3*(t+i)/4-i}(0,a,o)),d=0,h=o>0?a-4:a;for(i=0;i<h;i+=4)t=n[e.charCodeAt(i)]<<18|n[e.charCodeAt(i+1)]<<12|n[e.charCodeAt(i+2)]<<6|n[e.charCodeAt(i+3)],c[d++]=t>>16&255,c[d++]=t>>8&255,c[d++]=255&t;return 2===o&&(t=n[e.charCodeAt(i)]<<2|n[e.charCodeAt(i+1)]>>4,c[d++]=255&t),1===o&&(t=n[e.charCodeAt(i)]<<10|n[e.charCodeAt(i+1)]<<4|n[e.charCodeAt(i+2)]>>2,c[d++]=t>>8&255,c[d++]=255&t),c},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,s=[],a=16383,o=0,l=i-n;o<l;o+=a)s.push(c(e,o,o+a>l?l:o+a));return 1===n?(t=e[i-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[i-2]<<8)+e[i-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),s.join("")};for(var r=[],n=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function c(e,t,i){for(var n,s,a=[],o=t;o<i;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),a.push(r[(s=n)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},"./node_modules/bn.js/lib/bn.js":
/*!**************************************!*\
!*** ./node_modules/bn.js/lib/bn.js ***!
\**************************************/
/*! no static exports found */function(e,t,i){(function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}function s(e,t,i){if(s.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(i=t,t=10),this._init(e||0,t||10,i||"be"))}var a;"object"==typeof e?e.exports=s:t.BN=s,s.BN=s,s.wordSize=26;try{a=i(/*! buffer */2).Buffer}catch(e){}function o(e,t,i){for(var r=0,n=Math.min(e.length,i),s=t;s<n;s++){var a=e.charCodeAt(s)-48;r<<=4,r|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function l(e,t,i,r){for(var n=0,s=Math.min(e.length,i),a=t;a<s;a++){var o=e.charCodeAt(a)-48;n*=r,n+=o>=49?o-49+10:o>=17?o-17+10:o}return n}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&n++,16===t?this._parseHex(e,n):this._parseBase(e,t,n),"-"===e[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),t,i)},s.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},s.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,a,o=0;if("be"===i)for(n=e.length-1,s=0;n>=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[s]|=a<<o&67108863,this.words[s+1]=a>>>26-o&67108863,(o+=24)>=26&&(o-=26,s++);else if("le"===i)for(n=0,s=0;n<e.length;n+=3)a=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[s]|=a<<o&67108863,this.words[s+1]=a>>>26-o&67108863,(o+=24)>=26&&(o-=26,s++);return this.strip()},s.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,s=0;for(i=e.length-6,r=0;i>=t;i-=6)n=o(e,i,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303,(s+=24)>=26&&(s-=26,r++);i+6!==t&&(n=o(e,t,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303),this.strip()},s.prototype._parseBase=function(e,t,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var s=e.length-i,a=s%r,o=Math.min(s,s-a)+i,c=0,d=i;d<o;d+=r)c=l(e,d,d+r,t),this.imuln(n),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var h=1;for(c=l(e,d,e.length,t),d=0;d<a;d++)h*=t;this.imuln(h),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},s.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},s.prototype.clone=function(){var e=new s(null);return this.copy(e),e},s.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function u(e,t,i){i.negative=t.negative^e.negative;var r=e.length+t.length|0;i.length=r,r=r-1|0;var n=0|e.words[0],s=0|t.words[0],a=n*s,o=67108863&a,l=a/67108864|0;i.words[0]=o;for(var c=1;c<r;c++){for(var d=l>>>26,h=67108863&l,u=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=u;f++){var p=c-f|0;d+=(a=(n=0|e.words[p])*(s=0|t.words[f])+h)/67108864|0,h=67108863&a}i.words[c]=0|h,l=0|d}return 0!==l?i.words[c]=0|l:i.length--,i.strip()}s.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,s=0,a=0;a<this.length;a++){var o=this.words[a],l=(16777215&(o<<n|s)).toString(16);i=0!=(s=o>>>24-n&16777215)||a!==this.length-1?c[6-l.length]+l+i:l+i,(n+=2)>=26&&(n-=26,a--)}for(0!==s&&(i=s.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var u=d[e],f=h[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);i=(p=p.idivn(f)).isZero()?m+i:c[u-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),s=i||Math.max(1,n);r(n<=s,"byte array longer than desired length"),r(s>0,"Requested array length <= 0"),this.strip();var a,o,l="le"===t,c=new e(s),d=this.clone();if(l){for(o=0;!d.isZero();o++)a=d.andln(255),d.iushrn(8),c[o]=a;for(;o<s;o++)c[o]=0}else{for(o=0;o<s-n;o++)c[o]=0;for(o=0;!d.isZero();o++)a=d.andln(255),d.iushrn(8),c[s-o-1]=a}return c},Math.clz32?s.prototype._countBits=function(e){return 32-Math.clz32(e)}:s.prototype._countBits=function(e){var t=e,i=0;return t>=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,i=0;return 8191&t||(i+=13,t>>>=13),127&t||(i+=7,t>>>=7),15&t||(i+=4,t>>>=4),3&t||(i+=2,t>>>=2),1&t||i++,i},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var i=this._zeroBits(this.words[t]);if(e+=i,26!==i)break}return e},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},s.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},s.prototype.ior=function(e){return r(!(this.negative|e.negative)),this.iuor(e)},s.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=t.length,this.strip()},s.prototype.iand=function(e){return r(!(this.negative|e.negative)),this.iuand(e)},s.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,i;this.length>e.length?(t=this,i=e):(t=e,i=this);for(var r=0;r<i.length;r++)this.words[r]=t.words[r]^i.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},s.prototype.ixor=function(e){return r(!(this.negative|e.negative)),this.iuxor(e)},s.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},s.prototype.iadd=function(e){var t,i,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(i=this,r=e):(i=e,r=this);for(var n=0,s=0;s<r.length;s++)t=(0|i.words[s])+(0|r.words[s])+n,this.words[s]=67108863&t,n=t>>>26;for(;0!==n&&s<i.length;s++)t=(0|i.words[s])+n,this.words[s]=67108863&t,n=t>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this},s.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=e):(i=e,r=this);for(var s=0,a=0;a<r.length;a++)s=(t=(0|i.words[a])-(0|r.words[a])+s)>>26,this.words[a]=67108863&t;for(;0!==s&&a<i.length;a++)s=(t=(0|i.words[a])+s)>>26,this.words[a]=67108863&t;if(0===s&&a<i.length&&i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(e){return this.clone().isub(e)};var f=function(e,t,i){var r,n,s,a=e.words,o=t.words,l=i.words,c=0,d=0|a[0],h=8191&d,u=d>>>13,f=0|a[1],p=8191&f,m=f>>>13,g=0|a[2],b=8191&g,v=g>>>13,_=0|a[3],y=8191&_,w=_>>>13,x=0|a[4],E=8191&x,S=x>>>13,P=0|a[5],C=8191&P,A=P>>>13,L=0|a[6],T=8191&L,F=L>>>13,k=0|a[7],R=8191&k,B=k>>>13,M=0|a[8],O=8191&M,D=M>>>13,I=0|a[9],N=8191&I,j=I>>>13,z=0|o[0],H=8191&z,U=z>>>13,W=0|o[1],$=8191&W,q=W>>>13,V=0|o[2],K=8191&V,G=V>>>13,X=0|o[3],Y=8191&X,J=X>>>13,Z=0|o[4],Q=8191&Z,ee=Z>>>13,te=0|o[5],ie=8191&te,re=te>>>13,ne=0|o[6],se=8191&ne,ae=ne>>>13,oe=0|o[7],le=8191&oe,ce=oe>>>13,de=0|o[8],he=8191&de,ue=de>>>13,fe=0|o[9],pe=8191&fe,me=fe>>>13;i.negative=e.negative^t.negative,i.length=19;var ge=(c+(r=Math.imul(h,H))|0)+((8191&(n=(n=Math.imul(h,U))+Math.imul(u,H)|0))<<13)|0;c=((s=Math.imul(u,U))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,H),n=(n=Math.imul(p,U))+Math.imul(m,H)|0,s=Math.imul(m,U);var be=(c+(r=r+Math.imul(h,$)|0)|0)+((8191&(n=(n=n+Math.imul(h,q)|0)+Math.imul(u,$)|0))<<13)|0;c=((s=s+Math.imul(u,q)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(b,H),n=(n=Math.imul(b,U))+Math.imul(v,H)|0,s=Math.imul(v,U),r=r+Math.imul(p,$)|0,n=(n=n+Math.imul(p,q)|0)+Math.imul(m,$)|0,s=s+Math.imul(m,q)|0;var ve=(c+(r=r+Math.imul(h,K)|0)|0)+((8191&(n=(n=n+Math.imul(h,G)|0)+Math.imul(u,K)|0))<<13)|0;c=((s=s+Math.imul(u,G)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(y,H),n=(n=Math.imul(y,U))+Math.imul(w,H)|0,s=Math.imul(w,U),r=r+Math.imul(b,$)|0,n=(n=n+Math.imul(b,q)|0)+Math.imul(v,$)|0,s=s+Math.imul(v,q)|0,r=r+Math.imul(p,K)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,K)|0,s=s+Math.imul(m,G)|0;var _e=(c+(r=r+Math.imul(h,Y)|0)|0)+((8191&(n=(n=n+Math.imul(h,J)|0)+Math.imul(u,Y)|0))<<13)|0;c=((s=s+Math.imul(u,J)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(E,H),n=(n=Math.imul(E,U))+Math.imul(S,H)|0,s=Math.imul(S,U),r=r+Math.imul(y,$)|0,n=(n=n+Math.imul(y,q)|0)+Math.imul(w,$)|0,s=s+Math.imul(w,q)|0,r=r+Math.imul(b,K)|0,n=(n=n+Math.imul(b,G)|0)+Math.imul(v,K)|0,s=s+Math.imul(v,G)|0,r=r+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,J)|0;var ye=(c+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,ee)|0)+Math.imul(u,Q)|0))<<13)|0;c=((s=s+Math.imul(u,ee)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(C,H),n=(n=Math.imul(C,U))+Math.imul(A,H)|0,s=Math.imul(A,U),r=r+Math.imul(E,$)|0,n=(n=n+Math.imul(E,q)|0)+Math.imul(S,$)|0,s=s+Math.imul(S,q)|0,r=r+Math.imul(y,K)|0,n=(n=n+Math.imul(y,G)|0)+Math.imul(w,K)|0,s=s+Math.imul(w,G)|0,r=r+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,J)|0)+Math.imul(v,Y)|0,s=s+Math.imul(v,J)|0,r=r+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0;var we=(c+(r=r+Math.imul(h,ie)|0)|0)+((8191&(n=(n=n+Math.imul(h,re)|0)+Math.imul(u,ie)|0))<<13)|0;c=((s=s+Math.imul(u,re)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,H),n=(n=Math.imul(T,U))+Math.imul(F,H)|0,s=Math.imul(F,U),r=r+Math.imul(C,$)|0,n=(n=n+Math.imul(C,q)|0)+Math.imul(A,$)|0,s=s+Math.imul(A,q)|0,r=r+Math.imul(E,K)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(S,K)|0,s=s+Math.imul(S,G)|0,r=r+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(w,Y)|0,s=s+Math.imul(w,J)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(v,Q)|0,s=s+Math.imul(v,ee)|0,r=r+Math.imul(p,ie)|0,n=(n=n+Math.imul(p,re)|0)+Math.imul(m,ie)|0,s=s+Math.imul(m,re)|0;var xe=(c+(r=r+Math.imul(h,se)|0)|0)+((8191&(n=(n=n+Math.imul(h,ae)|0)+Math.imul(u,se)|0))<<13)|0;c=((s=s+Math.imul(u,ae)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(R,H),n=(n=Math.imul(R,U))+Math.imul(B,H)|0,s=Math.imul(B,U),r=r+Math.imul(T,$)|0,