@mablhq/mabl-cli 1.45.8 → 1.47.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/basicApiClient.js +6 -0
- package/api/featureSet.js +0 -4
- package/api/mablApiClient.js +8 -0
- package/browserEngines/browserEngine.js +40 -0
- package/browserEngines/browserEngines.js +14 -0
- package/browserEngines/chromiumBrowserEngine.js +175 -0
- package/browserEngines/firefoxBrowserEngine.js +117 -0
- package/browserEngines/unsupportedBrowserEngine.js +26 -0
- package/browserLauncher/frameBase.js +5 -1
- package/browserLauncher/pageEvent.js +1 -0
- package/{api/entities/Plan.js → browserLauncher/playwrightBrowserLauncher/browserDelegate.js} +0 -0
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumBrowserDelegate.js +58 -0
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumElementHandleDelegate.js +65 -0
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumFrameDelegate.js +12 -0
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumPageDelegate.js +117 -0
- package/browserLauncher/playwrightBrowserLauncher/elementHandleDelegate.js +2 -0
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxBrowserDelegate.js +54 -0
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxElementHandleDelegate.js +61 -0
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxFrameDelegate.js +23 -0
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxPageDelegate.js +83 -0
- package/browserLauncher/playwrightBrowserLauncher/frameDelegate.js +2 -0
- package/browserLauncher/playwrightBrowserLauncher/pageDelegate.js +2 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +44 -35
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +30 -5
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +33 -64
- package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +35 -11
- package/browserLauncher/playwrightBrowserLauncher/playwrightHttpRequest.js +9 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +28 -50
- package/commands/constants.js +6 -1
- package/commands/tests/testsUtil.js +27 -182
- package/commands/tests/tests_cmds/import.js +2 -2
- package/commands/tests/tests_cmds/run.js +9 -9
- package/commands/workspaces/workspace_cmds/copy.js +1 -2
- package/domUtil/index.js +1 -1
- package/execution/index.js +1 -1
- package/functions/apiTest/utils.js +47 -0
- package/functions/types.js +2 -0
- package/functions/utils.js +12 -0
- package/mablApi/index.js +1 -1
- package/mablscript/importer.js +3 -0
- package/mablscript/types/VariableNamespace.js +3 -3
- package/mablscriptFind/index.js +1 -1
- package/package.json +5 -4
- package/popupDismissal/index.js +7 -20
- package/proxy/index.js +1 -1
- package/resources/mablFind.js +1 -1
- package/resources/pdf-viewer/index.js +1 -1
- package/resources/pdf-viewer/libmablPdfViewer.js +117 -113
- package/resources/pdf-viewer/pdf.worker.0ceac9378bfc3bfcb634.js +81 -0
- package/resources/pdf-viewer/pdf.worker.df20a5600902b0735d4b.js +2 -0
- package/resources/popupDismissal.js +1 -1
- package/util/actionabilityUtil.js +4 -4
- package/util/browserTestUtils.js +18 -0
- package/util/clickUtil.js +7 -2
- package/util/fileUploadUtil.js +1 -1
- package/util/jestUtil.js +21 -0
- package/mablscript/types/VariableDataType.js +0 -28
- package/resources/pdf-viewer/pdf.worker.5953c23fa7251d236190.js +0 -2
- package/resources/pdf-viewer/pdf.worker.5f2736435a8b46d97859.js +0 -81
package/proxy/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Copyright ©
|
|
1
|
+
/*! Copyright © 2023 mabl Inc. All rights reserved. - License information can be found in LICENSE.txt */
|
|
2
2
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.proxy=t():e.proxy=t()}(global,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=76)}([function(e,t){e.exports={options:{usePureJavaScript:!1}}},function(e,t,r){var n=r(0),i=r(90),s=e.exports=n.util=n.util||{};function o(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function a(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(s.isArrayBuffer(e)||s.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof a||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser)return s.nextTick=process.nextTick,void("function"==typeof setImmediate?s.setImmediate=setImmediate:s.setImmediate=s.nextTick);if("function"==typeof setImmediate)return s.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(s.nextTick=function(e){return setImmediate(e)});if(s.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",t=[];s.setImmediate=function(r){t.push(r),1===t.length&&window.postMessage(e,"*")},window.addEventListener("message",(function(r){if(r.source===window&&r.data===e){r.stopPropagation();var n=t.slice();t.length=0,n.forEach((function(e){e()}))}}),!0)}if("undefined"!=typeof MutationObserver){var r=Date.now(),n=!0,i=document.createElement("div");t=[];new MutationObserver((function(){var e=t.slice();t.length=0,e.forEach((function(e){e()}))})).observe(i,{attributes:!0});var o=s.setImmediate;s.setImmediate=function(e){Date.now()-r>15?(r=Date.now(),o(e)):(t.push(e),1===t.length&&i.setAttribute("a",n=!n))}}s.nextTick=s.setImmediate}(),s.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,s.globalScope=s.isNodejs?global:"undefined"==typeof self?window:self,s.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},s.isArrayBufferView=function(e){return e&&s.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},s.ByteBuffer=a,s.ByteStringBuffer=a;s.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},s.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},s.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},s.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},s.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},s.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},s.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(s.encodeUtf8(e))},s.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},s.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},s.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},s.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},s.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},s.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},s.ByteStringBuffer.prototype.putInt=function(e,t){o(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},s.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},s.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},s.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},s.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},s.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},s.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},s.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},s.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},s.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},s.ByteStringBuffer.prototype.getInt=function(e){o(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},s.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},s.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},s.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},s.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},s.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},s.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},s.ByteStringBuffer.prototype.copy=function(){var e=s.createBuffer(this.data);return e.read=this.read,e},s.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},s.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},s.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},s.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},s.ByteStringBuffer.prototype.toString=function(){return s.decodeUtf8(this.bytes())},s.DataBuffer=function(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=s.isArrayBuffer(e),n=s.isArrayBufferView(e);if(r||n)return this.data=r?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in t?t.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)},s.DataBuffer.prototype.length=function(){return this.write-this.read},s.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},s.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},s.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},s.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},s.DataBuffer.prototype.putBytes=function(e,t){if(s.isArrayBufferView(e)){var r=(n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-n.byteOffset;return this.accommodate(r),new Uint8Array(this.data.buffer,this.write).set(n),this.write+=r,this}if(s.isArrayBuffer(e)){var n=new Uint8Array(e);return this.accommodate(n.byteLength),new Uint8Array(this.data.buffer).set(n,this.write),this.write+=n.byteLength,this}if(e instanceof s.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&s.isArrayBufferView(e.data)){n=new Uint8Array(e.data.byteLength,e.read,e.length());return this.accommodate(n.byteLength),new Uint8Array(e.data.byteLength,this.write).set(n),this.write+=n.byteLength,this}if(e instanceof s.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary","string"==typeof e){var i;if("hex"===t)return this.accommodate(Math.ceil(e.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=s.binary.hex.decode(e,i,this.write),this;if("base64"===t)return this.accommodate(3*Math.ceil(e.length/4)),i=new Uint8Array(this.data.buffer,this.write),this.write+=s.binary.base64.decode(e,i,this.write),this;if("utf8"===t&&(e=s.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=s.binary.raw.decode(i),this;if("utf16"===t)return this.accommodate(2*e.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=s.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},s.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},s.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},s.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},s.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},s.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},s.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},s.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},s.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},s.DataBuffer.prototype.putInt=function(e,t){o(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},s.DataBuffer.prototype.putSignedInt=function(e,t){return o(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},s.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},s.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},s.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},s.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},s.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},s.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},s.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},s.DataBuffer.prototype.getInt=function(e){o(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},s.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},s.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},s.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},s.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},s.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},s.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},s.DataBuffer.prototype.copy=function(){return new s.DataBuffer(this)},s.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},s.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},s.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},s.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},s.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return s.binary.raw.encode(t);if("hex"===e)return s.binary.hex.encode(t);if("base64"===e)return s.binary.base64.encode(t);if("utf8"===e)return s.text.utf8.decode(t);if("utf16"===e)return s.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},s.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=s.encodeUtf8(e)),new s.ByteBuffer(e)},s.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},s.xorBytes=function(e,t,r){for(var n="",i="",s="",o=0,a=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),a>=10&&(n+=s,s="",a=0),s+=String.fromCharCode(i),++a;return n+=s},s.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},s.bytesToHex=function(e){return s.createBuffer(e).toHex()},s.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";s.encode64=function(e,t){for(var r,n,i,s="",o="",a=0;a<e.length;)r=e.charCodeAt(a++),n=e.charCodeAt(a++),i=e.charCodeAt(a++),s+=c.charAt(r>>2),s+=c.charAt((3&r)<<4|n>>4),isNaN(n)?s+="==":(s+=c.charAt((15&n)<<2|i>>6),s+=isNaN(i)?"=":c.charAt(63&i)),t&&s.length>t&&(o+=s.substr(0,t)+"\r\n",s=s.substr(t));return o+=s},s.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,s="",o=0;o<e.length;)t=u[e.charCodeAt(o++)-43],r=u[e.charCodeAt(o++)-43],n=u[e.charCodeAt(o++)-43],i=u[e.charCodeAt(o++)-43],s+=String.fromCharCode(t<<2|r>>4),64!==n&&(s+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(s+=String.fromCharCode((3&n)<<6|i)));return s},s.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},s.decodeUtf8=function(e){return decodeURIComponent(escape(e))},s.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i.encode,decode:i.decode}},s.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},s.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,s=0;s<e.length;++s)n[i++]=e.charCodeAt(s);return t?i-r:n},s.binary.hex.encode=s.bytesToHex,s.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2)));var i=0,s=r=r||0;for(1&e.length&&(i=1,n[s++]=parseInt(e[0],16));i<e.length;i+=2)n[s++]=parseInt(e.substr(i,2),16);return t?s-r:n},s.binary.base64.encode=function(e,t){for(var r,n,i,s="",o="",a=0;a<e.byteLength;)r=e[a++],n=e[a++],i=e[a++],s+=c.charAt(r>>2),s+=c.charAt((3&r)<<4|n>>4),isNaN(n)?s+="==":(s+=c.charAt((15&n)<<2|i>>6),s+=isNaN(i)?"=":c.charAt(63&i)),t&&s.length>t&&(o+=s.substr(0,t)+"\r\n",s=s.substr(t));return o+=s},s.binary.base64.decode=function(e,t,r){var n,i,s,o,a=t;a||(a=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var c=0,l=r=r||0;c<e.length;)n=u[e.charCodeAt(c++)-43],i=u[e.charCodeAt(c++)-43],s=u[e.charCodeAt(c++)-43],o=u[e.charCodeAt(c++)-43],a[l++]=n<<2|i>>4,64!==s&&(a[l++]=(15&i)<<4|s>>2,64!==o&&(a[l++]=(3&s)<<6|o));return t?l-r:a.subarray(0,l)},s.binary.base58.encode=function(e,t){return s.binary.baseN.encode(e,l,t)},s.binary.base58.decode=function(e,t){return s.binary.baseN.decode(e,l,t)},s.text={utf8:{},utf16:{}},s.text.utf8.encode=function(e,t,r){e=s.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o<e.length;++o)n[i++]=e.charCodeAt(o);return t?i-r:n},s.text.utf8.decode=function(e){return s.decodeUtf8(String.fromCharCode.apply(null,e))},s.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));for(var i=new Uint16Array(n.buffer),s=r=r||0,o=r,a=0;a<e.length;++a)i[o++]=e.charCodeAt(a),s+=2;return t?s-r:n},s.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},s.deflate=function(e,t,r){if(t=s.decode64(e.deflate(s.encode64(t)).rval),r){var n=2;32&t.charCodeAt(1)&&(n=6),t=t.substring(n,t.length-4)}return t},s.inflate=function(e,t,r){var n=e.inflate(s.encode64(t)).rval;return null===n?null:s.decode64(n)};var h=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(null===r?n=e.removeItem(t):(r=s.encode64(JSON.stringify(r)),n=e.setItem(t,r)),void 0!==n&&!0!==n.rval){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},p=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(null===r.rval){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(s.decode64(r))),r},f=function(e,t,r,n){var i=p(e,t);null===i&&(i={}),i[r]=n,h(e,t,i)},d=function(e,t,r){var n=p(e,t);return null!==n&&(n=r in n?n[r]:null),n},y=function(e,t,r){var n=p(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var s in n){i=!1;break}i&&(n=null),h(e,t,n)}},g=function(e,t){h(e,t,null)},m=function(e,t,r){var n,i=null;void 0===r&&(r=["web","flash"]);var s=!1,o=null;for(var a in r){n=r[a];try{if("flash"===n||"both"===n){if(null===t[0])throw new Error("Flash local storage not available.");i=e.apply(this,t),s="flash"===n}"web"!==n&&"both"!==n||(t[0]=localStorage,i=e.apply(this,t),s=!0)}catch(e){o=e}if(s)break}if(!s)throw o;return i};s.setItem=function(e,t,r,n,i){m(f,arguments,i)},s.getItem=function(e,t,r,n){return m(d,arguments,n)},s.removeItem=function(e,t,r,n){m(y,arguments,n)},s.clearItems=function(e,t,r){m(g,arguments,r)},s.parseUrl=function(e){var t=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;t.lastIndex=0;var r=t.exec(e),n=null===r?null:{full:e,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?(80!==n.port&&"http"===n.scheme||443!==n.port&&"https"===n.scheme)&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var v=null;s.getQueryVariables=function(e){var t,r=function(e){for(var t={},r=e.split("&"),n=0;n<r.length;n++){var i,s,o=r[n].indexOf("=");o>0?(i=r[n].substring(0,o),s=r[n].substring(o+1)):(i=r[n],s=null),i in t||(t[i]=[]),i in Object.prototype||null===s||t[i].push(unescape(s))}return t};return void 0===e?(null===v&&(v="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=v):t=r(e),t},s.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:s.getQueryVariables(r)}},s.makeRequest=function(e){var t=s.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var n;return void 0===e?n=t.query:(n=t.query[e])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},s.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},s.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},s.format=function(e){for(var t,r,n=/%./g,i=0,s=[],o=0;t=n.exec(e);){(r=e.substring(o,n.lastIndex-2)).length>0&&s.push(r),o=n.lastIndex;var a=t[0][1];switch(a){case"s":case"o":i<arguments.length?s.push(arguments[1+i++]):s.push("<?>");break;case"%":s.push("%");break;default:s.push("<%"+a+"?>")}}return s.push(e.substring(o)),s.join("")},s.formatNumber=function(e,t,r,n){var i=e,s=isNaN(t=Math.abs(t))?2:t,o=void 0===r?",":r,a=void 0===n?".":n,c=i<0?"-":"",u=parseInt(i=Math.abs(+i||0).toFixed(s),10)+"",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+a:"")+u.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+a)+(s?o+Math.abs(i-u).toFixed(s).slice(2):"")},s.formatSize=function(e){return e=e>=1073741824?s.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?s.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?s.formatNumber(e/1024,0)+" KiB":s.formatNumber(e,0)+" bytes"},s.bytesFromIP=function(e){return-1!==e.indexOf(".")?s.bytesFromIPv4(e):-1!==e.indexOf(":")?s.bytesFromIPv6(e):null},s.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=s.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()},s.bytesFromIPv6=function(e){for(var t=0,r=2*(8-(e=e.split(":").filter((function(e){return 0===e.length&&++t,!0}))).length+t),n=s.createBuffer(),i=0;i<8;++i)if(e[i]&&0!==e[i].length){var o=s.hexToBytes(e[i]);o.length<2&&n.putByte(0),n.putBytes(o)}else n.fillWithByte(0,r),r=0;return n.getBytes()},s.bytesToIP=function(e){return 4===e.length?s.bytesToIPv4(e):16===e.length?s.bytesToIPv6(e):null},s.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},s.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var o=s.bytesToHex(e[i]+e[i+1]);"0"===o[0]&&"0"!==o;)o=o.substr(1);if("0"===o){var a=r[r.length-1],c=t.length;a&&c===a.end+1?(a.end=c,a.end-a.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:c,end:c})}t.push(o)}if(r.length>0){var u=r[n];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),0===u.start&&t.unshift(""),7===u.end&&t.push(""))}return t.join(":")},s.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in s&&!e.update)return t(null,s.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return s.cores=navigator.hardwareConcurrency,t(null,s.cores);if("undefined"==typeof Worker)return s.cores=1,t(null,s.cores);if("undefined"==typeof Blob)return s.cores=2,t(null,s.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()<r;);self.postMessage({st:t,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function e(n,i,o){if(0===i){var a=Math.floor(n.reduce((function(e,t){return e+t}),0)/n.length);return s.cores=Math.max(1,a),URL.revokeObjectURL(r),t(null,s.cores)}!function(e,t){for(var n=[],i=[],s=0;s<e;++s){var o=new Worker(r);o.addEventListener("message",(function(r){if(i.push(r.data),i.length===e){for(var s=0;s<e;++s)n[s].terminate();t(null,i)}})),n.push(o)}for(s=0;s<e;++s)n[s].postMessage(s)}(o,(function(t,r){n.push(function(e,t){for(var r=[],n=0;n<e;++n)for(var i=t[n],s=r[n]=[],o=0;o<e;++o)if(n!==o){var a=t[o];(i.st>a.st&&i.st<a.et||a.st>i.st&&a.st<i.et)&&s.push(o)}return r.reduce((function(e,t){return Math.max(e,t.length)}),0)}(o,r)),e(n,i-1,o)}))}([],5,16)}},function(e,t,r){"use strict";var n=r(68),i=Object.prototype.toString;function s(e){return Array.isArray(e)}function o(e){return void 0===e}function a(e){return"[object ArrayBuffer]"===i.call(e)}function c(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===i.call(e)}function h(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),s(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:s,isArrayBuffer:a,isBuffer:function(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===i.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&a(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:c,isPlainObject:u,isUndefined:o,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:l,isStream:function(e){return c(e)&&l(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===i.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:h,merge:function e(){var t={};function r(r,n){u(t[n])&&u(r)?t[n]=e(t[n],r):u(r)?t[n]=e({},r):s(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)h(arguments[n],r);return t},extend:function(e,t,r){return h(t,(function(t,i){e[i]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t,r){var n=r(0);r(6),r(54),r(55),r(1),n.random&&n.random.getBytes?e.exports=n.random:function(t){var r={},i=new Array(4),s=n.util.createBuffer();function o(){var e=n.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return n.aes._updateBlock(e,t,i,!1),s.putInt32(i[0]),s.putInt32(i[1]),s.putInt32(i[2]),s.putInt32(i[3]),s.getBytes()},r.increment=function(e){return++e[3],e},r.md=n.md.sha256;var a=o(),c=null,u=n.util.globalScope,l=u.crypto||u.msCrypto;if(l&&l.getRandomValues&&(c=function(e){return l.getRandomValues(e)}),n.options.usePureJavaScript||!n.util.isNodejs&&!c){if("undefined"==typeof window||window.document,a.collectInt(+new Date,32),"undefined"!=typeof navigator){var h="";for(var p in navigator)try{"string"==typeof navigator[p]&&(h+=navigator[p])}catch(e){}a.collect(h),h=null}t&&(t().mousemove((function(e){a.collectInt(e.clientX,16),a.collectInt(e.clientY,16)})),t().keypress((function(e){a.collectInt(e.charCode,8)})))}if(n.random)for(var p in a)n.random[p]=a[p];else n.random=a;n.random.createInstance=o,e.exports=n.random}("undefined"!=typeof jQuery?jQuery:null)},function(e,t,r){var n=r(0);r(1),r(7);var i=e.exports=n.asn1=n.asn1||{};function s(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,s,o){if(n.util.isArray(s)){for(var a=[],c=0;c<s.length;++c)void 0!==s[c]&&a.push(s[c]);s=a}var u={tagClass:e,type:t,constructed:r,composed:r||n.util.isArray(s),value:s};return o&&"bitStringContents"in o&&(u.bitStringContents=o.bitStringContents,u.original=i.copy(u)),u},i.copy=function(e,t){var r;if(n.util.isArray(e)){r=[];for(var s=0;s<e.length;++s)r.push(i.copy(e[s],t));return r}return"string"==typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:i.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},i.equals=function(e,t,r){if(n.util.isArray(e)){if(!n.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var s=0;s<e.length;++s)if(!i.equals(e[s],t[s]))return!1;return!0}if(typeof e!=typeof t)return!1;if("string"==typeof e)return e===t;var o=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&i.equals(e.value,t.value);return r&&r.includeBitStringContents&&(o=o&&e.bitStringContents===t.bitStringContents),o},i.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};i.fromDer=function(e,t){return void 0===t&&(t={strict:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"==typeof e&&(e=n.util.createBuffer(e)),function e(t,r,n,o){var a;s(t,r,2);var c=t.getByte();r--;var u=192&c,l=31&c;a=t.length();var h,p,f=function(e,t){var r=e.getByte();if(t--,128!==r){var n;if(128&r){var i=127&r;s(e,t,i),n=e.getInt(i<<3)}else n=r;if(n<0)throw new Error("Negative length: "+n);return n}}(t,r);if(r-=a-t.length(),void 0!==f&&f>r){if(o.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=t.length(),d.remaining=r,d.requested=f,d}f=r}var y=32==(32&c);if(y)if(h=[],void 0===f)for(;;){if(s(t,r,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),r-=2;break}a=t.length(),h.push(e(t,r,n+1,o)),r-=a-t.length()}else for(;f>0;)a=t.length(),h.push(e(t,f,n+1,o)),r-=a-t.length(),f-=a-t.length();void 0===h&&u===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&(p=t.bytes(f));if(void 0===h&&o.decodeBitStrings&&u===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&f>1){var g=t.read,m=r,v=0;if(l===i.Type.BITSTRING&&(s(t,r,1),v=t.getByte(),r--),0===v)try{a=t.length();var C={verbose:o.verbose,strict:!0,decodeBitStrings:!0},E=e(t,r,n+1,C),S=a-t.length();r-=S,l==i.Type.BITSTRING&&S++;var b=E.tagClass;S!==f||b!==i.Class.UNIVERSAL&&b!==i.Class.CONTEXT_SPECIFIC||(h=[E])}catch(e){}void 0===h&&(t.read=g,r=m)}if(void 0===h){if(void 0===f){if(o.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");f=r}if(l===i.Type.BMPSTRING)for(h="";f>0;f-=2)s(t,r,2),h+=String.fromCharCode(t.getInt16()),r-=2;else h=t.getBytes(f)}var T=void 0===p?null:{bitStringContents:p};return i.create(u,l,y,h,T)}(e,e.length(),0,t)},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,s=n.util.createBuffer(),o=!1;if("bitStringContents"in e&&(o=!0,e.original&&(o=i.equals(e,e.original))),o)s.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:s.putByte(0);for(var a=0;a<e.value.length;++a)void 0!==e.value[a]&&s.putBuffer(i.toDer(e.value[a]))}else if(e.type===i.Type.BMPSTRING)for(a=0;a<e.value.length;++a)s.putInt16(e.value.charCodeAt(a));else e.type===i.Type.INTEGER&&e.value.length>1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?s.putBytes(e.value.substr(1)):s.putBytes(e.value);if(t.putByte(r),s.length()<=127)t.putByte(127&s.length());else{var c=s.length(),u="";do{u+=String.fromCharCode(255&c),c>>>=8}while(c>0);t.putByte(128|u.length);for(a=u.length-1;a>=0;--a)t.putByte(u.charCodeAt(a))}return t.putBuffer(s),t},i.oidToDer=function(e){var t,r,i,s,o=e.split("."),a=n.util.createBuffer();a.putByte(40*parseInt(o[0],10)+parseInt(o[1],10));for(var c=2;c<o.length;++c){t=!0,r=[],i=parseInt(o[c],10);do{s=127&i,i>>>=7,t||(s|=128),r.push(s),t=!1}while(i>0);for(var u=r.length-1;u>=0;--u)a.putByte(r[u])}return a},i.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),s=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),a=0;if(e.length>11){var c=e.charAt(10),u=10;"+"!==c&&"-"!==c&&(a=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(s,o,a,0),u&&("+"===(c=e.charAt(u))||"-"===c)){var l=60*parseInt(e.substr(u+1,2),10)+parseInt(e.substr(u+4,2),10);l*=6e4,"+"===c?t.setTime(+t-l):t.setTime(+t+l)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),a=parseInt(e.substr(12,2),10),c=0,u=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var h=e.length-5,p=e.charAt(h);"+"!==p&&"-"!==p||(u=60*parseInt(e.substr(h+1,2),10)+parseInt(e.substr(h+4,2),10),u*=6e4,"+"===p&&(u*=-1),l=!0);return"."===e.charAt(14)&&(c=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,i),t.setUTCHours(s,o,a,c),t.setTime(+t+u)):(t.setFullYear(r,n,i),t.setHours(s,o,a,c)),t},i.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.dateToGeneralizedTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.integerToDer=function(e){var t=n.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,s){var o=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)s&&(e.tagClass!==t.tagClass&&s.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&s.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(o=!0,t.value&&n.util.isArray(t.value))for(var a=0,c=0;o&&c<t.value.length;++c)o=t.value[c].optional||!1,e.value[a]&&((o=i.validate(e.value[a],t.value[c],r,s))?++a:t.value[c].optional&&(o=!0)),!o&&s&&s.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(o&&r)if(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e)if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else{if(0!==e.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else s&&s.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');return o};var o=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(e,t,r){var s="";r=r||2,(t=t||0)>0&&(s+="\n");for(var a="",c=0;c<t*r;++c)a+=" ";switch(s+=a+"Tag: ",e.tagClass){case i.Class.UNIVERSAL:s+="Universal:";break;case i.Class.APPLICATION:s+="Application:";break;case i.Class.CONTEXT_SPECIFIC:s+="Context-Specific:";break;case i.Class.PRIVATE:s+="Private:"}if(e.tagClass===i.Class.UNIVERSAL)switch(s+=e.type,e.type){case i.Type.NONE:s+=" (None)";break;case i.Type.BOOLEAN:s+=" (Boolean)";break;case i.Type.INTEGER:s+=" (Integer)";break;case i.Type.BITSTRING:s+=" (Bit string)";break;case i.Type.OCTETSTRING:s+=" (Octet string)";break;case i.Type.NULL:s+=" (Null)";break;case i.Type.OID:s+=" (Object Identifier)";break;case i.Type.ODESC:s+=" (Object Descriptor)";break;case i.Type.EXTERNAL:s+=" (External or Instance of)";break;case i.Type.REAL:s+=" (Real)";break;case i.Type.ENUMERATED:s+=" (Enumerated)";break;case i.Type.EMBEDDED:s+=" (Embedded PDV)";break;case i.Type.UTF8:s+=" (UTF8)";break;case i.Type.ROID:s+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:s+=" (Sequence)";break;case i.Type.SET:s+=" (Set)";break;case i.Type.PRINTABLESTRING:s+=" (Printable String)";break;case i.Type.IA5String:s+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:s+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:s+=" (Generalized time)";break;case i.Type.BMPSTRING:s+=" (BMP String)"}else s+=e.type;if(s+="\n",s+=a+"Constructed: "+e.constructed+"\n",e.composed){var u=0,l="";for(c=0;c<e.value.length;++c)void 0!==e.value[c]&&(u+=1,l+=i.prettyPrint(e.value[c],t+1,r),c+1<e.value.length&&(l+=","));s+=a+"Sub values: "+u+l}else{if(s+=a+"Value: ",e.type===i.Type.OID){var h=i.derToOid(e.value);s+=h,n.pki&&n.pki.oids&&h in n.pki.oids&&(s+=" ("+n.pki.oids[h]+") ")}if(e.type===i.Type.INTEGER)try{s+=i.derToInteger(e.value)}catch(t){s+="0x"+n.util.bytesToHex(e.value)}else if(e.type===i.Type.BITSTRING){if(e.value.length>1?s+="0x"+n.util.bytesToHex(e.value.slice(1)):s+="(none)",e.value.length>0){var p=e.value.charCodeAt(0);1==p?s+=" (1 unused bit shown)":p>1&&(s+=" ("+p+" unused bits shown)")}}else e.type===i.Type.OCTETSTRING?(o.test(e.value)||(s+="("+e.value+") "),s+="0x"+n.util.bytesToHex(e.value)):e.type===i.Type.UTF8?s+=n.util.decodeUtf8(e.value):e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?s+=e.value:o.test(e.value)?s+="0x"+n.util.bytesToHex(e.value):0===e.value.length?s+="[null]":s+=e.value}return s}},function(e,t,r){var n=r(0);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},function(e,t,r){var n=r(0);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(31),r(50),r(1),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){l||h();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return f(r._w,e,t,!1)},decrypt:function(e,t){return f(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var i=0;i<t.length;++i)r.putByte(t[i])}}else r=n.util.createBuffer(r);if(!n.util.isArray(r)){t=r,r=[];var s=t.length();if(16===s||24===s||32===s){s>>>=2;for(i=0;i<s;++i)r.push(t.getInt32())}}if(!n.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var o=this.mode.name,a=-1!==["CFB","OFB","CTR","GCM"].indexOf(o);this._w=p(r,e.decrypt&&!a),this._init=!0}},n.aes._expandKey=function(e,t){return l||h(),p(e,t)},n.aes._updateBlock=f,i("AES-ECB",n.cipher.modes.ecb),i("AES-CBC",n.cipher.modes.cbc),i("AES-CFB",n.cipher.modes.cfb),i("AES-OFB",n.cipher.modes.ofb),i("AES-CTR",n.cipher.modes.ctr),i("AES-GCM",n.cipher.modes.gcm);var s,o,a,c,u,l=!1;function h(){l=!0,a=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;s=new Array(256),o=new Array(256),c=new Array(4),u=new Array(4);for(t=0;t<4;++t)c[t]=new Array(256),u[t]=new Array(256);var r,n,i,h,p,f,d,y=0,g=0;for(t=0;t<256;++t){h=(h=g^g<<1^g<<2^g<<3^g<<4)>>8^255&h^99,s[y]=h,o[h]=y,f=(p=e[h])<<24^h<<16^h<<8^h^p,d=((r=e[y])^(n=e[r])^(i=e[n]))<<24^(y^i)<<16^(y^n^i)<<8^y^r^i;for(var m=0;m<4;++m)c[m][y]=f,u[m][h]=d,f=f<<24|f>>>8,d=d<<24|d>>>8;0===y?y=g=1:(y=r^e[e[e[r^i]]],g^=e[e[g]])}}function p(e,t){for(var r,n=e.slice(0),i=1,o=n.length,c=4*(o+6+1),l=o;l<c;++l)r=n[l-1],l%o==0?(r=s[r>>>16&255]<<24^s[r>>>8&255]<<16^s[255&r]<<8^s[r>>>24]^a[i]<<24,i++):o>6&&l%o==4&&(r=s[r>>>24]<<24^s[r>>>16&255]<<16^s[r>>>8&255]<<8^s[255&r]),n[l]=n[l-o]^r;if(t){for(var h,p=u[0],f=u[1],d=u[2],y=u[3],g=n.slice(0),m=(l=0,(c=n.length)-4);l<c;l+=4,m-=4)if(0===l||l===c-4)g[l]=n[m],g[l+1]=n[m+3],g[l+2]=n[m+2],g[l+3]=n[m+1];else for(var v=0;v<4;++v)h=n[m+v],g[l+(3&-v)]=p[s[h>>>24]]^f[s[h>>>16&255]]^d[s[h>>>8&255]]^y[s[255&h]];n=g}return n}function f(e,t,r,n){var i,a,l,h,p,f,d,y,g,m,v,C,E=e.length/4-1;n?(i=u[0],a=u[1],l=u[2],h=u[3],p=o):(i=c[0],a=c[1],l=c[2],h=c[3],p=s),f=t[0]^e[0],d=t[n?3:1]^e[1],y=t[2]^e[2],g=t[n?1:3]^e[3];for(var S=3,b=1;b<E;++b)m=i[f>>>24]^a[d>>>16&255]^l[y>>>8&255]^h[255&g]^e[++S],v=i[d>>>24]^a[y>>>16&255]^l[g>>>8&255]^h[255&f]^e[++S],C=i[y>>>24]^a[g>>>16&255]^l[f>>>8&255]^h[255&d]^e[++S],g=i[g>>>24]^a[f>>>16&255]^l[d>>>8&255]^h[255&y]^e[++S],f=m,d=v,y=C;r[0]=p[f>>>24]<<24^p[d>>>16&255]<<16^p[y>>>8&255]<<8^p[255&g]^e[++S],r[n?3:1]=p[d>>>24]<<24^p[y>>>16&255]<<16^p[g>>>8&255]<<8^p[255&f]^e[++S],r[2]=p[y>>>24]<<24^p[g>>>16&255]<<16^p[f>>>8&255]<<8^p[255&d]^e[++S],r[n?1:3]=p[g>>>24]<<24^p[f>>>16&255]<<16^p[d>>>8&255]<<8^p[255&y]^e[++S]}function d(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var s=null;r instanceof n.util.ByteBuffer&&(s=r,r={}),(r=r||{}).output=s,r.iv=e,i.call(t,r)},t}},function(e,t,r){var n=r(0);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function s(e,t){i[e]=t,i[t]=e}function o(e,t){i[e]=t}s("1.2.840.113549.1.1.1","rsaEncryption"),s("1.2.840.113549.1.1.4","md5WithRSAEncryption"),s("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),s("1.2.840.113549.1.1.7","RSAES-OAEP"),s("1.2.840.113549.1.1.8","mgf1"),s("1.2.840.113549.1.1.9","pSpecified"),s("1.2.840.113549.1.1.10","RSASSA-PSS"),s("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),s("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),s("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),s("1.3.101.112","EdDSA25519"),s("1.2.840.10040.4.3","dsa-with-sha1"),s("1.3.14.3.2.7","desCBC"),s("1.3.14.3.2.26","sha1"),s("2.16.840.1.101.3.4.2.1","sha256"),s("2.16.840.1.101.3.4.2.2","sha384"),s("2.16.840.1.101.3.4.2.3","sha512"),s("1.2.840.113549.2.5","md5"),s("1.2.840.113549.1.7.1","data"),s("1.2.840.113549.1.7.2","signedData"),s("1.2.840.113549.1.7.3","envelopedData"),s("1.2.840.113549.1.7.4","signedAndEnvelopedData"),s("1.2.840.113549.1.7.5","digestedData"),s("1.2.840.113549.1.7.6","encryptedData"),s("1.2.840.113549.1.9.1","emailAddress"),s("1.2.840.113549.1.9.2","unstructuredName"),s("1.2.840.113549.1.9.3","contentType"),s("1.2.840.113549.1.9.4","messageDigest"),s("1.2.840.113549.1.9.5","signingTime"),s("1.2.840.113549.1.9.6","counterSignature"),s("1.2.840.113549.1.9.7","challengePassword"),s("1.2.840.113549.1.9.8","unstructuredAddress"),s("1.2.840.113549.1.9.14","extensionRequest"),s("1.2.840.113549.1.9.20","friendlyName"),s("1.2.840.113549.1.9.21","localKeyId"),s("1.2.840.113549.1.9.22.1","x509Certificate"),s("1.2.840.113549.1.12.10.1.1","keyBag"),s("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),s("1.2.840.113549.1.12.10.1.3","certBag"),s("1.2.840.113549.1.12.10.1.4","crlBag"),s("1.2.840.113549.1.12.10.1.5","secretBag"),s("1.2.840.113549.1.12.10.1.6","safeContentsBag"),s("1.2.840.113549.1.5.13","pkcs5PBES2"),s("1.2.840.113549.1.5.12","pkcs5PBKDF2"),s("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),s("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),s("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),s("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),s("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),s("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),s("1.2.840.113549.2.7","hmacWithSHA1"),s("1.2.840.113549.2.8","hmacWithSHA224"),s("1.2.840.113549.2.9","hmacWithSHA256"),s("1.2.840.113549.2.10","hmacWithSHA384"),s("1.2.840.113549.2.11","hmacWithSHA512"),s("1.2.840.113549.3.7","des-EDE3-CBC"),s("2.16.840.1.101.3.4.1.2","aes128-CBC"),s("2.16.840.1.101.3.4.1.22","aes192-CBC"),s("2.16.840.1.101.3.4.1.42","aes256-CBC"),s("2.5.4.3","commonName"),s("2.5.4.5","serialName"),s("2.5.4.6","countryName"),s("2.5.4.7","localityName"),s("2.5.4.8","stateOrProvinceName"),s("2.5.4.9","streetAddress"),s("2.5.4.10","organizationName"),s("2.5.4.11","organizationalUnitName"),s("2.5.4.13","description"),s("2.5.4.15","businessCategory"),s("2.5.4.17","postalCode"),s("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),s("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),s("2.16.840.1.113730.1.1","nsCertType"),s("2.16.840.1.113730.1.13","nsComment"),o("2.5.29.1","authorityKeyIdentifier"),o("2.5.29.2","keyAttributes"),o("2.5.29.3","certificatePolicies"),o("2.5.29.4","keyUsageRestriction"),o("2.5.29.5","policyMapping"),o("2.5.29.6","subtreesConstraint"),o("2.5.29.7","subjectAltName"),o("2.5.29.8","issuerAltName"),o("2.5.29.9","subjectDirectoryAttributes"),o("2.5.29.10","basicConstraints"),o("2.5.29.11","nameConstraints"),o("2.5.29.12","policyConstraints"),o("2.5.29.13","basicConstraints"),s("2.5.29.14","subjectKeyIdentifier"),s("2.5.29.15","keyUsage"),o("2.5.29.16","privateKeyUsagePeriod"),s("2.5.29.17","subjectAltName"),s("2.5.29.18","issuerAltName"),s("2.5.29.19","basicConstraints"),o("2.5.29.20","cRLNumber"),o("2.5.29.21","cRLReason"),o("2.5.29.22","expirationDate"),o("2.5.29.23","instructionCode"),o("2.5.29.24","invalidityDate"),o("2.5.29.25","cRLDistributionPoints"),o("2.5.29.26","issuingDistributionPoint"),o("2.5.29.27","deltaCRLIndicator"),o("2.5.29.28","issuingDistributionPoint"),o("2.5.29.29","certificateIssuer"),o("2.5.29.30","nameConstraints"),s("2.5.29.31","cRLDistributionPoints"),s("2.5.29.32","certificatePolicies"),o("2.5.29.33","policyMappings"),o("2.5.29.34","policyConstraints"),s("2.5.29.35","authorityKeyIdentifier"),o("2.5.29.36","policyConstraints"),s("2.5.29.37","extKeyUsage"),o("2.5.29.46","freshestCRL"),o("2.5.29.54","inhibitAnyPolicy"),s("1.3.6.1.4.1.11129.2.4.2","timestampList"),s("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),s("1.3.6.1.5.5.7.3.1","serverAuth"),s("1.3.6.1.5.5.7.3.2","clientAuth"),s("1.3.6.1.5.5.7.3.3","codeSigning"),s("1.3.6.1.5.5.7.3.4","emailProtection"),s("1.3.6.1.5.5.7.3.8","timeStamping")},function(e,t){e.exports=require("crypto")},function(e,t,r){var n=r(82),i=n.Buffer;function s(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(s(n,t),t.Buffer=o),s(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){var n=r(0);r(1);var i=e.exports=n.pem=n.pem||{};function s(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+"\r\n";var s=0,o=-1;for(i=0;i<t.length;++i,++s)if(s>65&&-1!==o){var a=t[o];","===a?(++o,t=t.substr(0,o)+"\r\n "+t.substr(o)):t=t.substr(0,o)+"\r\n"+a+t.substr(o+1),s=i-o-1,o=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(o=i);return t}function o(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=s(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=s(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=s(r)),e.headers)for(var o=0;o<e.headers.length;++o)i+=s(e.headers[o]);return e.procType&&(i+="\r\n"),i+=n.util.encode64(e.body,t.maxline||64)+"\r\n",i+="-----END "+e.type+"-----\r\n"},i.decode=function(e){for(var t,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,s=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,a=/\r?\n/;t=i.exec(e);){var c={type:t[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:n.util.decode64(t[3])};if(r.push(c),t[2]){for(var u=t[2].split(a),l=0;t&&l<u.length;){for(var h=u[l].replace(/\s+$/,""),p=l+1;p<u.length;++p){var f=u[p];if(!/\s/.test(f[0]))break;h+=f,l=p}if(t=h.match(s)){for(var d={name:t[1],values:[]},y=t[2].split(","),g=0;g<y.length;++g)d.values.push(o(y[g]));if(c.procType)if(c.contentDomain||"Content-Domain"!==d.name)if(c.dekInfo||"DEK-Info"!==d.name)c.headers.push(d);else{if(0===d.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');c.dekInfo={algorithm:y[0],parameters:y[1]||null}}else c.contentDomain=y[0]||"";else{if("Proc-Type"!==d.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==d.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');c.procType={version:y[0],type:y[1]}}}++l}if("ENCRYPTED"===c.procType&&!c.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}},function(e,t){e.exports=require("http")},function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("url")},function(e,t,r){var n=r(0);r(5),r(1),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,s={start:function(s,o){if(null!==s)if("string"==typeof s){if(!((s=s.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+s+'"');t=n.md.algorithms[s].create()}else t=s;if(null===o)o=e;else{if("string"==typeof o)o=n.util.createBuffer(o);else if(n.util.isArray(o)){var a=o;o=n.util.createBuffer();for(var c=0;c<a.length;++c)o.putByte(a[c])}var u=o.length();u>t.blockLength&&(t.start(),t.update(o.bytes()),o=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),u=o.length();for(c=0;c<u;++c){a=o.at(c);r.putByte(54^a),i.putByte(92^a)}if(u<t.blockLength)for(a=t.blockLength-u,c=0;c<a;++c)r.putByte(54),i.putByte(92);e=o,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()}};return s.digest=s.getMac,s}},function(e,t,r){var n=r(0);r(5),r(1);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){o||(s=String.fromCharCode(128),s+=n.util.fillString(String.fromCharCode(0),64),o=!0);var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,s=0;s<r;++s)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(s,o){"utf8"===o&&(s=n.util.encodeUtf8(s));var c=s.length;i.messageLength+=c,c=[c/4294967296>>>0,c>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=c[1],c[1]=c[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,c[0]=c[1]/4294967296>>>0;return t.putBytes(s),a(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var c,u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(s.substr(0,i.blockLength-u));for(var l=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)l+=(c=8*i.fullMessageLength[h+1])/4294967296>>>0,o.putInt32(l>>>0),l=c>>>0;o.putInt32(l);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};a(p,r,o);var f=n.util.createBuffer();return f.putInt32(p.h0),f.putInt32(p.h1),f.putInt32(p.h2),f.putInt32(p.h3),f.putInt32(p.h4),f},i};var s=null,o=!1;function a(e,t,r){for(var n,i,s,o,a,c,u,l=r.length();l>=64;){for(i=e.h0,s=e.h1,o=e.h2,a=e.h3,c=e.h4,u=0;u<16;++u)n=r.getInt32(),t[u]=n,n=(i<<5|i>>>27)+(a^s&(o^a))+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<20;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(i<<5|i>>>27)+(a^s&(o^a))+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<32;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(i<<5|i>>>27)+(s^o^a)+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<40;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(s^o^a)+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<60;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(s&o|a&(s^o))+c+2400959708+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<80;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(s^o^a)+c+3395469782+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+s|0,e.h2=e.h2+o|0,e.h3=e.h3+a|0,e.h4=e.h4+c|0,l-=64}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t,r,n){this.description=e,this.mablscript=t,this.url=r,this.selector=n}}},function(e,t,r){"use strict";var n=r(2),i=r(132),s=r(38),o={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:("undefined"!=typeof XMLHttpRequest?c=r(133):"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)&&(c=r(139)),c),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||t&&"application/json"===t["Content-Type"]?(a(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(t||JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||u.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw s(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){u.headers[e]=n.merge(o)})),e.exports=u},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t){e.exports=require("https")},function(e,t,r){"use strict";const n=r(9),i=r(83),s=r(29),o=r(30),a=n.Buffer,c=a.from([0,0,255,255]),u=a.from([0]),l=Symbol("write-in-progress"),h=Symbol("pending-close"),p=Symbol("total-length"),f=Symbol("callback"),d=Symbol("buffers"),y=Symbol("error"),g=Symbol("owner");let m;function v(e){this[d].push(e),this[p]+=e.length}function C(e){this[p]+=e.length,this[g]._maxPayload<1||this[p]<=this[g]._maxPayload?this[d].push(e):(this[y]=new Error("max payload size exceeded"),this[y].closeCode=1009,this.removeListener("data",C),this.reset())}function E(e){this[g]._inflate=null,this[f](e)}e.exports=class{constructor(e,t,r){if(this._maxPayload=0|r,this._options=e||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!m){const e=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;m=new i({concurrency:e})}}static get extensionName(){return"permessage-deflate"}offer(){const e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(e.client_max_window_bits=!0),e}accept(e){var t;return e=this.normalizeParams(e),t=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params=t,t}cleanup(){this._inflate&&(this._inflate[l]?this._inflate[h]=!0:(this._inflate.close(),this._inflate=null)),this._deflate&&(this._deflate[l]?this._deflate[h]=!0:(this._deflate.close(),this._deflate=null))}acceptAsServer(e){const t={};if(!e.some(e=>{if(!(!1===this._options.serverNoContextTakeover&&e.server_no_context_takeover||!1===this._options.serverMaxWindowBits&&e.server_max_window_bits||"number"==typeof this._options.serverMaxWindowBits&&"number"==typeof e.server_max_window_bits&&this._options.serverMaxWindowBits>e.server_max_window_bits||"number"==typeof this._options.clientMaxWindowBits&&!e.client_max_window_bits))return(this._options.serverNoContextTakeover||e.server_no_context_takeover)&&(t.server_no_context_takeover=!0),(this._options.clientNoContextTakeover||!1!==this._options.clientNoContextTakeover&&e.client_no_context_takeover)&&(t.client_no_context_takeover=!0),"number"==typeof this._options.serverMaxWindowBits?t.server_max_window_bits=this._options.serverMaxWindowBits:"number"==typeof e.server_max_window_bits&&(t.server_max_window_bits=e.server_max_window_bits),"number"==typeof this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:!1!==this._options.clientMaxWindowBits&&"number"==typeof e.client_max_window_bits&&(t.client_max_window_bits=e.client_max_window_bits),!0}))throw new Error("Doesn't support the offered configuration");return t}acceptAsClient(e){const t=e[0];if(!1===this._options.clientNoContextTakeover&&t.client_no_context_takeover)throw new Error('Invalid value for "client_no_context_takeover"');if("number"==typeof this._options.clientMaxWindowBits&&(!t.client_max_window_bits||t.client_max_window_bits>this._options.clientMaxWindowBits)||!1===this._options.clientMaxWindowBits&&t.client_max_window_bits)throw new Error('Invalid value for "client_max_window_bits"');return t}normalizeParams(e){return e.map(e=>(Object.keys(e).forEach(t=>{var r=e[t];if(r.length>1)throw new Error("Multiple extension parameters for "+t);switch(r=r[0],t){case"server_no_context_takeover":case"client_no_context_takeover":if(!0!==r)throw new Error(`invalid extension parameter value for ${t} (${r})`);e[t]=!0;break;case"server_max_window_bits":case"client_max_window_bits":if("string"==typeof r&&(r=parseInt(r,10),Number.isNaN(r)||r<s.Z_MIN_WINDOWBITS||r>s.Z_MAX_WINDOWBITS))throw new Error(`invalid extension parameter value for ${t} (${r})`);if(!this._isServer&&!0===r)throw new Error("Missing extension parameter value for "+t);e[t]=r;break;default:throw new Error(`Not defined extension parameter (${t})`)}}),e))}decompress(e,t,r){m.push(n=>{this._decompress(e,t,(e,t)=>{n(),r(e,t)})})}compress(e,t,r){m.push(n=>{this._compress(e,t,(e,t)=>{n(),r(e,t)})})}_decompress(e,t,r){const n=this._isServer?"client":"server";if(!this._inflate){const e=n+"_max_window_bits",t="number"!=typeof this.params[e]?s.Z_DEFAULT_WINDOWBITS:this.params[e];this._inflate=s.createInflateRaw({windowBits:t}),this._inflate[p]=0,this._inflate[d]=[],this._inflate[g]=this,this._inflate.on("error",E),this._inflate.on("data",C)}this._inflate[f]=r,this._inflate[l]=!0,this._inflate.write(e),t&&this._inflate.write(c),this._inflate.flush(()=>{const e=this._inflate[y];if(e)return this._inflate.close(),this._inflate=null,void r(e);const i=o.concat(this._inflate[d],this._inflate[p]);t&&this.params[n+"_no_context_takeover"]||this._inflate[h]?(this._inflate.close(),this._inflate=null):(this._inflate[l]=!1,this._inflate[p]=0,this._inflate[d]=[]),r(null,i)})}_compress(e,t,r){if(!e||0===e.length)return void process.nextTick(r,null,u);const n=this._isServer?"server":"client";if(!this._deflate){const e=n+"_max_window_bits",t="number"!=typeof this.params[e]?s.Z_DEFAULT_WINDOWBITS:this.params[e];this._deflate=s.createDeflateRaw({memLevel:this._options.memLevel,level:this._options.level,flush:s.Z_SYNC_FLUSH,windowBits:t}),this._deflate[p]=0,this._deflate[d]=[],this._deflate.on("data",v)}this._deflate[l]=!0,this._deflate.write(e),this._deflate.flush(s.Z_SYNC_FLUSH,()=>{var e=o.concat(this._deflate[d],this._deflate[p]);t&&(e=e.slice(0,e.length-4)),t&&this.params[n+"_no_context_takeover"]||this._deflate[h]?(this._deflate.close(),this._deflate=null):(this._deflate[l]=!1,this._deflate[p]=0,this._deflate[d]=[]),r(null,e)})}}},function(e,t,r){"use strict";const n=r(9).Buffer;t.BINARY_TYPES=["nodebuffer","arraybuffer","fragments"],t.GUID="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",t.EMPTY_BUFFER=n.alloc(0),t.NOOP=()=>{}},function(e,t,r){var n=r(0);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.des.Algorithm(e,t)}))}r(31),r(50),r(1),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return f(r._keys,e,t,!1)},decrypt:function(e,t){return f(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],s=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],o=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],a=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],c=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],f=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=e.length()>8?3:1,m=[],v=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],C=0,E=0;E<g;E++){var S=e.getInt32(),b=e.getInt32();S^=(t=252645135&(S>>>4^b))<<4,S^=t=65535&((b^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(b^=t<<-16)))<<2,S^=t=65535&((b^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(b^=t<<-16)))<<1,S^=t=16711935&((b^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(b^=t<<8)))<<1)<<8|(b^=t)>>>20&240,S=b<<24|b<<8&16711680|b>>>8&65280|b>>>24&240,b=t;for(var T=0;T<v.length;++T){v[T]?(S=S<<2|S>>>26,b=b<<2|b>>>26):(S=S<<1|S>>>27,b=b<<1|b>>>27);var _=r[(S&=-15)>>>28]|n[S>>>24&15]|i[S>>>20&15]|s[S>>>16&15]|o[S>>>12&15]|a[S>>>8&15]|c[S>>>4&15],A=u[(b&=-15)>>>28]|l[b>>>24&15]|h[b>>>20&15]|p[b>>>16&15]|f[b>>>12&15]|d[b>>>8&15]|y[b>>>4&15];t=65535&(A>>>16^_),m[C++]=_^t,m[C++]=A^t<<16}}return m}(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var s=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],o=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],a=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],u=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],h=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],p=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function f(e,t,r,n){var i,f,d=32===e.length?3:9;i=3===d?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],g=t[1];y^=(f=252645135&(y>>>4^g))<<4,y^=(f=65535&(y>>>16^(g^=f)))<<16,y^=f=858993459&((g^=f)>>>2^y),y^=f=16711935&((g^=f<<2)>>>8^y),y=(y^=(f=1431655765&(y>>>1^(g^=f<<8)))<<1)<<1|y>>>31,g=(g^=f)<<1|g>>>31;for(var m=0;m<d;m+=3){for(var v=i[m+1],C=i[m+2],E=i[m];E!=v;E+=C){var S=g^e[E],b=(g>>>4|g<<28)^e[E+1];f=y,y=g,g=f^(o[S>>>24&63]|c[S>>>16&63]|l[S>>>8&63]|p[63&S]|s[b>>>24&63]|a[b>>>16&63]|u[b>>>8&63]|h[63&b])}f=y,y=g,g=f}g=g>>>1|g<<31,g^=f=1431655765&((y=y>>>1|y<<31)>>>1^g),g^=(f=16711935&(g>>>8^(y^=f<<1)))<<8,g^=(f=858993459&(g>>>2^(y^=f)))<<2,g^=f=65535&((y^=f)>>>16^g),g^=f=252645135&((y^=f<<16)>>>4^g),y^=f<<4,r[0]=y,r[1]=g}function d(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var s=null;r instanceof n.util.ByteBuffer&&(s=r,r={}),(r=r||{}).output=s,r.iv=e,i.call(t,r)},t}},function(e,t,r){var n=r(0);if(r(4),r(24),r(7),r(57),r(58),r(3),r(1),void 0===i)var i=n.jsbn.BigInteger;var s=n.util.isNodejs?r(8):null,o=n.asn1,a=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var c=n.pki,u=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},h={name:"RSAPrivateKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},p={name:"RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},f=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d=function(e){var t;if(!(e.algorithm in c.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=c.oids[e.algorithm];var n=o.oidToDer(t).getBytes(),i=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),s=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]);s.value.push(o.create(o.Class.UNIVERSAL,o.Type.OID,!1,n)),s.value.push(o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,""));var a=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(s),i.value.push(a),o.toDer(i).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var s;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{s=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(s.compareTo(t.n)>=0||!s.gcd(t.n).equals(i.ONE));for(var o=(e=e.multiply(s.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),a=e.mod(t.q).modPow(t.dQ,t.q);o.compareTo(a)<0;)o=o.add(t.p);var c=o.subtract(a).multiply(t.qInv).mod(t.p).multiply(t.q).add(a);return c=c.multiply(s.modInverse(t.n)).mod(t.n)};function g(e,t,r){var i=n.util.createBuffer(),s=Math.ceil(t.n.bitLength()/8);if(e.length>s-11){var o=new Error("Message is too long for PKCS#1 v1.5 padding.");throw o.length=e.length,o.max=s-11,o}i.putByte(0),i.putByte(r);var a,c=s-3-e.length;if(0===r||1===r){a=0===r?0:255;for(var u=0;u<c;++u)i.putByte(a)}else for(;c>0;){var l=0,h=n.random.getBytes(c);for(u=0;u<c;++u)0===(a=h.charCodeAt(u))?++l:i.putByte(a);c=l}return i.putByte(0),i.putBytes(e),i}function m(e,t,r,i){var s=Math.ceil(t.n.bitLength()/8),o=n.util.createBuffer(e),a=o.getByte(),c=o.getByte();if(0!==a||r&&0!==c&&1!==c||!r&&2!=c||r&&0===c&&void 0===i)throw new Error("Encryption block is invalid.");var u=0;if(0===c){u=s-3-i;for(var l=0;l<u;++l)if(0!==o.getByte())throw new Error("Encryption block is invalid.")}else if(1===c)for(u=0;o.length()>1;){if(255!==o.getByte()){--o.read;break}++u}else if(2===c)for(u=0;o.length()>1;){if(0===o.getByte()){--o.read;break}++u}if(0!==o.getByte()||u!==s-3-o.length())throw new Error("Encryption block is invalid.");return o.getBytes()}function v(e,t,r){"function"==typeof t&&(r=t,t={});var s={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function o(){a(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?u(t,e.q):void a(e.qBits,u))}))}function a(e,t){n.prime.generateProbablePrime(e,s,t)}function u(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var s=e.p;e.p=e.q,e.q=s}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void o();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void a(e.qBits,u);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void o();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void a(e.qBits,u);var l=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(s.prng=t.prng),o()}function C(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function E(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function S(e){return n.util.isNodejs&&"function"==typeof s[e]}function b(e){return void 0!==a.globalScope&&"object"==typeof a.globalScope.crypto&&"object"==typeof a.globalScope.crypto.subtle&&"function"==typeof a.globalScope.crypto.subtle[e]}function T(e){return void 0!==a.globalScope&&"object"==typeof a.globalScope.msCrypto&&"object"==typeof a.globalScope.msCrypto.subtle&&"function"==typeof a.globalScope.msCrypto.subtle[e]}function _(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}c.rsa.encrypt=function(e,t,r){var s,o=r,a=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(o=2===r,s=g(e,t,r)):(s=n.util.createBuffer()).putBytes(e);for(var c=new i(s.toHex(),16),u=y(c,t,o).toString(16),l=n.util.createBuffer(),h=a-Math.ceil(u.length/2);h>0;)l.putByte(0),--h;return l.putBytes(n.util.hexToBytes(u)),l.getBytes()},c.rsa.decrypt=function(e,t,r,s){var o=Math.ceil(t.n.bitLength()/8);if(e.length!==o){var a=new Error("Encrypted message length is invalid.");throw a.length=e.length,a.expected=o,a}var c=new i(n.util.createBuffer(e).toHex(),16);if(c.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var u=y(c,t,r).toString(16),l=n.util.createBuffer(),h=o-Math.ceil(u.length/2);h>0;)l.putByte(0),--h;return l.putBytes(n.util.hexToBytes(u)),!1!==s?m(l.getBytes(),t,r):l.getBytes()},c.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var s,o=(r=r||{}).prng||n.random,a={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},c=r.algorithm||"PRIMEINC";if("PRIMEINC"!==c)throw new Error("Invalid key generation algorithm: "+c);return(s={algorithm:c,state:0,bits:e,rng:a,eInt:t||65537,e:new i(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(s.eInt),s},c.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,s=0,o=function(e,t){return e|t},a=+new Date,l=0;null===e.keys&&(t<=0||l<t);){if(0===e.state){var h=null===e.p?e.pBits:e.qBits,p=h-1;0===e.pqState?(e.num=new i(h,e.rng),e.num.testBit(p)||e.num.bitwiseTo(i.ONE.shiftLeft(p),o,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),s=0,++e.pqState):1===e.pqState?e.num.bitLength()>h?e.pqState=0:e.num.isProbablePrime(E(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(u[s++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var f=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,f,e.p,e.q,f.mod(e.p1),f.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)}}l+=(n=+new Date)-a,a=n}return null!==e.keys},c.rsa.generateKeyPair=function(e,t,r,i){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(i=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(i=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,i=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(i=r,r=void 0):(i=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(i){if(S("generateKeyPair"))return s.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return i(e);i(null,{privateKey:c.privateKeyFromPem(r),publicKey:c.publicKeyFromPem(t)})}));if(b("generateKey")&&b("exportKey"))return a.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:_(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return a.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){i(e)})).then((function(e){if(e){var t=c.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(e)));i(null,{privateKey:t,publicKey:c.setRsaPublicKey(t.n,t.e)})}}));if(T("generateKey")&&T("exportKey")){var u=a.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:_(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return u.oncomplete=function(e){var t=e.target.result,r=a.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=c.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(t)));i(null,{privateKey:r,publicKey:c.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){i(e)}},void(u.onerror=function(e){i(e)})}}else if(S("generateKeyPairSync")){var l=s.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:c.privateKeyFromPem(l.privateKey),publicKey:c.publicKeyFromPem(l.publicKey)}}var h=c.rsa.createKeyPairGenerationState(e,t,r);if(!i)return c.rsa.stepKeyPairGenerationState(h,0),h.keys;v(h,r,i)},c.setRsaPublicKey=c.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return g(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var s=t.encode(e,r,!0);return c.rsa.encrypt(s,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=m(t,r,!0),e===o.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=m(t,r,!0))}});var i=c.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},c.setRsaPrivateKey=c.rsa.setPrivateKey=function(e,t,r,i,s,o,a,u){var l={n:e,e:t,d:r,p:i,q:s,dP:o,dQ:a,qInv:u,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=c.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:m};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,l,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:d},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,l.n.bitLength());return c.rsa.encrypt(n,l,r)}};return l},c.wrapRsaPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(c.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(e).getBytes())])},c.privateKeyFromAsn1=function(e){var t,r,s,a,u,p,f,d,y={},g=[];if(o.validate(e,l,y,g)&&(e=o.fromDer(n.util.createBuffer(y.privateKey))),y={},g=[],!o.validate(e,h,y,g)){var m=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw m.errors=g,m}return t=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),s=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),a=n.util.createBuffer(y.privateKeyPrime1).toHex(),u=n.util.createBuffer(y.privateKeyPrime2).toHex(),p=n.util.createBuffer(y.privateKeyExponent1).toHex(),f=n.util.createBuffer(y.privateKeyExponent2).toHex(),d=n.util.createBuffer(y.privateKeyCoefficient).toHex(),c.setRsaPrivateKey(new i(t,16),new i(r,16),new i(s,16),new i(a,16),new i(u,16),new i(p,16),new i(f,16),new i(d,16))},c.privateKeyToAsn1=c.privateKeyToRSAPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,C(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,C(e.e)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,C(e.d)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,C(e.p)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,C(e.q)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,C(e.dP)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,C(e.dQ)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,C(e.qInv))])},c.publicKeyFromAsn1=function(e){var t={},r=[];if(o.validate(e,f,t,r)){var s,a=o.derToOid(t.publicKeyOid);if(a!==c.oids.rsaEncryption)throw(s=new Error("Cannot read public key. Unknown OID.")).oid=a,s;e=t.rsaPublicKey}if(r=[],!o.validate(e,p,t,r))throw(s=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,s;var u=n.util.createBuffer(t.publicKeyModulus).toHex(),l=n.util.createBuffer(t.publicKeyExponent).toHex();return c.setRsaPublicKey(new i(u,16),new i(l,16))},c.publicKeyToAsn1=c.publicKeyToSubjectPublicKeyInfo=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(c.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,[c.publicKeyToRSAPublicKey(e)])])},c.publicKeyToRSAPublicKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,C(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,C(e.e))])}},function(e,t,r){var n,i=r(0);e.exports=i.jsbn=i.jsbn||{};function s(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function o(){return new s(null)}function a(e,t,r,n,i,s){for(var o=16383&t,a=t>>14;--s>=0;){var c=16383&this.data[e],u=this.data[e++]>>14,l=a*c+u*o;i=((c=o*c+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+a*u,r.data[n++]=268435455&c}return i}i.jsbn.BigInteger=s,"undefined"==typeof navigator?(s.prototype.am=a,n=28):"Microsoft Internet Explorer"==navigator.appName?(s.prototype.am=function(e,t,r,n,i,s){for(var o=32767&t,a=t>>15;--s>=0;){var c=32767&this.data[e],u=this.data[e++]>>15,l=a*c+u*o;i=((c=o*c+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+a*u+(i>>>30),r.data[n++]=1073741823&c}return i},n=30):"Netscape"!=navigator.appName?(s.prototype.am=function(e,t,r,n,i,s){for(;--s>=0;){var o=t*this.data[e++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=67108863&o}return i},n=26):(s.prototype.am=a,n=28),s.prototype.DB=n,s.prototype.DM=(1<<n)-1,s.prototype.DV=1<<n;s.prototype.FV=Math.pow(2,52),s.prototype.F1=52-n,s.prototype.F2=2*n-52;var c,u,l=new Array;for(c="0".charCodeAt(0),u=0;u<=9;++u)l[c++]=u;for(c="a".charCodeAt(0),u=10;u<36;++u)l[c++]=u;for(c="A".charCodeAt(0),u=10;u<36;++u)l[c++]=u;function h(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function p(e,t){var r=l[e.charCodeAt(t)];return null==r?-1:r}function f(e){var t=o();return t.fromInt(e),t}function d(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function g(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function m(e,t){return e&t}function v(e,t){return e|t}function C(e,t){return e^t}function E(e,t){return e&~t}function S(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function b(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function T(){}function _(e){return e}function A(e){this.r2=o(),this.q3=o(),s.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},g.prototype.convert=function(e){var t=o();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(s.ZERO)>0&&this.m.subTo(t,t),t},g.prototype.revert=function(e){var t=o();return e.copyTo(t),this.reduce(t),t},g.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},g.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},g.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},s.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},s.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},s.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,o=0;--n>=0;){var a=8==r?255&e[n]:p(e,n);a<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this.data[this.t++]=a:o+r>this.DB?(this.data[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this.data[this.t++]=a>>this.DB-o):this.data[this.t-1]|=a<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this.data[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&s.ZERO.subTo(this,this)},s.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},s.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},s.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s},s.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,s=(1<<i)-1,o=Math.floor(e/this.DB),a=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+o+1]=this.data[r]>>i|a,a=(this.data[r]&s)<<n;for(r=o-1;r>=0;--r)t.data[r]=0;t.data[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()},s.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,s=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var o=r+1;o<this.t;++o)t.data[o-r-1]|=(this.data[o]&s)<<i,t.data[o-r]=this.data[o]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&s)<<i),t.t=this.t-r,t.clamp()}},s.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},s.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&s.ZERO.subTo(t,t)},s.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},s.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=o());var a=o(),c=this.s,u=e.s,l=this.DB-d(n.data[n.t-1]);l>0?(n.lShiftTo(l,a),i.lShiftTo(l,r)):(n.copyTo(a),i.copyTo(r));var h=a.t,p=a.data[h-1];if(0!=p){var f=p*(1<<this.F1)+(h>1?a.data[h-2]>>this.F2:0),y=this.FV/f,g=(1<<this.F1)/f,m=1<<this.F2,v=r.t,C=v-h,E=null==t?o():t;for(a.dlShiftTo(C,E),r.compareTo(E)>=0&&(r.data[r.t++]=1,r.subTo(E,r)),s.ONE.dlShiftTo(h,E),E.subTo(a,a);a.t<h;)a.data[a.t++]=0;for(;--C>=0;){var S=r.data[--v]==p?this.DM:Math.floor(r.data[v]*y+(r.data[v-1]+m)*g);if((r.data[v]+=a.am(0,S,r,C,0,h))<S)for(a.dlShiftTo(C,E),r.subTo(E,r);r.data[v]<--S;)r.subTo(E,r)}null!=t&&(r.drShiftTo(h,t),c!=u&&s.ZERO.subTo(t,t)),r.t=h,r.clamp(),l>0&&r.rShiftTo(l,r),c<0&&s.ZERO.subTo(r,r)}}},s.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},s.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},s.prototype.exp=function(e,t){if(e>4294967295||e<1)return s.ONE;var r=o(),n=o(),i=t.convert(this),a=d(e)-1;for(i.copyTo(r);--a>=0;)if(t.sqrTo(r,n),(e&1<<a)>0)t.mulTo(n,i,r);else{var c=r;r=n,n=c}return t.revert(r)},s.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,s="",o=this.t,a=this.DB-o*this.DB%t;if(o-- >0)for(a<this.DB&&(r=this.data[o]>>a)>0&&(i=!0,s=h(r));o>=0;)a<t?(r=(this.data[o]&(1<<a)-1)<<t-a,r|=this.data[--o]>>(a+=this.DB-t)):(r=this.data[o]>>(a-=t)&n,a<=0&&(a+=this.DB,--o)),r>0&&(i=!0),i&&(s+=h(r));return i?s:"0"},s.prototype.negate=function(){var e=o();return s.ZERO.subTo(this,e),e},s.prototype.abs=function(){return this.s<0?this.negate():this},s.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},s.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},s.prototype.mod=function(e){var t=o();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(s.ZERO)>0&&e.subTo(t,t),t},s.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new g(t),this.exp(e,r)},s.ZERO=f(0),s.ONE=f(1),T.prototype.convert=_,T.prototype.revert=_,T.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},T.prototype.sqrTo=function(e,t){e.squareTo(t)},A.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=o();return e.copyTo(t),this.reduce(t),t},A.prototype.revert=function(e){return e},A.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},A.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},A.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var I=[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],B=(1<<26)/I[I.length-1];s.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},s.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=f(r),i=o(),s=o(),a="";for(this.divRemTo(n,i,s);i.signum()>0;)a=(r+s.intValue()).toString(e).substr(1)+a,i.divRemTo(n,i,s);return s.intValue().toString(e)+a},s.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,o=0,a=0,c=0;c<e.length;++c){var u=p(e,c);u<0?"-"==e.charAt(c)&&0==this.signum()&&(i=!0):(a=t*a+u,++o>=r&&(this.dMultiply(n),this.dAddOffset(a,0),o=0,a=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(a,0)),i&&s.ZERO.subTo(this,this)},s.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(s.ONE.shiftLeft(e-1),v,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(s.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},s.prototype.bitwiseTo=function(e,t,r){var n,i,s=Math.min(e.t,this.t);for(n=0;n<s;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=s;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=s;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},s.prototype.changeBit=function(e,t){var r=s.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},s.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},s.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},s.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},s.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i<n;++i)r.data[i+this.t]=this.am(0,e.data[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e.data[i],r,i,0,t-i);r.clamp()},s.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},s.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},s.prototype.millerRabin=function(e){var t=this.subtract(s.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),o={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},a=0;a<e;++a){do{n=new s(this.bitLength(),o)}while(n.compareTo(s.ONE)<=0||n.compareTo(t)>=0);var c=n.modPow(i,this);if(0!=c.compareTo(s.ONE)&&0!=c.compareTo(t)){for(var u=1;u++<r&&0!=c.compareTo(t);)if(0==(c=c.modPowInt(2,this)).compareTo(s.ONE))return!1;if(0!=c.compareTo(t))return!1}}return!0},s.prototype.clone=function(){var e=o();return this.copyTo(e),e},s.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},s.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},s.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},s.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},s.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},s.prototype.equals=function(e){return 0==this.compareTo(e)},s.prototype.min=function(e){return this.compareTo(e)<0?this:e},s.prototype.max=function(e){return this.compareTo(e)>0?this:e},s.prototype.and=function(e){var t=o();return this.bitwiseTo(e,m,t),t},s.prototype.or=function(e){var t=o();return this.bitwiseTo(e,v,t),t},s.prototype.xor=function(e){var t=o();return this.bitwiseTo(e,C,t),t},s.prototype.andNot=function(e){var t=o();return this.bitwiseTo(e,E,t),t},s.prototype.not=function(){for(var e=o(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},s.prototype.shiftLeft=function(e){var t=o();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},s.prototype.shiftRight=function(e){var t=o();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},s.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+S(this.data[e]);return this.s<0?this.t*this.DB:-1},s.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=b(this.data[r]^t);return e},s.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this.data[t]&1<<e%this.DB)},s.prototype.setBit=function(e){return this.changeBit(e,v)},s.prototype.clearBit=function(e){return this.changeBit(e,E)},s.prototype.flipBit=function(e){return this.changeBit(e,C)},s.prototype.add=function(e){var t=o();return this.addTo(e,t),t},s.prototype.subtract=function(e){var t=o();return this.subTo(e,t),t},s.prototype.multiply=function(e){var t=o();return this.multiplyTo(e,t),t},s.prototype.divide=function(e){var t=o();return this.divRemTo(e,t,null),t},s.prototype.remainder=function(e){var t=o();return this.divRemTo(e,null,t),t},s.prototype.divideAndRemainder=function(e){var t=o(),r=o();return this.divRemTo(e,t,r),new Array(t,r)},s.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),s=f(1);if(i<=0)return s;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new y(t):t.isEven()?new A(t):new g(t);var a=new Array,c=3,u=r-1,l=(1<<r)-1;if(a[1]=n.convert(this),r>1){var h=o();for(n.sqrTo(a[1],h);c<=l;)a[c]=o(),n.mulTo(h,a[c-2],a[c]),c+=2}var p,m,v=e.t-1,C=!0,E=o();for(i=d(e.data[v])-1;v>=0;){for(i>=u?p=e.data[v]>>i-u&l:(p=(e.data[v]&(1<<i+1)-1)<<u-i,v>0&&(p|=e.data[v-1]>>this.DB+i-u)),c=r;0==(1&p);)p>>=1,--c;if((i-=c)<0&&(i+=this.DB,--v),C)a[p].copyTo(s),C=!1;else{for(;c>1;)n.sqrTo(s,E),n.sqrTo(E,s),c-=2;c>0?n.sqrTo(s,E):(m=s,s=E,E=m),n.mulTo(E,a[p],s)}for(;v>=0&&0==(e.data[v]&1<<i);)n.sqrTo(s,E),m=s,s=E,E=m,--i<0&&(i=this.DB-1,--v)}return n.revert(s)},s.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return s.ZERO;for(var r=e.clone(),n=this.clone(),i=f(1),o=f(0),a=f(0),c=f(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),t?(a.isEven()&&c.isEven()||(a.addTo(this,a),c.subTo(e,c)),a.rShiftTo(1,a)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(a,i),o.subTo(c,o)):(n.subTo(r,n),t&&a.subTo(i,a),c.subTo(o,c))}return 0!=n.compareTo(s.ONE)?s.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c},s.prototype.pow=function(e){return this.exp(e,new T)},s.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)return t;for(i<s&&(s=i),s>0&&(t.rShiftTo(s,t),r.rShiftTo(s,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r},s.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=I[I.length-1]){for(t=0;t<I.length;++t)if(r.data[0]==I[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<I.length;){for(var n=I[t],i=t+1;i<I.length&&n<B;)n*=I[i++];for(n=r.modInt(n);t<i;)if(n%I[t++]==0)return!1}return r.millerRabin(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compactWhitespace=t.normalizeText=t.escapeMablscriptString=t.toMablscriptToken=void 0;function n(e){return e.replace(/[ \t\xA0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\n\x0B\f\r\x85\u2028\u2029]+/g," ").trim()}t.toMablscriptToken=function e(t){if("string"==typeof t)return`"${t}"`;if(Array.isArray(t))return`[ ${t.join()} ]`;if("object"==typeof t){let r="";return Object.keys(t).forEach(n=>{r.length&&(r+=", "),r+=`${n}: ${e(t[n])}`}),`{ ${r} }`}return t.toString()},t.escapeMablscriptString=function(e){return e.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/"/g,'\\"').replace(/\r/g,"")},t.normalizeText=function(e){const t=n(e);return t?t.substring(0,300):t},t.compactWhitespace=n},function(e,t){e.exports=require("util")},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("events")},function(e,t){e.exports=require("zlib")},function(e,t,r){"use strict";const n=r(9).Buffer,i=(e,t)=>{const r=n.allocUnsafe(t);for(var i=0,s=0;s<e.length;s++){const t=e[s];t.copy(r,i),i+=t.length}return r};try{const t=r(!function(){var e=new Error("Cannot find module 'bufferutil'");throw e.code="MODULE_NOT_FOUND",e}());e.exports=Object.assign({concat:i},t.BufferUtil||t)}catch(t){const r=(e,t,r,n,i)=>{for(var s=0;s<i;s++)r[n+s]=e[s]^t[3&s]},n=(e,t)=>{const r=e.length;for(var n=0;n<r;n++)e[n]^=t[3&n]};e.exports={concat:i,mask:r,unmask:n}}},function(e,t,r){var n=r(0);r(1),e.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[e]:null};var i=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},function(e,t,r){var n=r(0);r(5),r(1);var i=e.exports=n.md5=n.md5||{};n.md.md5=n.md.algorithms.md5=i,i.create=function(){u||function(){s=String.fromCharCode(128),s+=n.util.fillString(String.fromCharCode(0),64),o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],a=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],c=new Array(64);for(var e=0;e<64;++e)c[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));u=!0}();var e=null,t=n.util.createBuffer(),r=new Array(16),i={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,s=0;s<r;++s)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},i}};return i.start(),i.update=function(s,o){"utf8"===o&&(s=n.util.encodeUtf8(s));var a=s.length;i.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=a[1],a[1]=a[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,a[0]=a[1]/4294967296>>>0;return t.putBytes(s),l(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var a=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(s.substr(0,i.blockLength-a));for(var c,u=0,h=i.fullMessageLength.length-1;h>=0;--h)u=(c=8*i.fullMessageLength[h]+u)/4294967296>>>0,o.putInt32Le(c>>>0);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};l(p,r,o);var f=n.util.createBuffer();return f.putInt32Le(p.h0),f.putInt32Le(p.h1),f.putInt32Le(p.h2),f.putInt32Le(p.h3),f},i};var s=null,o=null,a=null,c=null,u=!1;function l(e,t,r){for(var n,i,s,u,l,h,p,f=r.length();f>=64;){for(i=e.h0,s=e.h1,u=e.h2,l=e.h3,p=0;p<16;++p)t[p]=r.getInt32Le(),n=i+(l^s&(u^l))+c[p]+t[p],i=l,l=u,u=s,s+=n<<(h=a[p])|n>>>32-h;for(;p<32;++p)n=i+(u^l&(s^u))+c[p]+t[o[p]],i=l,l=u,u=s,s+=n<<(h=a[p])|n>>>32-h;for(;p<48;++p)n=i+(s^u^l)+c[p]+t[o[p]],i=l,l=u,u=s,s+=n<<(h=a[p])|n>>>32-h;for(;p<64;++p)n=i+(u^(s|~l))+c[p]+t[o[p]],i=l,l=u,u=s,s+=n<<(h=a[p])|n>>>32-h;e.h0=e.h0+i|0,e.h1=e.h1+s|0,e.h2=e.h2+u|0,e.h3=e.h3+l|0,f-=64}}},function(e,t,r){var n=r(0);r(14),r(5),r(1);var i,s=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(i=r(8)),e.exports=n.pbkdf2=s.pbkdf2=function(e,t,r,s,o,a){if("function"==typeof o&&(a=o,o=null),n.util.isNodejs&&!n.options.usePureJavaScript&&i.pbkdf2&&(null===o||"object"!=typeof o)&&(i.pbkdf2Sync.length>4||!o||"sha1"===o))return"string"!=typeof o&&(o="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),a?4===i.pbkdf2Sync.length?i.pbkdf2(e,t,r,s,(function(e,t){if(e)return a(e);a(null,t.toString("binary"))})):i.pbkdf2(e,t,r,s,o,(function(e,t){if(e)return a(e);a(null,t.toString("binary"))})):4===i.pbkdf2Sync.length?i.pbkdf2Sync(e,t,r,s).toString("binary"):i.pbkdf2Sync(e,t,r,s,o).toString("binary");if(null==o&&(o="sha1"),"string"==typeof o){if(!(o in n.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=n.md[o].create()}var c=o.digestLength;if(s>4294967295*c){var u=new Error("Derived key is too long.");if(a)return a(u);throw u}var l=Math.ceil(s/c),h=s-(l-1)*c,p=n.hmac.create();p.start(o,e);var f,d,y,g="";if(!a){for(var m=1;m<=l;++m){p.start(null,null),p.update(t),p.update(n.util.int32ToBytes(m)),f=y=p.digest().getBytes();for(var v=2;v<=r;++v)p.start(null,null),p.update(y),d=p.digest().getBytes(),f=n.util.xorBytes(f,d,c),y=d;g+=m<l?f:f.substr(0,h)}return g}m=1;function C(){if(m>l)return a(null,g);p.start(null,null),p.update(t),p.update(n.util.int32ToBytes(m)),f=y=p.digest().getBytes(),v=2,E()}function E(){if(v<=r)return p.start(null,null),p.update(y),d=p.digest().getBytes(),f=n.util.xorBytes(f,d,c),y=d,++v,n.util.setImmediate(E);g+=m<l?f:f.substr(0,h),++m,C()}C()}},function(e,t,r){var n=r(0);r(6),r(4),r(22),r(5),r(92),r(7),r(10),r(35),r(23),r(1);var i=n.asn1,s=e.exports=n.pki=n.pki||{},o=s.oids,a={};a.CN=o.commonName,a.commonName="CN",a.C=o.countryName,a.countryName="C",a.L=o.localityName,a.localityName="L",a.ST=o.stateOrProvinceName,a.stateOrProvinceName="ST",a.O=o.organizationName,a.organizationName="O",a.OU=o.organizationalUnitName,a.organizationalUnitName="OU",a.E=o.emailAddress,a.emailAddress="E";var c=n.pki.rsa.publicKeyValidator,u={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},c,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},l={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},h={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},c,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},p={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[h,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function f(e,t){"string"==typeof t&&(t={shortName:t});for(var r,n=null,i=0;null===n&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}s.RDNAttributesAsArray=function(e,t){for(var r,n,s,c=[],u=0;u<e.value.length;++u){r=e.value[u];for(var l=0;l<r.value.length;++l)s={},n=r.value[l],s.type=i.derToOid(n.value[0].value),s.value=n.value[1].value,s.valueTagClass=n.value[1].type,s.type in o&&(s.name=o[s.type],s.name in a&&(s.shortName=a[s.name])),t&&(t.update(s.type),t.update(s.value)),c.push(s)}return c},s.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var n=e[r],c=i.derToOid(n.value[0].value),u=n.value[1].value,l=0;l<u.length;++l){var h={};if(h.type=c,h.value=u[l].value,h.valueTagClass=u[l].type,h.type in o&&(h.name=o[h.type],h.name in a&&(h.shortName=a[h.name])),h.type===o.extensionRequest){h.extensions=[];for(var p=0;p<h.value.length;++p)h.extensions.push(s.certificateExtensionFromAsn1(h.value[p]))}t.push(h)}return t};var d=function(e,t,r){var n={};if(e!==o["RSASSA-PSS"])return n;r&&(n={hash:{algorithmOid:o.sha1},mgf:{algorithmOid:o.mgf1,hash:{algorithmOid:o.sha1}},saltLength:20});var s={},a=[];if(!i.validate(t,l,s,a)){var c=new Error("Cannot read RSASSA-PSS parameter block.");throw c.errors=a,c}return void 0!==s.hashOid&&(n.hash=n.hash||{},n.hash.algorithmOid=i.derToOid(s.hashOid)),void 0!==s.maskGenOid&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=i.derToOid(s.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=i.derToOid(s.maskGenHashOid)),void 0!==s.saltLength&&(n.saltLength=s.saltLength.charCodeAt(0)),n};function y(e){for(var t,r,s=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),o=e.attributes,a=0;a<o.length;++a){var c=(t=o[a]).value,u=i.Type.PRINTABLESTRING;"valueTagClass"in t&&(u=t.valueTagClass)===i.Type.UTF8&&(c=n.util.encodeUtf8(c)),r=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),i.create(i.Class.UNIVERSAL,u,!1,c)])]),s.value.push(r)}return s}function g(e){for(var t,r=0;r<e.length;++r){if(void 0===(t=e[r]).name&&(t.type&&t.type in s.oids?t.name=s.oids[t.type]:t.shortName&&t.shortName in a&&(t.name=s.oids[a[t.shortName]])),void 0===t.type){if(!t.name||!(t.name in s.oids))throw(c=new Error("Attribute type not specified.")).attribute=t,c;t.type=s.oids[t.name]}if(void 0===t.shortName&&t.name&&t.name in a&&(t.shortName=a[t.name]),t.type===o.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=i.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var n=0;n<t.extensions.length;++n)t.value.push(s.certificateExtensionToAsn1(m(t.extensions[n])))}var c;if(void 0===t.value)throw(c=new Error("Attribute value not specified.")).attribute=t,c}}function m(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in s.oids&&(e.name=s.oids[e.id]),void 0===e.id){if(!e.name||!(e.name in s.oids))throw(S=new Error("Extension ID not specified.")).extension=e,S;e.id=s.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var r=0,a=0,c=0;e.digitalSignature&&(a|=128,r=7),e.nonRepudiation&&(a|=64,r=6),e.keyEncipherment&&(a|=32,r=5),e.dataEncipherment&&(a|=16,r=4),e.keyAgreement&&(a|=8,r=3),e.keyCertSign&&(a|=4,r=2),e.cRLSign&&(a|=2,r=1),e.encipherOnly&&(a|=1,r=0),e.decipherOnly&&(c|=128,r=7);var u=String.fromCharCode(r);0!==c?u+=String.fromCharCode(a)+String.fromCharCode(c):0!==a&&(u+=String.fromCharCode(a)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,u)}else if("basicConstraints"===e.name)e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var l=e.value.value;for(var h in e)!0===e[h]&&(h in o?l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o[h]).getBytes())):-1!==h.indexOf(".")&&l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(h).getBytes())))}else if("nsCertType"===e.name){r=0,a=0;e.client&&(a|=128,r=7),e.server&&(a|=64,r=6),e.email&&(a|=32,r=5),e.objsign&&(a|=16,r=4),e.reserved&&(a|=8,r=3),e.sslCA&&(a|=4,r=2),e.emailCA&&(a|=2,r=1),e.objCA&&(a|=1,r=0);u=String.fromCharCode(r);0!==a&&(u+=String.fromCharCode(a)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,u)}else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var p=0;p<e.altNames.length;++p){u=(v=e.altNames[p]).value;if(7===v.type&&v.ip){if(null===(u=n.util.bytesFromIP(v.ip)))throw(S=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,S}else 8===v.type&&(u=v.oid?i.oidToDer(i.oidToDer(v.oid)):i.oidToDer(u));e.value.value.push(i.create(i.Class.CONTEXT_SPECIFIC,v.type,!1,u))}}else if("nsComment"===e.name&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var f=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=f.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,f.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;if(e.keyIdentifier){var d=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var g=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[y(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,g))}if(e.serialNumber){var m=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,m))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;var v,C=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),E=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(p=0;p<e.altNames.length;++p){u=(v=e.altNames[p]).value;if(7===v.type&&v.ip){if(null===(u=n.util.bytesFromIP(v.ip)))throw(S=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,S}else 8===v.type&&(u=v.oid?i.oidToDer(i.oidToDer(v.oid)):i.oidToDer(u));E.value.push(i.create(i.Class.CONTEXT_SPECIFIC,v.type,!1,u))}C.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[E])),l.push(C)}var S;if(void 0===e.value)throw(S=new Error("Extension value not specified.")).extension=e,S;return e}function v(e,t){switch(e){case o["RSASSA-PSS"]:var r=[];return void 0!==t.hash.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.saltLength).getBytes())])),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,r);default:return i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")}}function C(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,s=0;s<r.length;++s){var o=r[s],a=o.value,c=i.Type.UTF8;"valueTagClass"in o&&(c=o.valueTagClass),c===i.Type.UTF8&&(a=n.util.encodeUtf8(a));var u=!1;"valueConstructed"in o&&(u=o.valueConstructed);var l=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,c,u,a)])]);t.value.push(l)}return t}s.certificateFromPem=function(e,t,r){var o=n.pem.decode(e)[0];if("CERTIFICATE"!==o.type&&"X509 CERTIFICATE"!==o.type&&"TRUSTED CERTIFICATE"!==o.type){var a=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw a.headerType=o.type,a}if(o.procType&&"ENCRYPTED"===o.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var c=i.fromDer(o.body,r);return s.certificateFromAsn1(c,t)},s.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:i.toDer(s.certificateToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},s.publicKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PUBLIC KEY"!==t.type&&"RSA PUBLIC KEY"!==t.type){var r=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var o=i.fromDer(t.body);return s.publicKeyFromAsn1(o)},s.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:i.toDer(s.publicKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},s.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:i.toDer(s.publicKeyToRSAPublicKey(e)).getBytes()};return n.pem.encode(r,{maxline:t})},s.getPublicKeyFingerprint=function(e,t){var r,o=(t=t||{}).md||n.md.sha1.create();switch(t.type||"RSAPublicKey"){case"RSAPublicKey":r=i.toDer(s.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":r=i.toDer(s.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}o.start(),o.update(r);var a=o.digest();if("hex"===t.encoding){var c=a.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if("binary"===t.encoding)return a.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return a},s.certificationRequestFromPem=function(e,t,r){var o=n.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==o.type){var a=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw a.headerType=o.type,a}if(o.procType&&"ENCRYPTED"===o.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var c=i.fromDer(o.body,r);return s.certificationRequestFromAsn1(c,t)},s.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:i.toDer(s.certificationRequestToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},s.createCertificate=function(){var e={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return f(e.issuer,t)},e.issuer.addField=function(t){g([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return f(e.subject,t)},e.subject.addField=function(t){g([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){g(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){g(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)m(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){"string"==typeof t&&(t={name:t});for(var r,n=null,i=0;null===n&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(t,r){e.md=r||n.md.sha1.create();var a=o[e.md.algorithm+"WithRSAEncryption"];if(!a){var c=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw c.algorithm=e.md.algorithm,c}e.signatureOid=e.siginfo.algorithmOid=a,e.tbsCertificate=s.getTBSCertificate(e);var u=i.toDer(e.tbsCertificate);e.md.update(u.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var a=t.issuer,c=e.subject;throw(y=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.")).expectedIssuer=a.attributes,y.actualIssuer=c.attributes,y}var u=t.md;if(null===u){if(t.signatureOid in o)switch(o[t.signatureOid]){case"sha1WithRSAEncryption":u=n.md.sha1.create();break;case"md5WithRSAEncryption":u=n.md.md5.create();break;case"sha256WithRSAEncryption":u=n.md.sha256.create();break;case"sha384WithRSAEncryption":u=n.md.sha384.create();break;case"sha512WithRSAEncryption":u=n.md.sha512.create();break;case"RSASSA-PSS":u=n.md.sha256.create()}if(null===u)throw(y=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=t.signatureOid,y;var l=t.tbsCertificate||s.getTBSCertificate(t),h=i.toDer(l);u.update(h.getBytes())}if(null!==u){var p;switch(t.signatureOid){case o.sha1WithRSAEncryption:p=void 0;break;case o["RSASSA-PSS"]:var f,d,y;if(void 0===(f=o[t.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[f])throw(y=new Error("Unsupported MGF hash function.")).oid=t.signatureParameters.mgf.hash.algorithmOid,y.name=f,y;if(void 0===(d=o[t.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[d])throw(y=new Error("Unsupported MGF function.")).oid=t.signatureParameters.mgf.algorithmOid,y.name=d,y;if(d=n.mgf[d].create(n.md[f].create()),void 0===(f=o[t.signatureParameters.hash.algorithmOid])||void 0===n.md[f])throw{message:"Unsupported RSASSA-PSS hash function.",oid:t.signatureParameters.hash.algorithmOid,name:f};p=n.pss.create(n.md[f].create(),d,t.signatureParameters.saltLength)}r=e.publicKey.verify(u.digest().getBytes(),t.signature,p)}return r},e.isIssuer=function(t){var r=!1,n=e.issuer,i=t.subject;if(n.hash&&i.hash)r=n.hash===i.hash;else if(n.attributes.length===i.attributes.length){var s,o;r=!0;for(var a=0;r&&a<n.attributes.length;++a)s=n.attributes[a],o=i.attributes[a],s.type===o.type&&s.value===o.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return s.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=o.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var i=e.extensions[r];if(i.id===t){var s=e.generateSubjectKeyIdentifier().getBytes();return n.util.hexToBytes(i.subjectKeyIdentifier)===s}}return!1},e},s.certificateFromAsn1=function(e,t){var r={},a=[];if(!i.validate(e,u,r,a))throw(p=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=a,p;if(i.derToOid(r.publicKeyOid)!==s.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var c=s.createCertificate();c.version=r.certVersion?r.certVersion.charCodeAt(0):0;var l=n.util.createBuffer(r.certSerialNumber);c.serialNumber=l.toHex(),c.signatureOid=n.asn1.derToOid(r.certSignatureOid),c.signatureParameters=d(c.signatureOid,r.certSignatureParams,!0),c.siginfo.algorithmOid=n.asn1.derToOid(r.certinfoSignatureOid),c.siginfo.parameters=d(c.siginfo.algorithmOid,r.certinfoSignatureParams,!1),c.signature=r.certSignature;var h=[];if(void 0!==r.certValidity1UTCTime&&h.push(i.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&h.push(i.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&h.push(i.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&h.push(i.generalizedTimeToDate(r.certValidity4GeneralizedTime)),h.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(h.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=h[0],c.validity.notAfter=h[1],c.tbsCertificate=r.tbsCertificate,t){var p;if(c.md=null,c.signatureOid in o)switch(o[c.signatureOid]){case"sha1WithRSAEncryption":c.md=n.md.sha1.create();break;case"md5WithRSAEncryption":c.md=n.md.md5.create();break;case"sha256WithRSAEncryption":c.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":c.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":c.md=n.md.sha512.create();break;case"RSASSA-PSS":c.md=n.md.sha256.create()}if(null===c.md)throw(p=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=c.signatureOid,p;var y=i.toDer(c.tbsCertificate);c.md.update(y.getBytes())}var m=n.md.sha1.create();c.issuer.getField=function(e){return f(c.issuer,e)},c.issuer.addField=function(e){g([e]),c.issuer.attributes.push(e)},c.issuer.attributes=s.RDNAttributesAsArray(r.certIssuer,m),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=m.digest().toHex();var v=n.md.sha1.create();return c.subject.getField=function(e){return f(c.subject,e)},c.subject.addField=function(e){g([e]),c.subject.attributes.push(e)},c.subject.attributes=s.RDNAttributesAsArray(r.certSubject,v),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=v.digest().toHex(),r.certExtensions?c.extensions=s.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=s.publicKeyFromAsn1(r.subjectPublicKeyInfo),c},s.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r<e.value.length;++r)for(var n=e.value[r],i=0;i<n.value.length;++i)t.push(s.certificateExtensionFromAsn1(n.value[i]));return t},s.certificateExtensionFromAsn1=function(e){var t={};if(t.id=i.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===i.Type.BOOLEAN?(t.critical=0!==e.value[1].value.charCodeAt(0),t.value=e.value[2].value):t.value=e.value[1].value,t.id in o)if(t.name=o[t.id],"keyUsage"===t.name){var r=0,s=0;(c=i.fromDer(t.value)).value.length>1&&(r=c.value.charCodeAt(1),s=c.value.length>2?c.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&s)}else if("basicConstraints"===t.name){(c=i.fromDer(t.value)).value.length>0&&c.value[0].type===i.Type.BOOLEAN?t.cA=0!==c.value[0].value.charCodeAt(0):t.cA=!1;var a=null;c.value.length>0&&c.value[0].type===i.Type.INTEGER?a=c.value[0].value:c.value.length>1&&(a=c.value[1].value),null!==a&&(t.pathLenConstraint=i.derToInteger(a))}else if("extKeyUsage"===t.name)for(var c=i.fromDer(t.value),u=0;u<c.value.length;++u){var l=i.derToOid(c.value[u].value);l in o?t[o[l]]=!0:t[l]=!0}else if("nsCertType"===t.name){r=0;(c=i.fromDer(t.value)).value.length>1&&(r=c.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var h;t.altNames=[];c=i.fromDer(t.value);for(var p=0;p<c.value.length;++p){var f={type:(h=c.value[p]).type,value:h.value};switch(t.altNames.push(f),h.type){case 1:case 2:case 6:break;case 7:f.ip=n.util.bytesToIP(h.value);break;case 8:f.oid=i.derToOid(h.value)}}}else if("subjectKeyIdentifier"===t.name){c=i.fromDer(t.value);t.subjectKeyIdentifier=n.util.bytesToHex(c.value)}return t},s.certificationRequestFromAsn1=function(e,t){var r={},a=[];if(!i.validate(e,p,r,a))throw(u=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=a,u;if(i.derToOid(r.publicKeyOid)!==s.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var c=s.createCertificationRequest();if(c.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,c.signatureOid=n.asn1.derToOid(r.csrSignatureOid),c.signatureParameters=d(c.signatureOid,r.csrSignatureParams,!0),c.siginfo.algorithmOid=n.asn1.derToOid(r.csrSignatureOid),c.siginfo.parameters=d(c.siginfo.algorithmOid,r.csrSignatureParams,!1),c.signature=r.csrSignature,c.certificationRequestInfo=r.certificationRequestInfo,t){var u;if(c.md=null,c.signatureOid in o)switch(o[c.signatureOid]){case"sha1WithRSAEncryption":c.md=n.md.sha1.create();break;case"md5WithRSAEncryption":c.md=n.md.md5.create();break;case"sha256WithRSAEncryption":c.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":c.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":c.md=n.md.sha512.create();break;case"RSASSA-PSS":c.md=n.md.sha256.create()}if(null===c.md)throw(u=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=c.signatureOid,u;var l=i.toDer(c.certificationRequestInfo);c.md.update(l.getBytes())}var h=n.md.sha1.create();return c.subject.getField=function(e){return f(c.subject,e)},c.subject.addField=function(e){g([e]),c.subject.attributes.push(e)},c.subject.attributes=s.RDNAttributesAsArray(r.certificationRequestInfoSubject,h),c.subject.hash=h.digest().toHex(),c.publicKey=s.publicKeyFromAsn1(r.subjectPublicKeyInfo),c.getAttribute=function(e){return f(c,e)},c.addAttribute=function(e){g([e]),c.attributes.push(e)},c.attributes=s.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),c},s.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return f(e.subject,t)},e.subject.addField=function(t){g([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return f(e,t)},e.addAttribute=function(t){g([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){g(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){g(t),e.attributes=t},e.sign=function(t,r){e.md=r||n.md.sha1.create();var a=o[e.md.algorithm+"WithRSAEncryption"];if(!a){var c=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw c.algorithm=e.md.algorithm,c}e.signatureOid=e.siginfo.algorithmOid=a,e.certificationRequestInfo=s.getCertificationRequestInfo(e);var u=i.toDer(e.certificationRequestInfo);e.md.update(u.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(null===r){if(e.signatureOid in o)switch(o[e.signatureOid]){case"sha1WithRSAEncryption":r=n.md.sha1.create();break;case"md5WithRSAEncryption":r=n.md.md5.create();break;case"sha256WithRSAEncryption":r=n.md.sha256.create();break;case"sha384WithRSAEncryption":r=n.md.sha384.create();break;case"sha512WithRSAEncryption":r=n.md.sha512.create();break;case"RSASSA-PSS":r=n.md.sha256.create()}if(null===r)throw(p=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=e.signatureOid,p;var a=e.certificationRequestInfo||s.getCertificationRequestInfo(e),c=i.toDer(a);r.update(c.getBytes())}if(null!==r){var u;switch(e.signatureOid){case o.sha1WithRSAEncryption:break;case o["RSASSA-PSS"]:var l,h,p;if(void 0===(l=o[e.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[l])throw(p=new Error("Unsupported MGF hash function.")).oid=e.signatureParameters.mgf.hash.algorithmOid,p.name=l,p;if(void 0===(h=o[e.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[h])throw(p=new Error("Unsupported MGF function.")).oid=e.signatureParameters.mgf.algorithmOid,p.name=h,p;if(h=n.mgf[h].create(n.md[l].create()),void 0===(l=o[e.signatureParameters.hash.algorithmOid])||void 0===n.md[l])throw(p=new Error("Unsupported RSASSA-PSS hash function.")).oid=e.signatureParameters.hash.algorithmOid,p.name=l,p;u=n.pss.create(n.md[l].create(),h,e.signatureParameters.saltLength)}t=e.publicKey.verify(r.digest().getBytes(),e.signature,u)}return t},e};var E=new Date("1950-01-01T00:00:00Z"),S=new Date("2050-01-01T00:00:00Z");function b(e){return e>=E&&e<S?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(e)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(e))}s.getTBSCertificate=function(e){var t=b(e.validity.notBefore),r=b(e.validity.notAfter),o=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.siginfo.algorithmOid).getBytes()),v(e.siginfo.algorithmOid,e.siginfo.parameters)]),y(e.issuer),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,r]),y(e.subject),s.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&o.value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&o.value.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&o.value.push(s.certificateExtensionsToAsn1(e.extensions)),o},s.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),y(e.subject),s.publicKeyToAsn1(e.publicKey),C(e)])},s.distinguishedNameToAsn1=function(e){return y(e)},s.certificateToAsn1=function(e){var t=e.tbsCertificate||s.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),v(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},s.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;n<e.length;++n)r.value.push(s.certificateExtensionToAsn1(e[n]));return t},s.certificateExtensionToAsn1=function(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.id).getBytes())),e.critical&&t.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return"string"!=typeof e.value&&(r=i.toDer(r).getBytes()),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)),t},s.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||s.getCertificationRequestInfo(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),v(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},s.createCaStore=function(e){var t={certs:{}};function r(e){return o(e),t.certs[e.hash]||null}function o(e){if(!e.hash){var t=n.md.sha1.create();e.attributes=s.RDNAttributesAsArray(y(e),t),e.hash=t.digest().toHex()}}if(t.getIssuer=function(e){return r(e.issuer)},t.addCertificate=function(e){if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),o(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var r=t.certs[e.subject.hash];n.util.isArray(r)||(r=[r]),r.push(e),t.certs[e.subject.hash]=r}else t.certs[e.subject.hash]=e},t.hasCertificate=function(e){"string"==typeof e&&(e=n.pki.certificateFromPem(e));var t=r(e.subject);if(!t)return!1;n.util.isArray(t)||(t=[t]);for(var o=i.toDer(s.certificateToAsn1(e)).getBytes(),a=0;a<t.length;++a){if(o===i.toDer(s.certificateToAsn1(t[a])).getBytes())return!0}return!1},t.listAllCertificates=function(){var e=[];for(var r in t.certs)if(t.certs.hasOwnProperty(r)){var i=t.certs[r];if(n.util.isArray(i))for(var s=0;s<i.length;++s)e.push(i[s]);else e.push(i)}return e},t.removeCertificate=function(e){var a;if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),o(e.subject),!t.hasCertificate(e))return null;var c=r(e.subject);if(!n.util.isArray(c))return a=t.certs[e.subject.hash],delete t.certs[e.subject.hash],a;for(var u=i.toDer(s.certificateToAsn1(e)).getBytes(),l=0;l<c.length;++l){u===i.toDer(s.certificateToAsn1(c[l])).getBytes()&&(a=c[l],c.splice(l,1))}return 0===c.length&&delete t.certs[e.subject.hash],a},e)for(var a=0;a<e.length;++a){var c=e[a];t.addCertificate(c)}return t},s.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},s.verifyCertificateChain=function(e,t,r){"function"==typeof r&&(r={verify:r}),r=r||{};var i=(t=t.slice(0)).slice(0),o=r.validityCheckDate;void 0===o&&(o=new Date);var a=!0,c=null,u=0;do{var l=t.shift(),h=null,p=!1;if(o&&(o<l.validity.notBefore||o>l.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:s.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:o}),null===c){if(null===(h=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(p=!0,h=l),h){var f=h;n.util.isArray(f)||(f=[f]);for(var d=!1;!d&&f.length>0;){h=f.shift();try{d=h.verify(l)}catch(e){}}d||(c={message:"Certificate signature is invalid.",error:s.certificateError.bad_certificate})}null!==c||h&&!p||e.hasCertificate(l)||(c={message:"Certificate is not trusted.",error:s.certificateError.unknown_ca})}if(null===c&&h&&!l.isIssuer(h)&&(c={message:"Certificate issuer is invalid.",error:s.certificateError.bad_certificate}),null===c)for(var y={keyUsage:!0,basicConstraints:!0},g=0;null===c&&g<l.extensions.length;++g){var m=l.extensions[g];m.critical&&!(m.name in y)&&(c={message:"Certificate has an unsupported critical extension.",error:s.certificateError.unsupported_certificate})}if(null===c&&(!a||0===t.length&&(!h||p))){var v=l.getExtension("basicConstraints"),C=l.getExtension("keyUsage");if(null!==C&&(C.keyCertSign&&null!==v||(c={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:s.certificateError.bad_certificate})),null!==c||null===v||v.cA||(c={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:s.certificateError.bad_certificate}),null===c&&null!==C&&"pathLenConstraint"in v)u-1>v.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:s.certificateError.bad_certificate})}var E=null===c||c.error,S=r.verify?r.verify(E,u,i):E;if(!0!==S)throw!0===E&&(c={message:"The application rejected the certificate.",error:s.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||n.util.isArray(S)?"string"==typeof S&&(c.error=S):(S.message&&(c.message=S.message),S.error&&(c.error=S.error))),c;c=null,a=!1,++u}while(t.length>0);return!0}},function(e,t,r){var n=r(0);r(3),r(1),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,s=r.digestLength,o=e.salt||null;if("string"==typeof o&&(o=n.util.createBuffer(o)),"saltLength"in e)t=e.saltLength;else{if(null===o)throw new Error("Salt length not specified or specific salt not given.");t=o.length()}if(null!==o&&o.length()!==t)throw new Error("Given salt length does not match length of given salt.");var a=e.prng||n.random,c={encode:function(e,c){var u,l,h=c-1,p=Math.ceil(h/8),f=e.digest().getBytes();if(p<s+t+2)throw new Error("Message is too long to encrypt.");l=null===o?a.getBytesSync(t):o.bytes();var d=new n.util.ByteBuffer;d.fillWithByte(0,8),d.putBytes(f),d.putBytes(l),r.start(),r.update(d.getBytes());var y=r.digest().getBytes(),g=new n.util.ByteBuffer;g.fillWithByte(0,p-t-s-2),g.putByte(1),g.putBytes(l);var m=g.getBytes(),v=p-s-1,C=i.generate(y,v),E="";for(u=0;u<v;u++)E+=String.fromCharCode(m.charCodeAt(u)^C.charCodeAt(u));var S=65280>>8*p-h&255;return(E=String.fromCharCode(E.charCodeAt(0)&~S)+E.substr(1))+y+String.fromCharCode(188)},verify:function(e,o,a){var c,u=a-1,l=Math.ceil(u/8);if(o=o.substr(-l),l<s+t+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==o.charCodeAt(l-1))throw new Error("Encoded message does not end in 0xBC.");var h=l-s-1,p=o.substr(0,h),f=o.substr(h,s),d=65280>>8*l-u&255;if(0!=(p.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=i.generate(f,h),g="";for(c=0;c<h;c++)g+=String.fromCharCode(p.charCodeAt(c)^y.charCodeAt(c));g=String.fromCharCode(g.charCodeAt(0)&~d)+g.substr(1);var m=l-s-t-2;for(c=0;c<m;c++)if(0!==g.charCodeAt(c))throw new Error("Leftmost octets not zero as expected");if(1!==g.charCodeAt(m))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var v=g.substr(-t),C=new n.util.ByteBuffer;return C.fillWithByte(0,8),C.putBytes(e),C.putBytes(v),r.start(),r.update(C.getBytes()),f===r.digest().getBytes()}};return c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{append(e){return!1}}},function(e,t,r){"use strict";var n=r(2);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var s;if(r)s=r(t);else if(n.isURLSearchParams(t))s=t.toString();else{var o=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),o.push(i(t)+"="+i(e))})))})),s=o.join("&")}if(s){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},function(e,t,r){"use strict";var n=r(38);e.exports=function(e,t,r,i,s){var o=new Error(e);return n(o,t,r,i,s)}},function(e,t){e.exports={version:"0.26.0"}},function(e,t){e.exports=require("stream")},function(e,t,r){"use strict";function n(e,...t){return(...r)=>e(...t,...r)}function i(e){return function(...t){var r=t.pop();return e.call(this,t,r)}}r.r(t),r.d(t,"apply",(function(){return n})),r.d(t,"applyEach",(function(){return N})),r.d(t,"applyEachSeries",(function(){return O})),r.d(t,"asyncify",(function(){return h})),r.d(t,"auto",(function(){return P})),r.d(t,"autoInject",(function(){return q})),r.d(t,"cargo",(function(){return G})),r.d(t,"cargoQueue",(function(){return z})),r.d(t,"compose",(function(){return X})),r.d(t,"concat",(function(){return Z})),r.d(t,"concatLimit",(function(){return J})),r.d(t,"concatSeries",(function(){return ee})),r.d(t,"constant",(function(){return te})),r.d(t,"detect",(function(){return ne})),r.d(t,"detectLimit",(function(){return ie})),r.d(t,"detectSeries",(function(){return se})),r.d(t,"dir",(function(){return ae})),r.d(t,"doUntil",(function(){return ue})),r.d(t,"doWhilst",(function(){return ce})),r.d(t,"each",(function(){return he})),r.d(t,"eachLimit",(function(){return pe})),r.d(t,"eachOf",(function(){return k})),r.d(t,"eachOfLimit",(function(){return I})),r.d(t,"eachOfSeries",(function(){return L})),r.d(t,"eachSeries",(function(){return fe})),r.d(t,"ensureAsync",(function(){return de})),r.d(t,"every",(function(){return ye})),r.d(t,"everyLimit",(function(){return ge})),r.d(t,"everySeries",(function(){return me})),r.d(t,"filter",(function(){return Se})),r.d(t,"filterLimit",(function(){return be})),r.d(t,"filterSeries",(function(){return Te})),r.d(t,"forever",(function(){return _e})),r.d(t,"groupBy",(function(){return Ie})),r.d(t,"groupByLimit",(function(){return Ae})),r.d(t,"groupBySeries",(function(){return Be})),r.d(t,"log",(function(){return we})),r.d(t,"map",(function(){return R})),r.d(t,"mapLimit",(function(){return $})),r.d(t,"mapSeries",(function(){return x})),r.d(t,"mapValues",(function(){return Re})),r.d(t,"mapValuesLimit",(function(){return ke})),r.d(t,"mapValuesSeries",(function(){return Ne})),r.d(t,"memoize",(function(){return Le})),r.d(t,"nextTick",(function(){return xe})),r.d(t,"parallel",(function(){return De})),r.d(t,"parallelLimit",(function(){return Ue})),r.d(t,"priorityQueue",(function(){return Ke})),r.d(t,"queue",(function(){return Pe})),r.d(t,"race",(function(){return qe})),r.d(t,"reduce",(function(){return Q})),r.d(t,"reduceRight",(function(){return je})),r.d(t,"reflect",(function(){return He})),r.d(t,"reflectAll",(function(){return We})),r.d(t,"reject",(function(){return ze})),r.d(t,"rejectLimit",(function(){return Qe})),r.d(t,"rejectSeries",(function(){return Ye})),r.d(t,"retry",(function(){return $e})),r.d(t,"retryable",(function(){return Ze})),r.d(t,"seq",(function(){return Y})),r.d(t,"series",(function(){return et})),r.d(t,"setImmediate",(function(){return l})),r.d(t,"some",(function(){return tt})),r.d(t,"someLimit",(function(){return rt})),r.d(t,"someSeries",(function(){return nt})),r.d(t,"sortBy",(function(){return it})),r.d(t,"timeout",(function(){return st})),r.d(t,"times",(function(){return at})),r.d(t,"timesLimit",(function(){return ot})),r.d(t,"timesSeries",(function(){return ct})),r.d(t,"transform",(function(){return ut})),r.d(t,"tryEach",(function(){return lt})),r.d(t,"unmemoize",(function(){return ht})),r.d(t,"until",(function(){return ft})),r.d(t,"waterfall",(function(){return dt})),r.d(t,"whilst",(function(){return pt})),r.d(t,"all",(function(){return ye})),r.d(t,"allLimit",(function(){return ge})),r.d(t,"allSeries",(function(){return me})),r.d(t,"any",(function(){return tt})),r.d(t,"anyLimit",(function(){return rt})),r.d(t,"anySeries",(function(){return nt})),r.d(t,"find",(function(){return ne})),r.d(t,"findLimit",(function(){return ie})),r.d(t,"findSeries",(function(){return se})),r.d(t,"flatMap",(function(){return Z})),r.d(t,"flatMapLimit",(function(){return J})),r.d(t,"flatMapSeries",(function(){return ee})),r.d(t,"forEach",(function(){return he})),r.d(t,"forEachSeries",(function(){return fe})),r.d(t,"forEachLimit",(function(){return pe})),r.d(t,"forEachOf",(function(){return k})),r.d(t,"forEachOfSeries",(function(){return L})),r.d(t,"forEachOfLimit",(function(){return I})),r.d(t,"inject",(function(){return Q})),r.d(t,"foldl",(function(){return Q})),r.d(t,"foldr",(function(){return je})),r.d(t,"select",(function(){return Se})),r.d(t,"selectLimit",(function(){return be})),r.d(t,"selectSeries",(function(){return Te})),r.d(t,"wrapSync",(function(){return h})),r.d(t,"during",(function(){return pt})),r.d(t,"doDuring",(function(){return ce}));var s="function"==typeof queueMicrotask&&queueMicrotask,o="function"==typeof setImmediate&&setImmediate,a="object"==typeof process&&"function"==typeof process.nextTick;function c(e){setTimeout(e,0)}function u(e){return(t,...r)=>e(()=>t(...r))}var l=u(s?queueMicrotask:o?setImmediate:a?process.nextTick:c);function h(e){return d(e)?function(...t){const r=t.pop();return p(e.apply(this,t),r)}:i((function(t,r){var n;try{n=e.apply(this,t)}catch(e){return r(e)}if(n&&"function"==typeof n.then)return p(n,r);r(null,n)}))}function p(e,t){return e.then(e=>{f(t,null,e)},e=>{f(t,e&&e.message?e:new Error(e))})}function f(e,t,r){try{e(t,r)}catch(e){l(e=>{throw e},e)}}function d(e){return"AsyncFunction"===e[Symbol.toStringTag]}function y(e){if("function"!=typeof e)throw new Error("expected a function");return d(e)?h(e):e}function g(e,t=e.length){if(!t)throw new Error("arity is undefined");return function(...r){return"function"==typeof r[t-1]?e.apply(this,r):new Promise((n,i)=>{r[t-1]=(e,...t)=>{if(e)return i(e);n(t.length>1?t:t[0])},e.apply(this,r)})}}function m(e){return function(t,...r){return g((function(n){var i=this;return e(t,(e,t)=>{y(e).apply(i,r.concat(t))},n)}))}}function v(e,t,r,n){t=t||[];var i=[],s=0,o=y(r);return e(t,(e,t,r)=>{var n=s++;o(e,(e,t)=>{i[n]=t,r(e)})},e=>{n(e,i)})}function C(e){return e&&"number"==typeof e.length&&e.length>=0&&e.length%1==0}const E={};function S(e){function t(...t){if(null!==e){var r=e;e=null,r.apply(this,t)}}return Object.assign(t,e),t}function b(e){if(C(e))return function(e){var t=-1,r=e.length;return function(){return++t<r?{value:e[t],key:t}:null}}(e);var t,r,n,i,s=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}(e);return s?function(e){var t=-1;return function(){var r=e.next();return r.done?null:(t++,{value:r.value,key:t})}}(s):(r=(t=e)?Object.keys(t):[],n=-1,i=r.length,function e(){var s=r[++n];return"__proto__"===s?e():n<i?{value:t[s],key:s}:null})}function T(e){return function(...t){if(null===e)throw new Error("Callback was already called.");var r=e;e=null,r.apply(this,t)}}function _(e,t,r,n){let i=!1,s=!1,o=!1,a=0,c=0;function u(){a>=t||o||i||(o=!0,e.next().then(({value:e,done:t})=>{if(!s&&!i){if(o=!1,t)return i=!0,void(a<=0&&n(null));a++,r(e,c,l),c++,u()}}).catch(h))}function l(e,t){if(a-=1,!s)return e?h(e):!1===e?(i=!0,void(s=!0)):t===E||i&&a<=0?(i=!0,n(null)):void u()}function h(e){s||(o=!1,i=!0,n(e))}u()}var A=e=>(t,r,n)=>{if(n=S(n),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return n(null);if("AsyncGenerator"===t[Symbol.toStringTag])return _(t,e,r,n);if(function(e){return"function"==typeof e[Symbol.asyncIterator]}(t))return _(t[Symbol.asyncIterator](),e,r,n);var i=b(t),s=!1,o=!1,a=0,c=!1;function u(e,t){if(!o)if(a-=1,e)s=!0,n(e);else if(!1===e)s=!0,o=!0;else{if(t===E||s&&a<=0)return s=!0,n(null);c||l()}}function l(){for(c=!0;a<e&&!s;){var t=i();if(null===t)return s=!0,void(a<=0&&n(null));a+=1,r(t.value,t.key,T(u))}c=!1}l()};var I=g((function(e,t,r,n){return A(t)(e,y(r),n)}),4);function B(e,t,r){r=S(r);var n=0,i=0,{length:s}=e,o=!1;function a(e,t){!1===e&&(o=!0),!0!==o&&(e?r(e):++i!==s&&t!==E||r(null))}for(0===s&&r(null);n<s;n++)t(e[n],n,T(a))}function w(e,t,r){return I(e,1/0,t,r)}var k=g((function(e,t,r){return(C(e)?B:w)(e,y(t),r)}),3);var R=g((function(e,t,r){return v(k,e,t,r)}),3),N=m(R);var L=g((function(e,t,r){return I(e,1,t,r)}),3);var x=g((function(e,t,r){return v(L,e,t,r)}),3),O=m(x);const D=Symbol("promiseCallback");function U(){let e,t;function r(r,...n){if(r)return t(r);e(n.length>1?n:n[0])}return r[D]=new Promise((r,n)=>{e=r,t=n}),r}function P(e,t,r){"number"!=typeof t&&(r=t,t=null),r=S(r||U());var n=Object.keys(e).length;if(!n)return r(null);t||(t=n);var i={},s=0,o=!1,a=!1,c=Object.create(null),u=[],l=[],h={};function p(e,t){u.push(()=>function(e,t){if(a)return;var n=T((t,...n)=>{if(s--,!1!==t)if(n.length<2&&([n]=n),t){var u={};if(Object.keys(i).forEach(e=>{u[e]=i[e]}),u[e]=n,a=!0,c=Object.create(null),o)return;r(t,u)}else i[e]=n,(c[e]||[]).forEach(e=>e()),f();else o=!0});s++;var u=y(t[t.length-1]);t.length>1?u(i,n):u(n)}(e,t))}function f(){if(!o){if(0===u.length&&0===s)return r(null,i);for(;u.length&&s<t;){u.shift()()}}}function d(t){var r=[];return Object.keys(e).forEach(n=>{const i=e[n];Array.isArray(i)&&i.indexOf(t)>=0&&r.push(n)}),r}return Object.keys(e).forEach(t=>{var r=e[t];if(!Array.isArray(r))return p(t,[r]),void l.push(t);var n=r.slice(0,r.length-1),i=n.length;if(0===i)return p(t,r),void l.push(t);h[t]=i,n.forEach(s=>{if(!e[s])throw new Error("async.auto task `"+t+"` has a non-existent dependency `"+s+"` in "+n.join(", "));!function(e,t){var r=c[e];r||(r=c[e]=[]);r.push(t)}(s,()=>{0===--i&&p(t,r)})})}),function(){var e,t=0;for(;l.length;)e=l.pop(),t++,d(e).forEach(e=>{0==--h[e]&&l.push(e)});if(t!==n)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),f(),r[D]}var V=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,M=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,F=/,/,K=/(=.+)?(\s*)$/;function q(e,t){var r={};return Object.keys(e).forEach(t=>{var n,i=e[t],s=d(i),o=!s&&1===i.length||s&&0===i.length;if(Array.isArray(i))n=[...i],i=n.pop(),r[t]=n.concat(n.length>0?a:i);else if(o)r[t]=i;else{if(n=function(e){const t=function(e){let t="",r=0,n=e.indexOf("*/");for(;r<e.length;)if("/"===e[r]&&"/"===e[r+1]){let t=e.indexOf("\n",r);r=-1===t?e.length:t}else if(-1!==n&&"/"===e[r]&&"*"===e[r+1]){let i=e.indexOf("*/",r);-1!==i?(r=i+2,n=e.indexOf("*/",r)):(t+=e[r],r++)}else t+=e[r],r++;return t}(e.toString());let r=t.match(V);if(r||(r=t.match(M)),!r)throw new Error("could not parse args in autoInject\nSource:\n"+t);let[,n]=r;return n.replace(/\s/g,"").split(F).map(e=>e.replace(K,"").trim())}(i),0===i.length&&!s&&0===n.length)throw new Error("autoInject task functions require explicit parameters.");s||n.pop(),r[t]=n.concat(a)}function a(e,t){var r=n.map(t=>e[t]);r.push(t),y(i)(...r)}}),P(r,t)}class j{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):H(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):H(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:r}=t;e(t)&&this.removeLink(t),t=r}return this}}function H(e,t){e.length=1,e.head=e.tail=t}function W(e,t,r){if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var n=y(e),i=0,s=[];const o={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function a(e,t){return e?t?void(o[e]=o[e].filter(e=>e!==t)):o[e]=[]:Object.keys(o).forEach(e=>o[e]=[])}function c(e,...t){o[e].forEach(e=>e(...t))}var u=!1;function h(e,t,r,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");var i,s;function o(e,...t){return e?r?s(e):i():t.length<=1?i(t[0]):void i(t)}m.started=!0;var a={data:e,callback:r?o:n||o};if(t?m._tasks.unshift(a):m._tasks.push(a),u||(u=!0,l(()=>{u=!1,m.process()})),r||!n)return new Promise((e,t)=>{i=e,s=t})}function p(e){return function(t,...r){i-=1;for(var n=0,o=e.length;n<o;n++){var a=e[n],u=s.indexOf(a);0===u?s.shift():u>0&&s.splice(u,1),a.callback(t,...r),null!=t&&c("error",t,a.data)}i<=m.concurrency-m.buffer&&c("unsaturated"),m.idle()&&c("drain"),m.process()}}function f(e){return!(0!==e.length||!m.idle())&&(l(()=>c("drain")),!0)}const d=e=>t=>{if(!t)return new Promise((t,r)=>{!function(e,t){const r=(...n)=>{a(e,r),t(...n)};o[e].push(r)}(e,(e,n)=>{if(e)return r(e);t(n)})});a(e),function(e,t){o[e].push(t)}(e,t)};var g=!1,m={_tasks:new j,*[Symbol.iterator](){yield*m._tasks[Symbol.iterator]()},concurrency:t,payload:r,buffer:t/4,started:!1,paused:!1,push(e,t){if(Array.isArray(e)){if(f(e))return;return e.map(e=>h(e,!1,!1,t))}return h(e,!1,!1,t)},pushAsync(e,t){if(Array.isArray(e)){if(f(e))return;return e.map(e=>h(e,!1,!0,t))}return h(e,!1,!0,t)},kill(){a(),m._tasks.empty()},unshift(e,t){if(Array.isArray(e)){if(f(e))return;return e.map(e=>h(e,!0,!1,t))}return h(e,!0,!1,t)},unshiftAsync(e,t){if(Array.isArray(e)){if(f(e))return;return e.map(e=>h(e,!0,!0,t))}return h(e,!0,!0,t)},remove(e){m._tasks.remove(e)},process(){if(!g){for(g=!0;!m.paused&&i<m.concurrency&&m._tasks.length;){var e=[],t=[],r=m._tasks.length;m.payload&&(r=Math.min(r,m.payload));for(var o=0;o<r;o++){var a=m._tasks.shift();e.push(a),s.push(a),t.push(a.data)}i+=1,0===m._tasks.length&&c("empty"),i===m.concurrency&&c("saturated");var u=T(p(e));n(t,u)}g=!1}},length:()=>m._tasks.length,running:()=>i,workersList:()=>s,idle:()=>m._tasks.length+i===0,pause(){m.paused=!0},resume(){!1!==m.paused&&(m.paused=!1,l(m.process))}};return Object.defineProperties(m,{saturated:{writable:!1,value:d("saturated")},unsaturated:{writable:!1,value:d("unsaturated")},empty:{writable:!1,value:d("empty")},drain:{writable:!1,value:d("drain")},error:{writable:!1,value:d("error")}}),m}function G(e,t){return W(e,1,t)}function z(e,t,r){return W(e,t,r)}var Q=g((function(e,t,r,n){n=S(n);var i=y(r);return L(e,(e,r,n)=>{i(t,e,(e,r)=>{t=r,n(e)})},e=>n(e,t))}),4);function Y(...e){var t=e.map(y);return function(...e){var r=this,n=e[e.length-1];return"function"==typeof n?e.pop():n=U(),Q(t,e,(e,t,n)=>{t.apply(r,e.concat((e,...t)=>{n(e,t)}))},(e,t)=>n(e,...t)),n[D]}}function X(...e){return Y(...e.reverse())}var $=g((function(e,t,r,n){return v(A(t),e,r,n)}),4);var J=g((function(e,t,r,n){var i=y(r);return $(e,t,(e,t)=>{i(e,(e,...r)=>e?t(e):t(e,r))},(e,t)=>{for(var r=[],i=0;i<t.length;i++)t[i]&&(r=r.concat(...t[i]));return n(e,r)})}),4);var Z=g((function(e,t,r){return J(e,1/0,t,r)}),3);var ee=g((function(e,t,r){return J(e,1,t,r)}),3);function te(...e){return function(...t){return t.pop()(null,...e)}}function re(e,t){return(r,n,i,s)=>{var o,a=!1;const c=y(i);r(n,(r,n,i)=>{c(r,(n,s)=>n||!1===n?i(n):e(s)&&!o?(a=!0,o=t(!0,r),i(null,E)):void i())},e=>{if(e)return s(e);s(null,a?o:t(!1))})}}var ne=g((function(e,t,r){return re(e=>e,(e,t)=>t)(k,e,t,r)}),3);var ie=g((function(e,t,r,n){return re(e=>e,(e,t)=>t)(A(t),e,r,n)}),4);var se=g((function(e,t,r){return re(e=>e,(e,t)=>t)(A(1),e,t,r)}),3);function oe(e){return(t,...r)=>y(t)(...r,(t,...r)=>{"object"==typeof console&&(t?console.error&&console.error(t):console[e]&&r.forEach(t=>console[e](t)))})}var ae=oe("dir");var ce=g((function(e,t,r){r=T(r);var n,i=y(e),s=y(t);function o(e,...t){if(e)return r(e);!1!==e&&(n=t,s(...t,a))}function a(e,t){return e?r(e):!1!==e?t?void i(o):r(null,...n):void 0}return a(null,!0)}),3);function ue(e,t,r){const n=y(t);return ce(e,(...e)=>{const t=e.pop();n(...e,(e,r)=>t(e,!r))},r)}function le(e){return(t,r,n)=>e(t,n)}var he=g((function(e,t,r){return k(e,le(y(t)),r)}),3);var pe=g((function(e,t,r,n){return A(t)(e,le(y(r)),n)}),4);var fe=g((function(e,t,r){return pe(e,1,t,r)}),3);function de(e){return d(e)?e:function(...t){var r=t.pop(),n=!0;t.push((...e)=>{n?l(()=>r(...e)):r(...e)}),e.apply(this,t),n=!1}}var ye=g((function(e,t,r){return re(e=>!e,e=>!e)(k,e,t,r)}),3);var ge=g((function(e,t,r,n){return re(e=>!e,e=>!e)(A(t),e,r,n)}),4);var me=g((function(e,t,r){return re(e=>!e,e=>!e)(L,e,t,r)}),3);function ve(e,t,r,n){var i=new Array(t.length);e(t,(e,t,n)=>{r(e,(e,r)=>{i[t]=!!r,n(e)})},e=>{if(e)return n(e);for(var r=[],s=0;s<t.length;s++)i[s]&&r.push(t[s]);n(null,r)})}function Ce(e,t,r,n){var i=[];e(t,(e,t,n)=>{r(e,(r,s)=>{if(r)return n(r);s&&i.push({index:t,value:e}),n(r)})},e=>{if(e)return n(e);n(null,i.sort((e,t)=>e.index-t.index).map(e=>e.value))})}function Ee(e,t,r,n){return(C(t)?ve:Ce)(e,t,y(r),n)}var Se=g((function(e,t,r){return Ee(k,e,t,r)}),3);var be=g((function(e,t,r,n){return Ee(A(t),e,r,n)}),4);var Te=g((function(e,t,r){return Ee(L,e,t,r)}),3);var _e=g((function(e,t){var r=T(t),n=y(de(e));return function e(t){if(t)return r(t);!1!==t&&n(e)}()}),2);var Ae=g((function(e,t,r,n){var i=y(r);return $(e,t,(e,t)=>{i(e,(r,n)=>r?t(r):t(r,{key:n,val:e}))},(e,t)=>{for(var r={},{hasOwnProperty:i}=Object.prototype,s=0;s<t.length;s++)if(t[s]){var{key:o}=t[s],{val:a}=t[s];i.call(r,o)?r[o].push(a):r[o]=[a]}return n(e,r)})}),4);function Ie(e,t,r){return Ae(e,1/0,t,r)}function Be(e,t,r){return Ae(e,1,t,r)}var we=oe("log");var ke=g((function(e,t,r,n){n=S(n);var i={},s=y(r);return A(t)(e,(e,t,r)=>{s(e,t,(e,n)=>{if(e)return r(e);i[t]=n,r(e)})},e=>n(e,i))}),4);function Re(e,t,r){return ke(e,1/0,t,r)}function Ne(e,t,r){return ke(e,1,t,r)}function Le(e,t=(e=>e)){var r=Object.create(null),n=Object.create(null),s=y(e),o=i((e,i)=>{var o=t(...e);o in r?l(()=>i(null,...r[o])):o in n?n[o].push(i):(n[o]=[i],s(...e,(e,...t)=>{e||(r[o]=t);var i=n[o];delete n[o];for(var s=0,a=i.length;s<a;s++)i[s](e,...t)}))});return o.memo=r,o.unmemoized=e,o}var xe=u(a?process.nextTick:o?setImmediate:c),Oe=g((e,t,r)=>{var n=C(t)?[]:{};e(t,(e,t,r)=>{y(e)((e,...i)=>{i.length<2&&([i]=i),n[t]=i,r(e)})},e=>r(e,n))},3);function De(e,t){return Oe(k,e,t)}function Ue(e,t,r){return Oe(A(t),e,r)}function Pe(e,t){var r=y(e);return W((e,t)=>{r(e[0],t)},t,1)}class Ve{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(e){let t;for(;e>0&&Fe(this.heap[e],this.heap[t=Me(e)]);){let r=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=r,e=t}}percDown(e){let t;for(;(t=1+(e<<1))<this.heap.length&&(t+1<this.heap.length&&Fe(this.heap[t+1],this.heap[t])&&(t+=1),!Fe(this.heap[e],this.heap[t]));){let r=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=r,e=t}}push(e){e.pushCount=++this.pushCount,this.heap.push(e),this.percUp(this.heap.length-1)}unshift(e){return this.heap.push(e)}shift(){let[e]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),e}toArray(){return[...this]}*[Symbol.iterator](){for(let e=0;e<this.heap.length;e++)yield this.heap[e].data}remove(e){let t=0;for(let r=0;r<this.heap.length;r++)e(this.heap[r])||(this.heap[t]=this.heap[r],t++);this.heap.splice(t);for(let e=Me(this.heap.length-1);e>=0;e--)this.percDown(e);return this}}function Me(e){return(e+1>>1)-1}function Fe(e,t){return e.priority!==t.priority?e.priority<t.priority:e.pushCount<t.pushCount}function Ke(e,t){var r=Pe(e,t),n=!1;return r._tasks=new Ve,r.push=function(e,t=0,i=(()=>{})){if("function"!=typeof i)throw new Error("task callback must be a function");if(r.started=!0,Array.isArray(e)||(e=[e]),0===e.length&&r.idle())return l(()=>r.drain());for(var s=0,o=e.length;s<o;s++){var a={data:e[s],priority:t,callback:i};r._tasks.push(a)}n||(n=!0,l(()=>{n=!1,r.process()}))},delete r.unshift,r}var qe=g((function(e,t){if(t=S(t),!Array.isArray(e))return t(new TypeError("First argument to race must be an array of functions"));if(!e.length)return t();for(var r=0,n=e.length;r<n;r++)y(e[r])(t)}),2);function je(e,t,r,n){var i=[...e].reverse();return Q(i,t,r,n)}function He(e){var t=y(e);return i((function(e,r){return e.push((e,...t)=>{let n={};if(e&&(n.error=e),t.length>0){var i=t;t.length<=1&&([i]=t),n.value=i}r(null,n)}),t.apply(this,e)}))}function We(e){var t;return Array.isArray(e)?t=e.map(He):(t={},Object.keys(e).forEach(r=>{t[r]=He.call(this,e[r])})),t}function Ge(e,t,r,n){const i=y(r);return Ee(e,t,(e,t)=>{i(e,(e,r)=>{t(e,!r)})},n)}var ze=g((function(e,t,r){return Ge(k,e,t,r)}),3);var Qe=g((function(e,t,r,n){return Ge(A(t),e,r,n)}),4);var Ye=g((function(e,t,r){return Ge(L,e,t,r)}),3);function Xe(e){return function(){return e}}function $e(e,t,r){var n={times:5,intervalFunc:Xe(0)};if(arguments.length<3&&"function"==typeof e?(r=t||U(),t=e):(Je(n,e),r=r||U()),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var i=y(t),s=1;function o(){i((e,...t)=>{!1!==e&&(e&&s++<n.times&&("function"!=typeof n.errorFilter||n.errorFilter(e))?setTimeout(o,n.intervalFunc(s-1)):r(e,...t))})}return o(),r[D]}function Je(e,t){if("object"==typeof t)e.times=+t.times||5,e.intervalFunc="function"==typeof t.interval?t.interval:Xe(+t.interval||0),e.errorFilter=t.errorFilter;else{if("number"!=typeof t&&"string"!=typeof t)throw new Error("Invalid arguments for async.retry");e.times=+t||5}}function Ze(e,t){t||(t=e,e=null);let r=e&&e.arity||t.length;d(t)&&(r+=1);var n=y(t);return i((t,i)=>{function s(e){n(...t,e)}return(t.length<r-1||null==i)&&(t.push(i),i=U()),e?$e(e,s,i):$e(s,i),i[D]})}function et(e,t){return Oe(L,e,t)}var tt=g((function(e,t,r){return re(Boolean,e=>e)(k,e,t,r)}),3);var rt=g((function(e,t,r,n){return re(Boolean,e=>e)(A(t),e,r,n)}),4);var nt=g((function(e,t,r){return re(Boolean,e=>e)(L,e,t,r)}),3);var it=g((function(e,t,r){var n=y(t);return R(e,(e,t)=>{n(e,(r,n)=>{if(r)return t(r);t(r,{value:e,criteria:n})})},(e,t)=>{if(e)return r(e);r(null,t.sort(i).map(e=>e.value))});function i(e,t){var r=e.criteria,n=t.criteria;return r<n?-1:r>n?1:0}}),3);function st(e,t,r){var n=y(e);return i((i,s)=>{var o,a=!1;i.push((...e)=>{a||(s(...e),clearTimeout(o))}),o=setTimeout((function(){var t=e.name||"anonymous",n=new Error('Callback function "'+t+'" timed out.');n.code="ETIMEDOUT",r&&(n.info=r),a=!0,s(n)}),t),n(...i)})}function ot(e,t,r,n){var i=y(r);return $(function(e){for(var t=Array(e);e--;)t[e]=e;return t}(e),t,i,n)}function at(e,t,r){return ot(e,1/0,t,r)}function ct(e,t,r){return ot(e,1,t,r)}function ut(e,t,r,n){arguments.length<=3&&"function"==typeof t&&(n=r,r=t,t=Array.isArray(e)?[]:{}),n=S(n||U());var i=y(r);return k(e,(e,r,n)=>{i(t,e,r,n)},e=>n(e,t)),n[D]}var lt=g((function(e,t){var r,n=null;return fe(e,(e,t)=>{y(e)((e,...i)=>{if(!1===e)return t(e);i.length<2?[r]=i:r=i,n=e,t(e?null:{})})},()=>t(n,r))}));function ht(e){return(...t)=>(e.unmemoized||e)(...t)}var pt=g((function(e,t,r){r=T(r);var n=y(t),i=y(e),s=[];function o(e,...t){if(e)return r(e);s=t,!1!==e&&i(a)}function a(e,t){return e?r(e):!1!==e?t?void n(o):r(null,...s):void 0}return i(a)}),3);function ft(e,t,r){const n=y(e);return pt(e=>n((t,r)=>e(t,!r)),t,r)}var dt=g((function(e,t){if(t=S(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;function n(t){y(e[r++])(...t,T(i))}function i(i,...s){if(!1!==i)return i||r===e.length?t(i,...s):void n(s)}n([])})),yt={apply:n,applyEach:N,applyEachSeries:O,asyncify:h,auto:P,autoInject:q,cargo:G,cargoQueue:z,compose:X,concat:Z,concatLimit:J,concatSeries:ee,constant:te,detect:ne,detectLimit:ie,detectSeries:se,dir:ae,doUntil:ue,doWhilst:ce,each:he,eachLimit:pe,eachOf:k,eachOfLimit:I,eachOfSeries:L,eachSeries:fe,ensureAsync:de,every:ye,everyLimit:ge,everySeries:me,filter:Se,filterLimit:be,filterSeries:Te,forever:_e,groupBy:Ie,groupByLimit:Ae,groupBySeries:Be,log:we,map:R,mapLimit:$,mapSeries:x,mapValues:Re,mapValuesLimit:ke,mapValuesSeries:Ne,memoize:Le,nextTick:xe,parallel:De,parallelLimit:Ue,priorityQueue:Ke,queue:Pe,race:qe,reduce:Q,reduceRight:je,reflect:He,reflectAll:We,reject:ze,rejectLimit:Qe,rejectSeries:Ye,retry:$e,retryable:Ze,seq:Y,series:et,setImmediate:l,some:tt,someLimit:rt,someSeries:nt,sortBy:it,timeout:st,times:at,timesLimit:ot,timesSeries:ct,transform:ut,tryEach:lt,unmemoize:ht,until:ft,waterfall:dt,whilst:pt,all:ye,allLimit:ge,allSeries:me,any:tt,anyLimit:rt,anySeries:nt,find:ne,findLimit:ie,findSeries:se,flatMap:Z,flatMapLimit:J,flatMapSeries:ee,forEach:he,forEachSeries:fe,forEachLimit:pe,forEachOf:k,forEachOfSeries:L,forEachOfLimit:I,inject:Q,foldl:Q,foldr:je,select:Se,selectLimit:be,selectSeries:Te,wrapSync:h,during:pt,doDuring:ce};t.default=yt},function(e,t){e.exports=require("net")},function(e,t,r){"use strict";const n=r(28),i=r(8),s=r(45),o=r(19),a=r(11),c=r(13),u=r(20),l=r(84),h=r(46),p=r(21),f=r(47),d=r(49),y=[8,13];class g extends n{constructor(e,t,r){super(),t?"string"==typeof t?t=[t]:Array.isArray(t)||(r=t,t=[]):t=[],this.readyState=g.CONNECTING,this.bytesReceived=0,this.extensions={},this.protocol="",this._binaryType=p.BINARY_TYPES[0],this._finalize=this.finalize.bind(this),this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage="",this._closeTimer=null,this._finalized=!1,this._closeCode=1006,this._receiver=null,this._sender=null,this._socket=null,this._ultron=null,Array.isArray(e)?m.call(this,e[0],e[1],r):v.call(this,e,t,r)}get CONNECTING(){return g.CONNECTING}get CLOSING(){return g.CLOSING}get CLOSED(){return g.CLOSED}get OPEN(){return g.OPEN}get bufferedAmount(){var e=0;return this._socket&&(e=this._socket.bufferSize+this._sender._bufferedBytes),e}get binaryType(){return this._binaryType}set binaryType(e){p.BINARY_TYPES.indexOf(e)<0||(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}setSocket(e,t){e.setTimeout(0),e.setNoDelay(),this._receiver=new f(this.extensions,this._maxPayload,this.binaryType),this._sender=new d(e,this.extensions),this._ultron=new s(e),this._socket=e,this._ultron.on("close",this._finalize),this._ultron.on("error",this._finalize),this._ultron.on("end",this._finalize),t.length>0&&e.unshift(t),this._ultron.on("data",e=>{this.bytesReceived+=e.length,this._receiver.add(e)}),this._receiver.onmessage=e=>this.emit("message",e),this._receiver.onping=e=>{this.pong(e,!this._isServer,!0),this.emit("ping",e)},this._receiver.onpong=e=>this.emit("pong",e),this._receiver.onclose=(e,t)=>{this._closeFrameReceived=!0,this._closeMessage=t,this._closeCode=e,this._finalized||this.close(e,t)},this._receiver.onerror=(e,t)=>{this._closeMessage="",this._closeCode=t,this.readyState=g.CLOSING,this.emit("error",e),this.finalize(!0)},this.readyState=g.OPEN,this.emit("open")}finalize(e){if(!this._finalized){if(this.readyState=g.CLOSING,this._finalized=!0,"object"==typeof e&&this.emit("error",e),!this._socket)return this.emitClose();clearTimeout(this._closeTimer),this._closeTimer=null,this._ultron.destroy(),this._ultron=null,this._socket.on("error",p.NOOP),e?this._socket.destroy():this._socket.end(),this._socket=null,this._sender=null,this._receiver.cleanup(()=>this.emitClose()),this._receiver=null}}emitClose(){this.readyState=g.CLOSED,this.emit("close",this._closeCode,this._closeMessage),this.extensions[u.extensionName]&&this.extensions[u.extensionName].cleanup(),this.extensions=null,this.removeAllListeners()}pause(){if(this.readyState!==g.OPEN)throw new Error("not opened");this._socket.pause()}resume(){if(this.readyState!==g.OPEN)throw new Error("not opened");this._socket.resume()}close(e,t){if(this.readyState!==g.CLOSED)return this.readyState===g.CONNECTING?(this._req.abort(),void this.finalize(new Error("closed before the connection is established"))):void(this.readyState!==g.CLOSING?(this.readyState=g.CLOSING,this._sender.close(e,t,!this._isServer,e=>{e||(this._closeFrameSent=!0,this._finalized||(this._closeFrameReceived&&this._socket.end(),this._closeTimer=setTimeout(this._finalize,3e4,!0)))})):this._closeFrameSent&&this._closeFrameReceived&&this._socket.end())}ping(e,t,r){if(this.readyState!==g.OPEN){if(r)return;throw new Error("not opened")}"number"==typeof e&&(e=e.toString()),void 0===t&&(t=!this._isServer),this._sender.ping(e||p.EMPTY_BUFFER,t)}pong(e,t,r){if(this.readyState!==g.OPEN){if(r)return;throw new Error("not opened")}"number"==typeof e&&(e=e.toString()),void 0===t&&(t=!this._isServer),this._sender.pong(e||p.EMPTY_BUFFER,t)}send(e,t,r){if("function"==typeof t&&(r=t,t={}),this.readyState!==g.OPEN){if(!r)throw new Error("not opened");return void r(new Error("not opened"))}"number"==typeof e&&(e=e.toString());const n=Object.assign({binary:"string"!=typeof e,mask:!this._isServer,compress:!0,fin:!0},t);this.extensions[u.extensionName]||(n.compress=!1),this._sender.send(e||p.EMPTY_BUFFER,n,r)}terminate(){if(this.readyState!==g.CLOSED)return this.readyState===g.CONNECTING?(this._req.abort(),void this.finalize(new Error("closed before the connection is established"))):void this.finalize(!0)}}function m(e,t,r){this.protocolVersion=r.protocolVersion,this._maxPayload=r.maxPayload,this.extensions=r.extensions,this.protocol=r.protocol,this._isServer=!0,this.setSocket(e,t)}function v(e,t,r){if(r=Object.assign({protocolVersion:y[1],protocol:t.join(","),perMessageDeflate:!0,handshakeTimeout:null,localAddress:null,headers:null,family:null,origin:null,agent:null,host:null,checkServerIdentity:null,rejectUnauthorized:null,passphrase:null,ciphers:null,ecdhCurve:null,cert:null,key:null,pfx:null,ca:null},r),-1===y.indexOf(r.protocolVersion))throw new Error(`unsupported protocol version: ${r.protocolVersion} (supported versions: ${y.join(", ")})`);this.protocolVersion=r.protocolVersion,this._isServer=!1,this.url=e;const n=c.parse(e),s="ws+unix:"===n.protocol;if(!(n.host||s&&n.path))throw new Error("invalid url");const l="wss:"===n.protocol||"https:"===n.protocol,f=i.randomBytes(16).toString("base64"),d=l?o:a;var m;const v={port:n.port||(l?443:80),host:n.hostname,path:"/",headers:{"Sec-WebSocket-Version":r.protocolVersion,"Sec-WebSocket-Key":f,Connection:"Upgrade",Upgrade:"websocket"}};if(r.headers&&Object.assign(v.headers,r.headers),r.perMessageDeflate&&(m=new u(!0!==r.perMessageDeflate?r.perMessageDeflate:{},!1),v.headers["Sec-WebSocket-Extensions"]=h.format({[u.extensionName]:m.offer()})),r.protocol&&(v.headers["Sec-WebSocket-Protocol"]=r.protocol),r.origin&&(r.protocolVersion<13?v.headers["Sec-WebSocket-Origin"]=r.origin:v.headers.Origin=r.origin),r.host&&(v.headers.Host=r.host),n.auth&&(v.auth=n.auth),r.localAddress&&(v.localAddress=r.localAddress),r.family&&(v.family=r.family),s){const e=n.path.split(":");v.socketPath=e[0],v.path=e[1]}else n.path&&("/"!==n.path.charAt(0)?v.path="/"+n.path:v.path=n.path);var C=r.agent;(null!=r.rejectUnauthorized||r.checkServerIdentity||r.passphrase||r.ciphers||r.ecdhCurve||r.cert||r.key||r.pfx||r.ca)&&(r.passphrase&&(v.passphrase=r.passphrase),r.ciphers&&(v.ciphers=r.ciphers),r.ecdhCurve&&(v.ecdhCurve=r.ecdhCurve),r.cert&&(v.cert=r.cert),r.key&&(v.key=r.key),r.pfx&&(v.pfx=r.pfx),r.ca&&(v.ca=r.ca),r.checkServerIdentity&&(v.checkServerIdentity=r.checkServerIdentity),null!=r.rejectUnauthorized&&(v.rejectUnauthorized=r.rejectUnauthorized),C||(C=new d.Agent(v))),C&&(v.agent=C),this._req=d.get(v),r.handshakeTimeout&&this._req.setTimeout(r.handshakeTimeout,()=>{this._req.abort(),this.finalize(new Error("opening handshake has timed out"))}),this._req.on("error",e=>{this._req.aborted||(this._req=null,this.finalize(e))}),this._req.on("response",e=>{this.emit("unexpected-response",this._req,e)||(this._req.abort(),this.finalize(new Error(`unexpected server response (${e.statusCode})`)))}),this._req.on("upgrade",(e,t,n)=>{if(this.emit("headers",e.headers,e),this.readyState!==g.CONNECTING)return;this._req=null;const s=i.createHash("sha1").update(f+p.GUID,"binary").digest("base64");if(e.headers["sec-websocket-accept"]!==s)return t.destroy(),this.finalize(new Error("invalid server key"));const o=e.headers["sec-websocket-protocol"],a=(r.protocol||"").split(/, */);var c;if(!r.protocol&&o?c="server sent a subprotocol even though none requested":r.protocol&&!o?c="server sent no subprotocol even though requested":o&&-1===a.indexOf(o)&&(c="server responded with an invalid protocol"),c)return t.destroy(),this.finalize(new Error(c));if(o&&(this.protocol=o),m)try{const t=h.parse(e.headers["sec-websocket-extensions"]);t[u.extensionName]&&(m.accept(t[u.extensionName]),this.extensions[u.extensionName]=m)}catch(e){return t.destroy(),void this.finalize(new Error("invalid Sec-WebSocket-Extensions header"))}this.setSocket(t,n)})}g.CONNECTING=0,g.OPEN=1,g.CLOSING=2,g.CLOSED=3,["open","error","close","message"].forEach(e=>{Object.defineProperty(g.prototype,"on"+e,{get(){const t=this.listeners(e);for(var r=0;r<t.length;r++)if(t[r]._listener)return t[r]._listener},set(t){const r=this.listeners(e);for(var n=0;n<r.length;n++)r[n]._listener&&this.removeListener(e,r[n]);this.addEventListener(e,t)}})}),g.prototype.addEventListener=l.addEventListener,g.prototype.removeEventListener=l.removeEventListener,e.exports=g},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,i=0;function s(e){if(!(this instanceof s))return new s(e);this.id=i++,this.ee=e}s.prototype.on=function(e,t,r){return t.__ultron=this.id,this.ee.on(e,t,r),this},s.prototype.once=function(e,t,r){return t.__ultron=this.id,this.ee.once(e,t,r),this},s.prototype.remove=function(){var e,t=arguments,r=this.ee;if(1===t.length&&"string"==typeof t[0])t=t[0].split(/[, ]+/);else if(!t.length)if(r.eventNames)t=r.eventNames();else if(r._events){for(e in t=[],r._events)n.call(r._events,e)&&t.push(e);Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r._events)))}for(var i=0;i<t.length;i++)for(var s=r.listeners(t[i]),o=0;o<s.length;o++){if((e=s[o]).listener){if(e.listener.__ultron!==this.id)continue}else if(e.__ultron!==this.id)continue;r.removeListener(t[i],e)}return this},s.prototype.destroy=function(){return!!this.ee&&(this.remove(),this.ee=null,!0)},e.exports=s},function(e,t,r){"use strict";const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function i(e,t,r){Object.prototype.hasOwnProperty.call(e,t)?e[t].push(r):e[t]=[r]}e.exports={format:function(e){return Object.keys(e).map(t=>{var r=e[t];return Array.isArray(r)||(r=[r]),r.map(e=>[t].concat(Object.keys(e).map(t=>{var r=e[t];return Array.isArray(r)||(r=[r]),r.map(e=>!0===e?t:`${t}=${e}`).join("; ")})).join("; ")).join(", ")}).join(", ")},parse:function(e){const t={};if(void 0===e||""===e)return t;for(var r,s,o={},a=!1,c=!1,u=!1,l=-1,h=-1,p=0;p<e.length;p++){const d=e.charCodeAt(p);if(void 0===r)if(-1===h&&1===n[d])-1===l&&(l=p);else if(32===d||9===d)-1===h&&-1!==l&&(h=p);else{if(59!==d&&44!==d)throw new Error("unexpected character at index "+p);{if(-1===l)throw new Error("unexpected character at index "+p);-1===h&&(h=p);const n=e.slice(l,h);44===d?(i(t,n,o),o={}):r=n,l=h=-1}}else if(void 0===s)if(-1===h&&1===n[d])-1===l&&(l=p);else if(32===d||9===d)-1===h&&-1!==l&&(h=p);else if(59===d||44===d){if(-1===l)throw new Error("unexpected character at index "+p);-1===h&&(h=p),i(o,e.slice(l,h),!0),44===d&&(i(t,r,o),o={},r=void 0),l=h=-1}else{if(61!==d||-1===l||-1!==h)throw new Error("unexpected character at index "+p);s=e.slice(l,p),l=h=-1}else if(c){if(1!==n[d])throw new Error("unexpected character at index "+p);-1===l?l=p:a||(a=!0),c=!1}else if(u)if(1===n[d])-1===l&&(l=p);else if(34===d&&-1!==l)u=!1,h=p;else{if(92!==d)throw new Error("unexpected character at index "+p);c=!0}else if(34===d&&61===e.charCodeAt(p-1))u=!0;else if(-1===h&&1===n[d])-1===l&&(l=p);else if(-1===l||32!==d&&9!==d){if(59!==d&&44!==d)throw new Error("unexpected character at index "+p);if(-1===l)throw new Error("unexpected character at index "+p);-1===h&&(h=p);var f=e.slice(l,h);a&&(f=f.replace(/\\/g,""),a=!1),i(o,s,f),44===d&&(i(t,r,o),o={},r=void 0),s=void 0,l=h=-1}else-1===h&&(h=p)}if(-1===l||u)throw new Error("unexpected end of input");-1===h&&(h=p);const d=e.slice(l,h);return void 0===r?i(t,d,{}):(void 0===s?i(o,d,!0):i(o,s,a?d.replace(/\\/g,""):d),i(t,r,o)),t}}},function(e,t,r){"use strict";const n=r(9),i=r(20),s=r(85),o=r(30),a=r(48),c=r(21),u=n.Buffer;function l(e,t){return 1===e.length?e[0]:e.length>1?o.concat(e,t):c.EMPTY_BUFFER}e.exports=class{constructor(e,t,r){this._binaryType=r||c.BINARY_TYPES[0],this._extensions=e||{},this._maxPayload=0|t,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._fragmented=0,this._masked=!1,this._fin=!1,this._mask=null,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._cleanupCallback=null,this._hadError=!1,this._dead=!1,this._loop=!1,this.onmessage=null,this.onclose=null,this.onerror=null,this.onping=null,this.onpong=null,this._state=0}readBuffer(e){var t,r,n=0;if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length)return t=this._buffers[0].slice(0,e),this._buffers[0]=this._buffers[0].slice(e),t;for(t=u.allocUnsafe(e);e>0;)e>=(r=this._buffers[0].length)?(this._buffers[0].copy(t,n),n+=r,this._buffers.shift()):(this._buffers[0].copy(t,n,0,e),this._buffers[0]=this._buffers[0].slice(e)),e-=r;return t}hasBufferedBytes(e){return this._bufferedBytes>=e||(this._loop=!1,this._dead&&this.cleanup(this._cleanupCallback),!1)}add(e){this._dead||(this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop())}startLoop(){for(this._loop=!0;this._loop;)switch(this._state){case 0:this.getInfo();break;case 1:this.getPayloadLength16();break;case 2:this.getPayloadLength64();break;case 3:this.getMask();break;case 4:this.getData();break;default:this._loop=!1}}getInfo(){if(!this.hasBufferedBytes(2))return;const e=this.readBuffer(2);if(0!=(48&e[0]))return void this.error(new Error("RSV2 and RSV3 must be clear"),1002);const t=64==(64&e[0]);if(!t||this._extensions[i.extensionName]){if(this._fin=128==(128&e[0]),this._opcode=15&e[0],this._payloadLength=127&e[1],0===this._opcode){if(t)return void this.error(new Error("RSV1 must be clear"),1002);if(!this._fragmented)return void this.error(new Error("invalid opcode: "+this._opcode),1002);this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented)return void this.error(new Error("invalid opcode: "+this._opcode),1002);this._compressed=t}else{if(!(this._opcode>7&&this._opcode<11))return void this.error(new Error("invalid opcode: "+this._opcode),1002);if(!this._fin)return void this.error(new Error("FIN must be set"),1002);if(t)return void this.error(new Error("RSV1 must be clear"),1002);if(this._payloadLength>125)return void this.error(new Error("invalid payload length"),1002)}this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=128==(128&e[1]),126===this._payloadLength?this._state=1:127===this._payloadLength?this._state=2:this.haveLength()}else this.error(new Error("RSV1 must be clear"),1002)}getPayloadLength16(){this.hasBufferedBytes(2)&&(this._payloadLength=this.readBuffer(2).readUInt16BE(0,!0),this.haveLength())}getPayloadLength64(){if(!this.hasBufferedBytes(8))return;const e=this.readBuffer(8),t=e.readUInt32BE(0,!0);t>Math.pow(2,21)-1?this.error(new Error("max payload size exceeded"),1009):(this._payloadLength=t*Math.pow(2,32)+e.readUInt32BE(4,!0),this.haveLength())}haveLength(){this._opcode<8&&this.maxPayloadExceeded(this._payloadLength)||(this._masked?this._state=3:this._state=4)}getMask(){this.hasBufferedBytes(4)&&(this._mask=this.readBuffer(4),this._state=4)}getData(){var e=c.EMPTY_BUFFER;if(this._payloadLength){if(!this.hasBufferedBytes(this._payloadLength))return;e=this.readBuffer(this._payloadLength),this._masked&&o.unmask(e,this._mask)}this._opcode>7?this.controlMessage(e):this._compressed?(this._state=5,this.decompress(e)):this.pushFragment(e)&&this.dataMessage()}decompress(e){this._extensions[i.extensionName].decompress(e,this._fin,(e,t)=>{e?this.error(e,1009===e.closeCode?1009:1007):(this.pushFragment(t)&&this.dataMessage(),this.startLoop())})}dataMessage(){if(this._fin){const t=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){var e;e="nodebuffer"===this._binaryType?l(r,t):"arraybuffer"===this._binaryType?function(e){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}(l(r,t)):r,this.onmessage(e)}else{const e=l(r,t);if(!s(e))return void this.error(new Error("invalid utf8 sequence"),1007);this.onmessage(e.toString())}}this._state=0}controlMessage(e){if(8!==this._opcode)9===this._opcode?this.onping(e):this.onpong(e),this._state=0;else if(0===e.length)this.onclose(1e3,""),this._loop=!1,this.cleanup(this._cleanupCallback);else if(1===e.length)this.error(new Error("invalid payload length"),1002);else{const t=e.readUInt16BE(0,!0);if(!a.isValidErrorCode(t))return void this.error(new Error("invalid status code: "+t),1002);const r=e.slice(2);if(!s(r))return void this.error(new Error("invalid utf8 sequence"),1007);this.onclose(t,r.toString()),this._loop=!1,this.cleanup(this._cleanupCallback)}}error(e,t){this.onerror(e,t),this._hadError=!0,this._loop=!1,this.cleanup(this._cleanupCallback)}maxPayloadExceeded(e){if(0===e||this._maxPayload<1)return!1;const t=this._totalPayloadLength+e;return t<=this._maxPayload?(this._totalPayloadLength=t,!1):(this.error(new Error("max payload size exceeded"),1009),!0)}pushFragment(e){if(0===e.length)return!0;const t=this._messageLength+e.length;return this._maxPayload<1||t<=this._maxPayload?(this._messageLength=t,this._fragments.push(e),!0):(this.error(new Error("max payload size exceeded"),1009),!1)}cleanup(e){this._dead=!0,this._hadError||!this._loop&&5!==this._state?(this._extensions=null,this._fragments=null,this._buffers=null,this._mask=null,this._cleanupCallback=null,this.onmessage=null,this.onclose=null,this.onerror=null,this.onping=null,this.onpong=null,e&&e()):this._cleanupCallback=e}}},function(e,t,r){"use strict";e.exports={isValidErrorCode:function(e){return e>=1e3&&e<=1013&&1004!==e&&1005!==e&&1006!==e||e>=3e3&&e<=4999},1e3:"normal",1001:"going away",1002:"protocol error",1003:"unsupported data",1004:"reserved",1005:"reserved for extensions",1006:"reserved for extensions",1007:"inconsistent or invalid data",1008:"policy violation",1009:"message too big",1010:"extension handshake missing",1011:"an unexpected condition prevented the request from being fulfilled",1012:"service restart",1013:"try again later"}},function(e,t,r){"use strict";const n=r(9),i=r(8),s=r(20),o=r(30),a=r(48),c=r(21),u=n.Buffer;class l{constructor(e,t){this._extensions=t||{},this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){const r=e.length<1024||t.mask&&t.readOnly;var n=t.mask?6:2,s=e.length;e.length>=65536?(n+=8,s=127):e.length>125&&(n+=2,s=126);const a=u.allocUnsafe(r?e.length+n:n);if(a[0]=t.fin?128|t.opcode:t.opcode,t.rsv1&&(a[0]|=64),126===s?a.writeUInt16BE(e.length,2,!0):127===s&&(a.writeUInt32BE(0,2,!0),a.writeUInt32BE(e.length,6,!0)),!t.mask)return a[1]=s,r?(e.copy(a,n),[a]):[a,e];const c=i.randomBytes(4);return a[1]=128|s,a[n-4]=c[0],a[n-3]=c[1],a[n-2]=c[2],a[n-1]=c[3],r?(o.mask(e,c,a,n,e.length),[a]):(o.mask(e,c,e,0,e.length),[a,e])}close(e,t,r,n){var i;if(void 0===e)e=1e3;else if("number"!=typeof e||!a.isValidErrorCode(e))throw new Error("first argument must be a valid error code number");void 0===t||""===t?1e3===e?i=c.EMPTY_BUFFER:(i=u.allocUnsafe(2)).writeUInt16BE(e,0,!0):((i=u.allocUnsafe(2+u.byteLength(t))).writeUInt16BE(e,0,!0),i.write(t,2)),this._deflating?this.enqueue([this.doClose,i,r,n]):this.doClose(i,r,n)}doClose(e,t,r){this.sendFrame(l.frame(e,{fin:!0,rsv1:!1,opcode:8,mask:t,readOnly:!1}),r)}ping(e,t){var r=!0;u.isBuffer(e)||(e instanceof ArrayBuffer?e=u.from(e):ArrayBuffer.isView(e)?e=h(e):(e=u.from(e),r=!1)),this._deflating?this.enqueue([this.doPing,e,t,r]):this.doPing(e,t,r)}doPing(e,t,r){this.sendFrame(l.frame(e,{fin:!0,rsv1:!1,opcode:9,mask:t,readOnly:r}))}pong(e,t){var r=!0;u.isBuffer(e)||(e instanceof ArrayBuffer?e=u.from(e):ArrayBuffer.isView(e)?e=h(e):(e=u.from(e),r=!1)),this._deflating?this.enqueue([this.doPong,e,t,r]):this.doPong(e,t,r)}doPong(e,t,r){this.sendFrame(l.frame(e,{fin:!0,rsv1:!1,opcode:10,mask:t,readOnly:r}))}send(e,t,r){var n=t.binary?2:1,i=t.compress,o=!0;u.isBuffer(e)||(e instanceof ArrayBuffer?e=u.from(e):ArrayBuffer.isView(e)?e=h(e):(e=u.from(e),o=!1));const a=this._extensions[s.extensionName];if(this._firstFragment?(this._firstFragment=!1,i&&a&&(i=e.length>=a._threshold),this._compress=i):(i=!1,n=0),t.fin&&(this._firstFragment=!0),a){const s={fin:t.fin,rsv1:i,opcode:n,mask:t.mask,readOnly:o};this._deflating?this.enqueue([this.dispatch,e,this._compress,s,r]):this.dispatch(e,this._compress,s,r)}else this.sendFrame(l.frame(e,{fin:t.fin,rsv1:!1,opcode:n,mask:t.mask,readOnly:o}),r)}dispatch(e,t,r,n){if(!t)return void this.sendFrame(l.frame(e,r),n);const i=this._extensions[s.extensionName];this._deflating=!0,i.compress(e,r.fin,(e,t)=>{r.readOnly=!1,this.sendFrame(l.frame(t,r),n),this._deflating=!1,this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){const e=this._queue.shift();this._bufferedBytes-=e[1].length,e[0].apply(this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[1].length,this._queue.push(e)}sendFrame(e,t){2===e.length?(this._socket.write(e[0]),this._socket.write(e[1],t)):this._socket.write(e[0],t)}}function h(e){const t=u.from(e.buffer);return e.byteLength!==e.buffer.byteLength?t.slice(e.byteOffset,e.byteOffset+e.byteLength):t}e.exports=l},function(e,t,r){var n=r(0);r(1),n.cipher=n.cipher||{};var i=e.exports=n.cipher.modes=n.cipher.modes||{};function s(e,t){if("string"==typeof e&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var r=e;e=n.util.createBuffer();for(var i=0;i<r.length;++i)e.putByte(r[i])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!n.util.isArray(e)){var s=[],o=t/4;for(i=0;i<o;++i)s.push(e.getInt32());e=s}return e}function o(e){e[e.length-1]=e[e.length-1]+1&4294967295}function a(e){return[e/4294967296|0,4294967295&e]}i.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.ecb.prototype.start=function(e){},i.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=s(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=s(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);else{var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(s>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);else{var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(s>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=s(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(s>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=s(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(s>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}o(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(a(8*i)))}this._inBlock=this._j0.slice(0),o(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=a(8*t.length());var s=t.length()%this.blockSize;for(s&&t.fillWithByte(0,this.blockSize-s),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(s<=0||r){if(r){var a=n%this.blockSize;this._cipherLength+=a,this._partialOutput.truncate(this.blockSize-a)}else this._cipherLength+=this.blockSize;for(i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),o(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),o(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=n.util.createBuffer();var i=this._aDataLength.concat(a(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var s=[];this.cipher.encrypt(this._j0,s);for(var o=0;o<this._ints;++o)this.tag.putInt32(this._s[o]^s[o]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i){e[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r},i.gcm.prototype.pow=function(e,t){for(var r=1&e[3],n=3;n>0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,s=new Array(i),o=0;o<i;++o){var a=[0,0,0,0],c=(n-1-o%n)*t;a[o/n|0]=1<<t-1<<c,s[o]=this.generateSubHashTable(this.multiply(a,e),t)}return s},i.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var s=n>>>1;s>0;)this.pow(i[2*s],i[s]=[]),s>>=1;for(s=2;s<n;){for(var o=1;o<s;++o){var a=i[s],c=i[o];i[s+o]=[a[0]^c[0],a[1]^c[1],a[2]^c[2],a[3]^c[3]]}s*=2}for(i[0]=[0,0,0,0],s=n+1;s<r;++s){var u=i[s^n];i[s]=[e[0]^u[0],e[1]^u[1],e[2]^u[2],e[3]^u[3]]}return i}},function(e,t,r){var n=r(0);r(4),r(14),r(32),r(10),r(52),r(3),r(15),r(1);var i=function(e,t,r,i){var s=n.util.createBuffer(),o=e.length>>1,a=o+(1&e.length),c=e.substr(0,a),u=e.substr(o,a),l=n.util.createBuffer(),h=n.hmac.create();r=t+r;var p=Math.ceil(i/16),f=Math.ceil(i/20);h.start("MD5",c);var d=n.util.createBuffer();l.putBytes(r);for(var y=0;y<p;++y)h.start(null,null),h.update(l.getBytes()),l.putBuffer(h.digest()),h.start(null,null),h.update(l.bytes()+r),d.putBuffer(h.digest());h.start("SHA1",u);var g=n.util.createBuffer();l.clear(),l.putBytes(r);for(y=0;y<f;++y)h.start(null,null),h.update(l.getBytes()),l.putBuffer(h.digest()),h.start(null,null),h.update(l.bytes()+r),g.putBuffer(h.digest());return s.putBytes(n.util.xorBytes(d.getBytes(),g.getBytes(),i)),s},s=function(e,t,r){var i=!1;try{var s=e.deflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(s),t.length=s.length,i=!0}catch(e){}return i},o=function(e,t,r){var i=!1;try{var s=e.inflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(s),t.length=s.length,i=!0}catch(e){}return i},a=function(e,t){var r=0;switch(t){case 1:r=e.getByte();break;case 2:r=e.getInt16();break;case 3:r=e.getInt24();break;case 4:r=e.getInt32()}return n.util.createBuffer(e.getBytes(r))},c=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},u={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}}};u.SupportedVersions=[u.Versions.TLS_1_1,u.Versions.TLS_1_0],u.Version=u.SupportedVersions[0],u.MaxFragment=15360,u.ConnectionEnd={server:0,client:1},u.PRFAlgorithm={tls_prf_sha256:0},u.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},u.CipherType={stream:0,block:1,aead:2},u.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},u.CompressionMethod={none:0,deflate:1},u.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},u.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},u.Alert={},u.Alert.Level={warning:1,fatal:2},u.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},u.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},u.CipherSuites={},u.getCipherSuite=function(e){var t=null;for(var r in u.CipherSuites){var n=u.CipherSuites[r];if(n.id[0]===e.charCodeAt(0)&&n.id[1]===e.charCodeAt(1)){t=n;break}}return t},u.handleUnexpected=function(e,t){!e.open&&e.entity===u.ConnectionEnd.client||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unexpected_message}})},u.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(u.queue(e,u.createAlert(e,{level:u.Alert.Level.warning,description:u.Alert.Description.no_renegotiation})),u.flush(e)),e.process()},u.parseHelloMessage=function(e,t,r){var i=null,s=e.entity===u.ConnectionEnd.client;if(r<38)e.error(e,{message:s?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});else{var o=t.fragment,c=o.length();if(i={version:{major:o.getByte(),minor:o.getByte()},random:n.util.createBuffer(o.getBytes(32)),session_id:a(o,1),extensions:[]},s?(i.cipher_suite=o.getBytes(2),i.compression_method=o.getByte()):(i.cipher_suites=a(o,2),i.compression_methods=a(o,1)),(c=r-(c-o.length()))>0){for(var l=a(o,2);l.length()>0;)i.extensions.push({type:[l.getByte(),l.getByte()],data:a(l,2)});if(!s)for(var h=0;h<i.extensions.length;++h){var p=i.extensions[h];if(0===p.type[0]&&0===p.type[1])for(var f=a(p.data,2);f.length()>0;){if(0!==f.getByte())break;e.session.extensions.server_name.serverNameList.push(a(f,2).getBytes())}}}if(e.session.version&&(i.version.major!==e.session.version.major||i.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});if(s)e.session.cipherSuite=u.getCipherSuite(i.cipher_suite);else for(var d=n.util.createBuffer(i.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=u.getCipherSuite(d.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(i.cipher_suite)});e.session.compressionMethod=s?i.compression_method:u.CompressionMethod.none}return i},u.createSecurityParameters=function(e,t){var r=e.entity===u.ConnectionEnd.client,n=t.random.bytes(),i=r?e.session.sp.client_random:n,s=r?n:u.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:u.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:s}},u.handleServerHello=function(e,t,r){var n=u.parseHelloMessage(e,t,r);if(!e.fail){if(!(n.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});e.version.minor=n.version.minor,e.session.version=e.version;var i=n.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=d,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=l,e.session.resuming=!1,u.createSecurityParameters(e,n)),e.session.id=i,e.process()}},u.handleClientHello=function(e,t,r){var i=u.parseHelloMessage(e,t,r);if(!e.fail){var s=i.session_id.bytes(),o=null;if(e.sessionCache&&(null===(o=e.sessionCache.getSession(s))?s="":(o.version.major!==i.version.major||o.version.minor>i.version.minor)&&(o=null,s="")),0===s.length&&(s=n.random.getBytes(32)),e.session.id=s,e.session.clientHelloVersion=i.version,e.session.sp={},o)e.version=e.session.version=o.version,e.session.sp=o.sp;else{for(var a,c=1;c<u.SupportedVersions.length&&!((a=u.SupportedVersions[c]).minor<=i.version.minor);++c);e.version={major:a.major,minor:a.minor},e.session.version=e.version}null!==o?(e.expect=S,e.session.resuming=!0,e.session.sp.client_random=i.random.bytes()):(e.expect=!1!==e.verifyClient?v:C,e.session.resuming=!1,u.createSecurityParameters(e,i)),e.open=!0,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerHello(e)})),e.session.resuming?(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))):(u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)})),e.fail||(u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerKeyExchange(e)})),!1!==e.verifyClient&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateRequest(e)})),u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerHelloDone(e)})))),u.flush(e),e.process()}},u.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var i,s,o=t.fragment,c={certificate_list:a(o,3)},l=[];try{for(;c.certificate_list.length()>0;)i=a(c.certificate_list,3),s=n.asn1.fromDer(i),i=n.pki.certificateFromAsn1(s,!0),l.push(i)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var p=e.entity===u.ConnectionEnd.client;!p&&!0!==e.verifyClient||0!==l.length?0===l.length?e.expect=p?h:C:(p?e.session.serverCertificate=l[0]:e.session.clientCertificate=l[0],u.verifyCertificateChain(e,l)&&(e.expect=p?h:C)):e.error(e,{message:p?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}}),e.process()},u.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});e.expect=p,e.process()},u.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});var i=t.fragment,s={enc_pre_master_secret:a(i,2).getBytes()},o=null;if(e.getPrivateKey)try{o=e.getPrivateKey(e,e.session.serverCertificate),o=n.pki.privateKeyFromPem(o)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}if(null===o)return e.error(e,{message:"No private key set.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}});try{var c=e.session.sp;c.pre_master_secret=o.decrypt(s.enc_pre_master_secret);var l=e.session.clientHelloVersion;if(l.major!==c.pre_master_secret.charCodeAt(0)||l.minor!==c.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){c.pre_master_secret=n.random.getBytes(48)}e.expect=S,null!==e.session.clientCertificate&&(e.expect=E),e.process()},u.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var n=t.fragment,i={certificate_types:a(n,1),certificate_authorities:a(n,2)};e.session.certificateRequest=i,e.expect=f,e.process()},u.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var i=t.fragment;i.read-=4;var s=i.bytes();i.read+=4;var o={signature:a(i,2).getBytes()},c=n.util.createBuffer();c.putBuffer(e.session.md5.digest()),c.putBuffer(e.session.sha1.digest()),c=c.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(c,o.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(s),e.session.sha1.update(s)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure}})}e.expect=S,e.process()},u.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.record_overflow}});if(null===e.serverCertificate){var i={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.insufficient_security}},s=e.verify(e,i.alert.description,0,[]);if(!0!==s)return(s||0===s)&&("object"!=typeof s||n.util.isArray(s)?"number"==typeof s&&(i.alert.description=s):(s.message&&(i.message=s.message),s.alert&&(i.alert.description=s.alert))),e.error(e,i)}null!==e.session.certificateRequest&&(t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)}),u.queue(e,t)),t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createClientKeyExchange(e)}),u.queue(e,t),e.expect=m;var o=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateVerify(e,t)})),u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)})),e.expect=d,u.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return o(e,null);u.getClientSignature(e,o)},u.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var r=e.entity===u.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=u.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?y:b,e.process()},u.handleFinished=function(e,t,r){var s=t.fragment;s.read-=4;var o=s.bytes();s.read+=4;var a=t.fragment.getBytes();(s=n.util.createBuffer()).putBuffer(e.session.md5.digest()),s.putBuffer(e.session.sha1.digest());var c=e.entity===u.ConnectionEnd.client,l=c?"server finished":"client finished",h=e.session.sp;if((s=i(h.master_secret,l,s.getBytes(),12)).getBytes()!==a)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decrypt_error}});e.session.md5.update(o),e.session.sha1.update(o),(e.session.resuming&&c||!e.session.resuming&&!c)&&(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))),e.expect=c?g:T,e.handshaking=!1,++e.handshakes,e.peerCertificate=c?e.session.serverCertificate:e.session.clientCertificate,u.flush(e),e.isConnected=!0,e.connected(e),e.process()},u.handleAlert=function(e,t){var r,n=t.fragment,i={level:n.getByte(),description:n.getByte()};switch(i.description){case u.Alert.Description.close_notify:r="Connection closed.";break;case u.Alert.Description.unexpected_message:r="Unexpected message.";break;case u.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case u.Alert.Description.decryption_failed:r="Decryption failed.";break;case u.Alert.Description.record_overflow:r="Record overflow.";break;case u.Alert.Description.decompression_failure:r="Decompression failed.";break;case u.Alert.Description.handshake_failure:r="Handshake failure.";break;case u.Alert.Description.bad_certificate:r="Bad certificate.";break;case u.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case u.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case u.Alert.Description.certificate_expired:r="Certificate expired.";break;case u.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case u.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case u.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case u.Alert.Description.access_denied:r="Access denied.";break;case u.Alert.Description.decode_error:r="Decode error.";break;case u.Alert.Description.decrypt_error:r="Decrypt error.";break;case u.Alert.Description.export_restriction:r="Export restriction.";break;case u.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case u.Alert.Description.insufficient_security:r="Insufficient security.";break;case u.Alert.Description.internal_error:r="Internal error.";break;case u.Alert.Description.user_canceled:r="User canceled.";break;case u.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(i.description===u.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===u.ConnectionEnd.client?"server":"client",alert:i}),e.process()},u.handleHandshake=function(e,t){var r=t.fragment,i=r.getByte(),s=r.getInt24();if(s>r.length())return e.fragmented=t,t.fragment=n.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var o=r.bytes(s+4);r.read+=4,i in V[e.entity][e.expect]?(e.entity!==u.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),i!==u.HandshakeType.hello_request&&i!==u.HandshakeType.certificate_verify&&i!==u.HandshakeType.finished&&(e.session.md5.update(o),e.session.sha1.update(o)),V[e.entity][e.expect][i](e,t,s)):u.handleUnexpected(e,t)},u.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},u.handleHeartbeat=function(e,t){var r=t.fragment,i=r.getByte(),s=r.getInt16(),o=r.getBytes(s);if(i===u.HeartbeatMessageType.heartbeat_request){if(e.handshaking||s>o.length)return e.process();u.queue(e,u.createRecord(e,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_response,o)})),u.flush(e)}else if(i===u.HeartbeatMessageType.heartbeat_response){if(o!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,n.util.createBuffer(o))}e.process()};var l=1,h=2,p=3,f=4,d=5,y=6,g=7,m=8,v=1,C=2,E=3,S=4,b=5,T=6,_=u.handleUnexpected,A=u.handleChangeCipherSpec,I=u.handleAlert,B=u.handleHandshake,w=u.handleApplicationData,k=u.handleHeartbeat,R=[];R[u.ConnectionEnd.client]=[[_,I,B,_,k],[_,I,B,_,k],[_,I,B,_,k],[_,I,B,_,k],[_,I,B,_,k],[A,I,_,_,k],[_,I,B,_,k],[_,I,B,w,k],[_,I,B,_,k]],R[u.ConnectionEnd.server]=[[_,I,B,_,k],[_,I,B,_,k],[_,I,B,_,k],[_,I,B,_,k],[A,I,_,_,k],[_,I,B,_,k],[_,I,B,w,k],[_,I,B,_,k]];var N=u.handleHelloRequest,L=u.handleServerHello,x=u.handleCertificate,O=u.handleServerKeyExchange,D=u.handleCertificateRequest,U=u.handleServerHelloDone,P=u.handleFinished,V=[];V[u.ConnectionEnd.client]=[[_,_,L,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_],[N,_,_,_,_,_,_,_,_,_,_,x,O,D,U,_,_,_,_,_,_],[N,_,_,_,_,_,_,_,_,_,_,_,O,D,U,_,_,_,_,_,_],[N,_,_,_,_,_,_,_,_,_,_,_,_,D,U,_,_,_,_,_,_],[N,_,_,_,_,_,_,_,_,_,_,_,_,_,U,_,_,_,_,_,_],[N,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_],[N,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,P],[N,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_],[N,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_]];var M=u.handleClientHello,F=u.handleClientKeyExchange,K=u.handleCertificateVerify;V[u.ConnectionEnd.server]=[[_,M,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_],[_,_,_,_,_,_,_,_,_,_,_,x,_,_,_,_,_,_,_,_,_],[_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,F,_,_,_,_],[_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,K,_,_,_,_,_],[_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_],[_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,P],[_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_],[_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_]],u.generateKeys=function(e,t){var r=i,n=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",n,48).bytes(),t.pre_master_secret=null),n=t.server_random+t.client_random;var s=2*t.mac_key_length+2*t.enc_key_length,o=e.version.major===u.Versions.TLS_1_0.major&&e.version.minor===u.Versions.TLS_1_0.minor;o&&(s+=2*t.fixed_iv_length);var a=r(t.master_secret,"key expansion",n,s),c={client_write_MAC_key:a.getBytes(t.mac_key_length),server_write_MAC_key:a.getBytes(t.mac_key_length),client_write_key:a.getBytes(t.enc_key_length),server_write_key:a.getBytes(t.enc_key_length)};return o&&(c.client_write_IV=a.getBytes(t.fixed_iv_length),c.server_write_IV=a.getBytes(t.fixed_iv_length)),c},u.createConnectionState=function(e){var t=e.entity===u.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},n={read:r(),write:r()};if(n.read.update=function(e,t){return n.read.cipherFunction(t,n.read)?n.read.compressFunction(e,t,n.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_record_mac}}),!e.fail},n.write.update=function(e,t){return n.write.compressFunction(e,t,n.write)?n.write.cipherFunction(t,n.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=u.generateKeys(e,i),n.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,n.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(n,e,i),i.compression_algorithm){case u.CompressionMethod.none:break;case u.CompressionMethod.deflate:n.read.compressFunction=o,n.write.compressFunction=s;break;default:throw new Error("Unsupported compression algorithm.")}}return n},u.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=n.util.createBuffer();return r.putInt32(t),r.putBytes(n.random.getBytes(28)),r},u.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},u.createAlert=function(e,t){var r=n.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),u.createRecord(e,{type:u.ContentType.alert,data:r})},u.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=n.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var i=e.cipherSuites[r];t.putByte(i.id[0]),t.putByte(i.id[1])}var s=t.length(),o=n.util.createBuffer();o.putByte(u.CompressionMethod.none);var a=o.length(),l=n.util.createBuffer();if(e.virtualHost){var h=n.util.createBuffer();h.putByte(0),h.putByte(0);var p=n.util.createBuffer();p.putByte(0),c(p,2,n.util.createBuffer(e.virtualHost));var f=n.util.createBuffer();c(f,2,p),c(h,2,f),l.putBuffer(h)}var d=l.length();d>0&&(d+=2);var y=e.session.id,g=y.length+1+2+4+28+2+s+1+a+d,m=n.util.createBuffer();return m.putByte(u.HandshakeType.client_hello),m.putInt24(g),m.putByte(e.version.major),m.putByte(e.version.minor),m.putBytes(e.session.sp.client_random),c(m,1,n.util.createBuffer(y)),c(m,2,t),c(m,1,o),d>0&&c(m,2,l),m},u.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,i=n.util.createBuffer();return i.putByte(u.HandshakeType.server_hello),i.putInt24(r),i.putByte(e.version.major),i.putByte(e.version.minor),i.putBytes(e.session.sp.server_random),c(i,1,n.util.createBuffer(t)),i.putByte(e.session.cipherSuite.id[0]),i.putByte(e.session.cipherSuite.id[1]),i.putByte(e.session.compressionMethod),i},u.createCertificate=function(e){var t,r=e.entity===u.ConnectionEnd.client,i=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,i=e.getCertificate(e,t));var s=n.util.createBuffer();if(null!==i)try{n.util.isArray(i)||(i=[i]);for(var o=null,a=0;a<i.length;++a){var l=n.pem.decode(i[a])[0];if("CERTIFICATE"!==l.type&&"X509 CERTIFICATE"!==l.type&&"TRUSTED CERTIFICATE"!==l.type){var h=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw h.headerType=l.type,h}if(l.procType&&"ENCRYPTED"===l.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var p=n.util.createBuffer(l.body);null===o&&(o=n.asn1.fromDer(p.bytes(),!1));var f=n.util.createBuffer();c(f,3,p),s.putBuffer(f)}i=n.pki.certificateFromAsn1(o),r?e.session.clientCertificate=i:e.session.serverCertificate=i}catch(t){return e.error(e,{message:"Could not send certificate list.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var d=3+s.length(),y=n.util.createBuffer();return y.putByte(u.HandshakeType.certificate),y.putInt24(d),c(y,3,s),y},u.createClientKeyExchange=function(e){var t=n.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(n.random.getBytes(46));var r=e.session.sp;r.pre_master_secret=t.getBytes();var i=(t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret)).length+2,s=n.util.createBuffer();return s.putByte(u.HandshakeType.client_key_exchange),s.putInt24(i),s.putInt16(t.length),s.putBytes(t),s},u.createServerKeyExchange=function(e){var t=n.util.createBuffer();return t},u.getClientSignature=function(e,t){var r=n.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(e,t,r){var i=null;if(e.getPrivateKey)try{i=e.getPrivateKey(e,e.session.clientCertificate),i=n.pki.privateKeyFromPem(i)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}null===i?e.error(e,{message:"No private key set.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):t=i.sign(t,null),r(e,t)},e.getSignature(e,r,t)},u.createCertificateVerify=function(e,t){var r=t.length+2,i=n.util.createBuffer();return i.putByte(u.HandshakeType.certificate_verify),i.putInt24(r),i.putInt16(t.length),i.putBytes(t),i},u.createCertificateRequest=function(e){var t=n.util.createBuffer();t.putByte(1);var r=n.util.createBuffer();for(var i in e.caStore.certs){var s=e.caStore.certs[i],o=n.pki.distinguishedNameToAsn1(s.subject),a=n.asn1.toDer(o);r.putInt16(a.length()),r.putBuffer(a)}var l=1+t.length()+2+r.length(),h=n.util.createBuffer();return h.putByte(u.HandshakeType.certificate_request),h.putInt24(l),c(h,1,t),c(h,2,r),h},u.createServerHelloDone=function(e){var t=n.util.createBuffer();return t.putByte(u.HandshakeType.server_hello_done),t.putInt24(0),t},u.createChangeCipherSpec=function(){var e=n.util.createBuffer();return e.putByte(1),e},u.createFinished=function(e){var t=n.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===u.ConnectionEnd.client,s=e.session.sp,o=r?"client finished":"server finished";t=i(s.master_secret,o,t.getBytes(),12);var a=n.util.createBuffer();return a.putByte(u.HandshakeType.finished),a.putInt24(t.length()),a.putBuffer(t),a},u.createHeartbeat=function(e,t,r){void 0===r&&(r=t.length);var i=n.util.createBuffer();i.putByte(e),i.putInt16(r),i.putBytes(t);var s=i.length(),o=Math.max(16,s-r-3);return i.putBytes(n.random.getBytes(o)),i},u.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==u.ContentType.handshake&&t.type!==u.ContentType.alert&&t.type!==u.ContentType.change_cipher_spec)){if(t.type===u.ContentType.handshake){var r=t.fragment.bytes();e.session.md5.update(r),e.session.sha1.update(r),r=null}var i;if(t.fragment.length()<=u.MaxFragment)i=[t];else{i=[];for(var s=t.fragment.bytes();s.length>u.MaxFragment;)i.push(u.createRecord(e,{type:t.type,data:n.util.createBuffer(s.slice(0,u.MaxFragment))})),s=s.slice(u.MaxFragment);s.length>0&&i.push(u.createRecord(e,{type:t.type,data:n.util.createBuffer(s)}))}for(var o=0;o<i.length&&!e.fail;++o){var a=i[o];e.state.current.write.update(e,a)&&e.records.push(a)}}},u.flush=function(e){for(var t=0;t<e.records.length;++t){var r=e.records[t];e.tlsData.putByte(r.type),e.tlsData.putByte(r.version.major),e.tlsData.putByte(r.version.minor),e.tlsData.putInt16(r.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var q=function(e){switch(e){case!0:return!0;case n.pki.certificateError.bad_certificate:return u.Alert.Description.bad_certificate;case n.pki.certificateError.unsupported_certificate:return u.Alert.Description.unsupported_certificate;case n.pki.certificateError.certificate_revoked:return u.Alert.Description.certificate_revoked;case n.pki.certificateError.certificate_expired:return u.Alert.Description.certificate_expired;case n.pki.certificateError.certificate_unknown:return u.Alert.Description.certificate_unknown;case n.pki.certificateError.unknown_ca:return u.Alert.Description.unknown_ca;default:return u.Alert.Description.bad_certificate}};for(var j in u.verifyCertificateChain=function(e,t){try{var r={};for(var i in e.verifyOptions)r[i]=e.verifyOptions[i];r.verify=function(t,r,i){q(t);var s=e.verify(e,t,r,i);if(!0!==s){if("object"==typeof s&&!n.util.isArray(s)){var o=new Error("The application rejected the certificate.");throw o.send=!0,o.alert={level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate},s.message&&(o.message=s.message),s.alert&&(o.alert.description=s.alert),o}s!==t&&(s=function(e){switch(e){case!0:return!0;case u.Alert.Description.bad_certificate:return n.pki.certificateError.bad_certificate;case u.Alert.Description.unsupported_certificate:return n.pki.certificateError.unsupported_certificate;case u.Alert.Description.certificate_revoked:return n.pki.certificateError.certificate_revoked;case u.Alert.Description.certificate_expired:return n.pki.certificateError.certificate_expired;case u.Alert.Description.certificate_unknown:return n.pki.certificateError.certificate_unknown;case u.Alert.Description.unknown_ca:return n.pki.certificateError.unknown_ca;default:return n.pki.certificateError.bad_certificate}}(s))}return s},n.pki.verifyCertificateChain(e.caStore,t,r)}catch(t){var s=t;("object"!=typeof s||n.util.isArray(s))&&(s={send:!0,alert:{level:u.Alert.Level.fatal,description:q(t)}}),"send"in s||(s.send=!0),"alert"in s||(s.alert={level:u.Alert.Level.fatal,description:q(s.error)}),e.error(e,s)}return!e.fail},u.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{for(var i in(r={}).cache=e||{},r.capacity=Math.max(t||100,1),r.order=[],e)r.order.length<=t?r.order.push(i):delete e[i];r.getSession=function(e){var t=null,i=null;if(e?i=n.util.bytesToHex(e):r.order.length>0&&(i=r.order[0]),null!==i&&i in r.cache)for(var s in t=r.cache[i],delete r.cache[i],r.order)if(r.order[s]===i){r.order.splice(s,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}i=n.util.bytesToHex(e);r.order.push(i),r.cache[i]=t}}return r},u.createConnection=function(e){var t=null;t=e.caStore?n.util.isArray(e.caStore)?n.pki.createCaStore(e.caStore):e.caStore:n.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var i in r=[],u.CipherSuites)r.push(u.CipherSuites[i]);var s=e.server?u.ConnectionEnd.server:u.ConnectionEnd.client,o=e.sessionCache?u.createSessionCache(e.sessionCache):null,a={version:{major:u.Version.major,minor:u.Version.minor},entity:s,sessionId:e.sessionId,caStore:t,sessionCache:o,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,n){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===u.ConnectionEnd.client?"client":"server"),r.send&&(u.queue(t,u.createAlert(t,r.alert)),u.flush(t));var n=!1!==r.fatal;n&&(t.fail=!0),e.error(t,r),n&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){a.version={major:u.Version.major,minor:u.Version.minor},a.record=null,a.session=null,a.peerCertificate=null,a.state={pending:null,current:null},a.expect=(a.entity,u.ConnectionEnd.client,0),a.fragmented=null,a.records=[],a.open=!1,a.handshakes=0,a.handshaking=!1,a.isConnected=!1,a.fail=!(e||void 0===e),a.input.clear(),a.tlsData.clear(),a.data.clear(),a.state.current=u.createConnectionState(a)}};a.reset();return a.handshake=function(e){if(a.entity!==u.ConnectionEnd.client)a.error(a,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(a.handshaking)a.error(a,{message:"Handshake already in progress.",fatal:!1});else{a.fail&&!a.open&&0===a.handshakes&&(a.fail=!1),a.handshaking=!0;var t=null;(e=e||"").length>0&&(a.sessionCache&&(t=a.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&a.sessionCache&&null!==(t=a.sessionCache.getSession())&&(e=t.id),a.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:n.md.md5.create(),sha1:n.md.sha1.create()},t&&(a.version=t.version,a.session.sp=t.sp),a.session.sp.client_random=u.createRandom().getBytes(),a.open=!0,u.queue(a,u.createRecord(a,{type:u.ContentType.handshake,data:u.createClientHello(a)})),u.flush(a)}},a.process=function(e){var t=0;return e&&a.input.putBytes(e),a.fail||(null!==a.record&&a.record.ready&&a.record.fragment.isEmpty()&&(a.record=null),null===a.record&&(t=function(e){var t=0,r=e.input,i=r.length();if(i<5)t=5-i;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var s=e.record.version.major===e.version.major;s&&e.session&&e.session.version&&(s=e.record.version.minor===e.version.minor),s||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}})}return t}(a)),a.fail||null===a.record||a.record.ready||(t=function(e){var t=0,r=e.input,n=r.length();n<e.record.length?t=e.record.length-n:(e.record.fragment.putBytes(r.getBytes(e.record.length)),r.compact(),e.state.current.read.update(e,e.record)&&(null!==e.fragmented&&(e.fragmented.type===e.record.type?(e.fragmented.fragment.putBuffer(e.record.fragment),e.record=e.fragmented):e.error(e,{message:"Invalid fragmented record.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unexpected_message}})),e.record.ready=!0));return t}(a)),!a.fail&&null!==a.record&&a.record.ready&&function(e,t){var r=t.type-u.ContentType.change_cipher_spec,n=R[e.entity][e.expect];r in n?n[r](e,t):u.handleUnexpected(e,t)}(a,a.record)),t},a.prepare=function(e){return u.queue(a,u.createRecord(a,{type:u.ContentType.application_data,data:n.util.createBuffer(e)})),u.flush(a)},a.prepareHeartbeatRequest=function(e,t){return e instanceof n.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),a.expectedHeartbeatPayload=e,u.queue(a,u.createRecord(a,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_request,e,t)})),u.flush(a)},a.close=function(e){if(!a.fail&&a.sessionCache&&a.session){var t={id:a.session.id,version:a.session.version,sp:a.session.sp};t.sp.keys=null,a.sessionCache.setSession(t.id,t)}a.open&&(a.open=!1,a.input.clear(),(a.isConnected||a.handshaking)&&(a.isConnected=a.handshaking=!1,u.queue(a,u.createAlert(a,{level:u.Alert.Level.warning,description:u.Alert.Description.close_notify})),u.flush(a)),a.closed(a)),a.reset(e)},a},e.exports=n.tls=n.tls||{},u)"function"!=typeof u[j]&&(n.tls[j]=u[j]);n.tls.prf_tls1=i,n.tls.hmac_sha1=function(e,t,r){var i=n.hmac.create();i.start("SHA1",e);var s=n.util.createBuffer();return s.putInt32(t[0]),s.putInt32(t[1]),s.putByte(r.type),s.putByte(r.version.major),s.putByte(r.version.minor),s.putInt16(r.length),s.putBytes(r.fragment.bytes()),i.update(s.getBytes()),i.digest().getBytes()},n.tls.createSessionCache=u.createSessionCache,n.tls.createConnection=u.createConnection},function(e,t,r){var n=r(0);r(4),r(7),r(53),r(10),r(33),r(59),r(35),r(23),r(1),r(34);var i=n.asn1,s=e.exports=n.pki=n.pki||{};s.pemToDer=function(e){var t=n.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return n.util.createBuffer(t.body)},s.privateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var o=i.fromDer(t.body);return s.privateKeyFromAsn1(o)},s.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(s.privateKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},s.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:i.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})}},function(e,t,r){var n=r(0);if(r(6),r(4),r(22),r(5),r(7),r(33),r(10),r(3),r(56),r(23),r(1),void 0===i)var i=n.jsbn.BigInteger;var s=n.asn1,o=n.pki=n.pki||{};e.exports=o.pbe=n.pbe=n.pbe||{};var a=o.oids,c={name:"EncryptedPrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},u={name:"PBES2Algorithms",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},l={name:"pkcs-12PbeParams",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"iterations"}]};function h(e,t){return e.start().update(t).digest().getBytes()}function p(e){var t;if(e){if(!(t=o.oids[s.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return f(t)}function f(e){var t=n.md;switch(e){case"hmacWithSHA224":t=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}o.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,c,u,l=n.random.getBytesSync(r.saltSize),h=r.count,p=s.integerToDer(h);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var d,y,g;switch(r.algorithm){case"aes128":i=16,d=16,y=a["aes128-CBC"],g=n.aes.createEncryptionCipher;break;case"aes192":i=24,d=16,y=a["aes192-CBC"],g=n.aes.createEncryptionCipher;break;case"aes256":i=32,d=16,y=a["aes256-CBC"],g=n.aes.createEncryptionCipher;break;case"des":i=8,d=8,y=a.desCBC,g=n.des.createEncryptionCipher;break;default:throw(b=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,b}var m="hmacWith"+r.prfAlgorithm.toUpperCase(),v=f(m),C=n.pkcs5.pbkdf2(t,l,h,i,v),E=n.random.getBytesSync(d);(T=g(C)).start(E),T.update(s.toDer(e)),T.finish(),u=T.output.getBytes();var S=function(e,t,r,i){var a=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,t.getBytes())]);"hmacWithSHA1"!==i&&a.value.push(s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(o.oids[i]).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]));return a}(l,p,i,m);c=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(a.pkcs5PBES2).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(a.pkcs5PBKDF2).getBytes()),S]),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(y).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,E)])])])}else{var b;if("3des"!==r.algorithm)throw(b=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,b;i=24;var T,_=new n.util.ByteBuffer(l);C=o.pbe.generatePkcs12Key(t,_,1,h,i),E=o.pbe.generatePkcs12Key(t,_,2,h,i);(T=n.des.createEncryptionCipher(C)).start(E),T.update(s.toDer(e)),T.finish(),u=T.output.getBytes(),c=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(a["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,l),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,p.getBytes())])])}return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[c,s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,u)])},o.decryptPrivateKeyInfo=function(e,t){var r=null,i={},a=[];if(!s.validate(e,c,i,a)){var u=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw u.errors=a,u}var l=s.derToOid(i.encryptionOid),h=o.pbe.getCipher(l,i.encryptionParams,t),p=n.util.createBuffer(i.encryptedData);return h.update(p),h.finish()&&(r=s.fromDer(h.output)),r},o.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:s.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},o.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return s.fromDer(t.body)},o.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=o.wrapRsaPrivateKey(o.privateKeyToAsn1(e));return i=o.encryptPrivateKeyInfo(i,t,r),o.encryptedPrivateKeyToPem(i)}var a,c,u,l;switch(r.algorithm){case"aes128":a="AES-128-CBC",u=16,c=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes192":a="AES-192-CBC",u=24,c=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes256":a="AES-256-CBC",u=32,c=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"3des":a="DES-EDE3-CBC",u=24,c=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;case"des":a="DES-CBC",u=8,c=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;default:var h=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw h.algorithm=r.algorithm,h}var p=l(n.pbe.opensslDeriveBytes(t,c.substr(0,8),u));p.start(c),p.update(s.toDer(o.privateKeyToAsn1(e))),p.finish();var f={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:a,parameters:n.util.bytesToHex(c).toUpperCase()},body:p.output.getBytes()};return n.pem.encode(f)},o.decryptRsaPrivateKey=function(e,t){var r=null,i=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(u=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=u,u;if(i.procType&&"ENCRYPTED"===i.procType.type){var a,c;switch(i.dekInfo.algorithm){case"DES-CBC":a=8,c=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,c=n.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,c=n.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,c=n.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,c=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,c=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":a=8,c=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":a=16,c=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var u;throw(u=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,u}var l=n.util.hexToBytes(i.dekInfo.parameters),h=c(n.pbe.opensslDeriveBytes(t,l.substr(0,8),a));if(h.start(l),h.update(n.util.createBuffer(i.body)),!h.finish())return r;r=h.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?o.decryptPrivateKeyInfo(s.fromDer(r),t):s.fromDer(r))&&(r=o.privateKeyFromAsn1(r)),r},o.pbe.generatePkcs12Key=function(e,t,r,i,s,o){var a,c;if(null==o){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');o=n.md.sha1.create()}var u=o.digestLength,l=o.blockLength,h=new n.util.ByteBuffer,p=new n.util.ByteBuffer;if(null!=e){for(c=0;c<e.length;c++)p.putInt16(e.charCodeAt(c));p.putInt16(0)}var f=p.length(),d=t.length(),y=new n.util.ByteBuffer;y.fillWithByte(r,l);var g=l*Math.ceil(d/l),m=new n.util.ByteBuffer;for(c=0;c<g;c++)m.putByte(t.at(c%d));var v=l*Math.ceil(f/l),C=new n.util.ByteBuffer;for(c=0;c<v;c++)C.putByte(p.at(c%f));var E=m;E.putBuffer(C);for(var S=Math.ceil(s/u),b=1;b<=S;b++){var T=new n.util.ByteBuffer;T.putBytes(y.bytes()),T.putBytes(E.bytes());for(var _=0;_<i;_++)o.start(),o.update(T.getBytes()),T=o.digest();var A=new n.util.ByteBuffer;for(c=0;c<l;c++)A.putByte(T.at(c%u));var I=Math.ceil(d/l)+Math.ceil(f/l),B=new n.util.ByteBuffer;for(a=0;a<I;a++){var w=new n.util.ByteBuffer(E.getBytes(l)),k=511;for(c=A.length()-1;c>=0;c--)k>>=8,k+=A.at(c)+w.at(c),w.setAt(c,255&k);B.putBuffer(w)}E=B,h.putBuffer(T)}return h.truncate(h.length()-s),h},o.pbe.getCipher=function(e,t,r){switch(e){case o.oids.pkcs5PBES2:return o.pbe.getCipherForPBES2(e,t,r);case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case o.oids["pbewithSHAAnd40BitRC2-CBC"]:return o.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},o.pbe.getCipherForPBES2=function(e,t,r){var i,a={},c=[];if(!s.validate(t,u,a,c))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=c,i;if((e=s.derToOid(a.kdfOid))!==o.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=s.derToOid(a.encOid))!==o.oids["aes128-CBC"]&&e!==o.oids["aes192-CBC"]&&e!==o.oids["aes256-CBC"]&&e!==o.oids["des-EDE3-CBC"]&&e!==o.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var l,h,f=a.kdfSalt,d=n.util.createBuffer(a.kdfIterationCount);switch(d=d.getInt(d.length()<<3),o.oids[e]){case"aes128-CBC":l=16,h=n.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,h=n.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,h=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,h=n.des.createDecryptionCipher;break;case"desCBC":l=8,h=n.des.createDecryptionCipher}var y=p(a.prfOid),g=n.pkcs5.pbkdf2(r,f,d,l,y),m=a.encIv,v=h(g);return v.start(m),v},o.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},a=[];if(!s.validate(t,l,i,a))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=a,y;var c,u,h,f=n.util.createBuffer(i.salt),d=n.util.createBuffer(i.iterations);switch(d=d.getInt(d.length()<<3),e){case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,u=8,h=n.des.startDecrypting;break;case o.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,u=8,h=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,y}var g=p(i.prfOid),m=o.pbe.generatePkcs12Key(r,f,1,d,c,g);return g.start(),h(m,o.pbe.generatePkcs12Key(r,f,2,d,u,g))},o.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var s=[h(i,e+t)],o=16,a=1;o<r;++a,o+=16)s.push(h(i,s[a-1]+e+t));return s.join("").substr(0,r)}},function(e,t,r){var n=r(0);r(5),r(1);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){o||(s=String.fromCharCode(128),s+=n.util.fillString(String.fromCharCode(0),64),a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],o=!0);var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,s=0;s<r;++s)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(s,o){"utf8"===o&&(s=n.util.encodeUtf8(s));var a=s.length;i.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=a[1],a[1]=a[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,a[0]=a[1]/4294967296>>>0;return t.putBytes(s),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var a,u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(s.substr(0,i.blockLength-u));for(var l=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)l+=(a=8*i.fullMessageLength[h+1])/4294967296>>>0,o.putInt32(l>>>0),l=a>>>0;o.putInt32(l);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};c(p,r,o);var f=n.util.createBuffer();return f.putInt32(p.h0),f.putInt32(p.h1),f.putInt32(p.h2),f.putInt32(p.h3),f.putInt32(p.h4),f.putInt32(p.h5),f.putInt32(p.h6),f.putInt32(p.h7),f},i};var s=null,o=!1,a=null;function c(e,t,r){for(var n,i,s,o,c,u,l,h,p,f,d,y,g,m=r.length();m>=64;){for(c=0;c<16;++c)t[c]=r.getInt32();for(;c<64;++c)n=((n=t[c-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[c-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[c]=n+t[c-7]+i+t[c-16]|0;for(u=e.h0,l=e.h1,h=e.h2,p=e.h3,f=e.h4,d=e.h5,y=e.h6,g=e.h7,c=0;c<64;++c)s=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),o=u&l|h&(u^l),n=g+((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(y^f&(d^y))+a[c]+t[c],g=y,y=d,d=f,f=p+n>>>0,p=h,h=l,l=u,u=n+(i=s+o)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+l|0,e.h2=e.h2+h|0,e.h3=e.h3+p|0,e.h4=e.h4+f|0,e.h5=e.h5+d|0,e.h6=e.h6+y|0,e.h7=e.h7+g|0,m-=64}}},function(e,t,r){var n=r(0);r(1);var i=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(i=r(8)),(e.exports=n.prng=n.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,s=new Array(32),o=0;o<32;++o)s[o]=r.create();function a(){if(t.pools[0].messageLength>=32)return c();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),c()}function c(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function u(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var s=n.util.createBuffer();if(t)for(;s.length()<e;){var o=Math.max(1,Math.min(e-s.length(),65536)/4),a=new Uint32Array(Math.floor(o));try{t(a);for(var c=0;c<a.length;++c)s.putInt32(a[c])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(s.length()<e)for(var u,l,h,p=Math.floor(65536*Math.random());s.length()<e;){l=16807*(65535&p),l+=(32767&(u=16807*(p>>16)))<<16,p=4294967295&(l=(2147483647&(l+=u>>15))+(l>>31));for(c=0;c<3;++c)h=p>>>(c<<3),h^=Math.floor(256*Math.random()),s.putByte(String.fromCharCode(255&h))}return s.getBytes(e)}return t.pools=s,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,s=t.plugin.increment,o=t.plugin.formatKey,a=t.plugin.formatSeed,u=n.util.createBuffer();t.key=null,function l(h){if(h)return r(h);if(u.length()>=e)return r(null,u.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return n.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return c(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),c(),e()}))}(l)}));var p=i(t.key,t.seed);t.generated+=p.length,u.putBytes(p),t.key=o(i(t.key,s(t.seed))),t.seed=a(i(t.key,t.seed)),n.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,s=t.plugin.formatKey,o=t.plugin.formatSeed;t.key=null;for(var c=n.util.createBuffer();c.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&a();var u=r(t.key,t.seed);t.generated+=u.length,c.putBytes(u),t.key=s(r(t.key,i(t.seed))),t.seed=o(r(t.key,t.seed))}return c.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,u(e))}catch(e){t(e)}},t.seedFileSync=u),t.collect=function(e){for(var r=e.length,n=0;n<r;++n)t.pools[t.pool].update(e.substr(n,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(e>>i&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))}},t}},function(e,t,r){var n=r(0);r(1);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],s=[1,2,3,5],o=function(e,t){return e<<t&65535|(65535&e)>>16-t},a=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,s=e,o=e.length(),a=t,c=Math.ceil(a/8),u=255>>(7&a);for(r=o;r<128;r++)s.putByte(i[s.at(r-1)+s.at(r-o)&255]);for(s.setAt(128-c,i[s.at(128-c)&u]),r=127-c;r>=0;r--)s.setAt(r,i[s.at(r+1)^s.at(r+c)]);return s};var c=function(e,t,r){var i,c,u,l,h=!1,p=null,f=null,d=null,y=[];for(e=n.rc2.expandKey(e,t),u=0;u<64;u++)y.push(e.getInt16Le());r?(i=function(e){for(u=0;u<4;u++)e[u]+=y[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),e[u]=o(e[u],s[u]),l++},c=function(e){for(u=0;u<4;u++)e[u]+=y[63&e[(u+3)%4]]}):(i=function(e){for(u=3;u>=0;u--)e[u]=a(e[u],s[u]),e[u]-=y[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),l--},c=function(e){for(u=3;u>=0;u--)e[u]-=y[63&e[(u+3)%4]]});var g=function(e){var t=[];for(u=0;u<4;u++){var n=p.getInt16Le();null!==d&&(r?n^=d.getInt16Le():d.putInt16Le(n)),t.push(65535&n)}l=r?0:63;for(var i=0;i<e.length;i++)for(var s=0;s<e[i][0];s++)e[i][1](t);for(u=0;u<4;u++)null!==d&&(r?d.putInt16Le(t[u]):t[u]^=d.getInt16Le()),f.putInt16Le(t[u])},m=null;return m={start:function(e,t){e&&"string"==typeof e&&(e=n.util.createBuffer(e)),h=!1,p=n.util.createBuffer(),f=t||new n.util.createBuffer,d=e,m.output=f},update:function(e){for(h||p.putBuffer(e);p.length()>=8;)g([[5,i],[1,c],[6,i],[1,c],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,p,!r);else{var n=8===p.length()?8:8-p.length();p.fillWithByte(n,n)}if(t&&(h=!0,m.update()),!r&&(t=0===p.length()))if(e)t=e(8,f,!r);else{var i=f.length(),s=f.at(i-1);s>i?t=!1:f.truncate(s)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return c(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return c(e,t,!1)}},function(e,t,r){var n=r(0);r(1),r(3),r(15);var i=e.exports=n.pkcs1=n.pkcs1||{};function s(e,t,r){r||(r=n.md.sha1.create());for(var i="",s=Math.ceil(t/r.digestLength),o=0;o<s;++o){var a=String.fromCharCode(o>>24&255,o>>16&255,o>>8&255,255&o);r.start(),r.update(e+a),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,o,a,c;"string"==typeof r?(i=r,o=arguments[3]||void 0,a=arguments[4]||void 0):r&&(i=r.label||void 0,o=r.seed||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),a?a.start():a=n.md.sha1.create(),c||(c=a);var u=Math.ceil(e.n.bitLength()/8),l=u-2*a.digestLength-2;if(t.length>l)throw(g=new Error("RSAES-OAEP input message length is too long.")).length=t.length,g.maxLength=l,g;i||(i=""),a.update(i,"raw");for(var h=a.digest(),p="",f=l-t.length,d=0;d<f;d++)p+="\0";var y=h.getBytes()+p+""+t;if(o){if(o.length!==a.digestLength){var g;throw(g=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=o.length,g.digestLength=a.digestLength,g}}else o=n.random.getBytes(a.digestLength);var m=s(o,u-a.digestLength-1,c),v=n.util.xorBytes(y,m,y.length),C=s(v,a.digestLength,c),E=n.util.xorBytes(o,C,o.length);return"\0"+E+v},i.decode_rsa_oaep=function(e,t,r){var i,o,a;"string"==typeof r?(i=r,o=arguments[3]||void 0):r&&(i=r.label||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(a=r.mgf1.md));var c=Math.ceil(e.n.bitLength()/8);if(t.length!==c)throw(v=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,v.expectedLength=c,v;if(void 0===o?o=n.md.sha1.create():o.start(),a||(a=o),c<2*o.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),o.update(i,"raw");for(var u=o.digest().getBytes(),l=t.charAt(0),h=t.substring(1,o.digestLength+1),p=t.substring(1+o.digestLength),f=s(p,o.digestLength,a),d=n.util.xorBytes(h,f,h.length),y=s(d,c-o.digestLength-1,a),g=n.util.xorBytes(p,y,p.length),m=g.substring(0,o.digestLength),v="\0"!==l,C=0;C<o.digestLength;++C)v|=u.charAt(C)!==m.charAt(C);for(var E=1,S=o.digestLength,b=o.digestLength;b<g.length;b++){var T=g.charCodeAt(b),_=1&T^1,A=E?65534:0;v|=T&A,S+=E&=_}if(v||1!==g.charCodeAt(S))throw new Error("Invalid RSAES-OAEP padding.");return g.substring(S+1)}},function(e,t,r){var n=r(0);r(1),r(24),r(3),function(){if(n.prime)e.exports=n.prime;else{var t=e.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],s=new r(null);s.fromInt(30);var o=function(e,t){return e|t};t.generateProbablePrime=function(e,t,i){"function"==typeof t&&(i=t,t={});var s=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof s&&(s={name:s}),s.options=s.options||{};var o=t.prng||n.random,u={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===s.name)return function(e,t,i,s){if("workers"in i)return function(e,t,i,s){if("undefined"==typeof Worker)return a(e,t,i,s);var o=c(e,t),u=i.workers,l=i.workLoad||100,h=30*l/8,p=i.workerScript||"forge/prime.worker.js";if(-1===u)return n.util.estimateCores((function(e,t){e&&(t=2),u=t-1,f()}));function f(){u=Math.max(1,u);for(var n=[],i=0;i<u;++i)n[i]=new Worker(p);for(i=0;i<u;++i)n[i].addEventListener("message",f);var a=!1;function f(i){if(!a){0;var u=i.data;if(u.found){for(var p=0;p<n.length;++p)n[p].terminate();return a=!0,s(null,new r(u.prime,16))}o.bitLength()>e&&(o=c(e,t));var f=o.toString(16);i.target.postMessage({hex:f,workLoad:l}),o.dAddOffset(h,0)}}}f()}(e,t,i,s);return a(e,t,i,s)}(e,u,s.options,i);throw new Error("Invalid prime generation algorithm: "+s.name)}}function a(e,t,r,s){var o=c(e,t),a=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(o.bitLength());"millerRabinTests"in r&&(a=r.millerRabinTests);var u=10;"maxBlockTime"in r&&(u=r.maxBlockTime),function e(t,r,s,o,a,u,l){var h=+new Date;do{if(t.bitLength()>r&&(t=c(r,s)),t.isProbablePrime(a))return l(null,t);t.dAddOffset(i[o++%8],0)}while(u<0||+new Date-h<u);n.util.setImmediate((function(){e(t,r,s,o,a,u,l)}))}(o,e,t,0,a,u,s)}function c(e,t){var n=new r(e,t),i=e-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),o,n),n.dAddOffset(31-n.mod(s).byteValue(),0),n}}()},function(e,t,r){var n=r(0);r(4),r(14),r(7),r(60),r(53),r(3),r(23),r(15),r(1),r(34);var i=n.asn1,s=n.pki,o=e.exports=n.pkcs12=n.pkcs12||{},a={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},c={name:"PFX",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},a,{name:"PFX.macData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},u={name:"SafeBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},l={name:"Attribute",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,capture:"values"}]},h={name:"CertBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:i.Class.UNIVERSAL,type:i.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function p(e,t,r,n){for(var i=[],s=0;s<e.length;s++)for(var o=0;o<e[s].safeBags.length;o++){var a=e[s].safeBags[o];void 0!==n&&a.type!==n||(null!==t?void 0!==a.attributes[t]&&a.attributes[t].indexOf(r)>=0&&i.push(a):i.push(a))}return i}function f(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function d(e,t){var r={},o=[];if(!i.validate(e,n.pkcs7.asn1.encryptedDataValidator,r,o))throw(a=new Error("Cannot read EncryptedContentInfo.")).errors=o,a;var a,c=i.derToOid(r.contentType);if(c!==s.oids.data)throw(a=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=c,a;c=i.derToOid(r.encAlgorithm);var u=s.pbe.getCipher(c,r.encParameter,t),l=f(r.encryptedContentAsn1),h=n.util.createBuffer(l.value);if(u.update(h),!u.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return u.output.getBytes()}function y(e,t,r){if(!t&&0===e.length)return[];if((e=i.fromDer(e,t)).tagClass!==i.Class.UNIVERSAL||e.type!==i.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var n=[],o=0;o<e.value.length;o++){var a=e.value[o],c={},l=[];if(!i.validate(a,u,c,l))throw(m=new Error("Cannot read SafeBag.")).errors=l,m;var p,f,d={type:i.derToOid(c.bagId),attributes:g(c.bagAttributes)};n.push(d);var y=c.bagValue.value[0];switch(d.type){case s.oids.pkcs8ShroudedKeyBag:if(null===(y=s.decryptPrivateKeyInfo(y,r)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case s.oids.keyBag:try{d.key=s.privateKeyFromAsn1(y)}catch(e){d.key=null,d.asn1=y}continue;case s.oids.certBag:p=h,f=function(){if(i.derToOid(c.certId)!==s.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=i.derToOid(c.certId),e}var r=i.fromDer(c.cert,t);try{d.cert=s.certificateFromAsn1(r,!0)}catch(e){d.cert=null,d.asn1=r}};break;default:var m;throw(m=new Error("Unsupported PKCS#12 SafeBag type.")).oid=d.type,m}if(void 0!==p&&!i.validate(y,p,c,l))throw(m=new Error("Cannot read PKCS#12 "+p.name)).errors=l,m;f()}return n}function g(e){var t={};if(void 0!==e)for(var r=0;r<e.length;++r){var n={},o=[];if(!i.validate(e[r],l,n,o)){var a=new Error("Cannot read PKCS#12 BagAttribute.");throw a.errors=o,a}var c=i.derToOid(n.oid);if(void 0!==s.oids[c]){t[s.oids[c]]=[];for(var u=0;u<n.values.length;++u)t[s.oids[c]].push(n.values[u].value)}}return t}o.pkcs12FromAsn1=function(e,t,r){"string"==typeof t?(r=t,t=!0):void 0===t&&(t=!0);var u={};if(!i.validate(e,c,u,[]))throw(l=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=l,l;var l,h={version:u.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=n.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(r[e.bagType]=p(h.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=p(h.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(r.friendlyName=p(h.safeContents,"friendlyName",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return p(h.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return p(h.safeContents,"localKeyId",e,t)}};if(3!==u.version.charCodeAt(0))throw(l=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=u.version.charCodeAt(0),l;if(i.derToOid(u.contentType)!==s.oids.data)throw(l=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=i.derToOid(u.contentType),l;var g=u.content.value[0];if(g.tagClass!==i.Class.UNIVERSAL||g.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(g=f(g),u.mac){var m=null,v=0,C=i.derToOid(u.macAlgorithm);switch(C){case s.oids.sha1:m=n.md.sha1.create(),v=20;break;case s.oids.sha256:m=n.md.sha256.create(),v=32;break;case s.oids.sha384:m=n.md.sha384.create(),v=48;break;case s.oids.sha512:m=n.md.sha512.create(),v=64;break;case s.oids.md5:m=n.md.md5.create(),v=16}if(null===m)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+C);var E=new n.util.ByteBuffer(u.macSalt),S="macIterations"in u?parseInt(n.util.bytesToHex(u.macIterations),16):1,b=o.generateKey(r,E,3,S,v,m),T=n.hmac.create();if(T.start(m,b),T.update(g.value),T.getMac().getBytes()!==u.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return function(e,t,r,n){if((t=i.fromDer(t,r)).tagClass!==i.Class.UNIVERSAL||t.type!==i.Type.SEQUENCE||!0!==t.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var o=0;o<t.value.length;o++){var c=t.value[o],u={},l=[];if(!i.validate(c,a,u,l))throw(m=new Error("Cannot read ContentInfo.")).errors=l,m;var h={encrypted:!1},p=null,g=u.content.value[0];switch(i.derToOid(u.contentType)){case s.oids.data:if(g.tagClass!==i.Class.UNIVERSAL||g.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");p=f(g).value;break;case s.oids.encryptedData:p=d(g,n),h.encrypted=!0;break;default:var m;throw(m=new Error("Unsupported PKCS#12 contentType.")).contentType=i.derToOid(u.contentType),m}h.safeBags=y(p,r,n),e.safeContents.push(h)}}(h,g.value,t,r),h},o.toPkcs12Asn1=function(e,t,r,a){(a=a||{}).saltSize=a.saltSize||8,a.count=a.count||2048,a.algorithm=a.algorithm||a.encAlgorithm||"aes128","useMac"in a||(a.useMac=!0),"localKeyId"in a||(a.localKeyId=null),"generateLocalKeyId"in a||(a.generateLocalKeyId=!0);var c,u=a.localKeyId;if(null!==u)u=n.util.hexToBytes(u);else if(a.generateLocalKeyId)if(t){var l=n.util.isArray(t)?t[0]:t;"string"==typeof l&&(l=s.certificateFromPem(l)),(B=n.md.sha1.create()).update(i.toDer(s.certificateToAsn1(l)).getBytes()),u=B.digest().getBytes()}else u=n.random.getBytes(20);var h=[];null!==u&&h.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.localKeyId).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,u)])])),"friendlyName"in a&&h.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.friendlyName).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.BMPSTRING,!1,a.friendlyName)])])),h.length>0&&(c=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,h));var p=[],f=[];null!==t&&(f=n.util.isArray(t)?t:[t]);for(var d=[],y=0;y<f.length;++y){"string"==typeof(t=f[y])&&(t=s.certificateFromPem(t));var g=0===y?c:void 0,m=s.certificateToAsn1(t),v=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.certBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.x509Certificate).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(m).getBytes())])])]),g]);d.push(v)}if(d.length>0){var C=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,d),E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(C).getBytes())])]);p.push(E)}var S=null;if(null!==e){var b=s.wrapRsaPrivateKey(s.privateKeyToAsn1(e));S=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[b]),c]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[s.encryptPrivateKeyInfo(b,r,a)]),c]);var T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[S]),_=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(T).getBytes())])]);p.push(_)}var A,I=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,p);if(a.useMac){var B=n.md.sha1.create(),w=new n.util.ByteBuffer(n.random.getBytes(a.saltSize)),k=a.count,R=(e=o.generateKey(r,w,3,k,20),n.hmac.create());R.start(B,e),R.update(i.toDer(I).getBytes());var N=R.getMac();A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,N.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,w.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(k).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(I).getBytes())])]),A])},o.generateKey=n.pbe.generatePkcs12Key},function(e,t,r){var n=r(0);r(4),r(1);var i=n.asn1,s=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=s;var o={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};s.contentInfoValidator=o;var a={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};s.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(a)},s.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(a)};var c={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};s.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},o,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[c]}]},s.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},function(e,t,r){var n=r(0);r(1),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var i=new n.util.ByteBuffer,s=Math.ceil(r/e.digestLength),o=0;o<s;o++){var a=new n.util.ByteBuffer;a.putInt32(o),e.start(),e.update(t+a.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}}}},function(e,t,r){var n=r(0);e.exports=n.debug=n.debug||{},n.debug.storage={},n.debug.get=function(e,t){var r;return void 0===e?r=n.debug.storage:e in n.debug.storage&&(r=void 0===t?n.debug.storage[e]:n.debug.storage[e][t]),r},n.debug.set=function(e,t,r){e in n.debug.storage||(n.debug.storage[e]={}),n.debug.storage[e][t]=r},n.debug.clear=function(e,t){void 0===e?n.debug.storage={}:e in n.debug.storage&&(void 0===t?delete n.debug.storage[e]:delete n.debug.storage[e][t])}},function(e,t,r){var n=r(0);r(5),r(1);var i=e.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var s=n.sha384=n.sha512.sha384=n.sha512.sha384||{};s.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=s,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(e){if(a||(o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),128),c=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],(u={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],u["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],u["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],u["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],a=!0),void 0===e&&(e="SHA-512"),!(e in u))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=u[e],r=null,i=n.util.createBuffer(),s=new Array(80),h=0;h<80;++h)s[h]=new Array(2);var p=64;switch(e){case"SHA-384":p=48;break;case"SHA-512/256":p=32;break;case"SHA-512/224":p=28}var f={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:p,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){f.messageLength=0,f.fullMessageLength=f.messageLength128=[];for(var e=f.messageLengthSize/4,s=0;s<e;++s)f.fullMessageLength.push(0);i=n.util.createBuffer(),r=new Array(t.length);for(s=0;s<t.length;++s)r[s]=t[s].slice(0);return f}};return f.start(),f.update=function(e,t){"utf8"===t&&(e=n.util.encodeUtf8(e));var o=e.length;f.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var a=f.fullMessageLength.length-1;a>=0;--a)f.fullMessageLength[a]+=o[1],o[1]=o[0]+(f.fullMessageLength[a]/4294967296>>>0),f.fullMessageLength[a]=f.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return i.putBytes(e),l(r,s,i),(i.read>2048||0===i.length())&&i.compact(),f},f.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var a,c=f.fullMessageLength[f.fullMessageLength.length-1]+f.messageLengthSize&f.blockLength-1;t.putBytes(o.substr(0,f.blockLength-c));for(var u=8*f.fullMessageLength[0],h=0;h<f.fullMessageLength.length-1;++h)u+=(a=8*f.fullMessageLength[h+1])/4294967296>>>0,t.putInt32(u>>>0),u=a>>>0;t.putInt32(u);var p=new Array(r.length);for(h=0;h<r.length;++h)p[h]=r[h].slice(0);l(p,s,t);var d,y=n.util.createBuffer();d="SHA-512"===e?p.length:"SHA-384"===e?p.length-2:p.length-4;for(h=0;h<d;++h)y.putInt32(p[h][0]),h===d-1&&"SHA-512/224"===e||y.putInt32(p[h][1]);return y},f};var o=null,a=!1,c=null,u=null;function l(e,t,r){for(var n,i,s,o,a,u,l,h,p,f,d,y,g,m,v,C,E,S,b,T,_,A,I,B,w,k,R,N,L,x,O,D,U,P=r.length();P>=128;){for(R=0;R<16;++R)t[R][0]=r.getInt32()>>>0,t[R][1]=r.getInt32()>>>0;for(;R<80;++R)n=(((N=(x=t[R-2])[0])>>>19|(L=x[1])<<13)^(L>>>29|N<<3)^N>>>6)>>>0,i=((N<<13|L>>>19)^(L<<3|N>>>29)^(N<<26|L>>>6))>>>0,s=(((N=(D=t[R-15])[0])>>>1|(L=D[1])<<31)^(N>>>8|L<<24)^N>>>7)>>>0,o=((N<<31|L>>>1)^(N<<24|L>>>8)^(N<<25|L>>>7))>>>0,O=t[R-7],U=t[R-16],L=i+O[1]+o+U[1],t[R][0]=n+O[0]+s+U[0]+(L/4294967296>>>0)>>>0,t[R][1]=L>>>0;for(d=e[0][0],y=e[0][1],g=e[1][0],m=e[1][1],v=e[2][0],C=e[2][1],E=e[3][0],S=e[3][1],b=e[4][0],T=e[4][1],_=e[5][0],A=e[5][1],I=e[6][0],B=e[6][1],w=e[7][0],k=e[7][1],R=0;R<80;++R)l=((b>>>14|T<<18)^(b>>>18|T<<14)^(T>>>9|b<<23))>>>0,h=(I^b&(_^I))>>>0,a=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,u=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,p=(d&g|v&(d^g))>>>0,f=(y&m|C&(y^m))>>>0,L=k+(((b<<18|T>>>14)^(b<<14|T>>>18)^(T<<23|b>>>9))>>>0)+((B^T&(A^B))>>>0)+c[R][1]+t[R][1],n=w+l+h+c[R][0]+t[R][0]+(L/4294967296>>>0)>>>0,i=L>>>0,s=a+p+((L=u+f)/4294967296>>>0)>>>0,o=L>>>0,w=I,k=B,I=_,B=A,_=b,A=T,b=E+n+((L=S+i)/4294967296>>>0)>>>0,T=L>>>0,E=v,S=C,v=g,C=m,g=d,m=y,d=n+s+((L=i+o)/4294967296>>>0)>>>0,y=L>>>0;L=e[0][1]+y,e[0][0]=e[0][0]+d+(L/4294967296>>>0)>>>0,e[0][1]=L>>>0,L=e[1][1]+m,e[1][0]=e[1][0]+g+(L/4294967296>>>0)>>>0,e[1][1]=L>>>0,L=e[2][1]+C,e[2][0]=e[2][0]+v+(L/4294967296>>>0)>>>0,e[2][1]=L>>>0,L=e[3][1]+S,e[3][0]=e[3][0]+E+(L/4294967296>>>0)>>>0,e[3][1]=L>>>0,L=e[4][1]+T,e[4][0]=e[4][0]+b+(L/4294967296>>>0)>>>0,e[4][1]=L>>>0,L=e[5][1]+A,e[5][0]=e[5][0]+_+(L/4294967296>>>0)>>>0,e[5][1]=L>>>0,L=e[6][1]+B,e[6][0]=e[6][0]+I+(L/4294967296>>>0)>>>0,e[6][1]=L>>>0,L=e[7][1]+k,e[7][0]=e[7][0]+w+(L/4294967296>>>0)>>>0,e[7][1]=L>>>0,P-=128}}},function(e,t,r){var n=r(0);r(1),e.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var i={},s=[],o=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var a=0;a<n.log.levels.length;++a){var c=n.log.levels[a];i[c]={index:a,name:c.toUpperCase()}}n.log.logMessage=function(e){for(var t=i[e.level].index,r=0;r<s.length;++r){var o=s[r];if(o.flags&n.log.NO_LEVEL_CHECK)o.f(e);else t<=i[o.level].index&&o.f(o,e)}},n.log.prepareStandard=function(e){"standard"in e||(e.standard=i[e.level].name+" ["+e.category+"] "+e.message)},n.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]||!1),e.full=n.util.format.apply(this,t)}},n.log.prepareStandardFull=function(e){"standardFull"in e||(n.log.prepareStandard(e),e.standardFull=e.standard)};var u=["error","warning","info","debug","verbose"];for(a=0;a<u.length;++a)!function(e){n.log[e]=function(t,r){var i=Array.prototype.slice.call(arguments).slice(2),s={timestamp:new Date,level:e,category:t,message:r,arguments:i};n.log.logMessage(s)}}(u[a]);if(n.log.makeLogger=function(e){var t={flags:0,f:e};return n.log.setLevel(t,"none"),t},n.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&n.log.LEVEL_LOCKED))for(var i=0;i<n.log.levels.length;++i){if(t==n.log.levels[i]){e.level=t,r=!0;break}}return r},n.log.lock=function(e,t){void 0===t||t?e.flags|=n.log.LEVEL_LOCKED:e.flags&=~n.log.LEVEL_LOCKED},n.log.addLogger=function(e){s.push(e)},"undefined"!=typeof console&&"log"in console){var l;if(console.error&&console.warn&&console.info&&console.debug){var h={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},p=function(e,t){n.log.prepareStandard(t);var r=h[t.level],i=[t.standard];i=i.concat(t.arguments.slice()),r.apply(console,i)};l=n.log.makeLogger(p)}else{p=function(e,t){n.log.prepareStandardFull(t),console.log(t.standardFull)};l=n.log.makeLogger(p)}n.log.setLevel(l,"debug"),n.log.addLogger(l),o=l}else console={log:function(){}};if(null!==o){var f=n.util.getQueryVariables();if("console.level"in f&&n.log.setLevel(o,f["console.level"].slice(-1)[0]),"console.lock"in f)"true"==f["console.lock"].slice(-1)[0]&&n.log.lock(o)}n.log.consoleLogger=o},function(e,t,r){e.exports=function(e){function t(e){let r,i,s,o=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),s=i-(r||i);n.diff=s,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,i)=>{if("%%"===r)return"%";o++;const s=t.formatters[i];if("function"==typeof s){const t=e[o];r=s.call(n,t),e.splice(o,1),o--}return r}),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==t.namespaces&&(i=t.namespaces,s=t.enabled(e)),s),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(104),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},function(e,t){e.exports=require("tty")},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(16)),s=r(25);class o extends i.default{constructor(e){super("Visit URL "+e,`visit_url("${s.escapeMablscriptString(e)}")`,e)}}t.default=o},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t,r){"use strict";var n=r(39);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";var n=r(135),i=r(136);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},function(e,t,r){var n=r(13),i=n.URL,s=r(11),o=r(19),a=r(41).Writable,c=r(140),u=r(141),l=["abort","aborted","connect","error","socket","timeout"],h=Object.create(null);l.forEach((function(e){h[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}}));var p=S("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),f=S("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),d=S("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),y=S("ERR_STREAM_WRITE_AFTER_END","write after end");function g(e,t){a.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var r=this;this._onNativeResponse=function(e){r._processResponse(e)},this._performRequest()}function m(e){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(e).forEach((function(s){var o=s+":",a=r[o]=e[s],l=t[s]=Object.create(a);Object.defineProperties(l,{request:{value:function(e,s,a){if("string"==typeof e){var l=e;try{e=C(new i(l))}catch(t){e=n.parse(l)}}else i&&e instanceof i?e=C(e):(a=s,s=e,e={protocol:o});return"function"==typeof s&&(a=s,s=null),(s=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,s)).nativeProtocols=r,c.equal(s.protocol,o,"protocol mismatch"),u("options",s),new g(s,a)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,t,r){var n=l.request(e,t,r);return n.end(),n},configurable:!0,enumerable:!0,writable:!0}})})),t}function v(){}function C(e){var t={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return""!==e.port&&(t.port=Number(e.port)),t}function E(e,t){var r;for(var n in t)e.test(n)&&(r=t[n],delete t[n]);return null==r?void 0:String(r).trim()}function S(e,t){function r(e){Error.captureStackTrace(this,this.constructor),e?(this.message=t+": "+e.message,this.cause=e):this.message=t}return r.prototype=new Error,r.prototype.constructor=r,r.prototype.name="Error ["+e+"]",r.prototype.code=e,r}function b(e){for(var t=0;t<l.length;t++)e.removeListener(l[t],h[l[t]]);e.on("error",v),e.abort()}g.prototype=Object.create(a.prototype),g.prototype.abort=function(){b(this._currentRequest),this.emit("abort")},g.prototype.write=function(e,t,r){if(this._ending)throw new y;if(!("string"==typeof e||"object"==typeof e&&"length"in e))throw new TypeError("data should be a string, Buffer or Uint8Array");"function"==typeof t&&(r=t,t=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new d),this.abort()):r&&r()},g.prototype.end=function(e,t,r){if("function"==typeof e?(r=e,e=t=null):"function"==typeof t&&(r=t,t=null),e){var n=this,i=this._currentRequest;this.write(e,t,(function(){n._ended=!0,i.end(null,null,r)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,r)},g.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},g.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},g.prototype.setTimeout=function(e,t){var r=this;function n(t){t.setTimeout(e),t.removeListener("timeout",t.destroy),t.addListener("timeout",t.destroy)}function i(t){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout((function(){r.emit("timeout"),s()}),e),n(t)}function s(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",s),r.removeListener("error",s),r.removeListener("response",s),t&&r.removeListener("timeout",t),r.socket||r._currentRequest.removeListener("socket",i)}return t&&this.on("timeout",t),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){g.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(g.prototype,e,{get:function(){return this._currentRequest[e]}})})),g.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}},g.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(t){if(this._options.agents){var r=e.substr(0,e.length-1);this._options.agent=this._options.agents[r]}var i=this._currentRequest=t.request(this._options,this._onNativeResponse);this._currentUrl=n.format(this._options),i._redirectable=this;for(var s=0;s<l.length;s++)i.on(l[s],h[l[s]]);if(this._isRedirect){var o=0,a=this,c=this._requestBodyBuffers;!function e(t){if(i===a._currentRequest)if(t)a.emit("error",t);else if(o<c.length){var r=c[o++];i.finished||i.write(r.data,r.encoding,e)}else a._ended&&i.end()}()}}else this.emit("error",new TypeError("Unsupported protocol "+e))},g.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var r=e.headers.location;if(!r||!1===this._options.followRedirects||t<300||t>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(b(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)this.emit("error",new f);else{((301===t||302===t)&&"POST"===this._options.method||303===t&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],E(/^content-/i,this._options.headers));var i,s=E(/^host$/i,this._options.headers),o=n.parse(this._currentUrl),a=s||o.host,c=/^\w+:/.test(r)?this._currentUrl:n.format(Object.assign(o,{host:a}));try{i=n.resolve(c,r)}catch(e){return void this.emit("error",new p(e))}u("redirecting to",i),this._isRedirect=!0;var l=n.parse(i);if(Object.assign(this._options,l),(l.protocol!==o.protocol&&"https:"!==l.protocol||l.host!==a&&!function(e,t){const r=e.length-t.length-1;return r>0&&"."===e[r]&&e.endsWith(t)}(l.host,a))&&E(/^(?:authorization|cookie)$/i,this._options.headers),"function"==typeof this._options.beforeRedirect){var h={headers:e.headers};try{this._options.beforeRedirect.call(null,this._options,h)}catch(e){return void this.emit("error",e)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){this.emit("error",new p(e))}}},e.exports=m({http:s,https:o}),e.exports.wrap=m},function(e,t,r){var n;function i(e){function r(){if(r.enabled){var e=r,i=+new Date,s=i-(n||i);e.diff=s,e.prev=n,e.curr=i,n=i;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var c=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,(function(r,n){if("%%"===r)return r;c++;var i=t.formatters[n];if("function"==typeof i){var s=o[c];r=i.call(e,s),o.splice(c,1),c--}return r})),t.formatArgs.call(e,o);var u=r.log||t.log||console.log.bind(console);u.apply(e,o)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=e.exports=i.debug=i.default=i).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length,i=0;i<n;i++)r[i]&&("-"===(e=r[i].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(144),t.names=[],t.skips=[],t.formatters={}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";var n=r(2);e.exports=function(e,t){t=t||{};var r={};function i(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function s(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function o(e){if(!n.isUndefined(t[e]))return i(void 0,t[e])}function a(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function c(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||s,i=t(e);n.isUndefined(i)&&t!==c||(r[e]=i)})),r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n{constructor(e,t){this.body=t,this.contentType=n.getContentTypeHeader(e)}async bodyAsString(){if(!this.bodyString){const e=[],t=await new Promise((t,r)=>{this.body.on("data",t=>e.push(Buffer.from(t))),this.body.on("error",e=>r(e)),this.body.on("end",()=>t(Buffer.concat(e).toString(this.getBodyCharset())))});this.bodyString=t}return this.bodyString}async bodyAsJson(){if(!this.bodyJson&&this.hasJsonContent())try{this.bodyJson=JSON.parse(await this.bodyAsString())}catch(e){console.log(`Failed to parse body with content type ${this.contentType} as JSON: ${this.bodyAsString()}`,e)}return this.bodyJson}hasJsonContent(){var e,t;return null!==(t=null===(e=this.contentType)||void 0===e?void 0:e.startsWith("application/json"))&&void 0!==t&&t}getBodyCharset(){var e;let t=n.DEFAULT_CHARSET;return(null===(e=this.contentType)||void 0===e?void 0:e.includes("charset="))&&(t=this.contentType.substring(this.contentType.indexOf("charset=")).split("=")[1].toLowerCase(),t.includes(";")&&(t=t.split(";")[0].toLowerCase())),t}static getContentTypeHeader(e){var t;return null===(t=e&&n.getHeader(e,"content-type"))||void 0===t?void 0:t.toLowerCase()}static getHeader(e,t){const r=Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase());return r&&e[r]+""}}t.default=n,n.DEFAULT_CHARSET="utf-8",n.MAX_BODY_DEBUG_LENGTH=120},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Step=t.SeleniumProxy=void 0;const n=r(77);Object.defineProperty(t,"SeleniumProxy",{enumerable:!0,get:function(){return n.SeleniumProxy}}),Object.defineProperty(t,"Step",{enumerable:!0,get:function(){return n.Step}})},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Step=t.SeleniumProxy=void 0;const i=n(r(78));t.SeleniumProxy=i.default;const s=n(r(16));t.Step=s.default},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(41),s=n(r(79)),o=n(r(111)),a=n(r(150)),c=n(r(151));class u{constructor(e,t,r){this.mablscriptImportRule=new o.default(t,r&&(e=>r(this,e))),this.proxyOptions={port:e||u.DEFAULT_PORT},this.proxyServer=s.default()}async start(){await new Promise((e,t)=>{try{this.proxyServer.listen(this.proxyOptions,e)}catch(e){t(e)}}),this.proxyServer.onRequest((e,t)=>{const{host:r,method:n,path:s}=e.proxyToServerRequestOptions,o=e.proxyToServerRequestOptions.port,u=new a.default(n,r,o,s,e.clientToProxyRequest.headers,e.clientToProxyRequest);this.mablscriptImportRule.beforeSendRequest(u).then(()=>t()).catch(e=>t(e));const l=new i.Duplex;e.onResponseData((e,t,r)=>{l.push(t),r(void 0,t)}),e.onResponseEnd((e,t)=>{l.push(null);const r=new c.default(e.proxyToClientResponse,l);this.mablscriptImportRule.beforeSendResponse(u,r).then(()=>t()).catch(e=>t(e))})})}stop(){return this.proxyServer.close(),Promise.resolve()}getImportedSteps(){return this.mablscriptImportRule.getImportedSteps()}reset(){return this.mablscriptImportRule.reset()}}t.default=u,u.DEFAULT_PORT=8889},function(e,t,r){"use strict";e.exports=r(80)},function(e,t,r){"use strict";var n=r(42),i=r(43),s=r(11),o=r(19),a=r(26),c=r(12),u=r(27),l=r(28),h=r(81),p=r(13),f=r(87),d=r(88);const y=r(101),g=r(102)("http-mitm-proxy");e.exports=function(){return new m},e.exports.gunzip=r(109),e.exports.wildcard=r(110);var m=function(){this.onConnectHandlers=[],this.onRequestHandlers=[],this.onRequestHeadersHandlers=[],this.onWebSocketConnectionHandlers=[],this.onWebSocketFrameHandlers=[],this.onWebSocketCloseHandlers=[],this.onWebSocketErrorHandlers=[],this.onErrorHandlers=[],this.onRequestDataHandlers=[],this.onRequestEndHandlers=[],this.onResponseHandlers=[],this.onResponseHeadersHandlers=[],this.onResponseDataHandlers=[],this.onResponseEndHandlers=[],this.responseContentPotentiallyModified=!1};e.exports.Proxy=m,m.prototype.listen=function(e,t=(e=>{})){var r=this;return this.options=e||{},this.httpPort=e.port||0===e.port?e.port:8080,this.httpHost=e.host,this.timeout=e.timeout||0,this.keepAlive=!!e.keepAlive,this.httpAgent=void 0!==e.httpAgent?e.httpAgent:new s.Agent({keepAlive:this.keepAlive}),this.httpsAgent=void 0!==e.httpsAgent?e.httpsAgent:new o.Agent({keepAlive:this.keepAlive}),this.forceSNI=!!e.forceSNI,this.forceSNI&&g("SNI enabled. Clients not supporting SNI may fail"),this.httpsPort=this.forceSNI?e.httpsPort:void 0,this.sslCaDir=e.sslCaDir||u.resolve(process.cwd(),".http-mitm-proxy"),d.create(this.sslCaDir,(function(e,n){if(e)return t(e);r.ca=n,r.sslServers={},r.sslSemaphores={},r.connectRequests={},r.httpServer=s.createServer(),r.httpServer.timeout=r.timeout,r.httpServer.on("connect",r._onHttpServerConnect.bind(r)),r.httpServer.on("request",r._onHttpServerRequest.bind(r,!1)),r.wsServer=new h.Server({server:r.httpServer}),r.wsServer.on("error",r._onError.bind(r,"HTTP_SERVER_ERROR",null)),r.wsServer.on("connection",(e,t)=>{e.upgradeReq=t,r._onWebSocketServerConnect.call(r,!1,e,t)});const i={host:r.httpHost,port:r.httpPort};r.forceSNI?r._createHttpsServer({},(function(e,n,s){g("https server started on "+e),r.httpsServer=n,r.wssServer=s,r.httpsPort=e,r.httpServer.listen(i,()=>{r.httpPort=r.httpServer.address().port,t()})})):r.httpServer.listen(i,()=>{r.httpPort=r.httpServer.address().port,t()})})),this},m.prototype._createHttpsServer=function(e,t){var r=o.createServer(e);r.timeout=this.timeout,r.on("error",this._onError.bind(this,"HTTPS_SERVER_ERROR",null)),r.on("clientError",this._onError.bind(this,"HTTPS_CLIENT_ERROR",null)),r.on("connect",this._onHttpServerConnect.bind(this)),r.on("request",this._onHttpServerRequest.bind(this,!0));var n=this,i=new h.Server({server:r});i.on("connection",(function(e,t){e.upgradeReq=t,n._onWebSocketServerConnect.call(n,!0,e,t)}));var s=[function(){t&&t(r.address().port,r,i)}],a={port:0};this.httpsPort&&!e.hosts&&(a.port=this.httpsPort),this.httpHost&&(a.host=this.httpHost),s.unshift(a),r.listen.apply(r,s)},m.prototype.close=function(){var e=this;return this.httpServer.close(),delete this.httpServer,this.httpsServer&&(this.httpsServer.close(),delete this.httpsServer,delete this.wssServer,delete this.sslServers),this.sslServers&&Object.keys(this.sslServers).forEach((function(t){var r=e.sslServers[t].server;r&&r.close(),delete e.sslServers[t]})),this},m.prototype.onError=function(e){return this.onErrorHandlers.push(e),this},m.prototype.onConnect=function(e){return this.onConnectHandlers.push(e),this},m.prototype.onRequestHeaders=function(e){return this.onRequestHeadersHandlers.push(e),this},m.prototype.onRequest=function(e){return this.onRequestHandlers.push(e),this},m.prototype.onWebSocketConnection=function(e){return this.onWebSocketConnectionHandlers.push(e),this},m.prototype.onWebSocketSend=function(e){return this.onWebSocketFrameHandlers.push(function(e,t,r,n,i,s){if(!r&&"message"===t)return this(e,n,i,s);s(null,n,i)}.bind(e)),this},m.prototype.onWebSocketMessage=function(e){return this.onWebSocketFrameHandlers.push(function(e,t,r,n,i,s){if(r&&"message"===t)return this(e,n,i,s);s(null,n,i)}.bind(e)),this},m.prototype.onWebSocketFrame=function(e){return this.onWebSocketFrameHandlers.push(e),this},m.prototype.onWebSocketClose=function(e){return this.onWebSocketCloseHandlers.push(e),this},m.prototype.onWebSocketError=function(e){return this.onWebSocketErrorHandlers.push(e),this},m.prototype.onRequestData=function(e){return this.onRequestDataHandlers.push(e),this},m.prototype.onRequestEnd=function(e){return this.onRequestEndHandlers.push(e),this},m.prototype.onResponse=function(e){return this.onResponseHandlers.push(e),this},m.prototype.onResponseHeaders=function(e){return this.onResponseHeadersHandlers.push(e),this},m.prototype.onResponseData=function(e){return this.onResponseDataHandlers.push(e),this.responseContentPotentiallyModified=!0,this},m.prototype.onResponseEnd=function(e){return this.onResponseEndHandlers.push(e),this},m.prototype.use=function(e){return e.onError&&this.onError(e.onError),e.onCertificateRequired&&(this.onCertificateRequired=e.onCertificateRequired),e.onCertificateMissing&&(this.onCertificateMissing=e.onCertificateMissing),e.onConnect&&this.onConnect(e.onConnect),e.onRequest&&this.onRequest(e.onRequest),e.onRequestHeaders&&this.onRequestHeaders(e.onRequestHeaders),e.onRequestData&&this.onRequestData(e.onRequestData),e.onResponse&&this.onResponse(e.onResponse),e.onResponseHeaders&&this.onResponseHeaders(e.onResponseHeaders),e.onResponseData&&this.onResponseData(e.onResponseData),e.onWebSocketConnection&&this.onWebSocketConnection(e.onWebSocketConnection),e.onWebSocketSend&&this.onWebSocketFrame(function(e,t,r,n,i,s){if(!r&&"message"===t)return this(e,n,i,s);s(null,n,i)}.bind(e.onWebSocketSend)),e.onWebSocketMessage&&this.onWebSocketFrame(function(e,t,r,n,i,s){if(r&&"message"===t)return this(e,n,i,s);s(null,n,i)}.bind(e.onWebSocketMessage)),e.onWebSocketFrame&&this.onWebSocketFrame(e.onWebSocketFrame),e.onWebSocketClose&&this.onWebSocketClose(e.onWebSocketClose),e.onWebSocketError&&this.onWebSocketError(e.onWebSocketError),this},m.prototype._onSocketError=function(e,t){"ECONNRESET"===t.errno?g("Got ECONNRESET on "+e+", ignoring."):this._onError(e+"_ERROR",null,t)},m.prototype._onHttpServerConnect=function(e,t,r){var i=this;return t.on("error",i._onSocketError.bind(i,"CLIENT_TO_PROXY_SOCKET")),n.forEach(i.onConnectHandlers,(function(n,s){return n.call(i,e,t,r,s)}),(function(n){return n?i._onError("ON_CONNECT_ERROR",null,n):r&&0!==r.length?void i._onHttpServerConnectData(e,t,r):(t.once("data",i._onHttpServerConnectData.bind(i,e,t)),t.write("HTTP/1.1 200 OK\r\n"),i.keepAlive&&"keep-alive"===e.headers["proxy-connection"]&&(t.write("Proxy-Connection: keep-alive\r\n"),t.write("Connection: keep-alive\r\n")),t.write("\r\n"))}))},m.prototype._onHttpServerConnectData=function(e,t,r){var s=this;if(t.pause(),22!=r[0]&&128!=r[0]&&0!=r[0])return h(this.httpPort);var o=e.url.split(":",2)[0],a=this.sslServers[o];if(a)return h(a.port);var u=o.replace(/[^\.]+\./,"*."),l=s.sslSemaphores[u];function h(n){var o=i.connect({port:n,allowHalfOpen:!0},(function(){o.on("finish",()=>{t.destroy()}),t.on("close",()=>{o.end()});var n=o.localPort+":"+o.remotePort;return s.connectRequests[n]=e,t.pipe(o),o.pipe(t),t.emit("data",r),o.on("end",(function(){delete s.connectRequests[n]})),t.resume()}));o.on("error",s._onSocketError.bind(s,"PROXY_TO_PROXY_SOCKET"))}l||(l=s.sslSemaphores[u]=f(1)),l.take((function(){return s.sslServers[o]?(process.nextTick(l.leave.bind(l)),h(s.sslServers[o].port)):s.sslServers[u]?(process.nextTick(l.leave.bind(l)),s.sslServers[o]={port:s.sslServers[u]},h(s.sslServers[o].port)):void function(e,t){s.onCertificateRequired(e,(function(r,i){if(r)return t(r);n.auto({keyFileExists:function(e){return c.exists(i.keyFile,(function(t){return e(null,t)}))},certFileExists:function(e){return c.exists(i.certFile,(function(t){return e(null,t)}))},httpsOptions:["keyFileExists","certFileExists",function(t,r){if(t.keyFileExists&&t.certFileExists)return c.readFile(i.keyFile,(function(e,t){return e?r(e):c.readFile(i.certFile,(function(e,n){return e?r(e):r(null,{key:t,cert:n,hosts:i.hosts})}))}));var n={hostname:e,files:i,data:t};return s.onCertificateMissing(n,i,(function(e,t){return e?r(e):r(null,{key:t.keyFileData,cert:t.certFileData,hosts:t.hosts})}))}]},(function(r,n){return r?t(r):(n.httpsOptions&&n.httpsOptions.hosts&&n.httpsOptions.hosts.length?-1===(i=n.httpsOptions.hosts).indexOf(e)&&i.push(e):i=[e],delete n.httpsOptions.hosts,s.forceSNI&&!e.match(/^[\d\.]+$/)?(g("creating SNI context for "+e),i.forEach((function(e){s.httpsServer.addContext(e,n.httpsOptions),s.sslServers[e]={port:s.httpsPort}})),t(null,s.httpsPort)):(g("starting server for "+e),n.httpsOptions.hosts=i,void s._createHttpsServer(n.httpsOptions,(function(r,n,o){g("https server started for %s on %s",e,r);var a={server:n,wsServer:o,port:r};return i.forEach((function(t){s.sslServers[e]=a})),t(null,r)}))));var i}))}))}(o,(function(e,t){return process.nextTick(l.leave.bind(l)),e?s._onError("OPEN_HTTPS_SERVER_ERROR",null,e):h(t)}))}))},m.prototype.onCertificateRequired=function(e,t){return t(null,{keyFile:this.sslCaDir+"/keys/"+e+".key",certFile:this.sslCaDir+"/certs/"+e+".pem",hosts:[e]})},m.prototype.onCertificateMissing=function(e,t,r){var n=t.hosts||[e.hostname];return this.ca.generateServerCertificateKeys(n,(function(e,t){r(null,{certFileData:e,keyFileData:t,hosts:n})})),this},m.prototype._onError=function(e,t,r){this.onErrorHandlers.forEach((function(n){return n(t,r,e)})),t&&(t.onErrorHandlers.forEach((function(n){return n(t,r,e)})),t.proxyToClientResponse&&!t.proxyToClientResponse.headersSent&&t.proxyToClientResponse.writeHead(504,"Proxy Error"),t.proxyToClientResponse&&!t.proxyToClientResponse.finished&&t.proxyToClientResponse.end(e+": "+r,"utf8"))},m.prototype._onWebSocketServerConnect=function(e,t,r){var n,i=this,s={isSSL:e,connectRequest:i.connectRequests[t._socket.remotePort+":"+t._socket.localPort]||{},clientToProxyWebSocket:t,onWebSocketConnectionHandlers:[],onWebSocketFrameHandlers:[],onWebSocketCloseHandlers:[],onWebSocketErrorHandlers:[],onWebSocketConnection:function(e){return s.onWebSocketConnectionHandlers.push(e),s},onWebSocketSend:function(e){return s.onWebSocketFrameHandlers.push(function(e,t,r,n,i,s){if(!r&&"message"===t)return this(e,n,i,s);s(null,n,i)}.bind(e)),s},onWebSocketMessage:function(e){return s.onWebSocketFrameHandlers.push(function(e,t,r,n,i,s){if(r&&"message"===t)return this(e,n,i,s);s(null,n,i)}.bind(e)),s},onWebSocketFrame:function(e){return s.onWebSocketFrameHandlers.push(e),s},onWebSocketClose:function(e){return s.onWebSocketCloseHandlers.push(e),s},onWebSocketError:function(e){return s.onWebSocketErrorHandlers.push(e),s},use:function(e){return e.onWebSocketConnection&&s.onWebSocketConnection(e.onWebSocketConnection),e.onWebSocketSend&&s.onWebSocketFrame(function(e,t,r,n,i,s){if(!r&&"message"===t)return this(e,n,i,s);s(null,n,i)}.bind(e.onWebSocketSend)),e.onWebSocketMessage&&s.onWebSocketFrame(function(e,t,r,n,i,s){if(r&&"message"===t)return this(e,n,i,s);s(null,n,i)}.bind(e.onWebSocketMessage)),e.onWebSocketFrame&&s.onWebSocketFrame(e.onWebSocketFrame),e.onWebSocketClose&&s.onWebSocketClose(e.onWebSocketClose),e.onWebSocketError&&s.onWebSocketError(e.onWebSocketError),s}};if(s.clientToProxyWebSocket.on("message",i._onWebSocketFrame.bind(i,s,"message",!1)),s.clientToProxyWebSocket.on("ping",i._onWebSocketFrame.bind(i,s,"ping",!1)),s.clientToProxyWebSocket.on("pong",i._onWebSocketFrame.bind(i,s,"pong",!1)),s.clientToProxyWebSocket.on("error",i._onWebSocketError.bind(i,s)),s.clientToProxyWebSocket.on("close",i._onWebSocketClose.bind(i,s,!1)),s.clientToProxyWebSocket.pause(),""==r.url||/^\//.test(r.url)){var o=m.parseHostAndPort(r);n=(s.isSSL?"wss":"ws")+"://"+o.host+(o.port?":"+o.port:"")+r.url}else n=r.url;var a={},c=r.headers;for(var u in c)0!==u.indexOf("sec-websocket")&&(a[u]=c[u]);return s.proxyToServerWebSocketOptions={url:n,agent:s.isSSL?i.httpsAgent:i.httpAgent,headers:a},i._onWebSocketConnection(s,(function(e){return e?i._onWebSocketError(s,e):(s.proxyToServerWebSocket=new h(s.proxyToServerWebSocketOptions.url,s.proxyToServerWebSocketOptions),s.proxyToServerWebSocket.on("message",i._onWebSocketFrame.bind(i,s,"message",!0)),s.proxyToServerWebSocket.on("ping",i._onWebSocketFrame.bind(i,s,"ping",!0)),s.proxyToServerWebSocket.on("pong",i._onWebSocketFrame.bind(i,s,"pong",!0)),s.proxyToServerWebSocket.on("error",i._onWebSocketError.bind(i,s)),s.proxyToServerWebSocket.on("close",i._onWebSocketClose.bind(i,s,!0)),void s.proxyToServerWebSocket.on("open",(function(){s.clientToProxyWebSocket.readyState===h.OPEN&&s.clientToProxyWebSocket.resume()})))}))},m.prototype._onHttpServerRequest=function(e,t,r){var n=this,i={isSSL:e,connectRequest:n.connectRequests[t.socket.remotePort+":"+t.socket.localPort]||{},clientToProxyRequest:t,proxyToClientResponse:r,onRequestHandlers:[],onErrorHandlers:[],onRequestDataHandlers:[],onRequestEndHandlers:[],onResponseHandlers:[],onResponseDataHandlers:[],onResponseEndHandlers:[],requestFilters:[],responseFilters:[],responseContentPotentiallyModified:!1,onRequest:function(e){return i.onRequestHandlers.push(e),i},onError:function(e){return i.onErrorHandlers.push(e),i},onRequestData:function(e){return i.onRequestDataHandlers.push(e),i},onRequestEnd:function(e){return i.onRequestEndHandlers.push(e),i},addRequestFilter:function(e){return i.requestFilters.push(e),i},onResponse:function(e){return i.onResponseHandlers.push(e),i},onResponseData:function(e){return i.onResponseDataHandlers.push(e),i.responseContentPotentiallyModified=!0,i},onResponseEnd:function(e){return i.onResponseEndHandlers.push(e),i},addResponseFilter:function(e){return i.responseFilters.push(e),i.responseContentPotentiallyModified=!0,i},use:function(e){return e.onError&&i.onError(e.onError),e.onRequest&&i.onRequest(e.onRequest),e.onRequestHeaders&&i.onRequestHeaders(e.onRequestHeaders),e.onRequestData&&i.onRequestData(e.onRequestData),e.onResponse&&i.onResponse(e.onResponse),e.onResponseData&&i.onResponseData(e.onResponseData),i}};i.clientToProxyRequest.on("error",n._onError.bind(n,"CLIENT_TO_PROXY_REQUEST_ERROR",i)),i.proxyToClientResponse.on("error",n._onError.bind(n,"PROXY_TO_CLIENT_RESPONSE_ERROR",i)),i.clientToProxyRequest.pause();var a=m.parseHostAndPort(i.clientToProxyRequest,i.isSSL?443:80);if(null!==a){var c={};for(var u in i.clientToProxyRequest.headers)/^proxy\-/i.test(u)||(c[u]=i.clientToProxyRequest.headers[u]);return this.options.forceChunkedRequest&&delete c["content-length"],i.proxyToServerRequestOptions={method:i.clientToProxyRequest.method,path:i.clientToProxyRequest.url,host:a.host,port:a.port,headers:c,agent:i.isSSL?n.httpsAgent:n.httpAgent},n._onRequest(i,(function(e){return e?n._onError("ON_REQUEST_ERROR",i,e):n._onRequestHeaders(i,(function(e){return e?n._onError("ON_REQUESTHEADERS_ERROR",i,e):function(){var e=i.isSSL?o:s;i.proxyToServerRequest=e.request(i.proxyToServerRequestOptions,l),i.proxyToServerRequest.on("error",n._onError.bind(n,"PROXY_TO_SERVER_REQUEST_ERROR",i)),i.requestFilters.push(new v(n,i));var t=i.clientToProxyRequest;i.requestFilters.forEach((function(e){e.on("error",n._onError.bind(n,"REQUEST_FILTER_ERROR",i)),t=t.pipe(e)})),i.clientToProxyRequest.resume()}()}))}))}function l(e){return e.on("error",n._onError.bind(n,"SERVER_TO_PROXY_RESPONSE_ERROR",i)),e.pause(),i.serverToProxyResponse=e,n._onResponse(i,(function(e){return e?n._onError("ON_RESPONSE_ERROR",i,e):((n.responseContentPotentiallyModified||i.responseContentPotentiallyModified)&&(i.serverToProxyResponse.headers["transfer-encoding"]="chunked",delete i.serverToProxyResponse.headers["content-length"]),n.keepAlive?i.clientToProxyRequest.headers["proxy-connection"]&&(i.serverToProxyResponse.headers["proxy-connection"]="keep-alive",i.serverToProxyResponse.headers.connection="keep-alive"):i.serverToProxyResponse.headers.connection="close",n._onResponseHeaders(i,(function(e){if(e)return n._onError("ON_RESPONSEHEADERS_ERROR",i,e);i.proxyToClientResponse.writeHead(i.serverToProxyResponse.statusCode,m.filterAndCanonizeHeaders(i.serverToProxyResponse.headers)),i.responseFilters.push(new C(n,i));var t=i.serverToProxyResponse;return i.responseFilters.forEach((function(e){e.on("error",n._onError.bind(n,"RESPONSE_FILTER_ERROR",i)),t=t.pipe(e)})),i.serverToProxyResponse.resume()})))}))}i.clientToProxyRequest.resume(),i.proxyToClientResponse.writeHeader(400,{"Content-Type":"text/html; charset=utf-8"}),i.proxyToClientResponse.end("Bad request: Host missing...","UTF-8")};var v=function(e,t){l.EventEmitter.call(this),this.writable=!0,this.write=function(r){return e._onRequestData(t,r,(function(r,n){return r?e._onError("ON_REQUEST_DATA_ERROR",t,r):n?t.proxyToServerRequest.write(n):void 0})),!0},this.end=function(r){return r?e._onRequestData(t,r,(function(r,n){return r?e._onError("ON_REQUEST_DATA_ERROR",t,r):e._onRequestEnd(t,(function(r){return r?e._onError("ON_REQUEST_END_ERROR",t,r):t.proxyToServerRequest.end(n)}))})):e._onRequestEnd(t,(function(n){return n?e._onError("ON_REQUEST_END_ERROR",t,n):t.proxyToServerRequest.end(r||void 0)}))}};a.inherits(v,l.EventEmitter);var C=function(e,t){return l.EventEmitter.call(this),this.writable=!0,this.write=function(r){return e._onResponseData(t,r,(function(r,n){return r?e._onError("ON_RESPONSE_DATA_ERROR",t,r):n?t.proxyToClientResponse.write(n):void 0})),!0},this.end=function(r){return r?e._onResponseData(t,r,(function(r,n){return r?e._onError("ON_RESPONSE_DATA_ERROR",t,r):e._onResponseEnd(t,(function(r){return r?e._onError("ON_RESPONSE_END_ERROR",t,r):t.proxyToClientResponse.end(n||void 0)}))})):e._onResponseEnd(t,(function(n){return n?e._onError("ON_RESPONSE_END_ERROR",t,n):t.proxyToClientResponse.end(r||void 0)}))},this};a.inherits(C,l.EventEmitter),m.prototype._onRequestHeaders=function(e,t){n.forEach(this.onRequestHeadersHandlers,(function(t,r){return t(e,r)}),t)},m.prototype._onRequest=function(e,t){n.forEach(this.onRequestHandlers.concat(e.onRequestHandlers),(function(t,r){return t(e,r)}),t)},m.prototype._onWebSocketConnection=function(e,t){n.forEach(this.onWebSocketConnectionHandlers.concat(e.onWebSocketConnectionHandlers),(function(t,r){return t(e,r)}),t)},m.prototype._onWebSocketFrame=function(e,t,r,i,s){var o=this;n.forEach(this.onWebSocketFrameHandlers.concat(e.onWebSocketFrameHandlers),(function(n,o){return n(e,t,r,i,s,(function(e,t,r){return e?o(e):o(null,i=t,s=r)}))}),(function(n){if(n)return o._onWebSocketError(e,n);var a=r?e.clientToProxyWebSocket:e.proxyToServerWebSocket;if(a.readyState===h.OPEN)switch(t){case"message":a.send(i,s);break;case"ping":a.ping(i,s,!1);break;case"pong":a.pong(i,s,!1)}else o._onWebSocketError(e,new Error("Cannot send "+t+" because "+(r?"clientToProxy":"proxyToServer")+" WebSocket connection state is not OPEN"))}))},m.prototype._onWebSocketClose=function(e,t,r,i){e.closedByServer||e.closedByClient||(e.closedByServer=t,e.closedByClient=!t,n.forEach(this.onWebSocketCloseHandlers.concat(e.onWebSocketCloseHandlers),(function(t,n){return t(e,r,i,n)}),(function(t){if(t)return self._onWebSocketError(e,t);e.clientToProxyWebSocket.readyState!==e.proxyToServerWebSocket.readyState&&(e.clientToProxyWebSocket.readyState===h.CLOSED&&e.proxyToServerWebSocket.readyState===h.OPEN?e.proxyToServerWebSocket.close(r,i):e.proxyToServerWebSocket.readyState===h.CLOSED&&e.clientToProxyWebSocket.readyState===h.OPEN&&e.clientToProxyWebSocket.close(r,i))})))},m.prototype._onWebSocketError=function(e,t){this.onWebSocketErrorHandlers.forEach((function(r){return r(e,t)})),e&&e.onWebSocketErrorHandlers.forEach((function(r){return r(e,t)})),e.proxyToServerWebSocket&&e.clientToProxyWebSocket.readyState!==e.proxyToServerWebSocket.readyState&&(e.clientToProxyWebSocket.readyState===h.CLOSED&&e.proxyToServerWebSocket.readyState===h.OPEN?e.proxyToServerWebSocket.close():e.proxyToServerWebSocket.readyState===h.CLOSED&&e.clientToProxyWebSocket.readyState===h.OPEN&&e.clientToProxyWebSocket.close())},m.prototype._onRequestData=function(e,t,r){var i=this;n.forEach(this.onRequestDataHandlers.concat(e.onRequestDataHandlers),(function(r,n){return r(e,t,(function(e,r){return e?n(e):(t=r,n(null,r))}))}),(function(n){return n?i._onError("ON_REQUEST_DATA_ERROR",e,n):r(null,t)}))},m.prototype._onRequestEnd=function(e,t){var r=this;n.forEach(this.onRequestEndHandlers.concat(e.onRequestEndHandlers),(function(t,r){return t(e,r)}),(function(n){return n?r._onError("ON_REQUEST_END_ERROR",e,n):t(null)}))},m.prototype._onResponse=function(e,t){n.forEach(this.onResponseHandlers.concat(e.onResponseHandlers),(function(t,r){return t(e,r)}),t)},m.prototype._onResponseHeaders=function(e,t){n.forEach(this.onResponseHeadersHandlers,(function(t,r){return t(e,r)}),t)},m.prototype._onResponseData=function(e,t,r){var i=this;n.forEach(this.onResponseDataHandlers.concat(e.onResponseDataHandlers),(function(r,n){return r(e,t,(function(e,r){return e?n(e):(t=r,n(null,r))}))}),(function(n){return n?i._onError("ON_RESPONSE_DATA_ERROR",e,n):r(null,t)}))},m.prototype._onResponseEnd=function(e,t){var r=this;n.forEach(this.onResponseEndHandlers.concat(e.onResponseEndHandlers),(function(t,r){return t(e,r)}),(function(n){return n?r._onError("ON_RESPONSE_END_ERROR",e,n):t(null)}))},m.parseHostAndPort=function(e,t){var r=e.url.match(/^http:\/\/([^\/]+)(.*)/);return r?(e.url=r[2]||"/",m.parseHost(r[1],t)):e.headers.host?m.parseHost(e.headers.host,t):null},m.parseHost=function(e,t){if(e.match(/^http:\/\/(.*)/)){var r=p.parse(e);return{host:r.hostname,port:r.port}}var n=e.split(":");return{host:n[0],port:2===n.length?+n[1]:t}},m.filterAndCanonizeHeaders=function(e){var t={};for(var r in e){var n=r.trim();/^public\-key\-pins/i.test(n)||(y._checkInvalidHeaderChar(e[r])||(t[n]=e[r]))}return t}},function(e,t,r){"use strict";const n=r(44);n.Server=r(86),n.Receiver=r(47),n.Sender=r(49),e.exports=n},function(e,t){e.exports=require("buffer")},function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);e=e||{},this.concurrency=e.concurrency||1/0,this.pending=0,this.jobs=[],this.cbs=[],this._done=i.bind(this)}function i(){this.pending--,this._run()}["push","unshift","splice"].forEach((function(e){n.prototype[e]=function(){var t=Array.prototype[e].apply(this.jobs,arguments);return this._run(),t}})),Object.defineProperty(n.prototype,"length",{get:function(){return this.pending+this.jobs.length}}),n.prototype._run=function(){if(this.pending!==this.concurrency){if(this.jobs.length){var e=this.jobs.shift();this.pending++,e(this._done),this._run()}if(0===this.pending)for(;0!==this.cbs.length;){var t=this.cbs.pop();process.nextTick(t)}}},n.prototype.onDone=function(e){"function"==typeof e&&(this.cbs.push(e),this._run())},e.exports=n},function(e,t,r){"use strict";class n{constructor(e,t){this.target=t,this.type=e}}class i extends n{constructor(e,t){super("message",t),this.data=e}}class s extends n{constructor(e,t,r){super("close",r),this.wasClean=r._closeFrameReceived&&r._closeFrameSent,this.reason=t,this.code=e}}class o extends n{constructor(e){super("open",e)}}const a={addEventListener(e,t){function r(e){t.call(this,new i(e,this))}function n(e,r){t.call(this,new s(e,r,this))}function a(e){e.type="error",e.target=this,t.call(this,e)}function c(){t.call(this,new o(this))}"function"==typeof t&&("message"===e?(r._listener=t,this.on(e,r)):"close"===e?(n._listener=t,this.on(e,n)):"error"===e?(a._listener=t,this.on(e,a)):"open"===e?(c._listener=t,this.on(e,c)):this.on(e,t))},removeEventListener(e,t){const r=this.listeners(e);for(var n=0;n<r.length;n++)r[n]!==t&&r[n]._listener!==t||this.removeListener(e,r[n])}};e.exports=a},function(e,t,r){"use strict";try{const t=r(!function(){var e=new Error("Cannot find module 'utf-8-validate'");throw e.code="MODULE_NOT_FOUND",e}());e.exports="object"==typeof t?t.Validation.isValidUTF8:t}catch(t){e.exports=()=>!0}},function(e,t,r){"use strict";const n=r(9),i=r(28),s=r(8),o=r(45),a=r(11),c=r(13),u=r(20),l=r(46),h=r(21),p=r(44),f=n.Buffer;function d(){this.destroy()}function y(e,t,r){e.writable&&(r=r||a.STATUS_CODES[t],e.write(`HTTP/1.1 ${t} ${a.STATUS_CODES[t]}\r\nConnection: close\r\nContent-type: text/html\r\nContent-Length: ${f.byteLength(r)}\r\n\r\n`+r)),e.removeListener("error",d),e.destroy()}e.exports=class extends i{constructor(e,t){if(super(),null==(e=Object.assign({maxPayload:104857600,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null},e)).port&&!e.server&&!e.noServer)throw new TypeError("missing or invalid options");null!=e.port?(this._server=a.createServer((e,t)=>{const r=a.STATUS_CODES[426];t.writeHead(426,{"Content-Length":r.length,"Content-Type":"text/plain"}),t.end(r)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server&&(this._ultron=new o(this._server),this._ultron.on("listening",()=>this.emit("listening")),this._ultron.on("error",e=>this.emit("error",e)),this._ultron.on("upgrade",(e,t,r)=>{this.handleUpgrade(e,t,r,t=>{this.emit("connection",t,e)})})),!0===e.perMessageDeflate&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set),this.options=e}close(e){if(this.clients)for(const e of this.clients)e.terminate();const t=this._server;if(t&&(this._ultron.destroy(),this._ultron=this._server=null,null!=this.options.port))return t.close(e);e&&e()}shouldHandle(e){return!this.options.path||c.parse(e.url).pathname===this.options.path}handleUpgrade(e,t,r,n){t.on("error",d);const i=+e.headers["sec-websocket-version"],s={};if("GET"!==e.method||"websocket"!==e.headers.upgrade.toLowerCase()||!e.headers["sec-websocket-key"]||8!==i&&13!==i||!this.shouldHandle(e))return y(t,400);if(this.options.perMessageDeflate){const r=new u(this.options.perMessageDeflate,!0,this.options.maxPayload);try{const t=l.parse(e.headers["sec-websocket-extensions"]);t[u.extensionName]&&(r.accept(t[u.extensionName]),s[u.extensionName]=r)}catch(e){return y(t,400)}}var o=(e.headers["sec-websocket-protocol"]||"").split(/, */);if(this.options.handleProtocols){if(!1===(o=this.options.handleProtocols(o,e)))return y(t,401)}else o=o[0];if(this.options.verifyClient){const a={origin:e.headers[""+(8===i?"sec-websocket-origin":"origin")],secure:!(!e.connection.authorized&&!e.connection.encrypted),req:e};if(2===this.options.verifyClient.length)return void this.options.verifyClient(a,(a,c,u)=>{if(!a)return y(t,c||401,u);this.completeUpgrade(o,s,i,e,t,r,n)});if(!this.options.verifyClient(a))return y(t,401)}this.completeUpgrade(o,s,i,e,t,r,n)}completeUpgrade(e,t,r,n,i,o,a){if(!i.readable||!i.writable)return i.destroy();const c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade","Sec-WebSocket-Accept: "+s.createHash("sha1").update(n.headers["sec-websocket-key"]+h.GUID,"binary").digest("base64")];if(e&&c.push("Sec-WebSocket-Protocol: "+e),t[u.extensionName]){const e=t[u.extensionName].params,r=l.format({[u.extensionName]:[e]});c.push("Sec-WebSocket-Extensions: "+r)}this.emit("headers",c,n),i.write(c.concat("\r\n").join("\r\n"));const f=new p([i,o],null,{maxPayload:this.options.maxPayload,protocolVersion:r,extensions:t,protocol:e});this.clients&&(this.clients.add(f),f.on("close",()=>this.clients.delete(f))),i.removeListener("error",d),a(f)}}},function(e,t,r){!function(t){"use strict";var r=function(e){setTimeout(e,0)};"undefined"!=typeof process&&process&&"function"==typeof process.nextTick&&(r=process.nextTick),e.exports=function(e){var t={capacity:e||1,current:0,queue:[],firstHere:!1,take:function(){if(!1===t.firstHere){t.current++,t.firstHere=!0;var e=1}else e=0;var r={n:1};"function"==typeof arguments[0]?r.task=arguments[0]:r.n=arguments[0],arguments.length>=2&&("function"==typeof arguments[1]?r.task=arguments[1]:r.n=arguments[1]);var n=r.task;if(r.task=function(){n(t.leave)},t.current+r.n-e>t.capacity)return 1===e&&(t.current--,t.firstHere=!1),t.queue.push(r);t.current+=r.n-e,r.task(t.leave),1===e&&(t.firstHere=!1)},leave:function(e){if(e=e||1,t.current-=e,t.queue.length){var n=t.queue[0];n.n+t.current>t.capacity||(t.queue.shift(),t.current+=n.n,r(n.task))}else if(t.current<0)throw new Error("leave called too many times.")},available:function(e){return e=e||1,t.current+e<=t.capacity}};return t}}()},function(e,t,r){"use strict";var n=r(12),i=r(27),s=r(89),o=s.pki,a=r(100),c=r(42),u=[{name:"commonName",value:"NodeMITMProxyCA"},{name:"countryName",value:"Internet"},{shortName:"ST",value:"Internet"},{name:"localityName",value:"Internet"},{name:"organizationName",value:"Node MITM Proxy CA"},{shortName:"OU",value:"CA"}],l=[{name:"basicConstraints",cA:!0},{name:"keyUsage",keyCertSign:!0,digitalSignature:!0,nonRepudiation:!0,keyEncipherment:!0,dataEncipherment:!0},{name:"extKeyUsage",serverAuth:!0,clientAuth:!0,codeSigning:!0,emailProtection:!0,timeStamping:!0},{name:"nsCertType",client:!0,server:!0,email:!0,objsign:!0,sslCA:!0,emailCA:!0,objCA:!0},{name:"subjectKeyIdentifier"}],h=[{name:"countryName",value:"Internet"},{shortName:"ST",value:"Internet"},{name:"localityName",value:"Internet"},{name:"organizationName",value:"Node MITM Proxy CA"},{shortName:"OU",value:"Node MITM Proxy Server Certificate"}],p=[{name:"basicConstraints",cA:!1},{name:"keyUsage",keyCertSign:!1,digitalSignature:!0,nonRepudiation:!1,keyEncipherment:!0,dataEncipherment:!0},{name:"extKeyUsage",serverAuth:!0,clientAuth:!0,codeSigning:!1,emailProtection:!1,timeStamping:!1},{name:"nsCertType",client:!0,server:!0,email:!1,objsign:!1,sslCA:!1,emailCA:!1,objCA:!1},{name:"subjectKeyIdentifier"}],f=function(){};f.create=function(e,t){var r=new f;r.baseCAFolder=e,r.certsFolder=i.join(r.baseCAFolder,"certs"),r.keysFolder=i.join(r.baseCAFolder,"keys"),c.series([a.bind(null,r.baseCAFolder),a.bind(null,r.certsFolder),a.bind(null,r.keysFolder),function(e){n.exists(i.join(r.certsFolder,"ca.pem"),(function(t){t?r.loadCA(e):r.generateCA(e)}))}],(function(e){return e?t(e):t(null,r)}))},f.prototype.randomSerialNumber=function(){for(var e="",t=0;t<4;t++)e+=("00000000"+Math.floor(Math.random()*Math.pow(256,4)).toString(16)).slice(-8);return e},f.prototype.generateCA=function(e){var t=this;o.rsa.generateKeyPair({bits:2048},(function(r,a){if(r)return e(r);var h=o.createCertificate();h.publicKey=a.publicKey,h.serialNumber=t.randomSerialNumber(),h.validity.notBefore=new Date,h.validity.notBefore.setDate(h.validity.notBefore.getDate()-1),h.validity.notAfter=new Date,h.validity.notAfter.setFullYear(h.validity.notBefore.getFullYear()+2),h.setSubject(u),h.setIssuer(u),h.setExtensions(l),h.sign(a.privateKey,s.md.sha256.create()),t.CAcert=h,t.CAkeys=a,c.parallel([n.writeFile.bind(null,i.join(t.certsFolder,"ca.pem"),o.certificateToPem(h)),n.writeFile.bind(null,i.join(t.keysFolder,"ca.private.key"),o.privateKeyToPem(a.privateKey)),n.writeFile.bind(null,i.join(t.keysFolder,"ca.public.key"),o.publicKeyToPem(a.publicKey))],e)}))},f.prototype.loadCA=function(e){var t=this;c.auto({certPEM:function(e){n.readFile(i.join(t.certsFolder,"ca.pem"),"utf-8",e)},keyPrivatePEM:function(e){n.readFile(i.join(t.keysFolder,"ca.private.key"),"utf-8",e)},keyPublicPEM:function(e){n.readFile(i.join(t.keysFolder,"ca.public.key"),"utf-8",e)}},(function(r,n){return r?e(r):(t.CAcert=o.certificateFromPem(n.certPEM),t.CAkeys={privateKey:o.privateKeyFromPem(n.keyPrivatePEM),publicKey:o.publicKeyFromPem(n.keyPublicPEM)},e())}))},f.prototype.generateServerCertificateKeys=function(e,t){var r=this;"string"==typeof e&&(e=[e]);var i=e[0],a=o.rsa.generateKeyPair(2048),c=o.createCertificate();c.publicKey=a.publicKey,c.serialNumber=this.randomSerialNumber(),c.validity.notBefore=new Date,c.validity.notBefore.setDate(c.validity.notBefore.getDate()-1),c.validity.notAfter=new Date,c.validity.notAfter.setFullYear(c.validity.notBefore.getFullYear()+2);var u=h.slice(0);u.unshift({name:"commonName",value:i}),c.setSubject(u),c.setIssuer(this.CAcert.issuer.attributes),c.setExtensions(p.concat([{name:"subjectAltName",altNames:e.map((function(e){return e.match(/^[\d\.]+$/)?{type:7,ip:e}:{type:2,value:e}}))}])),c.sign(this.CAkeys.privateKey,s.md.sha256.create());var l=o.certificateToPem(c),f=o.privateKeyToPem(a.privateKey),d=o.publicKeyToPem(a.publicKey);n.writeFile(this.certsFolder+"/"+i.replace(/\*/g,"_")+".pem",l,(function(e){e&&console.error("Failed to save certificate to disk in "+r.certsFolder,e)})),n.writeFile(this.keysFolder+"/"+i.replace(/\*/g,"_")+".key",f,(function(e){e&&console.error("Failed to save private key to disk in "+r.keysFolder,e)})),n.writeFile(this.keysFolder+"/"+i.replace(/\*/g,"_")+".public.key",d,(function(e){e&&console.error("Failed to save public key to disk in "+r.keysFolder,e)})),t(l,f)},f.prototype.getCACertPath=function(){return this.certsFolder+"/ca.pem"},e.exports=f},function(e,t,r){e.exports=r(0),r(6),r(91),r(4),r(31),r(62),r(22),r(93),r(14),r(95),r(64),r(96),r(61),r(33),r(10),r(57),r(59),r(97),r(52),r(58),r(55),r(35),r(3),r(56),r(98),r(99),r(51),r(1)},function(e,t){var r={};e.exports=r;var n={};r.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,s=t.length,o=t.charAt(0),a=[0];for(i=0;i<e.length;++i){for(var c=0,u=e[i];c<a.length;++c)u+=a[c]<<8,a[c]=u%s,u=u/s|0;for(;u>0;)a.push(u%s),u=u/s|0}for(i=0;0===e[i]&&i<e.length-1;++i)n+=o;for(i=a.length-1;i>=0;--i)n+=t[a[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),s=[0];for(r=0;r<e.length();++r){for(var o=0,a=e.at(r);o<s.length;++o)a+=s[o]<<8,s[o]=a%n,a=a/n|0;for(;a>0;)s.push(a%n),a=a/n|0}var c="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)c+=i;for(r=s.length-1;r>=0;--r)c+=t[s[r]];return c}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},r.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var r=n[t];if(!r){r=n[t]=[];for(var i=0;i<t.length;++i)r[t.charCodeAt(i)]=i}e=e.replace(/\s/g,"");var s=t.length,o=t.charAt(0),a=[0];for(i=0;i<e.length;i++){var c=r[e.charCodeAt(i)];if(void 0===c)return;for(var u=0,l=c;u<a.length;++u)l+=a[u]*s,a[u]=255&l,l>>=8;for(;l>0;)a.push(255&l),l>>=8}for(var h=0;e[h]===o&&h<e.length-1;++h)a.push(0);return"undefined"!=typeof Buffer?Buffer.from(a.reverse()):new Uint8Array(a.reverse())}},function(e,t,r){var n=r(0);r(6),r(51);var i=e.exports=n.tls;function s(e,t,r){var s=t.entity===n.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:n.cipher.createDecipher("AES-CBC",s?r.keys.server_write_key:r.keys.client_write_key),iv:s?r.keys.server_write_IV:r.keys.client_write_IV},e.write.cipherState={init:!1,cipher:n.cipher.createCipher("AES-CBC",s?r.keys.client_write_key:r.keys.server_write_key),iv:s?r.keys.client_write_IV:r.keys.server_write_IV},e.read.cipherFunction=u,e.write.cipherFunction=o,e.read.macLength=e.write.macLength=r.mac_length,e.read.macFunction=e.write.macFunction=i.hmac_sha1}function o(e,t){var r,s=!1,o=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(o),t.updateSequenceNumber(),r=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:n.random.getBytesSync(16),t.cipherState.init=!0;var c=t.cipherState.cipher;return c.start({iv:r}),e.version.minor>=i.Versions.TLS_1_1.minor&&c.output.putBytes(r),c.update(e.fragment),c.finish(a)&&(e.fragment=c.output,e.length=e.fragment.length(),s=!0),s}function a(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function c(e,t,r){var n=!0;if(r){for(var i=t.length(),s=t.last(),o=i-1-s;o<i-1;++o)n=n&&t.at(o)==s;n&&t.truncate(s+1)}return n}function u(e,t){var r,s=!1;r=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:e.fragment.getBytes(16),t.cipherState.init=!0;var o=t.cipherState.cipher;o.start({iv:r}),o.update(e.fragment),s=o.finish(c);var a=t.macLength,u=n.random.getBytesSync(a),l=o.output.length();l>=a?(e.fragment=o.output.getBytes(l-a),u=o.output.getBytes(a)):e.fragment=o.output.getBytes(),e.fragment=n.util.createBuffer(e.fragment),e.length=e.fragment.length();var h=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),s=function(e,t,r){var i=n.hmac.create();return i.start("SHA1",e),i.update(t),t=i.digest().getBytes(),i.start(null,null),i.update(r),r=i.digest().getBytes(),t===r}(t.macKey,u,h)&&s}i.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:s},i.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:s}},function(e,t,r){var n=r(0);r(61),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},function(e,t,r){var n=r(0);r(24),r(3),r(63),r(1);var i=r(94),s=i.publicKeyValidator,o=i.privateKeyValidator;if(void 0===a)var a=n.jsbn.BigInteger;var c=n.util.ByteBuffer,u="undefined"==typeof Buffer?Uint8Array:Buffer;n.pki=n.pki||{},e.exports=n.pki.ed25519=n.ed25519=n.ed25519||{};var l=n.ed25519;function h(e){var t=e.message;if(t instanceof Uint8Array||t instanceof u)return t;var r=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');t=e.md.digest().getBytes(),r="binary"}if("string"==typeof t&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if("undefined"!=typeof Buffer)return Buffer.from(t,r);t=new c(t,r)}else if(!(t instanceof c))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new u(t.length()),i=0;i<n.length;++i)n[i]=t.at(i);return n}l.constants={},l.constants.PUBLIC_KEY_BYTE_LENGTH=32,l.constants.PRIVATE_KEY_BYTE_LENGTH=64,l.constants.SEED_BYTE_LENGTH=32,l.constants.SIGN_BYTE_LENGTH=64,l.constants.HASH_BYTE_LENGTH=64,l.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=n.random.getBytesSync(l.constants.SEED_BYTE_LENGTH);else if("string"==typeof t){if(t.length!==l.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+l.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=h({message:t,encoding:"binary"});for(var r=new u(l.constants.PUBLIC_KEY_BYTE_LENGTH),i=new u(l.constants.PRIVATE_KEY_BYTE_LENGTH),s=0;s<32;++s)i[s]=t[s];return function(e,t){var r,n=[D(),D(),D(),D()],i=E(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,N(n,i),A(e,n),r=0;r<32;++r)t[r+32]=e[r]}(r,i),{publicKey:r,privateKey:i}},l.privateKeyFromAsn1=function(e){var t={},r=[];if(!n.asn1.validate(e,o,t,r)){var i=new Error("Invalid Key.");throw i.errors=r,i}var s=n.asn1.derToOid(t.privateKeyOid),a=n.oids.EdDSA25519;if(s!==a)throw new Error('Invalid OID "'+s+'"; OID must be "'+a+'".');var c=t.privateKey;return{privateKeyBytes:h({message:n.asn1.fromDer(c).value,encoding:"binary"})}},l.publicKeyFromAsn1=function(e){var t={},r=[];if(!n.asn1.validate(e,s,t,r)){var i=new Error("Invalid Key.");throw i.errors=r,i}var o=n.asn1.derToOid(t.publicKeyOid),a=n.oids.EdDSA25519;if(o!==a)throw new Error('Invalid OID "'+o+'"; OID must be "'+a+'".');var c=t.ed25519PublicKey;if(c.length!==l.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return h({message:c,encoding:"binary"})},l.publicKeyFromPrivateKey=function(e){var t=h({message:(e=e||{}).privateKey,encoding:"binary"});if(t.length!==l.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+l.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new u(l.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<r.length;++n)r[n]=t[32+n];return r},l.sign=function(e){var t=h(e=e||{}),r=h({message:e.privateKey,encoding:"binary"});if(r.length===l.constants.SEED_BYTE_LENGTH)r=l.generateKeyPair({seed:r}).privateKey;else if(r.length!==l.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+l.constants.SEED_BYTE_LENGTH+" or "+l.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new u(l.constants.SIGN_BYTE_LENGTH+t.length);!function(e,t,r,n){var i,s,o=new Float64Array(64),a=[D(),D(),D(),D()],c=E(n,32);c[0]&=248,c[31]&=127,c[31]|=64;var u=r+64;for(i=0;i<r;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=c[32+i];var l=E(e.subarray(32),r+32);for(b(l),N(a,l),A(e,a),i=32;i<64;++i)e[i]=n[i];var h=E(e,r+64);for(b(h),i=32;i<64;++i)o[i]=0;for(i=0;i<32;++i)o[i]=l[i];for(i=0;i<32;++i)for(s=0;s<32;s++)o[i+s]+=h[i]*c[s];S(e.subarray(32),o)}(n,t,t.length,r);for(var i=new u(l.constants.SIGN_BYTE_LENGTH),s=0;s<i.length;++s)i[s]=n[s];return i},l.verify=function(e){var t=h(e=e||{});if(void 0===e.signature)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var r=h({message:e.signature,encoding:"binary"});if(r.length!==l.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+l.constants.SIGN_BYTE_LENGTH);var n=h({message:e.publicKey,encoding:"binary"});if(n.length!==l.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+l.constants.PUBLIC_KEY_BYTE_LENGTH);var i,s=new u(l.constants.SIGN_BYTE_LENGTH+t.length),o=new u(l.constants.SIGN_BYTE_LENGTH+t.length);for(i=0;i<l.constants.SIGN_BYTE_LENGTH;++i)s[i]=r[i];for(i=0;i<t.length;++i)s[i+l.constants.SIGN_BYTE_LENGTH]=t[i];return function(e,t,r,n){var i,s=new u(32),o=[D(),D(),D(),D()],a=[D(),D(),D(),D()];if(-1,r<64)return-1;if(function(e,t){var r=D(),n=D(),i=D(),s=D(),o=D(),a=D(),c=D();L(e[2],f),function(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(e[1],t),V(i,e[1]),M(s,i,d),P(i,i,e[2]),U(s,e[2],s),V(o,s),V(a,o),M(c,a,o),M(r,c,i),M(r,r,s),function(e,t){var r,n=D();for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)V(n,n),1!==r&&M(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(r,r),M(r,r,i),M(r,r,s),M(r,r,s),M(e[0],r,s),V(n,e[0]),M(n,n,s),B(n,i)&&M(e[0],e[0],C);if(V(n,e[0]),M(n,n,s),B(n,i))return-1;k(e[0])===t[31]>>7&&P(e[0],p,e[0]);return M(e[3],e[0],e[1]),0}(a,n))return-1;for(i=0;i<r;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=n[i];var c=E(e,r);if(b(c),R(o,a,c),N(a,t.subarray(32)),T(o,a),A(s,o),r-=64,w(t,0,s,0)){for(i=0;i<r;++i)e[i]=0;return-1}for(i=0;i<r;++i)e[i]=t[i+64];return r}(o,s,s.length,n)>=0};var p=D(),f=D([1]),d=D([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=D([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=D([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),m=D([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),v=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),C=D([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function E(e,t){var r=n.md.sha512.create(),i=new c(e);r.update(i.getBytes(t),"binary");var s=r.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(s,"binary");for(var o=new u(l.constants.HASH_BYTE_LENGTH),a=0;a<64;++a)o[a]=s.charCodeAt(a);return o}function S(e,t){var r,n,i,s;for(n=63;n>=32;--n){for(r=0,i=n-32,s=n-12;i<s;++i)t[i]+=r-16*t[n]*v[i-(n-32)],r=t[i]+128>>8,t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;++i)t[i]+=r-(t[31]>>4)*v[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*v[i];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function b(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;S(e,t)}function T(e,t){var r=D(),n=D(),i=D(),s=D(),o=D(),a=D(),c=D(),u=D(),l=D();P(r,e[1],e[0]),P(l,t[1],t[0]),M(r,r,l),U(n,e[0],e[1]),U(l,t[0],t[1]),M(n,n,l),M(i,e[3],t[3]),M(i,i,y),M(s,e[2],t[2]),U(s,s,s),P(o,n,r),P(a,s,i),U(c,s,i),U(u,n,r),M(e[0],o,a),M(e[1],u,c),M(e[2],c,a),M(e[3],o,u)}function _(e,t,r){for(var n=0;n<4;++n)O(e[n],t[n],r)}function A(e,t){var r=D(),n=D(),i=D();!function(e,t){var r,n=D();for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)V(n,n),2!==r&&4!==r&&M(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(i,t[2]),M(r,t[0],i),M(n,t[1],i),I(e,n),e[31]^=k(r)<<7}function I(e,t){var r,n,i,s=D(),o=D();for(r=0;r<16;++r)o[r]=t[r];for(x(o),x(o),x(o),n=0;n<2;++n){for(s[0]=o[0]-65517,r=1;r<15;++r)s[r]=o[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=o[15]-32767-(s[14]>>16&1),i=s[15]>>16&1,s[14]&=65535,O(o,s,1-i)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function B(e,t){var r=new u(32),n=new u(32);return I(r,e),I(n,t),w(r,0,n,0)}function w(e,t,r,n){return function(e,t,r,n,i){var s,o=0;for(s=0;s<i;++s)o|=e[t+s]^r[n+s];return(1&o-1>>>8)-1}(e,t,r,n,32)}function k(e){var t=new u(32);return I(t,e),1&t[0]}function R(e,t,r){var n,i;for(L(e[0],p),L(e[1],f),L(e[2],f),L(e[3],p),i=255;i>=0;--i)_(e,t,n=r[i/8|0]>>(7&i)&1),T(t,e),T(e,e),_(e,t,n)}function N(e,t){var r=[D(),D(),D(),D()];L(r[0],g),L(r[1],m),L(r[2],f),M(r[3],g,m),R(e,r,t)}function L(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function x(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function O(e,t,r){for(var n,i=~(r-1),s=0;s<16;++s)n=i&(e[s]^t[s]),e[s]^=n,t[s]^=n}function D(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function U(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]+r[n]}function P(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]-r[n]}function V(e,t){M(e,t,t)}function M(e,t,r){var n,i,s=0,o=0,a=0,c=0,u=0,l=0,h=0,p=0,f=0,d=0,y=0,g=0,m=0,v=0,C=0,E=0,S=0,b=0,T=0,_=0,A=0,I=0,B=0,w=0,k=0,R=0,N=0,L=0,x=0,O=0,D=0,U=r[0],P=r[1],V=r[2],M=r[3],F=r[4],K=r[5],q=r[6],j=r[7],H=r[8],W=r[9],G=r[10],z=r[11],Q=r[12],Y=r[13],X=r[14],$=r[15];s+=(n=t[0])*U,o+=n*P,a+=n*V,c+=n*M,u+=n*F,l+=n*K,h+=n*q,p+=n*j,f+=n*H,d+=n*W,y+=n*G,g+=n*z,m+=n*Q,v+=n*Y,C+=n*X,E+=n*$,o+=(n=t[1])*U,a+=n*P,c+=n*V,u+=n*M,l+=n*F,h+=n*K,p+=n*q,f+=n*j,d+=n*H,y+=n*W,g+=n*G,m+=n*z,v+=n*Q,C+=n*Y,E+=n*X,S+=n*$,a+=(n=t[2])*U,c+=n*P,u+=n*V,l+=n*M,h+=n*F,p+=n*K,f+=n*q,d+=n*j,y+=n*H,g+=n*W,m+=n*G,v+=n*z,C+=n*Q,E+=n*Y,S+=n*X,b+=n*$,c+=(n=t[3])*U,u+=n*P,l+=n*V,h+=n*M,p+=n*F,f+=n*K,d+=n*q,y+=n*j,g+=n*H,m+=n*W,v+=n*G,C+=n*z,E+=n*Q,S+=n*Y,b+=n*X,T+=n*$,u+=(n=t[4])*U,l+=n*P,h+=n*V,p+=n*M,f+=n*F,d+=n*K,y+=n*q,g+=n*j,m+=n*H,v+=n*W,C+=n*G,E+=n*z,S+=n*Q,b+=n*Y,T+=n*X,_+=n*$,l+=(n=t[5])*U,h+=n*P,p+=n*V,f+=n*M,d+=n*F,y+=n*K,g+=n*q,m+=n*j,v+=n*H,C+=n*W,E+=n*G,S+=n*z,b+=n*Q,T+=n*Y,_+=n*X,A+=n*$,h+=(n=t[6])*U,p+=n*P,f+=n*V,d+=n*M,y+=n*F,g+=n*K,m+=n*q,v+=n*j,C+=n*H,E+=n*W,S+=n*G,b+=n*z,T+=n*Q,_+=n*Y,A+=n*X,I+=n*$,p+=(n=t[7])*U,f+=n*P,d+=n*V,y+=n*M,g+=n*F,m+=n*K,v+=n*q,C+=n*j,E+=n*H,S+=n*W,b+=n*G,T+=n*z,_+=n*Q,A+=n*Y,I+=n*X,B+=n*$,f+=(n=t[8])*U,d+=n*P,y+=n*V,g+=n*M,m+=n*F,v+=n*K,C+=n*q,E+=n*j,S+=n*H,b+=n*W,T+=n*G,_+=n*z,A+=n*Q,I+=n*Y,B+=n*X,w+=n*$,d+=(n=t[9])*U,y+=n*P,g+=n*V,m+=n*M,v+=n*F,C+=n*K,E+=n*q,S+=n*j,b+=n*H,T+=n*W,_+=n*G,A+=n*z,I+=n*Q,B+=n*Y,w+=n*X,k+=n*$,y+=(n=t[10])*U,g+=n*P,m+=n*V,v+=n*M,C+=n*F,E+=n*K,S+=n*q,b+=n*j,T+=n*H,_+=n*W,A+=n*G,I+=n*z,B+=n*Q,w+=n*Y,k+=n*X,R+=n*$,g+=(n=t[11])*U,m+=n*P,v+=n*V,C+=n*M,E+=n*F,S+=n*K,b+=n*q,T+=n*j,_+=n*H,A+=n*W,I+=n*G,B+=n*z,w+=n*Q,k+=n*Y,R+=n*X,N+=n*$,m+=(n=t[12])*U,v+=n*P,C+=n*V,E+=n*M,S+=n*F,b+=n*K,T+=n*q,_+=n*j,A+=n*H,I+=n*W,B+=n*G,w+=n*z,k+=n*Q,R+=n*Y,N+=n*X,L+=n*$,v+=(n=t[13])*U,C+=n*P,E+=n*V,S+=n*M,b+=n*F,T+=n*K,_+=n*q,A+=n*j,I+=n*H,B+=n*W,w+=n*G,k+=n*z,R+=n*Q,N+=n*Y,L+=n*X,x+=n*$,C+=(n=t[14])*U,E+=n*P,S+=n*V,b+=n*M,T+=n*F,_+=n*K,A+=n*q,I+=n*j,B+=n*H,w+=n*W,k+=n*G,R+=n*z,N+=n*Q,L+=n*Y,x+=n*X,O+=n*$,E+=(n=t[15])*U,o+=38*(b+=n*V),a+=38*(T+=n*M),c+=38*(_+=n*F),u+=38*(A+=n*K),l+=38*(I+=n*q),h+=38*(B+=n*j),p+=38*(w+=n*H),f+=38*(k+=n*W),d+=38*(R+=n*G),y+=38*(N+=n*z),g+=38*(L+=n*Q),m+=38*(x+=n*Y),v+=38*(O+=n*X),C+=38*(D+=n*$),s=(n=(s+=38*(S+=n*P))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),C=(n=C+i+65535)-65536*(i=Math.floor(n/65536)),E=(n=E+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=(s+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),C=(n=C+i+65535)-65536*(i=Math.floor(n/65536)),E=(n=E+i+65535)-65536*(i=Math.floor(n/65536)),s+=i-1+37*(i-1),e[0]=s,e[1]=o,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=h,e[7]=p,e[8]=f,e[9]=d,e[10]=y,e[11]=g,e[12]=m,e[13]=v,e[14]=C,e[15]=E}},function(e,t,r){var n=r(0);r(4);var i=n.asn1;t.privateKeyValidator={name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},t.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},function(e,t,r){var n=r(0);r(1),r(3),r(24),e.exports=n.kem=n.kem||{};var i=n.jsbn.BigInteger;function s(e,t,r,i){e.generate=function(e,s){for(var o=new n.util.ByteBuffer,a=Math.ceil(s/i)+r,c=new n.util.ByteBuffer,u=r;u<a;++u){c.putInt32(u),t.start(),t.update(e+c.getBytes());var l=t.digest();o.putBytes(l.getBytes(i))}return o.truncate(o.length()-s),o.getBytes()}}n.kem.rsa={},n.kem.rsa.create=function(e,t){var r=(t=t||{}).prng||n.random,s={encrypt:function(t,s){var o,a=Math.ceil(t.n.bitLength()/8);do{o=new i(n.util.bytesToHex(r.getBytesSync(a)),16).mod(t.n)}while(o.compareTo(i.ONE)<=0);var c=a-(o=n.util.hexToBytes(o.toString(16))).length;return c>0&&(o=n.util.fillString(String.fromCharCode(0),c)+o),{encapsulation:t.encrypt(o,"NONE"),key:e.generate(o,s)}},decrypt:function(t,r,n){var i=t.decrypt(r,"NONE");return e.generate(i,n)}};return s},n.kem.kdf1=function(e,t){s(this,e,0,t||e.digestLength)},n.kem.kdf2=function(e,t){s(this,e,1,t||e.digestLength)}},function(e,t,r){e.exports=r(5),r(32),r(15),r(54),r(63)},function(e,t,r){var n=r(0);r(6),r(4),r(22),r(7),r(10),r(60),r(3),r(1),r(34);var i=n.asn1,s=e.exports=n.pkcs7=n.pkcs7||{};function o(e){var t={},r=[];if(!i.validate(e,s.asn1.recipientInfoValidator,t,r)){var o=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw o.errors=r,o}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function a(e){for(var t,r=[],s=0;s<e.length;++s)r.push((t=e[s],i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:t.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(t.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.encryptedContent.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.encryptedContent.content)])));return r}function c(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.digestAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),s=0;s<e.unauthenticatedAttributes.length;++s){var o=e.unauthenticatedAttributes[s];r.values.push(u(o))}t.value.push(r)}return t}function u(e){var t;if(e.type===n.pki.oids.contentType)t=i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.value).getBytes());else if(e.type===n.pki.oids.messageDigest)t=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===n.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),s=new Date("2050-01-01T00:00:00Z"),o=e.value;if("string"==typeof o){var a=Date.parse(o);o=isNaN(a)?13===o.length?i.utcTimeToDate(o):i.generalizedTimeToDate(o):new Date(a)}t=o>=r&&o<s?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(o)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(o))}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[t])])}function l(e,t,r){var s={};if(!i.validate(t,r,s,[])){var o=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw o.errors=o,o}if(i.derToOid(s.contentType)!==n.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(s.encryptedContent){var a="";if(n.util.isArray(s.encryptedContent))for(var c=0;c<s.encryptedContent.length;++c){if(s.encryptedContent[c].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");a+=s.encryptedContent[c].value}else a=s.encryptedContent;e.encryptedContent={algorithm:i.derToOid(s.encAlgorithm),parameter:n.util.createBuffer(s.encParameter.value),content:n.util.createBuffer(a)}}if(s.content){a="";if(n.util.isArray(s.content))for(c=0;c<s.content.length;++c){if(s.content[c].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");a+=s.content[c].value}else a=s.content;e.content=n.util.createBuffer(a)}return e.version=s.version.charCodeAt(0),e.rawCapture=s,s}function h(e){if(void 0===e.encryptedContent.key)throw new Error("Symmetric key not available.");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case n.pki.oids["aes128-CBC"]:case n.pki.oids["aes192-CBC"]:case n.pki.oids["aes256-CBC"]:t=n.aes.createDecryptionCipher(e.encryptedContent.key);break;case n.pki.oids.desCBC:case n.pki.oids["des-EDE3-CBC"]:t=n.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}s.messageFromPem=function(e){var t=n.pem.decode(e)[0];if("PKCS7"!==t.type){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var o=i.fromDer(t.body);return s.messageFromAsn1(o)},s.messageToPem=function(e,t){var r={type:"PKCS7",body:i.toDer(e.toAsn1()).getBytes()};return n.pem.encode(r,{maxline:t})},s.messageFromAsn1=function(e){var t={},r=[];if(!i.validate(e,s.asn1.contentInfoValidator,t,r)){var o=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw o.errors=r,o}var a,c=i.derToOid(t.contentType);switch(c){case n.pki.oids.envelopedData:a=s.createEnvelopedData();break;case n.pki.oids.encryptedData:a=s.createEncryptedData();break;case n.pki.oids.signedData:a=s.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+c+" is not (yet) supported.")}return a.fromAsn1(t.content.value[0]),a},s.createSignedData=function(){var e=null;return e={type:n.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(l(e,t,s.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var r=e.rawCapture.certificates.value,i=0;i<r.length;++i)e.certificates.push(n.pki.certificateFromAsn1(r[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],r=0;r<e.certificates.length;++r)t.push(n.pki.certificateToAsn1(e.certificates[r]));var s=[],o=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),s.length>0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,s)),o.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),o])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var s=t.certificate;"string"==typeof s&&(s=n.pki.certificateFromPem(s)),r=s.issuer.attributes,i=s.serialNumber}var o=t.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof o&&(o=n.pki.privateKeyFromPem(o));var a=t.digestAlgorithm||n.pki.oids.sha1;switch(a){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+a)}var c=t.authenticatedAttributes||[];if(c.length>0){for(var u=!1,l=!1,h=0;h<c.length;++h){var p=c[h];if(u||p.type!==n.pki.oids.contentType){if(l||p.type!==n.pki.oids.messageDigest);else if(l=!0,u)break}else if(u=!0,l)break}if(!u||!l)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:o,version:1,issuer:r,serialNumber:i,digestAlgorithm:a,signatureAlgorithm:n.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:c,unauthenticatedAttributes:[]})},sign:function(t){var r;(t=t||{},"object"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes())]),"content"in e&&(e.content instanceof n.util.ByteBuffer?r=e.content.bytes():"string"==typeof e.content&&(r=n.util.encodeUtf8(e.content)),t.detached?e.detachedContent=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r):e.contentInfo.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)]))));0!==e.signers.length&&function(t){var r;r=e.detachedContent?e.detachedContent:(r=e.contentInfo.value[1]).value[0];if(!r)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var s=i.derToOid(e.contentInfo.value[0].value),o=i.toDer(r);for(var a in o.getByte(),i.getBerValueLength(o),o=o.getBytes(),t)t[a].start().update(o);for(var l=new Date,h=0;h<e.signers.length;++h){var p=e.signers[h];if(0===p.authenticatedAttributes.length){if(s!==n.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{p.authenticatedAttributesAsn1=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var f=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[]),d=0;d<p.authenticatedAttributes.length;++d){var y=p.authenticatedAttributes[d];y.type===n.pki.oids.messageDigest?y.value=t[p.digestAlgorithm].digest():y.type===n.pki.oids.signingTime&&(y.value||(y.value=l)),f.value.push(u(y)),p.authenticatedAttributesAsn1.value.push(u(y))}o=i.toDer(f).getBytes(),p.md.start().update(o)}p.signature=p.key.sign(p.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=function(e){for(var t=[],r=0;r<e.length;++r)t.push(c(e[r]));return t}(e.signers)}(function(){for(var t={},r=0;r<e.signers.length;++r){var s=e.signers[r];(o=s.digestAlgorithm)in t||(t[o]=n.md[n.pki.oids[o]].create()),0===s.authenticatedAttributes.length?s.md=t[o]:s.md=n.md[n.pki.oids[o]].create()}for(var o in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]));return t}())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=n.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}}},s.createEncryptedData=function(){var e=null;return e={type:n.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){l(e,t,s.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),h(e)}}},s.createEnvelopedData=function(){var e=null;return e={type:n.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=l(e,t,s.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(o(e[r]));return t}(r.recipientInfos.value)},toAsn1:function(){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,a(e.recipients)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,(t=e.encryptedContent,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.parameter.getBytes())]),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.content.getBytes())])]))])])]);var t},findRecipient:function(t){for(var r=t.issuer.attributes,n=0;n<e.recipients.length;++n){var i=e.recipients[n],s=i.issuer;if(i.serialNumber===t.serialNumber&&s.length===r.length){for(var o=!0,a=0;a<r.length;++a)if(s[a].type!==r[a].type||s[a].value!==r[a].value){o=!1;break}if(o)return i}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:case n.pki.oids.desCBC:var i=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=n.util.createBuffer(i);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}h(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:n.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){var i,s,o;switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case n.pki.oids["aes128-CBC"]:i=16,s=16,o=n.aes.createEncryptionCipher;break;case n.pki.oids["aes192-CBC"]:i=24,s=16,o=n.aes.createEncryptionCipher;break;case n.pki.oids["aes256-CBC"]:i=32,s=16,o=n.aes.createEncryptionCipher;break;case n.pki.oids["des-EDE3-CBC"]:i=24,s=8,o=n.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=n.util.createBuffer(n.random.getBytes(i));else if(t.length()!=i)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+i+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=n.util.createBuffer(n.random.getBytes(s));var a=o(t);if(a.start(e.encryptedContent.parameter.copy()),a.update(e.content),!a.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=a.output}for(var c=0;c<e.recipients.length;++c){var u=e.recipients[c];if(void 0===u.encryptedContent.content)switch(u.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:u.encryptedContent.content=u.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+u.encryptedContent.algorithm)}}}}}},function(e,t,r){var n=r(0);r(6),r(14),r(32),r(15),r(1);var i=e.exports=n.ssh=n.ssh||{};function s(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var i=n.util.hexToBytes(r);e.putInt32(i.length),e.putBytes(i)}function o(e,t){e.putInt32(t.length),e.putString(t)}function a(){for(var e=n.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}i.privateKeyToPutty=function(e,t,r){var i=""===(t=t||"")?"none":"aes256-cbc",c="PuTTY-User-Key-File-2: ssh-rsa\r\n";c+="Encryption: "+i+"\r\n",c+="Comment: "+(r=r||"")+"\r\n";var u=n.util.createBuffer();o(u,"ssh-rsa"),s(u,e.e),s(u,e.n);var l=n.util.encode64(u.bytes(),64),h=Math.floor(l.length/66)+1;c+="Public-Lines: "+h+"\r\n",c+=l;var p,f=n.util.createBuffer();if(s(f,e.d),s(f,e.p),s(f,e.q),s(f,e.qInv),t){var d=f.length()+16-1;d-=d%16;var y=a(f.bytes());y.truncate(y.length()-d+f.length()),f.putBuffer(y);var g=n.util.createBuffer();g.putBuffer(a("\0\0\0\0",t)),g.putBuffer(a("\0\0\0",t));var m=n.aes.createEncryptionCipher(g.truncate(8),"CBC");m.start(n.util.createBuffer().fillWithByte(0,16)),m.update(f.copy()),m.finish();var v=m.output;v.truncate(16),p=n.util.encode64(v.bytes(),64)}else p=n.util.encode64(f.bytes(),64);c+="\r\nPrivate-Lines: "+(h=Math.floor(p.length/66)+1)+"\r\n",c+=p;var C=a("putty-private-key-file-mac-key",t),E=n.util.createBuffer();o(E,"ssh-rsa"),o(E,i),o(E,r),E.putInt32(u.length()),E.putBuffer(u),E.putInt32(f.length()),E.putBuffer(f);var S=n.hmac.create();return S.start("sha1",C),S.update(E.bytes()),c+="\r\nPrivate-MAC: "+S.digest().toHex()+"\r\n"},i.publicKeyToOpenSSH=function(e,t){t=t||"";var r=n.util.createBuffer();return o(r,"ssh-rsa"),s(r,e.e),s(r,e.n),"ssh-rsa "+n.util.encode64(r.bytes())+" "+t},i.privateKeyToOpenSSH=function(e,t){return t?n.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):n.pki.privateKeyToPem(e)},i.getPublicKeyFingerprint=function(e,t){var r=(t=t||{}).md||n.md.md5.create(),i=n.util.createBuffer();o(i,"ssh-rsa"),s(i,e.e),s(i,e.n),r.start(),r.update(i.getBytes());var a=r.digest();if("hex"===t.encoding){var c=a.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if("binary"===t.encoding)return a.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return a}},function(e,t,r){var n=r(0);r(62),r(64),r(1);var i="forge.task",s={},o=0;n.debug.set(i,"tasks",s);var a={};n.debug.set(i,"queues",a);var c="ready",u="running",l="blocked",h="sleeping",p="done",f="error",d="stop",y="start",g={ready:{}};g[c][d]=c,g[c][y]=u,g[c].cancel=p,g[c].fail=f,g[u]={},g[u][d]=c,g[u][y]=u,g[u].block=l,g[u].unblock=u,g[u].sleep=h,g[u].wakeup=u,g[u].cancel=p,g[u].fail=f,g[l]={},g[l][d]=l,g[l][y]=l,g[l].block=l,g[l].unblock=l,g[l].sleep=l,g[l].wakeup=l,g[l].cancel=p,g[l].fail=f,g[h]={},g[h][d]=h,g[h][y]=h,g[h].block=h,g[h].unblock=h,g[h].sleep=h,g[h].wakeup=h,g[h].cancel=p,g[h].fail=f,g[p]={},g[p][d]=p,g[p][y]=p,g[p].block=p,g[p].unblock=p,g[p].sleep=p,g[p].wakeup=p,g[p].cancel=p,g[p].fail=f,g[f]={},g[f][d]=f,g[f][y]=f,g[f].block=f,g[f].unblock=f,g[f].sleep=f,g[f].wakeup=f,g[f].cancel=f,g[f].fail=f;var m=function(e){this.id=-1,this.name=e.name||"?",this.parent=e.parent||null,this.run=e.run,this.subtasks=[],this.error=!1,this.state=c,this.blocks=0,this.timeoutId=null,this.swapTime=null,this.userData=null,this.id=o++,s[this.id]=this};m.prototype.debug=function(e){e=e||"",n.log.debug(i,e,"[%s][%s] task:",this.id,this.name,this,"subtasks:",this.subtasks.length,"queue:",a)},m.prototype.next=function(e,t){"function"==typeof e&&(t=e,e=this.name);var r=new m({run:t,name:e,parent:this});return r.state=u,r.type=this.type,r.successCallback=this.successCallback||null,r.failureCallback=this.failureCallback||null,this.subtasks.push(r),this},m.prototype.parallel=function(e,t){return n.util.isArray(e)&&(t=e,e=this.name),this.next(e,(function(r){var i=r;i.block(t.length);for(var s=function(e,r){n.task.start({type:e,run:function(e){t[r](e)},success:function(e){i.unblock()},failure:function(e){i.unblock()}})},o=0;o<t.length;o++){s(e+"__parallel-"+r.id+"-"+o,o)}}))},m.prototype.stop=function(){this.state=g[this.state][d]},m.prototype.start=function(){this.error=!1,this.state=g[this.state][y],this.state===u&&(this.start=new Date,this.run(this),v(this,0))},m.prototype.block=function(e){e=void 0===e?1:e,this.blocks+=e,this.blocks>0&&(this.state=g[this.state].block)},m.prototype.unblock=function(e){return e=void 0===e?1:e,this.blocks-=e,0===this.blocks&&this.state!==p&&(this.state=u,v(this,0)),this.blocks},m.prototype.sleep=function(e){e=void 0===e?0:e,this.state=g[this.state].sleep;var t=this;this.timeoutId=setTimeout((function(){t.timeoutId=null,t.state=u,v(t,0)}),e)},m.prototype.wait=function(e){e.wait(this)},m.prototype.wakeup=function(){this.state===h&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state=u,v(this,0))},m.prototype.cancel=function(){this.state=g[this.state].cancel,this.permitsNeeded=0,null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null),this.subtasks=[]},m.prototype.fail=function(e){if(this.error=!0,C(this,!0),e)e.error=this.error,e.swapTime=this.swapTime,e.userData=this.userData,v(e,0);else{if(null!==this.parent){for(var t=this.parent;null!==t.parent;)t.error=this.error,t.swapTime=this.swapTime,t.userData=this.userData,t=t.parent;C(t,!0)}this.failureCallback&&this.failureCallback(this)}};var v=function(e,t){var r=t>30||+new Date-e.swapTime>20,n=function(t){if(t++,e.state===u)if(r&&(e.swapTime=+new Date),e.subtasks.length>0){var n=e.subtasks.shift();n.error=e.error,n.swapTime=e.swapTime,n.userData=e.userData,n.run(n),n.error||v(n,t)}else C(e),e.error||null!==e.parent&&(e.parent.error=e.error,e.parent.swapTime=e.swapTime,e.parent.userData=e.userData,v(e.parent,t))};r?setTimeout(n,0):n(t)},C=function(e,t){e.state=p,delete s[e.id],null===e.parent&&(e.type in a?0===a[e.type].length?n.log.error(i,"[%s][%s] task queue empty [%s]",e.id,e.name,e.type):a[e.type][0]!==e?n.log.error(i,"[%s][%s] task not first in queue [%s]",e.id,e.name,e.type):(a[e.type].shift(),0===a[e.type].length?delete a[e.type]:a[e.type][0].start()):n.log.error(i,"[%s][%s] task queue missing [%s]",e.id,e.name,e.type),t||(e.error&&e.failureCallback?e.failureCallback(e):!e.error&&e.successCallback&&e.successCallback(e)))};e.exports=n.task=n.task||{},n.task.start=function(e){var t=new m({run:e.run,name:e.name||"?"});t.type=e.type,t.successCallback=e.success||null,t.failureCallback=e.failure||null,t.type in a?a[e.type].push(t):(a[t.type]=[t],function(e){e.error=!1,e.state=g[e.state][y],setTimeout((function(){e.state===u&&(e.swapTime=+new Date,e.run(e),v(e,0))}),0)}(t))},n.task.cancel=function(e){e in a&&(a[e]=[a[e][0]])},n.task.createCondition=function(){var e={tasks:{},wait:function(t){t.id in e.tasks||(t.block(),e.tasks[t.id]=t)},notify:function(){var t=e.tasks;for(var r in e.tasks={},t)t[r].unblock()}};return e}},function(e,t,r){var n=r(27),i=r(12),s=parseInt("0777",8);function o(e,t,r,a){"function"==typeof t?(r=t,t={}):t&&"object"==typeof t||(t={mode:t});var c=t.mode,u=t.fs||i;void 0===c&&(c=s),a||(a=null);var l=r||function(){};e=n.resolve(e),u.mkdir(e,c,(function(r){if(!r)return l(null,a=a||e);switch(r.code){case"ENOENT":if(n.dirname(e)===e)return l(r);o(n.dirname(e),t,(function(r,n){r?l(r,n):o(e,t,l,n)}));break;default:u.stat(e,(function(e,t){e||!t.isDirectory()?l(r,a):l(null,a)}))}}))}e.exports=o.mkdirp=o.mkdirP=o,o.sync=function e(t,r,o){r&&"object"==typeof r||(r={mode:r});var a=r.mode,c=r.fs||i;void 0===a&&(a=s),o||(o=null),t=n.resolve(t);try{c.mkdirSync(t,a),o=o||t}catch(i){switch(i.code){case"ENOENT":o=e(n.dirname(t),r,o),e(t,r,o);break;default:var u;try{u=c.statSync(t)}catch(e){throw i}if(!u.isDirectory())throw i}}return o}},function(e,t){e.exports=require("_http_common")},function(e,t,r){"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=r(103):e.exports=r(105)},function(e,t,r){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(65)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},function(e,t){var r=1e3,n=6e4,i=60*n,s=24*i;function o(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,t){t=t||{};var a=typeof e;if("string"===a&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var o=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return 6048e5*o;case"days":case"day":case"d":return o*s;case"hours":case"hour":case"hrs":case"hr":case"h":return o*i;case"minutes":case"minute":case"mins":case"min":case"m":return o*n;case"seconds":case"second":case"secs":case"sec":case"s":return o*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(e);if("number"===a&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=s)return o(e,t,s,"day");if(t>=i)return o(e,t,i,"hour");if(t>=n)return o(e,t,n,"minute");if(t>=r)return o(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=s)return Math.round(e/s)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=n)return Math.round(e/n)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){const n=r(66),i=r(26);t.init=function(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=t.inspectOpts[r[n]]},t.log=function(...e){return process.stderr.write(i.format(...e)+"\n")},t.formatArgs=function(r){const{namespace:n,useColors:i}=this;if(i){const t=this.color,i="[3"+(t<8?t:"8;5;"+t),s=` ${i};1m${n} [0m`;r[0]=s+r[0].split("\n").join("\n"+s),r.push(i+"m+"+e.exports.humanize(this.diff)+"[0m")}else r[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+n+" "+r[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=i.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=r(106);e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e},{}),e.exports=r(65)(t);const{formatters:s}=e.exports;s.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},s.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)}},function(e,t,r){"use strict";const n=r(107),i=r(108),s=process.env;let o;function a(e){return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(function(e){if(!1===o)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(e&&!e.isTTY&&!0!==o)return 0;const t=o?1:0;if("win32"===process.platform){const e=n.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in s)||"codeship"===s.CI_NAME?1:t;if("TEAMCITY_VERSION"in s)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0;if("truecolor"===s.COLORTERM)return 3;if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(s.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)||"COLORTERM"in s?1:(s.TERM,t)}(e))}i("no-color")||i("no-colors")||i("color=false")?o=!1:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(o=!0),"FORCE_COLOR"in s&&(o=0===s.FORCE_COLOR.length||0!==parseInt(s.FORCE_COLOR,10)),e.exports={supportsColor:a,stdout:a(process.stdout),stderr:a(process.stderr)}},function(e,t){e.exports=require("os")},function(e,t,r){"use strict";e.exports=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return-1!==n&&(-1===i||n<i)}},function(e,t,r){"use strict";var n=r(29);e.exports={onResponse:function(e,t){return e.serverToProxyResponse.headers["content-encoding"]&&"gzip"==e.serverToProxyResponse.headers["content-encoding"].toLowerCase()&&(delete e.serverToProxyResponse.headers["content-encoding"],e.addResponseFilter(n.createGunzip())),t()},onRequest:function(e,t){return e.proxyToServerRequestOptions.headers["accept-encoding"]="gzip",t()}}},function(e,t,r){"use strict";const n=/^(.+)(\.[^\.]{4,}(\.[^\.]{1,3})*\.[^\.]+)$/;e.exports={onCertificateRequired:function(e,t){var r=e;return n.test(e)&&(r=e.replace(/^[^\.]+\./,"")),t(null,{keyFile:this.sslCaDir+"/keys/_."+r+".key",certFile:this.sslCaDir+"/certs/_."+r+".pem",hosts:["*."+r,r]})}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(112));t.default=class{constructor(e=!1,t){this.debug=e,this.importer=new i.default(e,t)}async beforeSendRequest(e){try{this.isSeleniumRequest(e)&&(this.debug&&e.debug(),await this.importer.recordBefore(e))}catch(e){console.log("Error handling request",e)}}async beforeSendResponse(e,t){try{this.isSeleniumRequest(e)&&(this.debug&&await t.debug(),await this.importer.recordAfter(e))}catch(e){console.log("Error handling response",e)}}isSeleniumRequest(e){return/\/session\/[^/]+/.test(e.path)}getImportedSteps(){return this.importer.getImportedSteps()}reset(){return this.importer.reset()}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(113)),s=n(r(114)),o=r(124),a=n(r(125)),c=n(r(67));t.default=class{constructor(e=!1,t){this.debug=e,this.selectors={},this.importerFactories=new s.default,this.importers=[],this.xpathLibrary=new o.XpathLibrary(this.debug),this.onSessionDelete=t}async recordBefore(e){if("DELETE"===e.method)return;const t=this.importerFactories.createActionImporter(e);if(!t)return;let r=Promise.resolve(void 0);const n=e.path.match(/\/element\/([^/]+)/);if(n){const t=n[1];r=this.getSelector(e,t)}const i=await r;try{t.recordBefore(e,i),0!==this.importers.length&&this.importers[this.importers.length-1].append(t)||this.importers.push(t)}catch(e){console.log(`Error recording ${t.getImporterName()} action`,e)}}async recordAfter(e){if("DELETE"===e.method&&this.onSessionDelete)try{this.onSessionDelete(this)}catch(e){console.log("Error invoking session delete handler",e)}}getImportedSteps(){return this.normalizeSteps([].concat(...this.importers.map(e=>e.getSteps())))}reset(){return this.normalizeSteps([].concat(...this.importers.splice(0,this.importers.length).map(e=>e.getSteps())))}normalizeSteps(e){var t;if(e.length&&!(e[0]instanceof c.default)){const r=null===(t=e.find(e=>e.url))||void 0===t?void 0:t.url;if(r)return[new c.default(r)].concat(e)}return e}getSelector(e,t){return this.selectors[t]?Promise.resolve(this.selectors[t]):this.retrieveAndCacheSelector(e,t)}async retrieveAndCacheSelector(e,t){const r=a.default.newClient(e.host,e.getSessionId(),e.isGridRequest()),n=r.executeSync("var items = {};for (index = 0; index < arguments[0].attributes.length; ++index) {items[arguments[0].attributes[index].name] = arguments[0].attributes[index].value};items.tagName = arguments[0].tagName;return items;",t),s=this.xpathLibrary.computeXpath(r,t).catch(this.defaultCatch("Error computing xpath")),o=r.getText(t).catch(this.defaultCatch("Error retrieving inner text")),c=r.getTitle().catch(this.defaultCatch("Error retrieving title")),u=r.getUrl().catch(this.defaultCatch("Error retrieving URL"));try{const[e,r,a,l,h]=await Promise.all([n,o,c,u,s]),p=new i.default(e,t,void 0,r,a,l,h);return this.selectors[t]=p,p}catch(e){return void(this.debug&&console.log("Error retrieving selector",e))}}defaultCatch(e){return t=>{this.debug&&console.log(e)}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(25),i=e=>e,s=e=>[e[0].replace(/-/g,"_"),e[1]];function o(e){return t=>[e,t[1]]}const a={alt:i,"aria-controls":s,"aria-label":s,"aria-labelledby":s,"aria-owns":s,autocomplete:i,bounding_x:i,bounding_y:i,bounding_height:i,bounding_width:i,class:o("class_name"),css_query:i,"data-test-id":s,"data-tracking":s,for:o("for_attr"),form:i,height:i,href:i,label:o("label_attr"),findable_ancestor_uuid:i,id:i,maxlength:i,name:i,"ng-class":s,"ng-model":s,placeholder:i,relative_xpath:i,role:i,src:i,style:i,tabindex:i,tagName:(c="tag_name",e=>[c,(""+e[1]).toLowerCase()]),target:i,text:i,title:i,type:o("inputElementType"),url:i,value:i,xpath:i,width:i};var c;t.default=class{constructor(e,t,r,n,i,s,o){this.properties={uuid:t};const c=e;Object.keys(c).map(e=>[e,c[e]]).filter(e=>!!e[1]).filter(e=>Object.keys(a).includes(e[0])).forEach(e=>{const t=a[e[0]](e);this.properties[t[0]]=t[1]}),r&&(this.properties.label=r),n&&(this.properties.text=n),i&&(this.properties.title=i),s&&(this.properties.url=s),o&&(this.properties.xpath=o)}uuid(){return this.properties.uuid}url(){return this.properties.url}toMablscriptSelector(){return n.toMablscriptToken(this.properties)}equals(e){return JSON.stringify(this.properties)===JSON.stringify(e.properties)}humanize(){switch(this.properties.tag_name){case"a":return this.humanizeLink();case"button":return this.humanizeButton();case"input":case"textarea":return this.isTextInput()?this.humanizeInputTargetDescription():this.humanizeButton();case"select":return this.humanizeInputTargetDescription();default:return"the "+this.humanizeTag()}}isTextInput(){switch(this.properties.tag_name){case"input":case"textarea":const e=this.properties.inputElementType;return!("button"===e||"submit"===e||"reset"===e)}return!1}isPasswordField(){return this.isTextInput()&&"password"===this.properties.inputElementType}humanizeLink(){let e="the link";return this.properties.text&&(e+=` "${this.properties.text}"`),this.properties.href&&(e+=" to "+this.humanizeUrl()),e}humanizeUrl(){return this.humanizeValue(this.properties.url,40)}humanizeButton(){const e=this.properties.value||this.properties.text;return e?`the "${e}" button`:"a button"}humanizeValue(e,t){return!e||void 0===t||t<6?e:e.length>t?e.slice(0,t-3)+"...":e}humanizeInputTargetDescription(){let e;switch(this.properties.inputElementType){case"radio":e="radio input";break;case"checkbox":e="checkbox";break;default:e="text field"}const t=this.properties.label||this.properties.placeholder;return t?`the "${t}" ${e}`:this.properties.id?`the ${e} with ID "${this.properties.id}"`:"a "+e}humanizeTag(){let e=(this.properties.tag_name||"unknown")+" element";return this.properties.text?e+=` with text "${this.properties.text}"`:this.properties.name?e+=` with name "${this.properties.name}"`:this.properties.class_name?e+=` with class name "${this.properties.class_name}"`:this.properties.id&&(e+=` with id "${this.properties.id}"`),e}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(115)),s=n(r(116)),o=n(r(117)),a=n(r(119)),c=n(r(120)),u=n(r(122)),l=/post/i;class h{constructor(){this.factories=[h.create(l,"/window/rect",()=>new o.default),h.create(l,"/url",()=>new a.default),h.create(l,"/.*/click",()=>new c.default),h.create(l,"/element/.*/value",()=>new u.default)]}static create(e,t,r){return new s.default(new i.default(e,new RegExp("/session/[0-9a-f]+"+t.replace(/\//g,"/"))),r)}createActionImporter(e){const t=this.factories.find(t=>t.canImport(e));return t&&t.createImporter()}}t.default=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t){this.methodMatcher=e,this.pathMatcher=t}matches(e){var t;return this.pathMatcher.test(e.path)&&this.methodMatcher.test(null!==(t=e.method)&&void 0!==t?t:"")}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t){this.matcher=e,this.importer=t}canImport(e){return this.matcher.matches(e)}createImporter(){return this.importer()}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(36)),s=n(r(118));class o extends i.default{async recordBefore(e){const t=await e.bodyAsJson();t&&(this.parameters=t)}getSteps(){return this.parameters?[new s.default(this.parameters.width)]:[]}getImporterName(){return"SetViewport"}}t.default=o},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(16));class s extends i.default{constructor(e){super("Set viewport size to width "+e,`set_viewport({ size : { width : ${e} } })`)}}t.default=s},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(36)),s=n(r(67));class o extends i.default{async recordBefore(e){const t=await e.bodyAsJson();if(t){const e=t;e.url.match(/^https?:\/\//)&&(this.parameters=e)}}getSteps(){return this.parameters?[new s.default(this.parameters.url)]:[]}getImporterName(){return"VisitUrl"}}t.default=o},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(36)),s=n(r(121));class o extends i.default{async recordBefore(e,t){this.selector=t}getSteps(){return this.selector?[new s.default(this.selector)]:[]}getImporterName(){return"Click"}}t.default=o},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(16));class s extends i.default{constructor(e){super("Click "+e.humanize(),`find_one([${e.toMablscriptSelector()}]).click()`,e.url(),e)}}t.default=s},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(123)),s=r(25),o={"":"Enter","":"Tab","":"Backspace","":"Delete","":"ArrowUp","":"ArrowDown","":"ArrowLeft","":"ArrowRight"},a={"":"altKey","":"ctrlKey","":"metaKey","":"shiftKey"};class c{async recordBefore(e,t){const r=await e.bodyAsJson();this.action=t&&u.create(t,r.text||r.value&&"".concat(...r.value))}append(e){if(this.action&&e instanceof c){const t=e;return!(!t.action||this.action.getType()!==t.action.getType()||!this.action.getTarget().equals(e.action.getTarget()))&&(this.action.append(t.action),!0)}return!1}getSteps(){return this.action&&[this.action.toStep()]||[]}getImporterName(){return"EnterText"}}t.default=c;class u{constructor(e,t,r){this.type=e,this.target=t,this.values=[r]}getEscapedValue(){return s.escapeMablscriptString(this.getRawValue())}getNormalizedValue(){return s.normalizeText(this.getRawValue())}getRawValue(){return this.values.join("")}getType(){return this.type}getTarget(){return this.target}append(e){this.values.push(...e.values)}toStep(){return new i.default(this.toDescription(),this.toMablscript(),this.target)}static create(e,t){return Object.keys(a).concat(Object.keys(o)).find(e=>t.includes(e))?new h(e,t):new l(e,t)}}class l extends u{constructor(e,t){super("Text",e,t)}toDescription(){return`Enter ${this.getTarget().isPasswordField()?"a password":'"'+this.getNormalizedValue()+'"'} into`}toMablscript(){return`enter_text("${this.getEscapedValue()}")`}}class h extends u{constructor(e,t){super("Keypress",e,t)}toDescription(){const e=this.valueToKeypress();let t="";return!0===e.altKey&&(t+="Alt+"),!0===e.ctrlKey&&(t+="Ctrl+"),!0===e.metaKey&&(t+="Meta+"),!0===e.shiftKey&&(t+="Shift+"),e.key&&(t+=e.key),`Send ${t} to`}toMablscript(){return`send_keys(${s.toMablscriptToken(this.valueToKeypress())})`}valueToKeypress(){const e={},t=this.getRawValue();for(let r=0;r<t.length;r++){const n=t.charAt(r);if(Object.keys(a).includes(n)){e[a[n]]=!0}else if(Object.keys(o).includes(n)){const t=n;e.key=o[t]}else e.key=n}return e}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(16));class s extends i.default{constructor(e,t,r){super(`${e} ${r.humanize()}`,`find_one([${r.toMablscriptSelector()}]).${t}`,r.url(),r)}}t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XpathLibrary=void 0;const n=r(12),i=__dirname+"/lib";class s{constructor(e,t,r){this.scopedName="mabl_"+t,this.fullyQualifiedName="window."+this.scopedName,this.source=s.readSource(e),this.debug=r||!1}execute(e,t,r){return this.isDefined(e).then(n=>n?this.executeLibraryFunction(e,t,r):this.defineLibraryAndExecuteFunction(e,t,r))}async isDefined(e){try{return!0===await e.executeSync("return !!"+this.fullyQualifiedName)}catch(e){return this.debug&&console.log(`Error checking whether library ${this.scopedName} is defined`),!1}}async defineLibraryAndExecuteFunction(e,t,r){try{return await e.executeAsync(`${this.fullyQualifiedName}=${this.source};\n${this.generateInvokeScript(t)}`,r)}catch(e){throw this.debug&&console.log(`Error defining/executing function ${t} on ${this.scopedName}`),e}}async executeLibraryFunction(e,t,r){try{return await e.executeAsync("\n"+this.generateInvokeScript(t),r)}catch(e){throw this.debug&&console.log(`Error executing function ${t} on ${this.scopedName}`),e}}generateInvokeScript(e){return`${this.fullyQualifiedName}.${e}.apply(${this.scopedName}, arguments);\n`}static readSource(e){return n.readFileSync(`${i}/${e}`,"utf8")}}t.XpathLibrary=class extends s{constructor(e){super("xpath.js","xpath",e)}computeXpath(e,t){return this.execute(e,"xpath",t)}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(126)),s=r(25);class o{constructor(e,t){this.args=[],this.script=e,t&&this.args.push({ELEMENT:t,"element-6066-11e4-a52e-4f735466cecf":t})}}class a{constructor(e,t){this.baseUrl=`http://${e}${t}`}static newClient(e,t,r){return r?new u(e,t):new l(e,t)}getText(e){const t=`${this.baseUrl}/element/${e}/text`;return i.default.get(t).then(e=>e.data.value).then(s.normalizeText).then(s.escapeMablscriptString)}getTitle(){const e=this.baseUrl+"/title";return i.default.get(e).then(e=>e.data.value)}getUrl(){const e=this.baseUrl+"/url";return i.default.get(e).then(e=>e.data.value)}execute(e,t,r){const n=`${this.baseUrl}${e}`,s=new o(t,r);return i.default.post(n,s).then(e=>e.data.value)}}t.default=a;class c extends a{constructor(e,t){super(e,t)}executeSync(e,t){return this.execute("/execute",e,t)}executeAsync(e,t){return this.execute("/execute_async",e,t)}}class u extends c{constructor(e,t){super(e,"/wd/hub/session/"+t)}}class l extends a{constructor(e,t){super(e,"/session/"+t)}executeSync(e,t){return this.execute("/execute/sync",e,t)}executeAsync(e,t){return this.execute("/execute/async",e,t)}}},function(e,t,r){e.exports=r(127)},function(e,t,r){"use strict";var n=r(2),i=r(68),s=r(128),o=r(74);var a=function e(t){var r=new s(t),a=i(s.prototype.request,r);return n.extend(a,s.prototype,r),n.extend(a,r),a.create=function(r){return e(o(t,r))},a}(r(17));a.Axios=s,a.Cancel=r(18),a.CancelToken=r(147),a.isCancel=r(73),a.VERSION=r(40).version,a.all=function(e){return Promise.all(e)},a.spread=r(148),a.isAxiosError=r(149),e.exports=a,e.exports.default=a},function(e,t,r){"use strict";var n=r(2),i=r(37),s=r(129),o=r(130),a=r(74),c=r(146),u=c.validators;function l(e){this.defaults=e,this.interceptors={request:new s,response:new s}}l.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&c.assertOptions(r,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var s,l=[];if(this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)})),!i){var h=[o,void 0];for(Array.prototype.unshift.apply(h,n),h=h.concat(l),s=Promise.resolve(t);h.length;)s=s.then(h.shift(),h.shift());return s}for(var p=t;n.length;){var f=n.shift(),d=n.shift();try{p=f(p)}catch(e){d(e);break}}try{s=o(p)}catch(e){return Promise.reject(e)}for(;l.length;)s=s.then(l.shift(),l.shift());return s},l.prototype.getUri=function(e){return e=a(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=l},function(e,t,r){"use strict";var n=r(2);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},function(e,t,r){"use strict";var n=r(2),i=r(131),s=r(73),o=r(17),a=r(18);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a("canceled")}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return c(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return s(t)||(c(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(2),i=r(17);e.exports=function(e,t,r){var s=this||i;return n.forEach(r,(function(r){e=r.call(s,e,t)})),e}},function(e,t,r){"use strict";var n=r(2);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(2),i=r(69),s=r(134),o=r(37),a=r(70),c=r(137),u=r(138),l=r(39),h=r(17),p=r(18);e.exports=function(e){return new Promise((function(t,r){var f,d=e.data,y=e.headers,g=e.responseType;function m(){e.cancelToken&&e.cancelToken.unsubscribe(f),e.signal&&e.signal.removeEventListener("abort",f)}n.isFormData(d)&&delete y["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var C=e.auth.username||"",E=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";y.Authorization="Basic "+btoa(C+":"+E)}var S=a(e.baseURL,e.url);function b(){if(v){var n="getAllResponseHeaders"in v?c(v.getAllResponseHeaders()):null,s={data:g&&"text"!==g&&"json"!==g?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};i((function(e){t(e),m()}),(function(e){r(e),m()}),s),v=null}}if(v.open(e.method.toUpperCase(),o(S,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=b:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(b)},v.onabort=function(){v&&(r(l("Request aborted",e,"ECONNABORTED",v)),v=null)},v.onerror=function(){r(l("Network Error",e,null,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||h.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(l(t,e,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},n.isStandardBrowserEnv()){var T=(e.withCredentials||u(S))&&e.xsrfCookieName?s.read(e.xsrfCookieName):void 0;T&&(y[e.xsrfHeaderName]=T)}"setRequestHeader"in v&&n.forEach(y,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete y[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),g&&"json"!==g&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(f=function(e){v&&(r(!e||e&&e.type?new p("canceled"):e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(f),e.signal&&(e.signal.aborted?f():e.signal.addEventListener("abort",f))),d||(d=null),v.send(d)}))}},function(e,t,r){"use strict";var n=r(2);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,s,o){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(s)&&a.push("domain="+s),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(2),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,s,o={};return e?(n.forEach(e.split("\n"),(function(e){if(s=e.indexOf(":"),t=n.trim(e.substr(0,s)).toLowerCase(),r=n.trim(e.substr(s+1)),t){if(o[t]&&i.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}})),o):o}},function(e,t,r){"use strict";var n=r(2);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(2),i=r(69),s=r(70),o=r(37),a=r(11),c=r(19),u=r(71).http,l=r(71).https,h=r(13),p=r(29),f=r(40).version,d=r(39),y=r(38),g=r(17),m=r(18),v=/https:?/;e.exports=function(e){return new Promise((function(t,r){var C;function E(){e.cancelToken&&e.cancelToken.unsubscribe(C),e.signal&&e.signal.removeEventListener("abort",C)}var S=function(e){E(),t(e)},b=!1,T=function(e){E(),b=!0,r(e)},_=e.data,A=e.headers,I={};if(Object.keys(A).forEach((function(e){I[e.toLowerCase()]=e})),"user-agent"in I?A[I["user-agent"]]||delete A[I["user-agent"]]:A["User-Agent"]="axios/"+f,_&&!n.isStream(_)){if(Buffer.isBuffer(_));else if(n.isArrayBuffer(_))_=Buffer.from(new Uint8Array(_));else{if(!n.isString(_))return T(d("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",e));_=Buffer.from(_,"utf-8")}if(e.maxBodyLength>-1&&_.length>e.maxBodyLength)return T(d("Request body larger than maxBodyLength limit",e));I["content-length"]||(A["Content-Length"]=_.length)}var B=void 0;e.auth&&(B=(e.auth.username||"")+":"+(e.auth.password||""));var w=s(e.baseURL,e.url),k=h.parse(w),R=k.protocol||"http:";if(!B&&k.auth){var N=k.auth.split(":");B=(N[0]||"")+":"+(N[1]||"")}B&&I.authorization&&delete A[I.authorization];var L=v.test(R),x=L?e.httpsAgent:e.httpAgent;try{o(k.path,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(t){var O=new Error(t.message);O.config=e,O.url=e.url,O.exists=!0,T(O)}var D={path:o(k.path,e.params,e.paramsSerializer).replace(/^\?/,""),method:e.method.toUpperCase(),headers:A,agent:x,agents:{http:e.httpAgent,https:e.httpsAgent},auth:B};e.socketPath?D.socketPath=e.socketPath:(D.hostname=k.hostname,D.port=k.port);var U,P=e.proxy;if(!P&&!1!==P){var V=R.slice(0,-1)+"_proxy",M=process.env[V]||process.env[V.toUpperCase()];if(M){var F=h.parse(M),K=process.env.no_proxy||process.env.NO_PROXY,q=!0;if(K)q=!K.split(",").map((function(e){return e.trim()})).some((function(e){return!!e&&("*"===e||("."===e[0]&&k.hostname.substr(k.hostname.length-e.length)===e||k.hostname===e))}));if(q&&(P={host:F.hostname,port:F.port,protocol:F.protocol},F.auth)){var j=F.auth.split(":");P.auth={username:j[0],password:j[1]}}}}P&&(D.headers.host=k.hostname+(k.port?":"+k.port:""),function e(t,r,n){if(t.hostname=r.host,t.host=r.host,t.port=r.port,t.path=n,r.auth){var i=Buffer.from(r.auth.username+":"+r.auth.password,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+i}t.beforeRedirect=function(t){t.headers.host=t.host,e(t,r,t.href)}}(D,P,R+"//"+k.hostname+(k.port?":"+k.port:"")+D.path));var H=L&&(!P||v.test(P.protocol));e.transport?U=e.transport:0===e.maxRedirects?U=H?c:a:(e.maxRedirects&&(D.maxRedirects=e.maxRedirects),U=H?l:u),e.maxBodyLength>-1&&(D.maxBodyLength=e.maxBodyLength),e.insecureHTTPParser&&(D.insecureHTTPParser=e.insecureHTTPParser);var W=U.request(D,(function(t){if(!W.aborted){var r=t,s=t.req||W;if(204!==t.statusCode&&"HEAD"!==s.method&&!1!==e.decompress)switch(t.headers["content-encoding"]){case"gzip":case"compress":case"deflate":r=r.pipe(p.createUnzip()),delete t.headers["content-encoding"]}var o={status:t.statusCode,statusText:t.statusMessage,headers:t.headers,config:e,request:s};if("stream"===e.responseType)o.data=r,i(S,T,o);else{var a=[],c=0;r.on("data",(function(t){a.push(t),c+=t.length,e.maxContentLength>-1&&c>e.maxContentLength&&(b=!0,r.destroy(),T(d("maxContentLength size of "+e.maxContentLength+" exceeded",e,null,s)))})),r.on("aborted",(function(){b||(r.destroy(),T(d("error request aborted",e,"ERR_REQUEST_ABORTED",s)))})),r.on("error",(function(t){W.aborted||T(y(t,e,null,s))})),r.on("end",(function(){try{var t=1===a.length?a[0]:Buffer.concat(a);"arraybuffer"!==e.responseType&&(t=t.toString(e.responseEncoding),e.responseEncoding&&"utf8"!==e.responseEncoding||(t=n.stripBOM(t))),o.data=t}catch(t){T(y(t,e,t.code,o.request,o))}i(S,T,o)}))}}}));if(W.on("error",(function(t){W.aborted&&"ERR_FR_TOO_MANY_REDIRECTS"!==t.code||T(y(t,e,null,W))})),W.on("socket",(function(e){e.setKeepAlive(!0,6e4)})),e.timeout){var G=parseInt(e.timeout,10);if(isNaN(G))return void T(d("error trying to parse `config.timeout` to int",e,"ERR_PARSE_TIMEOUT",W));W.setTimeout(G,(function(){W.abort();var t="";t=e.timeoutErrorMessage?e.timeoutErrorMessage:"timeout of "+e.timeout+"ms exceeded";var r=e.transitional||g.transitional;T(d(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",W))}))}(e.cancelToken||e.signal)&&(C=function(e){W.aborted||(W.abort(),T(!e||e&&e.type?new m("canceled"):e))},e.cancelToken&&e.cancelToken.subscribe(C),e.signal&&(e.signal.aborted?C():e.signal.addEventListener("abort",C))),n.isStream(_)?_.on("error",(function(t){T(y(t,e,null,W))})).pipe(W):W.end(_)}))}},function(e,t){e.exports=require("assert")},function(e,t,r){var n;e.exports=function(){if(!n){try{n=r(142)("follow-redirects")}catch(e){}"function"!=typeof n&&(n=function(){})}n.apply(null,arguments)}},function(e,t,r){"undefined"!=typeof process&&"renderer"===process.type?e.exports=r(143):e.exports=r(145)},function(e,t,r){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=r(72)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),!r)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,s=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(i++,"%c"===e&&(s=i))})),e.splice(s,0,n)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())},function(e,t){var r=1e3,n=6e4,i=60*n,s=24*i;function o(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}e.exports=function(e,t){t=t||{};var a,c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var o=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"days":case"day":case"d":return o*s;case"hours":case"hour":case"hrs":case"hr":case"h":return o*i;case"minutes":case"minute":case"mins":case"min":case"m":return o*n;case"seconds":case"second":case"secs":case"sec":case"s":return o*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(e);if("number"===c&&!1===isNaN(e))return t.long?o(a=e,s,"day")||o(a,i,"hour")||o(a,n,"minute")||o(a,r,"second")||a+" ms":function(e){if(e>=s)return Math.round(e/s)+"d";if(e>=i)return Math.round(e/i)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){var n=r(66),i=r(26);(t=e.exports=r(72)).init=function(e){e.inspectOpts={};for(var r=Object.keys(t.inspectOpts),n=0;n<r.length;n++)e.inspectOpts[r[n]]=t.inspectOpts[r[n]]},t.log=function(){return o.write(i.format.apply(i,arguments)+"\n")},t.formatArgs=function(e){var r=this.namespace;if(this.useColors){var n=this.color,i=" [3"+n+";1m"+r+" [0m";e[0]=i+e[0].split("\n").join("\n"+i),e.push("[3"+n+"m+"+t.humanize(this.diff)+"[0m")}else e[0]=(new Date).toUTCString()+" "+r+" "+e[0]},t.save=function(e){null==e?delete process.env.DEBUG:process.env.DEBUG=e},t.load=a,t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(s)},t.colors=[6,2,3,4,5,1],t.inspectOpts=Object.keys(process.env).filter((function(e){return/^debug_/i.test(e)})).reduce((function(e,t){var r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(function(e,t){return t.toUpperCase()})),n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e}),{});var s=parseInt(process.env.DEBUG_FD,10)||2;1!==s&&2!==s&&i.deprecate((function(){}),"except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")();var o=1===s?process.stdout:2===s?process.stderr:function(e){var t;switch(process.binding("tty_wrap").guessHandleType(e)){case"TTY":(t=new n.WriteStream(e))._type="tty",t._handle&&t._handle.unref&&t._handle.unref();break;case"FILE":var i=r(12);(t=new i.SyncWriteStream(e,{autoClose:!1}))._type="fs";break;case"PIPE":case"TCP":var s=r(43);(t=new s.Socket({fd:e,readable:!1,writable:!0})).readable=!1,t.read=null,t._type="pipe",t._handle&&t._handle.unref&&t._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return t.fd=e,t._isStdio=!0,t}(s);function a(){return process.env.DEBUG}t.formatters.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split("\n").map((function(e){return e.trim()})).join(" ")},t.formatters.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)},t.enable(a())},function(e,t,r){"use strict";var n=r(40).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var s={};i.transitional=function(e,t,r){function i(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,o){if(!1===e)throw new Error(i(n," has been removed"+(t?" in "+t:"")));return t&&!s[n]&&(s[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,o)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),i=n.length;i-- >0;){var s=n[i],o=t[s];if(o){var a=e[s],c=void 0===a||o(a,s,e);if(!0!==c)throw new TypeError("option "+s+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+s)}},validators:i}},function(e,t,r){"use strict";var n=r(18);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";var n=r(2);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(75));class s extends i.default{constructor(e,t,r,n,i,s){super(i,s),this.method=e,this.path=n,this.host=`${t}:${null!=r?r:80}`,this.method=e}getSessionId(){if(void 0===this.sessionId){const e=this.path.match(/\/.*session\/([^/]+)/);this.sessionId=e&&e.length>1&&e[1]||null}return this.sessionId}isGridRequest(){return this.path.startsWith("/wd/hub")}async debug(){const e=await this.bodyAsString()||"(no request body)";console.log(`${this.method} ${this.path} =>`,e.substring(0,i.default.MAX_BODY_DEBUG_LENGTH),e.length>i.default.MAX_BODY_DEBUG_LENGTH?"...":"")}}t.default=s},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(75));class s extends i.default{constructor(e,t){super(e.getHeaders(),t),this.statusCode=e.statusCode}isSuccessful(){return this.statusCode>=100&&this.statusCode<=400}async debug(){const e=await this.bodyAsString()||"(no response body)";console.log("<=",e.substring(0,i.default.MAX_BODY_DEBUG_LENGTH),e.length>i.default.MAX_BODY_DEBUG_LENGTH?"...":"")}}t.default=s}])}));
|