@pageproof/sdk-pr 280.0.1604526415503 → 281.0.1602190868209
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/CHANGELOG.md +0 -41
- package/lib/adapters/SchedulerCryptoAdapter.d.ts +1 -3
- package/lib/adapters/SchedulerCryptoAdapter.js +1 -1
- package/lib/adapters/SyncCryptoAdapter.d.ts +1 -3
- package/lib/adapters/SyncCryptoAdapter.js +1 -1
- package/lib/api/Encryption.d.ts +0 -219
- package/lib/api/Encryption.js +1 -1
- package/lib/api/Files.d.ts +2 -0
- package/lib/api/Files.js +1 -1
- package/lib/api/Profile.d.ts +0 -8
- package/lib/api/Profile.js +1 -1
- package/lib/api/Proofs.d.ts +1 -8
- package/lib/api/Proofs.js +1 -1
- package/lib/api/ProofsCustomTools.d.ts +5 -6
- package/lib/api/Workflows.d.ts +2 -24
- package/lib/api/Workflows.js +1 -1
- package/lib/api/admin/Team.d.ts +4 -18
- package/lib/api/admin/Team.js +4 -29
- package/lib/api/admin/TeamFeatures.d.ts +0 -7
- package/lib/api/admin/TeamFeatures.js +0 -5
- package/lib/api/admin/TeamIntegrations.d.ts +10 -0
- package/lib/api/admin/{TeamWorkflows.js → TeamIntegrations.js} +16 -32
- package/lib/api/admin/TeamMondayDotCom.d.ts +15 -0
- package/lib/api/admin/{TeamCustomTools.js → TeamMondayDotCom.js} +18 -29
- package/lib/crypto/envelopes.d.ts +1 -2
- package/lib/crypto/envelopes.js +1 -1
- package/lib/crypto/index.d.ts +1 -2
- package/lib/crypto/index.js +1 -1
- package/lib/models/Proof.d.ts +0 -7
- package/lib/models/Proof.js +1 -1
- package/lib/models/TeamEmailFeatures.d.ts +1 -8
- package/lib/models/TeamEmailFeatures.js +1 -1
- package/lib/models/TeamFeatures.d.ts +0 -8
- package/lib/models/TeamFeatures.js +1 -1
- package/lib/models/Workflow.d.ts +0 -21
- package/lib/models/Workflow.js +1 -1
- package/lib/network/Request.js +1 -1
- package/lib/network/endpoints.json +4 -60
- package/lib/pageproof.js +1 -1
- package/lib/sync-crypto-adapter.js +1 -1
- package/lib/util/constants.d.ts +0 -2
- package/lib/util/constants.js +1 -1
- package/lib/worker-crypto-adapter.js +1 -1
- package/lib/worker.33813125.js +2 -0
- package/package.json +1 -1
- package/lib/api/Integrations.d.ts +0 -56
- package/lib/api/Integrations.js +0 -1
- package/lib/api/ProofsIntegrationReferences.d.ts +0 -41
- package/lib/api/ProofsIntegrationReferences.js +0 -1
- package/lib/api/admin/TeamCustomTools.d.ts +0 -22
- package/lib/api/admin/TeamWorkflows.d.ts +0 -19
- package/lib/crypto/transformFile.d.ts +0 -2
- package/lib/crypto/transformFile.js +0 -1
- package/lib/models/ProofIntegrationReference.d.ts +0 -33
- package/lib/models/ProofIntegrationReference.js +0 -1
- package/lib/models/TeamAccountFeatures.d.ts +0 -26
- package/lib/models/TeamAccountFeatures.js +0 -1
- package/lib/util/encryptionVersions.json +0 -52
- package/lib/worker.a2f0a156.js +0 -2
package/lib/worker.a2f0a156.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=50)}([function(e,t){e.exports={options:{usePureJavaScript:!1}}},function(e,t,r){function n(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function i(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(o.isArrayBuffer(e)||o.isArrayBufferView(e)){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 i||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}function a(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=o.isArrayBuffer(e),n=o.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&&void 0!==e&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}var s=r(0),o=e.exports=s.util=s.util||{};!function(){function e(e){if(e.source===window&&e.data===t){e.stopPropagation();var n=r.slice();r.length=0,n.forEach(function(e){e()})}}if("undefined"!=typeof process&&process.nextTick)return o.nextTick=process.nextTick,void("function"==typeof setImmediate?o.setImmediate=setImmediate:o.setImmediate=o.nextTick);if("function"==typeof setImmediate)return o.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(o.nextTick=function(e){return setImmediate(e)});if(o.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var t="forge.setImmediate",r=[];o.setImmediate=function(e){r.push(e),1===r.length&&window.postMessage(t,"*")},window.addEventListener("message",e,!0)}if("undefined"!=typeof MutationObserver){var n=Date.now(),i=!0,a=document.createElement("div"),r=[];new MutationObserver(function(){var e=r.slice();r.length=0,e.forEach(function(e){e()})}).observe(a,{attributes:!0});var s=o.setImmediate;o.setImmediate=function(e){Date.now()-n>15?(n=Date.now(),s(e)):(r.push(e),1===r.length&&a.setAttribute("a",i=!i))}}o.nextTick=o.setImmediate}(),o.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,o.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},o.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},o.isArrayBufferView=function(e){return e&&o.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},o.ByteBuffer=i,o.ByteStringBuffer=i;o.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},o.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},o.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},o.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},o.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},o.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},o.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(o.encodeUtf8(e))},o.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},o.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},o.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))},o.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},o.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},o.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))},o.ByteStringBuffer.prototype.putInt=function(e,t){n(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},o.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},o.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},o.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},o.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},o.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},o.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},o.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},o.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},o.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},o.ByteStringBuffer.prototype.getInt=function(e){n(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},o.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},o.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},o.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},o.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},o.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},o.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},o.ByteStringBuffer.prototype.copy=function(){var e=o.createBuffer(this.data);return e.read=this.read,e},o.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},o.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},o.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},o.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},o.ByteStringBuffer.prototype.toString=function(){return o.decodeUtf8(this.bytes())},o.DataBuffer=a,o.DataBuffer.prototype.length=function(){return this.write-this.read},o.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},o.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},o.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},o.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},o.DataBuffer.prototype.putBytes=function(e,t){if(o.isArrayBufferView(e)){var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=r.byteLength-r.byteOffset;this.accommodate(n);var i=new Uint8Array(this.data.buffer,this.write);return i.set(r),this.write+=n,this}if(o.isArrayBuffer(e)){var r=new Uint8Array(e);this.accommodate(r.byteLength);var i=new Uint8Array(this.data.buffer);return i.set(r,this.write),this.write+=r.byteLength,this}if(e instanceof o.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&o.isArrayBufferView(e.data)){var r=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(r.byteLength);var i=new Uint8Array(e.data.byteLength,this.write);return i.set(r),this.write+=r.byteLength,this}if(e instanceof o.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary","string"==typeof e){var a;if("hex"===t)return this.accommodate(Math.ceil(e.length/2)),a=new Uint8Array(this.data.buffer,this.write),this.write+=o.binary.hex.decode(e,a,this.write),this;if("base64"===t)return this.accommodate(3*Math.ceil(e.length/4)),a=new Uint8Array(this.data.buffer,this.write),this.write+=o.binary.base64.decode(e,a,this.write),this;if("utf8"===t&&(e=o.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),a=new Uint8Array(this.data.buffer,this.write),this.write+=o.binary.raw.decode(a),this;if("utf16"===t)return this.accommodate(2*e.length),a=new Uint16Array(this.data.buffer,this.write),this.write+=o.text.utf16.encode(a),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},o.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},o.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},o.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},o.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},o.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},o.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},o.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},o.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},o.DataBuffer.prototype.putInt=function(e,t){n(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},o.DataBuffer.prototype.putSignedInt=function(e,t){return n(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},o.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},o.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},o.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},o.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},o.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},o.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},o.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},o.DataBuffer.prototype.getInt=function(e){n(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},o.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},o.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},o.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},o.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},o.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},o.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},o.DataBuffer.prototype.copy=function(){return new o.DataBuffer(this)},o.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},o.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},o.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},o.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},o.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return o.binary.raw.encode(t);if("hex"===e)return o.binary.hex.encode(t);if("base64"===e)return o.binary.base64.encode(t);if("utf8"===e)return o.text.utf8.decode(t);if("utf16"===e)return o.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},o.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=o.encodeUtf8(e)),new o.ByteBuffer(e)},o.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},o.xorBytes=function(e,t,r){for(var n="",i="",a="",s=0,o=0;r>0;--r,++s)i=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(n+=a,a="",o=0),a+=String.fromCharCode(i),++o;return n+=a},o.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},o.bytesToHex=function(e){return o.createBuffer(e).toHex()},o.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];o.encode64=function(e,t){for(var r,n,i,a="",s="",o=0;o<e.length;)r=e.charCodeAt(o++),n=e.charCodeAt(o++),i=e.charCodeAt(o++),a+=c.charAt(r>>2),a+=c.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=c.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":c.charAt(63&i)),t&&a.length>t&&(s+=a.substr(0,t)+"\r\n",a=a.substr(t));return s+=a},o.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",s=0;s<e.length;)t=u[e.charCodeAt(s++)-43],r=u[e.charCodeAt(s++)-43],n=u[e.charCodeAt(s++)-43],i=u[e.charCodeAt(s++)-43],a+=String.fromCharCode(t<<2|r>>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},o.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},o.decodeUtf8=function(e){return decodeURIComponent(escape(e))},o.binary={raw:{},hex:{},base64:{}},o.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},o.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length)),r=r||0;for(var i=r,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n},o.binary.hex.encode=o.bytesToHex,o.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2))),r=r||0;var i=0,a=r;for(1&e.length&&(i=1,n[a++]=parseInt(e[0],16));i<e.length;i+=2)n[a++]=parseInt(e.substr(i,2),16);return t?a-r:n},o.binary.base64.encode=function(e,t){for(var r,n,i,a="",s="",o=0;o<e.byteLength;)r=e[o++],n=e[o++],i=e[o++],a+=c.charAt(r>>2),a+=c.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=c.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":c.charAt(63&i)),t&&a.length>t&&(s+=a.substr(0,t)+"\r\n",a=a.substr(t));return s+=a},o.binary.base64.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,a,s,o,c=0,l=r;c<e.length;)i=u[e.charCodeAt(c++)-43],a=u[e.charCodeAt(c++)-43],s=u[e.charCodeAt(c++)-43],o=u[e.charCodeAt(c++)-43],n[l++]=i<<2|a>>4,64!==s&&(n[l++]=(15&a)<<4|s>>2,64!==o&&(n[l++]=(3&s)<<6|o));return t?l-r:n.subarray(0,l)},o.text={utf8:{},utf16:{}},o.text.utf8.encode=function(e,t,r){e=o.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length)),r=r||0;for(var i=r,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n},o.text.utf8.decode=function(e){return o.decodeUtf8(String.fromCharCode.apply(null,e))},o.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));var i=new Uint16Array(n.buffer);r=r||0;for(var a=r,s=r,o=0;o<e.length;++o)i[s++]=e.charCodeAt(o),a+=2;return t?a-r:n},o.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},o.deflate=function(e,t,r){if(t=o.decode64(e.deflate(o.encode64(t)).rval),r){var n=2;32&t.charCodeAt(1)&&(n=6),t=t.substring(n,t.length-4)}return t},o.inflate=function(e,t,r){var n=e.inflate(o.encode64(t)).rval;return null===n?null:o.decode64(n)};var l=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(null===r?n=e.removeItem(t):(r=o.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}},h=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(o.decode64(r))),r},f=function(e,t,r,n){var i=h(e,t);null===i&&(i={}),i[r]=n,l(e,t,i)},p=function(e,t,r){var n=h(e,t);return null!==n&&(n=r in n?n[r]:null),n},d=function(e,t,r){var n=h(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),l(e,t,n)}},g=function(e,t){l(e,t,null)},y=function(e,t,r){var n=null;void 0===r&&(r=["web","flash"]);var i,a=!1,s=null;for(var o in r){i=r[o];try{if("flash"===i||"both"===i){if(null===t[0])throw new Error("Flash local storage not available.");n=e.apply(this,t),a="flash"===i}"web"!==i&&"both"!==i||(t[0]=localStorage,n=e.apply(this,t),a=!0)}catch(e){s=e}if(a)break}if(!a)throw s;return n};o.setItem=function(e,t,r,n,i){y(f,arguments,i)},o.getItem=function(e,t,r,n){return y(p,arguments,n)},o.removeItem=function(e,t,r,n){y(d,arguments,n)},o.clearItems=function(e,t,r){y(g,arguments,r)},o.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?n.fullHost+=":"+n.port: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;o.getQueryVariables=function(e){var t,r=function(e){for(var t={},r=e.split("&"),n=0;n<r.length;n++){var i,a,s=r[n].indexOf("=");s>0?(i=r[n].substring(0,s),a=r[n].substring(s+1)):(i=r[n],a=null),i in t||(t[i]=[]),i in Object.prototype||null===a||t[i].push(unescape(a))}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},o.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?{}:o.getQueryVariables(r)}},o.makeRequest=function(e){var t=o.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},o.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:"")},o.setPath=function(e,t,r){if("object"==typeof e&&null!==e)for(var n=0,i=t.length;n<i;){var a=t[n++];if(n==i)e[a]=r;else{var s=a in e;(!s||s&&"object"!=typeof e[a]||s&&null===e[a])&&(e[a]={}),e=e[a]}}},o.getPath=function(e,t,r){for(var n=0,i=t.length,a=!0;a&&n<i&&"object"==typeof e&&null!==e;){var s=t[n++];a=s in e,a&&(e=e[s])}return a?e:r},o.deletePath=function(e,t){if("object"==typeof e&&null!==e)for(var r=0,n=t.length;r<n;){var i=t[r++];if(r==n)delete e[i];else{if(!(i in e)||"object"!=typeof e[i]||null===e[i])break;e=e[i]}}},o.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},o.format=function(e){for(var t,r,n=/%./g,i=0,a=[],s=0;t=n.exec(e);){r=e.substring(s,n.lastIndex-2),r.length>0&&a.push(r),s=n.lastIndex;var o=t[0][1];switch(o){case"s":case"o":i<arguments.length?a.push(arguments[1+i++]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+o+"?>")}}return a.push(e.substring(s)),a.join("")},o.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,s=void 0===r?",":r,o=void 0===n?".":n,c=i<0?"-":"",u=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+o:"")+u.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+o)+(a?s+Math.abs(i-u).toFixed(a).slice(2):"")},o.formatSize=function(e){return e=e>=1073741824?o.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?o.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?o.formatNumber(e/1024,0)+" KiB":o.formatNumber(e,0)+" bytes"},o.bytesFromIP=function(e){return-1!==e.indexOf(".")?o.bytesFromIPv4(e):-1!==e.indexOf(":")?o.bytesFromIPv6(e):null},o.bytesFromIPv4=function(e){if(e=e.split("."),4!==e.length)return null;for(var t=o.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()},o.bytesFromIPv6=function(e){var t=0;e=e.split(":").filter(function(e){return 0===e.length&&++t,!0});for(var r=2*(8-e.length+t),n=o.createBuffer(),i=0;i<8;++i)if(e[i]&&0!==e[i].length){var a=o.hexToBytes(e[i]);a.length<2&&n.putByte(0),n.putBytes(a)}else n.fillWithByte(0,r),r=0;return n.getBytes()},o.bytesToIP=function(e){return 4===e.length?o.bytesToIPv4(e):16===e.length?o.bytesToIPv6(e):null},o.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(".")},o.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var a=o.bytesToHex(e[i]+e[i+1]);"0"===a[0]&&"0"!==a;)a=a.substr(1);if("0"===a){var s=r[r.length-1],c=t.length;s&&c===s.end+1?(s.end=c,s.end-s.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:c,end:c})}t.push(a)}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(":")},o.estimateCores=function(e,t){function r(e,s,c){if(0===s){var u=Math.floor(e.reduce(function(e,t){return e+t},0)/e.length);return o.cores=Math.max(1,u),URL.revokeObjectURL(a),t(null,o.cores)}n(c,function(t,n){e.push(i(c,n)),r(e,s-1,c)})}function n(e,t){for(var r=[],n=[],i=0;i<e;++i){var s=new Worker(a);s.addEventListener("message",function(i){if(n.push(i.data),n.length===e){for(var a=0;a<e;++a)r[a].terminate();t(null,n)}}),r.push(s)}for(var i=0;i<e;++i)r[i].postMessage(i)}function i(e,t){for(var r=[],n=0;n<e;++n)for(var i=t[n],a=r[n]=[],s=0;s<e;++s)if(n!==s){var o=t[s];(i.st>o.st&&i.st<o.et||o.st>i.st&&o.st<i.et)&&a.push(s)}return r.reduce(function(e,t){return Math.max(e,t.length)},0)}if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in o&&!e.update)return t(null,o.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return o.cores=navigator.hardwareConcurrency,t(null,o.cores);if("undefined"==typeof Worker)return o.cores=1,t(null,o.cores);if("undefined"==typeof Blob)return o.cores=2,t(null,o.cores);var a=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"}));r([],5,16)}},function(e,t,r){e.exports=r(0),r(9),r(61),r(4),r(17),r(38),r(14),r(12),r(63),r(39),r(64),r(37),r(19),r(11),r(33),r(35),r(66),r(27),r(34),r(31),r(22),r(3),r(32),r(67),r(68),r(26),r(1)},function(e,t,r){var n=r(0);r(9),r(30),r(31),r(1),function(){if(n.random&&n.random.getBytes)return void(e.exports=n.random);!function(t){function r(){var e=n.prng.create(i);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}var i={},a=new Array(4),s=n.util.createBuffer();i.formatKey=function(e){var t=n.util.createBuffer(e);return e=new Array(4),e[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},i.formatSeed=function(e){var t=n.util.createBuffer(e);return e=new Array(4),e[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},i.cipher=function(e,t){return n.aes._updateBlock(e,t,a,!1),s.putInt32(a[0]),s.putInt32(a[1]),s.putInt32(a[2]),s.putInt32(a[3]),s.getBytes()},i.increment=function(e){return++e[3],e},i.md=n.md.sha256;var o=r(),c=null;if("undefined"!=typeof window){var u=window.crypto||window.msCrypto;u&&u.getRandomValues&&(c=function(e){return u.getRandomValues(e)})}if(n.options.usePureJavaScript||!n.util.isNodejs&&!c){if("undefined"==typeof window||window.document,o.collectInt(+new Date,32),"undefined"!=typeof navigator){var l="";for(var h in navigator)try{"string"==typeof navigator[h]&&(l+=navigator[h])}catch(e){}o.collect(l),l=null}t&&(t().mousemove(function(e){o.collectInt(e.clientX,16),o.collectInt(e.clientY,16)}),t().keypress(function(e){o.collectInt(e.charCode,8)}))}if(n.random)for(var h in o)n.random[h]=o[h];else n.random=o;n.random.createInstance=r,e.exports=n.random}("undefined"!=typeof jQuery?jQuery:null)}()},function(e,t,r){function n(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}}function i(e,t,r,a){var c;n(e,t,2);var u=e.getByte();t--;var l=192&u,h=31&u;c=e.length();var f=o(e,t);if(t-=c-e.length(),void 0!==f&&f>t){if(a.strict){var p=new Error("Too few bytes to read ASN.1 value.");throw p.available=e.length(),p.remaining=t,p.requested=f,p}f=t}var d,g,y=32==(32&u);if(y)if(d=[],void 0===f)for(;;){if(n(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}c=e.length(),d.push(i(e,t,r+1,a)),t-=c-e.length()}else for(;f>0;)c=e.length(),d.push(i(e,f,r+1,a)),t-=c-e.length(),f-=c-e.length();if(void 0===d&&l===s.Class.UNIVERSAL&&h===s.Type.BITSTRING&&(g=e.bytes(f)),void 0===d&&a.decodeBitStrings&&l===s.Class.UNIVERSAL&&h===s.Type.BITSTRING&&f>1){var v=e.read,m=t,C=0;if(h===s.Type.BITSTRING&&(n(e,t,1),C=e.getByte(),t--),0===C)try{c=e.length();var E={verbose:a.verbose,strict:!0,decodeBitStrings:!0},S=i(e,t,r+1,E),_=c-e.length();t-=_,h==s.Type.BITSTRING&&_++;var b=S.tagClass;_!==f||b!==s.Class.UNIVERSAL&&b!==s.Class.CONTEXT_SPECIFIC||(d=[S])}catch(e){}void 0===d&&(e.read=v,t=m)}if(void 0===d){if(void 0===f){if(a.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");f=t}if(h===s.Type.BMPSTRING)for(d="";f>0;f-=2)n(e,t,2),d+=String.fromCharCode(e.getInt16()),t-=2;else d=e.getBytes(f)}var T=void 0===g?null:{bitStringContents:g};return s.create(l,h,y,d,T)}var a=r(0);r(1),r(10);var s=e.exports=a.asn1=a.asn1||{};s.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},s.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},s.create=function(e,t,r,n,i){if(a.util.isArray(n)){for(var o=[],c=0;c<n.length;++c)void 0!==n[c]&&o.push(n[c]);n=o}var u={tagClass:e,type:t,constructed:r,composed:r||a.util.isArray(n),value:n};return i&&"bitStringContents"in i&&(u.bitStringContents=i.bitStringContents,u.original=s.copy(u)),u},s.copy=function(e,t){var r;if(a.util.isArray(e)){r=[];for(var n=0;n<e.length;++n)r.push(s.copy(e[n],t));return r}return"string"==typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:s.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},s.equals=function(e,t,r){if(a.util.isArray(e)){if(!a.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)return!!s.equals(e[n],t[n])}if(typeof e!=typeof t)return!1;if("string"==typeof e)return e===t;var i=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&s.equals(e.value,t.value);return r&&r.includeBitStringContents&&(i=i&&e.bitStringContents===t.bitStringContents),i},s.getBerValueLength=function(e){var t=e.getByte();if(128!==t){return 128&t?e.getInt((127&t)<<3):t}};var o=function(e,t){var r=e.getByte();if(t--,128!==r){var i;if(128&r){var a=127&r;n(e,t,a),i=e.getInt(a<<3)}else i=r;if(i<0)throw new Error("Negative length: "+i);return i}};s.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=a.util.createBuffer(e)),i(e,e.length(),0,t)},s.toDer=function(e){var t=a.util.createBuffer(),r=e.tagClass|e.type,n=a.util.createBuffer(),i=!1;if("bitStringContents"in e&&(i=!0,e.original&&(i=s.equals(e,e.original))),i)n.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:n.putByte(0);for(var o=0;o<e.value.length;++o)void 0!==e.value[o]&&n.putBuffer(s.toDer(e.value[o]))}else if(e.type===s.Type.BMPSTRING)for(var o=0;o<e.value.length;++o)n.putInt16(e.value.charCodeAt(o));else e.type===s.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)))?n.putBytes(e.value.substr(1)):n.putBytes(e.value);if(t.putByte(r),n.length()<=127)t.putByte(127&n.length());else{var c=n.length(),u="";do{u+=String.fromCharCode(255&c),c>>>=8}while(c>0);t.putByte(128|u.length);for(var o=u.length-1;o>=0;--o)t.putByte(u.charCodeAt(o))}return t.putBuffer(n),t},s.oidToDer=function(e){var t=e.split("."),r=a.util.createBuffer();r.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var n,i,s,o,c=2;c<t.length;++c){n=!0,i=[],s=parseInt(t[c],10);do{o=127&s,s>>>=7,n||(o|=128),i.push(o),n=!1}while(s>0);for(var u=i.length-1;u>=0;--u)r.putByte(i[u])}return r},s.derToOid=function(e){var t;"string"==typeof e&&(e=a.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var n=0;e.length()>0;)r=e.getByte(),n<<=7,128&r?n+=127&r:(t+="."+(n+r),n=0);return t},s.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),a=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),u=10;"+"!==c&&"-"!==c&&(o=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,s,o,0),u&&("+"===(c=e.charAt(u))||"-"===c)){var l=parseInt(e.substr(u+1,2),10),h=parseInt(e.substr(u+4,2),10),f=60*l+h;f*=6e4,"+"===c?t.setTime(+t-f):t.setTime(+t+f)}return t},s.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),a=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=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,f=e.charAt(h);if("+"===f||"-"===f){u=60*parseInt(e.substr(h+1,2),10)+parseInt(e.substr(h+4,2),10),u*=6e4,"+"===f&&(u*=-1),l=!0}return"."===e.charAt(14)&&(c=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,s,o,c),t.setTime(+t+u)):(t.setFullYear(r,n,i),t.setHours(a,s,o,c)),t},s.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"},s.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"},s.integerToDer=function(e){var t=a.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},s.derToInteger=function(e){"string"==typeof e&&(e=a.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)},s.validate=function(e,t,r,n){var i=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)n&&(e.tagClass!==t.tagClass&&n.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&n.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(i=!0,t.value&&a.util.isArray(t.value))for(var o=0,c=0;i&&c<t.value.length;++c)i=t.value[c].optional||!1,e.value[o]&&(i=s.validate(e.value[o],t.value[c],r,n),i?++o:t.value[c].optional&&(i=!0)),!i&&n&&n.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(i&&r&&(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{var u=e.bitStringContents.charCodeAt(0);if(0!==u)throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}}else n&&n.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');return i};var c=/[^\\u0000-\\u00ff]/;s.prettyPrint=function(e,t,r){var n="";t=t||0,r=r||2,t>0&&(n+="\n");for(var i="",o=0;o<t*r;++o)i+=" ";switch(n+=i+"Tag: ",e.tagClass){case s.Class.UNIVERSAL:n+="Universal:";break;case s.Class.APPLICATION:n+="Application:";break;case s.Class.CONTEXT_SPECIFIC:n+="Context-Specific:";break;case s.Class.PRIVATE:n+="Private:"}if(e.tagClass===s.Class.UNIVERSAL)switch(n+=e.type,e.type){case s.Type.NONE:n+=" (None)";break;case s.Type.BOOLEAN:n+=" (Boolean)";break;case s.Type.INTEGER:n+=" (Integer)";break;case s.Type.BITSTRING:n+=" (Bit string)";break;case s.Type.OCTETSTRING:n+=" (Octet string)";break;case s.Type.NULL:n+=" (Null)";break;case s.Type.OID:n+=" (Object Identifier)";break;case s.Type.ODESC:n+=" (Object Descriptor)";break;case s.Type.EXTERNAL:n+=" (External or Instance of)";break;case s.Type.REAL:n+=" (Real)";break;case s.Type.ENUMERATED:n+=" (Enumerated)";break;case s.Type.EMBEDDED:n+=" (Embedded PDV)";break;case s.Type.UTF8:n+=" (UTF8)";break;case s.Type.ROID:n+=" (Relative Object Identifier)";break;case s.Type.SEQUENCE:n+=" (Sequence)";break;case s.Type.SET:n+=" (Set)";break;case s.Type.PRINTABLESTRING:n+=" (Printable String)";break;case s.Type.IA5String:n+=" (IA5String (ASCII))";break;case s.Type.UTCTIME:n+=" (UTC time)";break;case s.Type.GENERALIZEDTIME:n+=" (Generalized time)";break;case s.Type.BMPSTRING:n+=" (BMP String)"}else n+=e.type;if(n+="\n",n+=i+"Constructed: "+e.constructed+"\n",e.composed){for(var u=0,l="",o=0;o<e.value.length;++o)void 0!==e.value[o]&&(u+=1,l+=s.prettyPrint(e.value[o],t+1,r),o+1<e.value.length&&(l+=","));n+=i+"Sub values: "+u+l}else{if(n+=i+"Value: ",e.type===s.Type.OID){var h=s.derToOid(e.value);n+=h,a.pki&&a.pki.oids&&h in a.pki.oids&&(n+=" ("+a.pki.oids[h]+") ")}if(e.type===s.Type.INTEGER)try{n+=s.derToInteger(e.value)}catch(t){n+="0x"+a.util.bytesToHex(e.value)}else if(e.type===s.Type.BITSTRING){if(e.value.length>1?n+="0x"+a.util.bytesToHex(e.value.slice(1)):n+="(none)",e.value.length>0){var f=e.value.charCodeAt(0);1==f?n+=" (1 unused bit shown)":f>1&&(n+=" ("+f+" unused bits shown)")}}else e.type===s.Type.OCTETSTRING?(c.test(e.value)||(n+="("+e.value+") "),n+="0x"+a.util.bytesToHex(e.value)):e.type===s.Type.UTF8?n+=a.util.decodeUtf8(e.value):e.type===s.Type.PRINTABLESTRING||e.type===s.Type.IA5String?n+=e.value:c.test(e.value)?n+="0x"+a.util.bytesToHex(e.value):0===e.value.length?n+="[null]":n+=e.value}return n}},function(e,t,r){var n=r(0);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},function(e,t,r){!function(r,n){e.exports=t=n()}(0,function(){var e=e||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},a=i.Base=function(){return{extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=i.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a<i;a++){var s=r[a>>>2]>>>24-a%4*8&255;t[n+a>>>2]|=s<<24-(n+a)%4*8}else for(var a=0;a<i;a+=4)t[n+a>>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=0;i<t;i+=4){var a=function(t){var t=t,r=987654321,n=4294967295;return function(){r=36969*(65535&r)+(r>>16)&n,t=18e3*(65535&t)+(t>>16)&n;var i=(r<<16)+t&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}}(4294967296*(r||e.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new s.init(n,t)}}),o=n.enc={},c=o.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new s.init(r,t/2)}},u=o.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new s.init(r,t)}},l=o.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},h=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,a=this.blockSize,o=4*a,c=i/o;c=t?e.ceil(c):e.max((0|c)-this._minBufferSize,0);var u=c*a,l=e.min(4*u,i);if(u){for(var h=0;h<u;h+=a)this._doProcessBlock(n,h);var f=n.splice(0,u);r.sigBytes-=l}return new s.init(f,l)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),f=(i.Hasher=h.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new f.HMAC.init(e,r).finalize(t)}}}),n.algo={});return n}(Math);return e})},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var a={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)return void e.set(t.subarray(r,r+n),i);for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){var t,r,n,i,a,s;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(s=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)a=e[t],s.set(a,i),i+=a.length;return s}},s={arraySet:function(e,t,r,n,i){for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,a)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,s))},t.setTyped(i)},function(e,t,r){"use strict";function n(e,t){try{var r=o.util.decode64(e);return t.decrypt(r,u)}catch(e){return null}}function i(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new Promise(function(n){var i=[];t.forEach(function(t){var r=o.pki.publicKeyFromPem(t),n=r.encrypt(e,u);i.push(o.util.encode64(n))}),n((r?c+l:"")+i.join(l))})}function a(e,t){return new Promise(function(r,i){for(var a=o.pki.privateKeyFromPem(t),s=e.split(l),c=0;c<s.length;c+=1){var u=n(s[c],a);if(null!==u){var h=u.split(l);return void r({key:h[0],iv:h[1]})}}i(new Error("Unable to unseal envelope. User's private key was unable to decrypt any of the "+s.length+" payload(s)."))})}t.__esModule=!0,t.envelopeUnseal=t.envelopeSeal=void 0;var s=r(2),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),c="0001",u="RSAES-PKCS1-V1_5",l="|";t.envelopeSeal=i,t.envelopeUnseal=a},function(e,t,r){function n(e,t){var r=function(){return new c.aes.Algorithm(e,t)};c.cipher.registerAlgorithm(e,r)}function i(){d=!0,h=[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;u=new Array(256),l=new Array(256),f=new Array(4),p=new Array(4);for(var t=0;t<4;++t)f[t]=new Array(256),p[t]=new Array(256);for(var r,n,i,a,s,o,c,g=0,y=0,t=0;t<256;++t){a=y^y<<1^y<<2^y<<3^y<<4,a=a>>8^255&a^99,u[g]=a,l[a]=g,s=e[a],r=e[g],n=e[r],i=e[n],o=s<<24^a<<16^a<<8^a^s,c=(r^n^i)<<24^(g^i)<<16^(g^n^i)<<8^g^r^i;for(var v=0;v<4;++v)f[v][g]=o,p[v][a]=c,o=o<<24|o>>>8,c=c<<24|c>>>8;0===g?g=y=1:(g=r^e[e[e[r^i]]],y^=e[e[y]])}}function a(e,t){for(var r,n=e.slice(0),i=1,a=n.length,s=a+6+1,o=g*s,c=a;c<o;++c)r=n[c-1],c%a==0?(r=u[r>>>16&255]<<24^u[r>>>8&255]<<16^u[255&r]<<8^u[r>>>24]^h[i]<<24,i++):a>6&&c%a==4&&(r=u[r>>>24]<<24^u[r>>>16&255]<<16^u[r>>>8&255]<<8^u[255&r]),n[c]=n[c-a]^r;if(t){var l,f=p[0],d=p[1],y=p[2],v=p[3],m=n.slice(0);o=n.length;for(var c=0,C=o-g;c<o;c+=g,C-=g)if(0===c||c===o-g)m[c]=n[C],m[c+1]=n[C+3],m[c+2]=n[C+2],m[c+3]=n[C+1];else for(var E=0;E<g;++E)l=n[C+E],m[c+(3&-E)]=f[u[l>>>24]]^d[u[l>>>16&255]]^y[u[l>>>8&255]]^v[u[255&l]];n=m}return n}function s(e,t,r,n){var i,a,s,o,c,h=e.length/4-1;n?(i=p[0],a=p[1],s=p[2],o=p[3],c=l):(i=f[0],a=f[1],s=f[2],o=f[3],c=u);var d,g,y,v,m,C,E;d=t[0]^e[0],g=t[n?3:1]^e[1],y=t[2]^e[2],v=t[n?1:3]^e[3];for(var S=3,_=1;_<h;++_)m=i[d>>>24]^a[g>>>16&255]^s[y>>>8&255]^o[255&v]^e[++S],C=i[g>>>24]^a[y>>>16&255]^s[v>>>8&255]^o[255&d]^e[++S],E=i[y>>>24]^a[v>>>16&255]^s[d>>>8&255]^o[255&g]^e[++S],v=i[v>>>24]^a[d>>>16&255]^s[g>>>8&255]^o[255&y]^e[++S],d=m,g=C,y=E;r[0]=c[d>>>24]<<24^c[g>>>16&255]<<16^c[y>>>8&255]<<8^c[255&v]^e[++S],r[n?3:1]=c[g>>>24]<<24^c[y>>>16&255]<<16^c[v>>>8&255]<<8^c[255&d]^e[++S],r[2]=c[y>>>24]<<24^c[v>>>16&255]<<16^c[d>>>8&255]<<8^c[255&g]^e[++S],r[n?1:3]=c[v>>>24]<<24^c[d>>>16&255]<<16^c[g>>>8&255]<<8^c[255&y]^e[++S]}function o(e){e=e||{};var t,r=(e.mode||"CBC").toUpperCase(),n="AES-"+r;t=e.decrypt?c.cipher.createDecipher(n,e.key):c.cipher.createCipher(n,e.key);var i=t.start;return t.start=function(e,r){var n=null;r instanceof c.util.ByteBuffer&&(n=r,r={}),r=r||{},r.output=n,r.iv=e,i.call(t,r)},t}var c=r(0);r(17),r(25),r(1),e.exports=c.aes=c.aes||{},c.aes.startEncrypting=function(e,t,r,n){var i=o({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},c.aes.createEncryptionCipher=function(e,t){return o({key:e,output:null,decrypt:!1,mode:t})},c.aes.startDecrypting=function(e,t,r,n){var i=o({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},c.aes.createDecryptionCipher=function(e,t){return o({key:e,output:null,decrypt:!0,mode:t})},c.aes.Algorithm=function(e,t){d||i();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return s(r._w,e,t,!1)},decrypt:function(e,t){return s(r._w,e,t,!0)}}}),r._init=!1},c.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(c.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=c.util.createBuffer();for(var n=0;n<t.length;++n)r.putByte(t[n])}}else r=c.util.createBuffer(r);if(!c.util.isArray(r)){t=r,r=[];var i=t.length();if(16===i||24===i||32===i){i>>>=2;for(var n=0;n<i;++n)r.push(t.getInt32())}}if(!c.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var s=this.mode.name,o=-1!==["CFB","OFB","CTR","GCM"].indexOf(s);this._w=a(r,e.decrypt&&!o),this._init=!0}},c.aes._expandKey=function(e,t){return d||i(),a(e,t)},c.aes._updateBlock=s,n("AES-ECB",c.cipher.modes.ecb),n("AES-CBC",c.cipher.modes.cbc),n("AES-CFB",c.cipher.modes.cfb),n("AES-OFB",c.cipher.modes.ofb),n("AES-CTR",c.cipher.modes.ctr),n("AES-GCM",c.cipher.modes.gcm);var u,l,h,f,p,d=!1,g=4},function(e,t,r){function n(e,t){s[e]=t,s[t]=e}function i(e,t){s[e]=t}var a=r(0);a.pki=a.pki||{};var s=e.exports=a.pki.oids=a.oids=a.oids||{};n("1.2.840.113549.1.1.1","rsaEncryption"),n("1.2.840.113549.1.1.4","md5WithRSAEncryption"),n("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),n("1.2.840.113549.1.1.7","RSAES-OAEP"),n("1.2.840.113549.1.1.8","mgf1"),n("1.2.840.113549.1.1.9","pSpecified"),n("1.2.840.113549.1.1.10","RSASSA-PSS"),n("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),n("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),n("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),n("1.3.14.3.2.7","desCBC"),n("1.3.14.3.2.26","sha1"),n("2.16.840.1.101.3.4.2.1","sha256"),n("2.16.840.1.101.3.4.2.2","sha384"),n("2.16.840.1.101.3.4.2.3","sha512"),n("1.2.840.113549.2.5","md5"),n("1.2.840.113549.1.7.1","data"),n("1.2.840.113549.1.7.2","signedData"),n("1.2.840.113549.1.7.3","envelopedData"),n("1.2.840.113549.1.7.4","signedAndEnvelopedData"),n("1.2.840.113549.1.7.5","digestedData"),n("1.2.840.113549.1.7.6","encryptedData"),n("1.2.840.113549.1.9.1","emailAddress"),n("1.2.840.113549.1.9.2","unstructuredName"),n("1.2.840.113549.1.9.3","contentType"),n("1.2.840.113549.1.9.4","messageDigest"),n("1.2.840.113549.1.9.5","signingTime"),n("1.2.840.113549.1.9.6","counterSignature"),n("1.2.840.113549.1.9.7","challengePassword"),n("1.2.840.113549.1.9.8","unstructuredAddress"),n("1.2.840.113549.1.9.14","extensionRequest"),n("1.2.840.113549.1.9.20","friendlyName"),n("1.2.840.113549.1.9.21","localKeyId"),n("1.2.840.113549.1.9.22.1","x509Certificate"),n("1.2.840.113549.1.12.10.1.1","keyBag"),n("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),n("1.2.840.113549.1.12.10.1.3","certBag"),n("1.2.840.113549.1.12.10.1.4","crlBag"),n("1.2.840.113549.1.12.10.1.5","secretBag"),n("1.2.840.113549.1.12.10.1.6","safeContentsBag"),n("1.2.840.113549.1.5.13","pkcs5PBES2"),n("1.2.840.113549.1.5.12","pkcs5PBKDF2"),n("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),n("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),n("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),n("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),n("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),n("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),n("1.2.840.113549.2.7","hmacWithSHA1"),n("1.2.840.113549.2.8","hmacWithSHA224"),n("1.2.840.113549.2.9","hmacWithSHA256"),n("1.2.840.113549.2.10","hmacWithSHA384"),n("1.2.840.113549.2.11","hmacWithSHA512"),n("1.2.840.113549.3.7","des-EDE3-CBC"),n("2.16.840.1.101.3.4.1.2","aes128-CBC"),n("2.16.840.1.101.3.4.1.22","aes192-CBC"),n("2.16.840.1.101.3.4.1.42","aes256-CBC"),n("2.5.4.3","commonName"),n("2.5.4.5","serialName"),n("2.5.4.6","countryName"),n("2.5.4.7","localityName"),n("2.5.4.8","stateOrProvinceName"),n("2.5.4.10","organizationName"),n("2.5.4.11","organizationalUnitName"),n("2.16.840.1.113730.1.1","nsCertType"),i("2.5.29.1","authorityKeyIdentifier"),i("2.5.29.2","keyAttributes"),i("2.5.29.3","certificatePolicies"),i("2.5.29.4","keyUsageRestriction"),i("2.5.29.5","policyMapping"),i("2.5.29.6","subtreesConstraint"),i("2.5.29.7","subjectAltName"),i("2.5.29.8","issuerAltName"),i("2.5.29.9","subjectDirectoryAttributes"),i("2.5.29.10","basicConstraints"),i("2.5.29.11","nameConstraints"),i("2.5.29.12","policyConstraints"),i("2.5.29.13","basicConstraints"),n("2.5.29.14","subjectKeyIdentifier"),n("2.5.29.15","keyUsage"),i("2.5.29.16","privateKeyUsagePeriod"),n("2.5.29.17","subjectAltName"),n("2.5.29.18","issuerAltName"),n("2.5.29.19","basicConstraints"),i("2.5.29.20","cRLNumber"),i("2.5.29.21","cRLReason"),i("2.5.29.22","expirationDate"),i("2.5.29.23","instructionCode"),i("2.5.29.24","invalidityDate"),i("2.5.29.25","cRLDistributionPoints"),i("2.5.29.26","issuingDistributionPoint"),i("2.5.29.27","deltaCRLIndicator"),i("2.5.29.28","issuingDistributionPoint"),i("2.5.29.29","certificateIssuer"),i("2.5.29.30","nameConstraints"),n("2.5.29.31","cRLDistributionPoints"),n("2.5.29.32","certificatePolicies"),i("2.5.29.33","policyMappings"),i("2.5.29.34","policyConstraints"),n("2.5.29.35","authorityKeyIdentifier"),i("2.5.29.36","policyConstraints"),n("2.5.29.37","extKeyUsage"),i("2.5.29.46","freshestCRL"),i("2.5.29.54","inhibitAnyPolicy"),n("1.3.6.1.4.1.11129.2.4.2","timestampList"),n("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),n("1.3.6.1.5.5.7.3.1","serverAuth"),n("1.3.6.1.5.5.7.3.2","clientAuth"),n("1.3.6.1.5.5.7.3.3","codeSigning"),n("1.3.6.1.5.5.7.3.4","emailProtection"),n("1.3.6.1.5.5.7.3.8","timeStamping")},function(e,t,r){function n(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";for(var a=0,s=-1,i=0;i<t.length;++i,++a)if(a>65&&-1!==s){var o=t[s];","===o?(++s,t=t.substr(0,s)+"\r\n "+t.substr(s)):t=t.substr(0,s)+"\r\n"+o+t.substr(s+1),a=i-s-1,s=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(s=i);return t}function i(e){return e.replace(/^\s+/,"")}var a=r(0);r(1);var s=e.exports=a.pem=a.pem||{};s.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]},i+=n(r)),e.contentDomain&&(r={name:"Content-Domain",values:[e.contentDomain]},i+=n(r)),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=n(r)),e.headers)for(var s=0;s<e.headers.length;++s)i+=n(e.headers[s]);return e.procType&&(i+="\r\n"),i+=a.util.encode64(e.body,t.maxline||64)+"\r\n",i+="-----END "+e.type+"-----\r\n"},s.decode=function(e){for(var t,r=[],n=/\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^:]+)/,o=/\r?\n/;;){if(!(t=n.exec(e)))break;var c={type:t[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:a.util.decode64(t[3])};if(r.push(c),t[2]){for(var u=t[2].split(o),l=0;t&&l<u.length;){for(var h=u[l].replace(/\s+$/,""),f=l+1;f<u.length;++f){var p=u[f];if(!/\s/.test(p[0]))break;h+=p,l=f}if(t=h.match(s)){for(var d={name:t[1],values:[]},g=t[2].split(","),y=0;y<g.length;++y)d.values.push(i(g[y]));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:g[0],parameters:g[1]||null}}else c.contentDomain=g[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:g[0],type:g[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,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,a={};return a.start=function(a,s){if(null!==a)if("string"==typeof a){if(!((a=a.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+a+'"');t=n.md.algorithms[a].create()}else t=a;if(null===s)s=e;else{if("string"==typeof s)s=n.util.createBuffer(s);else if(n.util.isArray(s)){var o=s;s=n.util.createBuffer();for(var c=0;c<o.length;++c)s.putByte(o[c])}var u=s.length();u>t.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),u=s.length();for(var c=0;c<u;++c){var o=s.at(c);r.putByte(54^o),i.putByte(92^o)}if(u<t.blockLength)for(var o=t.blockLength-u,c=0;c<o;++c)r.putByte(54),i.putByte(92);e=s,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},a.update=function(e){t.update(e)},a.getMac=function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()},a.digest=a.getMac,a}},function(e,t,r){function n(){o=String.fromCharCode(128),o+=a.util.fillString(String.fromCharCode(0),64),c=!0}function i(e,t,r){for(var n,i,a,s,o,c,u,l,h=r.length();h>=64;){for(i=e.h0,a=e.h1,s=e.h2,o=e.h3,c=e.h4,l=0;l<16;++l)n=r.getInt32(),t[l]=n,u=o^a&(s^o),n=(i<<5|i>>>27)+u+c+1518500249+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;l<20;++l)n=t[l-3]^t[l-8]^t[l-14]^t[l-16],n=n<<1|n>>>31,t[l]=n,u=o^a&(s^o),n=(i<<5|i>>>27)+u+c+1518500249+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;l<32;++l)n=t[l-3]^t[l-8]^t[l-14]^t[l-16],n=n<<1|n>>>31,t[l]=n,u=a^s^o,n=(i<<5|i>>>27)+u+c+1859775393+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;l<40;++l)n=t[l-6]^t[l-16]^t[l-28]^t[l-32],n=n<<2|n>>>30,t[l]=n,u=a^s^o,n=(i<<5|i>>>27)+u+c+1859775393+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;l<60;++l)n=t[l-6]^t[l-16]^t[l-28]^t[l-32],n=n<<2|n>>>30,t[l]=n,u=a&s|o&(a^s),n=(i<<5|i>>>27)+u+c+2400959708+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;l<80;++l)n=t[l-6]^t[l-16]^t[l-28]^t[l-32],n=n<<2|n>>>30,t[l]=n,u=a^s^o,n=(i<<5|i>>>27)+u+c+3395469782+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,h-=64}}var a=r(0);r(5),r(1);var s=e.exports=a.sha1=a.sha1||{};a.md.sha1=a.md.algorithms.sha1=s,s.create=function(){c||n();var e=null,t=a.util.createBuffer(),r=new Array(80),s={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return s.start=function(){s.messageLength=0,s.fullMessageLength=s.messageLength64=[];for(var r=s.messageLengthSize/4,n=0;n<r;++n)s.fullMessageLength.push(0);return t=a.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},s},s.start(),s.update=function(n,o){"utf8"===o&&(n=a.util.encodeUtf8(n));var c=n.length;s.messageLength+=c,c=[c/4294967296>>>0,c>>>0];for(var u=s.fullMessageLength.length-1;u>=0;--u)s.fullMessageLength[u]+=c[1],c[1]=c[0]+(s.fullMessageLength[u]/4294967296>>>0),s.fullMessageLength[u]=s.fullMessageLength[u]>>>0,c[0]=c[1]/4294967296>>>0;return t.putBytes(n),i(e,r,t),(t.read>2048||0===t.length())&&t.compact(),s},s.digest=function(){var n=a.util.createBuffer();n.putBytes(t.bytes());var c=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize,u=c&s.blockLength-1;n.putBytes(o.substr(0,s.blockLength-u));for(var l,h,f=8*s.fullMessageLength[0],p=0;p<s.fullMessageLength.length-1;++p)l=8*s.fullMessageLength[p+1],h=l/4294967296>>>0,f+=h,n.putInt32(f>>>0),f=l>>>0;n.putInt32(f);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};i(d,r,n);var g=a.util.createBuffer();return g.putInt32(d.h0),g.putInt32(d.h1),g.putInt32(d.h2),g.putInt32(d.h3),g.putInt32(d.h4),g},s};var o=null,c=!1},function(e,t,r){function n(e,t){var r=function(){return new o.des.Algorithm(e,t)};o.cipher.registerAlgorithm(e,r)}function i(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],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[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],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[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],g=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=e.length()>8?3:1,v=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],C=0,E=0;E<y;E++){var S=e.getInt32(),_=e.getInt32();t=252645135&(S>>>4^_),_^=t,S^=t<<4,t=65535&(_>>>-16^S),S^=t,_^=t<<-16,t=858993459&(S>>>2^_),_^=t,S^=t<<2,t=65535&(_>>>-16^S),S^=t,_^=t<<-16,t=1431655765&(S>>>1^_),_^=t,S^=t<<1,t=16711935&(_>>>8^S),S^=t,_^=t<<8,t=1431655765&(S>>>1^_),_^=t,S^=t<<1,t=S<<8|_>>>20&240,S=_<<24|_<<8&16711680|_>>>8&65280|_>>>24&240,_=t;for(var b=0;b<m.length;++b){m[b]?(S=S<<2|S>>>26,_=_<<2|_>>>26):(S=S<<1|S>>>27,_=_<<1|_>>>27),S&=-15,_&=-15;var T=r[S>>>28]|n[S>>>24&15]|i[S>>>20&15]|a[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|c[S>>>4&15],B=u[_>>>28]|l[_>>>24&15]|h[_>>>20&15]|f[_>>>16&15]|p[_>>>12&15]|d[_>>>8&15]|g[_>>>4&15];t=65535&(B>>>16^T),v[C++]=T^t,v[C++]=B^t<<16}}return v}function a(e,t,r,n){var i,a=32===e.length?3:9;i=3===a?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 s,o=t[0],y=t[1];s=252645135&(o>>>4^y),y^=s,o^=s<<4,s=65535&(o>>>16^y),y^=s,o^=s<<16,s=858993459&(y>>>2^o),o^=s,y^=s<<2,s=16711935&(y>>>8^o),o^=s,y^=s<<8,s=1431655765&(o>>>1^y),y^=s,o^=s<<1,o=o<<1|o>>>31,y=y<<1|y>>>31;for(var v=0;v<a;v+=3){for(var m=i[v+1],C=i[v+2],E=i[v];E!=m;E+=C){var S=y^e[E],_=(y>>>4|y<<28)^e[E+1];s=o,o=y,y=s^(u[S>>>24&63]|h[S>>>16&63]|p[S>>>8&63]|g[63&S]|c[_>>>24&63]|l[_>>>16&63]|f[_>>>8&63]|d[63&_])}s=o,o=y,y=s}o=o>>>1|o<<31,y=y>>>1|y<<31,s=1431655765&(o>>>1^y),y^=s,o^=s<<1,s=16711935&(y>>>8^o),o^=s,y^=s<<8,s=858993459&(y>>>2^o),o^=s,y^=s<<2,s=65535&(o>>>16^y),y^=s,o^=s<<16,s=252645135&(o>>>4^y),y^=s,o^=s<<4,r[0]=o,r[1]=y}function s(e){e=e||{};var t,r=(e.mode||"CBC").toUpperCase(),n="DES-"+r;t=e.decrypt?o.cipher.createDecipher(n,e.key):o.cipher.createCipher(n,e.key);var i=t.start;return t.start=function(e,r){var n=null;r instanceof o.util.ByteBuffer&&(n=r,r={}),r=r||{},r.output=n,r.iv=e,i.call(t,r)},t}var o=r(0);r(17),r(25),r(1),e.exports=o.des=o.des||{},o.des.startEncrypting=function(e,t,r,n){var i=s({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},o.des.createEncryptionCipher=function(e,t){return s({key:e,output:null,decrypt:!1,mode:t})},o.des.startDecrypting=function(e,t,r,n){var i=s({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},o.des.createDecryptionCipher=function(e,t){return s({key:e,output:null,decrypt:!0,mode:t})},o.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return a(r._keys,e,t,!1)},decrypt:function(e,t){return a(r._keys,e,t,!0)}}}),r._init=!1},o.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=o.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=i(t),this._init=!0}},n("DES-ECB",o.cipher.modes.ecb),n("DES-CBC",o.cipher.modes.cbc),n("DES-CFB",o.cipher.modes.cfb),n("DES-OFB",o.cipher.modes.ofb),n("DES-CTR",o.cipher.modes.ctr),n("3DES-ECB",o.cipher.modes.ecb),n("3DES-CBC",o.cipher.modes.cbc),n("3DES-CFB",o.cipher.modes.cfb),n("3DES-OFB",o.cipher.modes.ofb),n("3DES-CTR",o.cipher.modes.ctr);var c=[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],u=[-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],l=[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],h=[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],f=[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],p=[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],d=[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],g=[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(e,t,r){function n(e,t,r){var n=h.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=i-11,a}n.putByte(0),n.putByte(r);var s,o=i-3-e.length;if(0===r||1===r){s=0===r?0:255;for(var c=0;c<o;++c)n.putByte(s)}else for(;o>0;){for(var u=0,l=h.random.getBytes(o),c=0;c<o;++c)s=l.charCodeAt(c),0===s?++u:n.putByte(s);o=u}return n.putByte(0),n.putBytes(e),n}function i(e,t,r,n){var i=Math.ceil(t.n.bitLength()/8),a=h.util.createBuffer(e),s=a.getByte(),o=a.getByte();if(0!==s||r&&0!==o&&1!==o||!r&&2!=o||r&&0===o&&void 0===n)throw new Error("Encryption block is invalid.");var c=0;if(0===o){c=i-3-n;for(var u=0;u<c;++u)if(0!==a.getByte())throw new Error("Encryption block is invalid.")}else if(1===o)for(c=0;a.length()>1;){if(255!==a.getByte()){--a.read;break}++c}else if(2===o)for(c=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++c}if(0!==a.getByte()||c!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function a(e,t,r){function n(){i(e.pBits,function(t,n){return t?r(t):(e.p=n,null!==e.q?a(t,e.q):void i(e.qBits,a))})}function i(e,t){h.prime.generateProbablePrime(e,s,t)}function a(t,s){if(t)return r(t);if(e.q=s,e.p.compareTo(e.q)<0){var o=e.p;e.p=e.q,e.q=o}if(0!==e.p.subtract(f.ONE).gcd(e.e).compareTo(f.ONE))return e.p=null,void n();if(0!==e.q.subtract(f.ONE).gcd(e.e).compareTo(f.ONE))return e.q=null,void i(e.qBits,a);if(e.p1=e.p.subtract(f.ONE),e.q1=e.q.subtract(f.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(f.ONE))return e.p=e.q=null,void n();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void i(e.qBits,a);var c=e.e.modInverse(e.phi);e.keys={privateKey:d.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:d.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"function"==typeof t&&(r=t,t={}),t=t||{};var s={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(s.prng=t.prng),n()}function s(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=h.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 o(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 c(e){return"undefined"!=typeof window&&"object"==typeof window.crypto&&"object"==typeof window.crypto.subtle&&"function"==typeof window.crypto.subtle[e]}function u(e){return"undefined"!=typeof window&&"object"==typeof window.msCrypto&&"object"==typeof window.msCrypto.subtle&&"function"==typeof window.msCrypto.subtle[e]}function l(e){for(var t=h.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}var h=r(0);if(r(4),r(20),r(10),r(33),r(34),r(3),r(1),void 0===f)var f=h.jsbn.BigInteger;var p=h.asn1;h.pki=h.pki||{},e.exports=h.pki.rsa=h.rsa=h.rsa||{};var d=h.pki,g=[6,4,2,4,2,4,6,2],y={name:"PrivateKeyInfo",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:p.Class.UNIVERSAL,type:p.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:p.Class.UNIVERSAL,type:p.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},v={name:"RSAPrivateKey",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},m={name:"RSAPublicKey",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},C=h.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:p.Class.UNIVERSAL,type:p.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:p.Class.UNIVERSAL,type:p.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},E=function(e){var t;if(!(e.algorithm in d.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=d.oids[e.algorithm];var n=p.oidToDer(t).getBytes(),i=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[]),a=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[]);a.value.push(p.create(p.Class.UNIVERSAL,p.Type.OID,!1,n)),a.value.push(p.create(p.Class.UNIVERSAL,p.Type.NULL,!1,""));var s=p.create(p.Class.UNIVERSAL,p.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(s),p.toDer(i).getBytes()},S=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);t.dP||(t.dP=t.d.mod(t.p.subtract(f.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(f.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var n;do{n=new f(h.util.bytesToHex(h.random.getBytes(t.n.bitLength()/8)),16)}while(n.compareTo(t.n)>=0||!n.gcd(t.n).equals(f.ONE));e=e.multiply(n.modPow(t.e,t.n)).mod(t.n);for(var i=e.mod(t.p).modPow(t.dP,t.p),a=e.mod(t.q).modPow(t.dQ,t.q);i.compareTo(a)<0;)i=i.add(t.p);var s=i.subtract(a).multiply(t.qInv).mod(t.p).multiply(t.q).add(a);return s=s.multiply(n.modInverse(t.n)).mod(t.n)};d.rsa.encrypt=function(e,t,r){var i,a=r,s=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(a=2===r,i=n(e,t,r)):(i=h.util.createBuffer(),i.putBytes(e));for(var o=new f(i.toHex(),16),c=S(o,t,a),u=c.toString(16),l=h.util.createBuffer(),p=s-Math.ceil(u.length/2);p>0;)l.putByte(0),--p;return l.putBytes(h.util.hexToBytes(u)),l.getBytes()},d.rsa.decrypt=function(e,t,r,n){var a=Math.ceil(t.n.bitLength()/8);if(e.length!==a){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=a,s}var o=new f(h.util.createBuffer(e).toHex(),16);if(o.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var c=S(o,t,r),u=c.toString(16),l=h.util.createBuffer(),p=a-Math.ceil(u.length/2);p>0;)l.putByte(0),--p;return l.putBytes(h.util.hexToBytes(u)),!1!==n?i(l.getBytes(),t,r):l.getBytes()},d.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048,r=r||{};var n,i=r.prng||h.random,a={nextBytes:function(e){for(var t=i.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},s=r.algorithm||"PRIMEINC";if("PRIMEINC"!==s)throw new Error("Invalid key generation algorithm: "+s);return n={algorithm:s,state:0,bits:e,rng:a,eInt:t||65537,e:new f(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},n.e.fromInt(n.eInt),n},d.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new f(null);r.fromInt(30);for(var n,i=0,a=function(e,t){return e|t},s=+new Date,c=0;null===e.keys&&(t<=0||c<t);){if(0===e.state){var u=null===e.p?e.pBits:e.qBits,l=u-1;0===e.pqState?(e.num=new f(u,e.rng),e.num.testBit(l)||e.num.bitwiseTo(f.ONE.shiftLeft(l),a,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),i=0,++e.pqState):1===e.pqState?e.num.bitLength()>u?e.pqState=0:e.num.isProbablePrime(o(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(g[i++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(f.ONE).gcd(e.e).compareTo(f.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(f.ONE),e.q1=e.q.subtract(f.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(f.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 h=e.e.modInverse(e.phi);e.keys={privateKey:d.rsa.setPrivateKey(e.n,e.e,h,e.p,e.q,h.mod(e.p1),h.mod(e.q1),e.q.modInverse(e.p)),publicKey:d.rsa.setPublicKey(e.n,e.e)}}n=+new Date,c+=n-s,s=n}return null!==e.keys},d.rsa.generateKeyPair=function(e,t,r,n){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(n=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(n=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,n=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(n=r,r=void 0):(n=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!h.options.usePureJavaScript&&n&&e>=256&&e<=16384&&(65537===t||3===t)){if(c("generateKey")&&c("exportKey"))return window.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:l(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(e){return window.crypto.subtle.exportKey("pkcs8",e.privateKey)}).then(void 0,function(e){n(e)}).then(function(e){if(e){var t=d.privateKeyFromAsn1(p.fromDer(h.util.createBuffer(e)));n(null,{privateKey:t,publicKey:d.setRsaPublicKey(t.n,t.e)})}});if(u("generateKey")&&u("exportKey")){var i=window.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:l(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return i.oncomplete=function(e){var t=e.target.result,r=window.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=d.privateKeyFromAsn1(p.fromDer(h.util.createBuffer(t)));n(null,{privateKey:r,publicKey:d.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){n(e)}},void(i.onerror=function(e){n(e)})}}var s=d.rsa.createKeyPairGenerationState(e,t,r);if(!n)return d.rsa.stepKeyPairGenerationState(s,0),s.keys;a(s,r,n)},d.setRsaPublicKey=d.rsa.setPublicKey=function(e,t){var r={n:e,e:t};return r.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 n(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return h.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 a=t.encode(e,r,!0);return d.rsa.encrypt(a,r,!0)},r.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=i(t,r,!0),e===p.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return t=i(t,r,!0),e===t}});var a=d.rsa.decrypt(t,r,!0,!1);return n.verify(e,a,r.n.bitLength())},r},d.setRsaPrivateKey=d.rsa.setPrivateKey=function(e,t,r,n,a,s,o,c){var u={n:e,e:t,d:r,p:n,q:a,dP:s,dQ:o,qInv:c};return u.decrypt=function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var n=d.rsa.decrypt(e,u,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:i};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return h.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(n,u,!1)},u.sign=function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:E},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,u.n.bitLength());return d.rsa.encrypt(n,u,r)},u},d.wrapRsaPrivateKey=function(e){return p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,p.integerToDer(0).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(d.oids.rsaEncryption).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.NULL,!1,"")]),p.create(p.Class.UNIVERSAL,p.Type.OCTETSTRING,!1,p.toDer(e).getBytes())])},d.privateKeyFromAsn1=function(e){var t={},r=[];if(p.validate(e,y,t,r)&&(e=p.fromDer(h.util.createBuffer(t.privateKey))),t={},r=[],!p.validate(e,v,t,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,a,s,o,c,u,l,g;return i=h.util.createBuffer(t.privateKeyModulus).toHex(),a=h.util.createBuffer(t.privateKeyPublicExponent).toHex(),s=h.util.createBuffer(t.privateKeyPrivateExponent).toHex(),o=h.util.createBuffer(t.privateKeyPrime1).toHex(),c=h.util.createBuffer(t.privateKeyPrime2).toHex(),u=h.util.createBuffer(t.privateKeyExponent1).toHex(),l=h.util.createBuffer(t.privateKeyExponent2).toHex(),g=h.util.createBuffer(t.privateKeyCoefficient).toHex(),d.setRsaPrivateKey(new f(i,16),new f(a,16),new f(s,16),new f(o,16),new f(c,16),new f(u,16),new f(l,16),new f(g,16))},d.privateKeyToAsn1=d.privateKeyToRSAPrivateKey=function(e){return p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,p.integerToDer(0).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,s(e.n)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,s(e.e)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,s(e.d)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,s(e.p)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,s(e.q)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,s(e.dP)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,s(e.dQ)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,s(e.qInv))])},d.publicKeyFromAsn1=function(e){var t={},r=[];if(p.validate(e,C,t,r)){var n=p.derToOid(t.publicKeyOid);if(n!==d.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}e=t.rsaPublicKey}if(r=[],!p.validate(e,m,t,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var a=h.util.createBuffer(t.publicKeyModulus).toHex(),s=h.util.createBuffer(t.publicKeyExponent).toHex();return d.setRsaPublicKey(new f(a,16),new f(s,16))},d.publicKeyToAsn1=d.publicKeyToSubjectPublicKeyInfo=function(e){return p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(d.oids.rsaEncryption).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.NULL,!1,"")]),p.create(p.Class.UNIVERSAL,p.Type.BITSTRING,!1,[d.publicKeyToRSAPublicKey(e)])])},d.publicKeyToRSAPublicKey=function(e){return p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,s(e.n)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,s(e.e))])}},function(e,t,r){!function(n,i,a){e.exports=t=i(r(6),r(55),r(56),r(24),r(59))}(0,function(e){return function(){var t=e,r=t.lib,n=r.BlockCipher,i=t.algo,a=[],s=[],o=[],c=[],u=[],l=[],h=[],f=[],p=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=0,n=0,t=0;t<256;t++){var i=n^n<<1^n<<2^n<<3^n<<4;i=i>>>8^255&i^99,a[r]=i,s[i]=r;var g=e[r],y=e[g],v=e[y],m=257*e[i]^16843008*i;o[r]=m<<24|m>>>8,c[r]=m<<16|m>>>16,u[r]=m<<8|m>>>24,l[r]=m;var m=16843009*v^65537*y^257*g^16843008*r;h[i]=m<<24|m>>>8,f[i]=m<<16|m>>>16,p[i]=m<<8|m>>>24,d[i]=m,r?(r=g^e[e[e[v^g]]],n^=e[e[n]]):r=n=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],y=i.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=this._nRounds=r+6,i=4*(n+1),s=this._keySchedule=[],o=0;o<i;o++)if(o<r)s[o]=t[o];else{var c=s[o-1];o%r?r>6&&o%r==4&&(c=a[c>>>24]<<24|a[c>>>16&255]<<16|a[c>>>8&255]<<8|a[255&c]):(c=c<<8|c>>>24,c=a[c>>>24]<<24|a[c>>>16&255]<<16|a[c>>>8&255]<<8|a[255&c],c^=g[o/r|0]<<24),s[o]=s[o-r]^c}for(var u=this._invKeySchedule=[],l=0;l<i;l++){var o=i-l;if(l%4)var c=s[o];else var c=s[o-4];u[l]=l<4||o<=4?c:h[a[c>>>24]]^f[a[c>>>16&255]]^p[a[c>>>8&255]]^d[a[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,c,u,l,a)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,h,f,p,d,s);var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,a,s,o){for(var c=this._nRounds,u=e[t]^r[0],l=e[t+1]^r[1],h=e[t+2]^r[2],f=e[t+3]^r[3],p=4,d=1;d<c;d++){var g=n[u>>>24]^i[l>>>16&255]^a[h>>>8&255]^s[255&f]^r[p++],y=n[l>>>24]^i[h>>>16&255]^a[f>>>8&255]^s[255&u]^r[p++],v=n[h>>>24]^i[f>>>16&255]^a[u>>>8&255]^s[255&l]^r[p++],m=n[f>>>24]^i[u>>>16&255]^a[l>>>8&255]^s[255&h]^r[p++];u=g,l=y,h=v,f=m}var g=(o[u>>>24]<<24|o[l>>>16&255]<<16|o[h>>>8&255]<<8|o[255&f])^r[p++],y=(o[l>>>24]<<24|o[h>>>16&255]<<16|o[f>>>8&255]<<8|o[255&u])^r[p++],v=(o[h>>>24]<<24|o[f>>>16&255]<<16|o[u>>>8&255]<<8|o[255&l])^r[p++],m=(o[f>>>24]<<24|o[u>>>16&255]<<16|o[l>>>8&255]<<8|o[255&h])^r[p++];e[t]=g,e[t+1]=y,e[t+2]=v,e[t+3]=m},keySize:8});t.AES=n._createHelper(y)}(),e.AES})},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(),e 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){function n(){o=String.fromCharCode(128),o+=a.util.fillString(String.fromCharCode(0),64),c=[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],u=[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],l=new Array(64);for(var e=0;e<64;++e)l[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));h=!0}function i(e,t,r){for(var n,i,a,s,o,h,f,p,d=r.length();d>=64;){for(i=e.h0,a=e.h1,s=e.h2,o=e.h3,p=0;p<16;++p)t[p]=r.getInt32Le(),h=o^a&(s^o),n=i+h+l[p]+t[p],f=u[p],i=o,o=s,s=a,a+=n<<f|n>>>32-f;for(;p<32;++p)h=s^o&(a^s),n=i+h+l[p]+t[c[p]],f=u[p],i=o,o=s,s=a,a+=n<<f|n>>>32-f;for(;p<48;++p)h=a^s^o,n=i+h+l[p]+t[c[p]],f=u[p],i=o,o=s,s=a,a+=n<<f|n>>>32-f;for(;p<64;++p)h=s^(a|~o),n=i+h+l[p]+t[c[p]],f=u[p],i=o,o=s,s=a,a+=n<<f|n>>>32-f;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,d-=64}}var a=r(0);r(5),r(1);var s=e.exports=a.md5=a.md5||{};a.md.md5=a.md.algorithms.md5=s,s.create=function(){h||n();var e=null,t=a.util.createBuffer(),r=new Array(16),s={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return s.start=function(){s.messageLength=0,s.fullMessageLength=s.messageLength64=[];for(var r=s.messageLengthSize/4,n=0;n<r;++n)s.fullMessageLength.push(0);return t=a.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},s},s.start(),s.update=function(n,o){"utf8"===o&&(n=a.util.encodeUtf8(n));var c=n.length;s.messageLength+=c,c=[c/4294967296>>>0,c>>>0];for(var u=s.fullMessageLength.length-1;u>=0;--u)s.fullMessageLength[u]+=c[1],c[1]=c[0]+(s.fullMessageLength[u]/4294967296>>>0),s.fullMessageLength[u]=s.fullMessageLength[u]>>>0,c[0]=c[1]/4294967296>>>0;return t.putBytes(n),i(e,r,t),(t.read>2048||0===t.length())&&t.compact(),s},s.digest=function(){var n=a.util.createBuffer();n.putBytes(t.bytes());var c=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize,u=c&s.blockLength-1;n.putBytes(o.substr(0,s.blockLength-u));for(var l,h=0,f=s.fullMessageLength.length-1;f>=0;--f)l=8*s.fullMessageLength[f]+h,h=l/4294967296>>>0,n.putInt32Le(l>>>0);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};i(p,r,n);var d=a.util.createBuffer();return d.putInt32Le(p.h0),d.putInt32Le(p.h1),d.putInt32Le(p.h2),d.putInt32Le(p.h3),d},s};var o=null,c=null,u=null,l=null,h=!1},function(e,t,r){var n=r(0);r(12),r(5),r(1);var i,a=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(i=r(29)),e.exports=n.pbkdf2=a.pbkdf2=function(e,t,r,a,s,o){function c(){if(C>f)return o(null,m);d.start(null,null),d.update(t),d.update(n.util.int32ToBytes(C)),g=v=d.digest().getBytes(),E=2,u()}function u(){if(E<=r)return d.start(null,null),d.update(v),y=d.digest().getBytes(),g=n.util.xorBytes(g,y,l),v=y,++E,n.util.setImmediate(u);m+=C<f?g:g.substr(0,p),++C,c()}if("function"==typeof s&&(o=s,s=null),n.util.isNodejs&&!n.options.usePureJavaScript&&i.pbkdf2&&(null===s||"object"!=typeof s)&&(i.pbkdf2Sync.length>4||!s||"sha1"===s))return"string"!=typeof s&&(s="sha1"),e=new Buffer(e,"binary"),t=new Buffer(t,"binary"),o?4===i.pbkdf2Sync.length?i.pbkdf2(e,t,r,a,function(e,t){if(e)return o(e);o(null,t.toString("binary"))}):i.pbkdf2(e,t,r,a,s,function(e,t){if(e)return o(e);o(null,t.toString("binary"))}):4===i.pbkdf2Sync.length?i.pbkdf2Sync(e,t,r,a).toString("binary"):i.pbkdf2Sync(e,t,r,a,s).toString("binary");if(void 0!==s&&null!==s||(s="sha1"),"string"==typeof s){if(!(s in n.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=n.md[s].create()}var l=s.digestLength;if(a>4294967295*l){var h=new Error("Derived key is too long.");if(o)return o(h);throw h}var f=Math.ceil(a/l),p=a-(f-1)*l,d=n.hmac.create();d.start(s,e);var g,y,v,m="";if(!o){for(var C=1;C<=f;++C){d.start(null,null),d.update(t),d.update(n.util.int32ToBytes(C)),g=v=d.digest().getBytes();for(var E=2;E<=r;++E)d.start(null,null),d.update(v),y=d.digest().getBytes(),g=n.util.xorBytes(g,y,l),v=y;m+=C<f?g:g.substr(0,p)}return m}var E,C=1;c()}},function(e,t,r){function n(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 i(){return new n(null)}function a(e,t,r,n,i,a){for(;--a>=0;){var s=t*this.data[e++]+r.data[n]+i;i=Math.floor(s/67108864),r.data[n++]=67108863&s}return i}function s(e,t,r,n,i,a){for(var s=32767&t,o=t>>15;--a>=0;){var c=32767&this.data[e],u=this.data[e++]>>15,l=o*c+u*s;c=s*c+((32767&l)<<15)+r.data[n]+(1073741823&i),i=(c>>>30)+(l>>>15)+o*u+(i>>>30),r.data[n++]=1073741823&c}return i}function o(e,t,r,n,i,a){for(var s=16383&t,o=t>>14;--a>=0;){var c=16383&this.data[e],u=this.data[e++]>>14,l=o*c+u*s;c=s*c+((16383&l)<<14)+r.data[n]+i,i=(c>>28)+(l>>14)+o*u,r.data[n++]=268435455&c}return i}function c(e){return at.charAt(e)}function u(e,t){var r=st[e.charCodeAt(t)];return null==r?-1:r}function l(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function h(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}function f(e){var t=i();return t.fromInt(e),t}function p(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 i=e.length,a=!1,s=0;--i>=0;){var o=8==r?255&e[i]:u(e,i);o<0?"-"==e.charAt(i)&&(a=!0):(a=!1,0==s?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this.data[this.t++]=o>>this.DB-s):this.data[this.t-1]|=o<<s,(s+=r)>=this.DB&&(s-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),a&&n.ZERO.subTo(this,this)}function d(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function g(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,a="",s=this.t,o=this.DB-s*this.DB%t;if(s-- >0)for(o<this.DB&&(r=this.data[s]>>o)>0&&(i=!0,a=c(r));s>=0;)o<t?(r=(this.data[s]&(1<<o)-1)<<t-o,r|=this.data[--s]>>(o+=this.DB-t)):(r=this.data[s]>>(o-=t)&n,o<=0&&(o+=this.DB,--s)),r>0&&(i=!0),i&&(a+=c(r));return i?a:"0"}function y(){var e=i();return n.ZERO.subTo(this,e),e}function v(){return this.s<0?this.negate():this}function m(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}function C(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 E(){return this.t<=0?0:this.DB*(this.t-1)+C(this.data[this.t-1]^this.s&this.DM)}function S(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}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}function b(e,t){var r,n=e%this.DB,i=this.DB-n,a=(1<<i)-1,s=Math.floor(e/this.DB),o=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+s+1]=this.data[r]>>i|o,o=(this.data[r]&a)<<n;for(r=s-1;r>=0;--r)t.data[r]=0;t.data[s]=o,t.t=this.t+s+1,t.s=this.s,t.clamp()}function T(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)return void(t.t=0);var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var s=r+1;s<this.t;++s)t.data[s-r-1]|=(this.data[s]&a)<<i,t.data[s-r]=this.data[s]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}function B(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()}function I(e,t){var r=this.abs(),i=e.abs(),a=r.t;for(t.t=a+i.t;--a>=0;)t.data[a]=0;for(a=0;a<i.t;++a)t.data[a+r.t]=r.am(0,i.data[a],t,a,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&n.ZERO.subTo(t,t)}function A(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()}function w(e,t,r){var a=e.abs();if(!(a.t<=0)){var s=this.abs();if(s.t<a.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=i());var o=i(),c=this.s,u=e.s,l=this.DB-C(a.data[a.t-1]);l>0?(a.lShiftTo(l,o),s.lShiftTo(l,r)):(a.copyTo(o),s.copyTo(r));var h=o.t,f=o.data[h-1];if(0!=f){var p=f*(1<<this.F1)+(h>1?o.data[h-2]>>this.F2:0),d=this.FV/p,g=(1<<this.F1)/p,y=1<<this.F2,v=r.t,m=v-h,E=null==t?i():t;for(o.dlShiftTo(m,E),r.compareTo(E)>=0&&(r.data[r.t++]=1,r.subTo(E,r)),n.ONE.dlShiftTo(h,E),E.subTo(o,o);o.t<h;)o.data[o.t++]=0;for(;--m>=0;){var S=r.data[--v]==f?this.DM:Math.floor(r.data[v]*d+(r.data[v-1]+y)*g);if((r.data[v]+=o.am(0,S,r,m,0,h))<S)for(o.dlShiftTo(m,E),r.subTo(E,r);r.data[v]<--S;)r.subTo(E,r)}null!=t&&(r.drShiftTo(h,t),c!=u&&n.ZERO.subTo(t,t)),r.t=h,r.clamp(),l>0&&r.rShiftTo(l,r),c<0&&n.ZERO.subTo(r,r)}}}function k(e){var t=i();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(n.ZERO)>0&&e.subTo(t,t),t}function N(e){this.m=e}function R(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function L(e){return e}function D(e){e.divRemTo(this.m,null,e)}function U(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function x(e,t){e.squareTo(t),this.reduce(t)}function P(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return t=t*(2-(15&e)*t)&15,t=t*(2-(255&e)*t)&255,t=t*(2-((65535&e)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function O(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 V(e){var t=i();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(n.ZERO)>0&&this.m.subTo(t,t),t}function K(e){var t=i();return e.copyTo(t),this.reduce(t),t}function M(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)}function F(e,t){e.squareTo(t),this.reduce(t)}function z(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function j(){return 0==(this.t>0?1&this.data[0]:this.s)}function H(e,t){if(e>4294967295||e<1)return n.ONE;var r=i(),a=i(),s=t.convert(this),o=C(e)-1;for(s.copyTo(r);--o>=0;)if(t.sqrTo(r,a),(e&1<<o)>0)t.mulTo(a,s,r);else{var c=r;r=a,a=c}return t.revert(r)}function q(e,t){var r;return r=e<256||t.isEven()?new N(t):new O(t),this.exp(e,r)}function G(){var e=i();return this.copyTo(e),e}function Q(){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]}function W(){return 0==this.t?this.s:this.data[0]<<24>>24}function X(){return 0==this.t?this.s:this.data[0]<<16>>16}function Z(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function Y(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1}function J(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),a=i(),s=i(),o="";for(this.divRemTo(n,a,s);a.signum()>0;)o=(r+s.intValue()).toString(e).substr(1)+o,a.divRemTo(n,a,s);return s.intValue().toString(e)+o}function $(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),i=Math.pow(t,r),a=!1,s=0,o=0,c=0;c<e.length;++c){var l=u(e,c);l<0?"-"==e.charAt(c)&&0==this.signum()&&(a=!0):(o=t*o+l,++s>=r&&(this.dMultiply(i),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(o,0)),a&&n.ZERO.subTo(this,this)}function ee(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(n.ONE.shiftLeft(e-1),ce,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(n.ONE.shiftLeft(e-1),this);else{var i=new Array,a=7&e;i.length=1+(e>>3),t.nextBytes(i),a>0?i[0]&=(1<<a)-1:i[0]=0,this.fromString(i,256)}}function te(){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}function re(e){return 0==this.compareTo(e)}function ne(e){return this.compareTo(e)<0?this:e}function ie(e){return this.compareTo(e)>0?this:e}function ae(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;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()}function se(e,t){return e&t}function oe(e){var t=i();return this.bitwiseTo(e,se,t),t}function ce(e,t){return e|t}function ue(e){var t=i();return this.bitwiseTo(e,ce,t),t}function le(e,t){return e^t}function he(e){var t=i();return this.bitwiseTo(e,le,t),t}function fe(e,t){return e&~t}function pe(e){var t=i();return this.bitwiseTo(e,fe,t),t}function de(){for(var e=i(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function ge(e){var t=i();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function ye(e){var t=i();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function ve(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 me(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+ve(this.data[e]);return this.s<0?this.t*this.DB:-1}function Ce(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function Ee(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=Ce(this.data[r]^t);return e}function Se(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this.data[t]&1<<e%this.DB)}function _e(e,t){var r=n.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function be(e){return this.changeBit(e,ce)}function Te(e){return this.changeBit(e,fe)}function Be(e){return this.changeBit(e,le)}function Ie(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()}function Ae(e){var t=i();return this.addTo(e,t),t}function we(e){var t=i();return this.subTo(e,t),t}function ke(e){var t=i();return this.multiplyTo(e,t),t}function Ne(e){var t=i();return this.divRemTo(e,t,null),t}function Re(e){var t=i();return this.divRemTo(e,null,t),t}function Le(e){var t=i(),r=i();return this.divRemTo(e,t,r),new Array(t,r)}function De(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function Ue(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]}}function xe(){}function Pe(e){return e}function Oe(e,t,r){e.multiplyTo(t,r)}function Ve(e,t){e.squareTo(t)}function Ke(e){return this.exp(e,new xe)}function Me(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n<i;++n)r.data[n+this.t]=this.am(0,e.data[n],r,n,0,this.t);for(i=Math.min(e.t,t);n<i;++n)this.am(0,e.data[n],r,n,0,t-n);r.clamp()}function Fe(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)}function ze(e){this.r2=i(),this.q3=i(),n.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function je(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=i();return e.copyTo(t),this.reduce(t),t}function He(e){return e}function qe(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)}function Ge(e,t){e.squareTo(t),this.reduce(t)}function Qe(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function We(e,t){var r,n,a=e.bitLength(),s=f(1);if(a<=0)return s;r=a<18?1:a<48?3:a<144?4:a<768?5:6,n=a<8?new N(t):t.isEven()?new ze(t):new O(t);var o=new Array,c=3,u=r-1,l=(1<<r)-1;if(o[1]=n.convert(this),r>1){var h=i();for(n.sqrTo(o[1],h);c<=l;)o[c]=i(),n.mulTo(h,o[c-2],o[c]),c+=2}var p,d,g=e.t-1,y=!0,v=i();for(a=C(e.data[g])-1;g>=0;){for(a>=u?p=e.data[g]>>a-u&l:(p=(e.data[g]&(1<<a+1)-1)<<u-a,g>0&&(p|=e.data[g-1]>>this.DB+a-u)),c=r;0==(1&p);)p>>=1,--c;if((a-=c)<0&&(a+=this.DB,--g),y)o[p].copyTo(s),y=!1;else{for(;c>1;)n.sqrTo(s,v),n.sqrTo(v,s),c-=2;c>0?n.sqrTo(s,v):(d=s,s=v,v=d),n.mulTo(v,o[p],s)}for(;g>=0&&0==(e.data[g]&1<<a);)n.sqrTo(s,v),d=s,s=v,v=d,--a<0&&(a=this.DB-1,--g)}return n.revert(s)}function Xe(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(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,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 a>0&&r.lShiftTo(a,r),r}function Ze(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}function Ye(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return n.ZERO;for(var r=e.clone(),i=this.clone(),a=f(1),s=f(0),o=f(0),c=f(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(a.isEven()&&s.isEven()||(a.addTo(this,a),s.subTo(e,s)),a.rShiftTo(1,a)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;i.isEven();)i.rShiftTo(1,i),t?(o.isEven()&&c.isEven()||(o.addTo(this,o),c.subTo(e,c)),o.rShiftTo(1,o)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);r.compareTo(i)>=0?(r.subTo(i,r),t&&a.subTo(o,a),s.subTo(c,s)):(i.subTo(r,i),t&&o.subTo(a,o),c.subTo(s,c))}return 0!=i.compareTo(n.ONE)?n.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c}function Je(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=ot[ot.length-1]){for(t=0;t<ot.length;++t)if(r.data[0]==ot[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<ot.length;){for(var n=ot[t],i=t+1;i<ot.length&&n<ct;)n*=ot[i++];for(n=r.modInt(n);t<i;)if(n%ot[t++]==0)return!1}return r.millerRabin(e)}function $e(e){var t=this.subtract(n.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var i,a=t.shiftRight(r),s=et(),o=0;o<e;++o){do{i=new n(this.bitLength(),s)}while(i.compareTo(n.ONE)<=0||i.compareTo(t)>=0);var c=i.modPow(a,this);if(0!=c.compareTo(n.ONE)&&0!=c.compareTo(t)){for(var u=1;u++<r&&0!=c.compareTo(t);)if(c=c.modPowInt(2,this),0==c.compareTo(n.ONE))return!1;if(0!=c.compareTo(t))return!1}}return!0}function et(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}}}var tt=r(0);e.exports=tt.jsbn=tt.jsbn||{};var rt;tt.jsbn.BigInteger=n,"undefined"==typeof navigator?(n.prototype.am=o,rt=28):"Microsoft Internet Explorer"==navigator.appName?(n.prototype.am=s,rt=30):"Netscape"!=navigator.appName?(n.prototype.am=a,rt=26):(n.prototype.am=o,rt=28),n.prototype.DB=rt,n.prototype.DM=(1<<rt)-1,n.prototype.DV=1<<rt;n.prototype.FV=Math.pow(2,52),n.prototype.F1=52-rt,n.prototype.F2=2*rt-52;var nt,it,at="0123456789abcdefghijklmnopqrstuvwxyz",st=new Array;for(nt="0".charCodeAt(0),it=0;it<=9;++it)st[nt++]=it;for(nt="a".charCodeAt(0),it=10;it<36;++it)st[nt++]=it;for(nt="A".charCodeAt(0),it=10;it<36;++it)st[nt++]=it;N.prototype.convert=R,N.prototype.revert=L,N.prototype.reduce=D,N.prototype.mulTo=U,N.prototype.sqrTo=x,O.prototype.convert=V,O.prototype.revert=K,O.prototype.reduce=M,O.prototype.mulTo=z,O.prototype.sqrTo=F,n.prototype.copyTo=l,n.prototype.fromInt=h,n.prototype.fromString=p,n.prototype.clamp=d,n.prototype.dlShiftTo=S,n.prototype.drShiftTo=_,n.prototype.lShiftTo=b,n.prototype.rShiftTo=T,n.prototype.subTo=B,n.prototype.multiplyTo=I,n.prototype.squareTo=A,n.prototype.divRemTo=w,n.prototype.invDigit=P,n.prototype.isEven=j,n.prototype.exp=H,n.prototype.toString=g,n.prototype.negate=y,n.prototype.abs=v,n.prototype.compareTo=m,n.prototype.bitLength=E,n.prototype.mod=k,n.prototype.modPowInt=q,n.ZERO=f(0),n.ONE=f(1),xe.prototype.convert=Pe,xe.prototype.revert=Pe,xe.prototype.mulTo=Oe,xe.prototype.sqrTo=Ve,ze.prototype.convert=je,ze.prototype.revert=He,ze.prototype.reduce=qe,ze.prototype.mulTo=Qe,ze.prototype.sqrTo=Ge;var ot=[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],ct=(1<<26)/ot[ot.length-1];n.prototype.chunkSize=Z,n.prototype.toRadix=J,n.prototype.fromRadix=$,n.prototype.fromNumber=ee,n.prototype.bitwiseTo=ae,n.prototype.changeBit=_e,n.prototype.addTo=Ie,n.prototype.dMultiply=De,n.prototype.dAddOffset=Ue,n.prototype.multiplyLowerTo=Me,n.prototype.multiplyUpperTo=Fe,n.prototype.modInt=Ze,n.prototype.millerRabin=$e,n.prototype.clone=G,n.prototype.intValue=Q,n.prototype.byteValue=W,n.prototype.shortValue=X,n.prototype.signum=Y,n.prototype.toByteArray=te,n.prototype.equals=re,n.prototype.min=ne,n.prototype.max=ie,n.prototype.and=oe,n.prototype.or=ue,n.prototype.xor=he,n.prototype.andNot=pe,n.prototype.not=de,n.prototype.shiftLeft=ge,n.prototype.shiftRight=ye,n.prototype.getLowestSetBit=me,n.prototype.bitCount=Ee,n.prototype.testBit=Se,n.prototype.setBit=be,n.prototype.clearBit=Te,n.prototype.flipBit=Be,n.prototype.add=Ae,n.prototype.subtract=we,n.prototype.multiply=ke,n.prototype.divide=Ne,n.prototype.remainder=Re,n.prototype.divideAndRemainder=Le,n.prototype.modPow=We,n.prototype.modInverse=Ye,n.prototype.pow=Ke,n.prototype.gcd=Xe,n.prototype.isProbablePrime=Je},function(e,t,r){function n(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?n=r:t.name&&t.name===r.name?n=r:t.shortName&&t.shortName===r.shortName&&(n=r);return n}function i(e){for(var t,r,n=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[]),i=e.attributes,a=0;a<i.length;++a){t=i[a];var s=t.value,o=l.Type.PRINTABLESTRING;"valueTagClass"in t&&(o=t.valueTagClass)===l.Type.UTF8&&(s=u.util.encodeUtf8(s)),r=l.create(l.Class.UNIVERSAL,l.Type.SET,!0,[l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(t.type).getBytes()),l.create(l.Class.UNIVERSAL,o,!1,s)])]),n.value.push(r)}return n}function a(e){for(var t,r=0;r<e.length;++r){if(t=e[r],void 0===t.name&&(t.type&&t.type in h.oids?t.name=h.oids[t.type]:t.shortName&&t.shortName in p&&(t.name=h.oids[p[t.shortName]])),void 0===t.type){if(!(t.name&&t.name in h.oids)){var n=new Error("Attribute type not specified.");throw n.attribute=t,n}t.type=h.oids[t.name]}if(void 0===t.shortName&&t.name&&t.name in p&&(t.shortName=p[t.name]),t.type===f.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=l.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var i=0;i<t.extensions.length;++i)t.value.push(h.certificateExtensionToAsn1(s(t.extensions[i])))}if(void 0===t.value){var n=new Error("Attribute value not specified.");throw n.attribute=t,n}}}function s(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in h.oids&&(e.name=h.oids[e.id]),void 0===e.id){if(!(e.name&&e.name in h.oids)){var r=new Error("Extension ID not specified.");throw r.extension=e,r}e.id=h.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var n=0,a=0,s=0;e.digitalSignature&&(a|=128,n=7),e.nonRepudiation&&(a|=64,n=6),e.keyEncipherment&&(a|=32,n=5),e.dataEncipherment&&(a|=16,n=4),e.keyAgreement&&(a|=8,n=3),e.keyCertSign&&(a|=4,n=2),e.cRLSign&&(a|=2,n=1),e.encipherOnly&&(a|=1,n=0),e.decipherOnly&&(s|=128,n=7);var o=String.fromCharCode(n);0!==s?o+=String.fromCharCode(a)+String.fromCharCode(s):0!==a&&(o+=String.fromCharCode(a)),e.value=l.create(l.Class.UNIVERSAL,l.Type.BITSTRING,!1,o)}else if("basicConstraints"===e.name)e.value=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(l.create(l.Class.UNIVERSAL,l.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(l.create(l.Class.UNIVERSAL,l.Type.INTEGER,!1,l.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[]);var c=e.value.value;for(var p in e)!0===e[p]&&(p in f?c.push(l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(f[p]).getBytes())):-1!==p.indexOf(".")&&c.push(l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(p).getBytes())))}else if("nsCertType"===e.name){var n=0,a=0;e.client&&(a|=128,n=7),e.server&&(a|=64,n=6),e.email&&(a|=32,n=5),e.objsign&&(a|=16,n=4),e.reserved&&(a|=8,n=3),e.sslCA&&(a|=4,n=2),e.emailCA&&(a|=2,n=1),e.objCA&&(a|=1,n=0);var o=String.fromCharCode(n);0!==a&&(o+=String.fromCharCode(a)),e.value=l.create(l.Class.UNIVERSAL,l.Type.BITSTRING,!1,o)}else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[]);for(var d,g=0;g<e.altNames.length;++g){d=e.altNames[g];var o=d.value;if(7===d.type&&d.ip){if(null===(o=u.util.bytesFromIP(d.ip))){var r=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw r.extension=e,r}}else 8===d.type&&(o=d.oid?l.oidToDer(l.oidToDer(d.oid)):l.oidToDer(o));e.value.value.push(l.create(l.Class.CONTEXT_SPECIFIC,d.type,!1,o))}}else if("subjectKeyIdentifier"===e.name&&t.cert){var y=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=y.toHex(),e.value=l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,y.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[]);var c=e.value.value;if(e.keyIdentifier){var v=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;c.push(l.create(l.Class.CONTEXT_SPECIFIC,0,!1,v))}if(e.authorityCertIssuer){var m=[l.create(l.Class.CONTEXT_SPECIFIC,4,!0,[i(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];c.push(l.create(l.Class.CONTEXT_SPECIFIC,1,!0,m))}if(e.serialNumber){var C=u.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);c.push(l.create(l.Class.CONTEXT_SPECIFIC,2,!1,C))}}else if("cRLDistributionPoints"===e.name){e.value=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[]);for(var d,c=e.value.value,E=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[]),S=l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[]),g=0;g<e.altNames.length;++g){d=e.altNames[g];var o=d.value;if(7===d.type&&d.ip){if(null===(o=u.util.bytesFromIP(d.ip))){var r=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw r.extension=e,r}}else 8===d.type&&(o=d.oid?l.oidToDer(l.oidToDer(d.oid)):l.oidToDer(o));S.value.push(l.create(l.Class.CONTEXT_SPECIFIC,d.type,!1,o))}E.value.push(l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[S])),c.push(E)}if(void 0===e.value){var r=new Error("Extension value not specified.");throw r.extension=e,r}return e}function o(e,t){switch(e){case f["RSASSA-PSS"]:var r=[];return void 0!==t.hash.algorithmOid&&r.push(l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(t.hash.algorithmOid).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&r.push(l.create(l.Class.CONTEXT_SPECIFIC,1,!0,[l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(t.mgf.algorithmOid).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(t.mgf.hash.algorithmOid).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&r.push(l.create(l.Class.CONTEXT_SPECIFIC,2,!0,[l.create(l.Class.UNIVERSAL,l.Type.INTEGER,!1,l.integerToDer(t.saltLength).getBytes())])),l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,r);default:return l.create(l.Class.UNIVERSAL,l.Type.NULL,!1,"")}}function c(e){var t=l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,n=0;n<r.length;++n){var i=r[n],a=i.value,s=l.Type.UTF8;"valueTagClass"in i&&(s=i.valueTagClass),s===l.Type.UTF8&&(a=u.util.encodeUtf8(a));var o=!1;"valueConstructed"in i&&(o=i.valueConstructed);var c=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(i.type).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.SET,!0,[l.create(l.Class.UNIVERSAL,s,o,a)])]);t.value.push(c)}return t}var u=r(0);r(9),r(4),r(14),r(5),r(62),r(10),r(11),r(22),r(15),r(1);var l=u.asn1,h=e.exports=u.pki=u.pki||{},f=h.oids,p={};p.CN=f.commonName,p.commonName="CN",p.C=f.countryName,p.countryName="C",p.L=f.localityName,p.localityName="L",p.ST=f.stateOrProvinceName,p.stateOrProvinceName="ST",p.O=f.organizationName,p.organizationName="O",p.OU=f.organizationalUnitName,p.organizationalUnitName="OU",p.E=f.emailAddress,p.emailAddress="E";var d=u.pki.rsa.publicKeyValidator,g={name:"Certificate",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:l.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:l.Class.UNIVERSAL,type:l.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:l.Class.UNIVERSAL,type:l.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:l.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:l.Class.UNIVERSAL,type:l.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:l.Class.UNIVERSAL,type:l.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:l.Class.UNIVERSAL,type:l.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:l.Class.UNIVERSAL,type:l.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},d,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:l.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:l.Class.UNIVERSAL,type:l.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:l.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:l.Class.UNIVERSAL,type:l.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:l.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:l.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:l.Class.UNIVERSAL,type:l.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},y={name:"rsapss",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:l.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:l.Class.UNIVERSAL,type:l.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:l.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:l.Class.UNIVERSAL,type:l.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:l.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:l.Class.UNIVERSAL,type:l.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:l.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:l.Class.UNIVERSAL,type:l.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},v={name:"CertificationRequestInfo",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:l.Class.UNIVERSAL,type:l.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},d,{name:"CertificationRequestInfo.attributes",tagClass:l.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:l.Class.UNIVERSAL,type:l.Type.SET,constructed:!0}]}]}]},m={name:"CertificationRequest",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[v,{name:"CertificationRequest.signatureAlgorithm",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:l.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:l.Class.UNIVERSAL,type:l.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};h.RDNAttributesAsArray=function(e,t){for(var r,n,i,a=[],s=0;s<e.value.length;++s){r=e.value[s];for(var o=0;o<r.value.length;++o)i={},n=r.value[o],i.type=l.derToOid(n.value[0].value),i.value=n.value[1].value,i.valueTagClass=n.value[1].type,i.type in f&&(i.name=f[i.type],i.name in p&&(i.shortName=p[i.name])),t&&(t.update(i.type),t.update(i.value)),a.push(i)}return a},h.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var n=e[r],i=l.derToOid(n.value[0].value),a=n.value[1].value,s=0;s<a.length;++s){var o={};if(o.type=i,o.value=a[s].value,o.valueTagClass=a[s].type,o.type in f&&(o.name=f[o.type],o.name in p&&(o.shortName=p[o.name])),o.type===f.extensionRequest){o.extensions=[];for(var c=0;c<o.value.length;++c)o.extensions.push(h.certificateExtensionFromAsn1(o.value[c]))}t.push(o)}return t};var C=function(e,t,r){var n={};if(e!==f["RSASSA-PSS"])return n;r&&(n={hash:{algorithmOid:f.sha1},mgf:{algorithmOid:f.mgf1,hash:{algorithmOid:f.sha1}},saltLength:20});var i={},a=[];if(!l.validate(t,y,i,a)){var s=new Error("Cannot read RSASSA-PSS parameter block.");throw s.errors=a,s}return void 0!==i.hashOid&&(n.hash=n.hash||{},n.hash.algorithmOid=l.derToOid(i.hashOid)),void 0!==i.maskGenOid&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=l.derToOid(i.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=l.derToOid(i.maskGenHashOid)),void 0!==i.saltLength&&(n.saltLength=i.saltLength.charCodeAt(0)),n};h.certificateFromPem=function(e,t,r){var n=u.pem.decode(e)[0];if("CERTIFICATE"!==n.type&&"X509 CERTIFICATE"!==n.type&&"TRUSTED CERTIFICATE"!==n.type){var i=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw i.headerType=n.type,i}if(n.procType&&"ENCRYPTED"===n.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var a=l.fromDer(n.body,r);return h.certificateFromAsn1(a,t)},h.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:l.toDer(h.certificateToAsn1(e)).getBytes()};return u.pem.encode(r,{maxline:t})},h.publicKeyFromPem=function(e){var t=u.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 n=l.fromDer(t.body);return h.publicKeyFromAsn1(n)},h.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:l.toDer(h.publicKeyToAsn1(e)).getBytes()};return u.pem.encode(r,{maxline:t})},h.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:l.toDer(h.publicKeyToRSAPublicKey(e)).getBytes()};return u.pem.encode(r,{maxline:t})},h.getPublicKeyFingerprint=function(e,t){t=t||{};var r,n=t.md||u.md.sha1.create(),i=t.type||"RSAPublicKey";switch(i){case"RSAPublicKey":r=l.toDer(h.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":r=l.toDer(h.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}n.start(),n.update(r);var a=n.digest();if("hex"===t.encoding){var s=a.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}if("binary"===t.encoding)return a.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return a},h.certificationRequestFromPem=function(e,t,r){var n=u.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==n.type){var i=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw i.headerType=n.type,i}if(n.procType&&"ENCRYPTED"===n.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var a=l.fromDer(n.body,r);return h.certificationRequestFromAsn1(a,t)},h.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:l.toDer(h.certificationRequestToAsn1(e)).getBytes()};return u.pem.encode(r,{maxline:t})},h.createCertificate=function(){var e={};return e.version=2,e.serialNumber="00",e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return n(e.issuer,t)},e.issuer.addField=function(t){a([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return n(e.subject,t)},e.subject.addField=function(t){a([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){a(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){a(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)s(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?n=r:t.name&&r.name===t.name&&(n=r);return n},e.sign=function(t,r){e.md=r||u.md.sha1.create();var n=f[e.md.algorithm+"WithRSAEncryption"];if(!n){var i=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=n,e.tbsCertificate=h.getTBSCertificate(e);var a=l.toDer(e.tbsCertificate);e.md.update(a.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var n=t.issuer,i=e.subject,a=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw a.expectedIssuer=n.attributes,a.actualIssuer=i.attributes,a}var s=t.md;if(null===s){if(t.signatureOid in f){switch(f[t.signatureOid]){case"sha1WithRSAEncryption":s=u.md.sha1.create();break;case"md5WithRSAEncryption":s=u.md.md5.create();break;case"sha256WithRSAEncryption":s=u.md.sha256.create();break;case"sha512WithRSAEncryption":s=u.md.sha512.create();break;case"RSASSA-PSS":s=u.md.sha256.create()}}if(null===s){var a=new Error("Could not compute certificate digest. Unknown signature OID.");throw a.signatureOid=t.signatureOid,a}var o=t.tbsCertificate||h.getTBSCertificate(t),c=l.toDer(o);s.update(c.getBytes())}if(null!==s){var p;switch(t.signatureOid){case f.sha1WithRSAEncryption:p=void 0;break;case f["RSASSA-PSS"]:var d,g;if(void 0===(d=f[t.signatureParameters.mgf.hash.algorithmOid])||void 0===u.md[d]){var a=new Error("Unsupported MGF hash function.");throw a.oid=t.signatureParameters.mgf.hash.algorithmOid,a.name=d,a}if(void 0===(g=f[t.signatureParameters.mgf.algorithmOid])||void 0===u.mgf[g]){var a=new Error("Unsupported MGF function.");throw a.oid=t.signatureParameters.mgf.algorithmOid,a.name=g,a}if(g=u.mgf[g].create(u.md[d].create()),void 0===(d=f[t.signatureParameters.hash.algorithmOid])||void 0===u.md[d])throw{message:"Unsupported RSASSA-PSS hash function.",oid:t.signatureParameters.hash.algorithmOid,name:d};p=u.pss.create(u.md[d].create(),g,t.signatureParameters.saltLength)}r=e.publicKey.verify(s.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){r=!0;for(var a,s,o=0;r&&o<n.attributes.length;++o)a=n.attributes[o],s=i.attributes[o],a.type===s.type&&a.value===s.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return h.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=f.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var n=e.extensions[r];if(n.id===t){var i=e.generateSubjectKeyIdentifier().getBytes();return u.util.hexToBytes(n.subjectKeyIdentifier)===i}}return!1},e},h.certificateFromAsn1=function(e,t){var r={},i=[];if(!l.validate(e,g,r,i)){var s=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw s.errors=i,s}var o=l.derToOid(r.publicKeyOid);if(o!==h.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var c=h.createCertificate();c.version=r.certVersion?r.certVersion.charCodeAt(0):0;var p=u.util.createBuffer(r.certSerialNumber);c.serialNumber=p.toHex(),c.signatureOid=u.asn1.derToOid(r.certSignatureOid),c.signatureParameters=C(c.signatureOid,r.certSignatureParams,!0),c.siginfo.algorithmOid=u.asn1.derToOid(r.certinfoSignatureOid),c.siginfo.parameters=C(c.siginfo.algorithmOid,r.certinfoSignatureParams,!1),c.signature=r.certSignature;var d=[];if(void 0!==r.certValidity1UTCTime&&d.push(l.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&d.push(l.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&d.push(l.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&d.push(l.generalizedTimeToDate(r.certValidity4GeneralizedTime)),d.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(d.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=d[0],c.validity.notAfter=d[1],c.tbsCertificate=r.tbsCertificate,t){if(c.md=null,c.signatureOid in f){var o=f[c.signatureOid];switch(o){case"sha1WithRSAEncryption":c.md=u.md.sha1.create();break;case"md5WithRSAEncryption":c.md=u.md.md5.create();break;case"sha256WithRSAEncryption":c.md=u.md.sha256.create();break;case"sha512WithRSAEncryption":c.md=u.md.sha512.create();break;case"RSASSA-PSS":c.md=u.md.sha256.create()}}if(null===c.md){var s=new Error("Could not compute certificate digest. Unknown signature OID.");throw s.signatureOid=c.signatureOid,s}var y=l.toDer(c.tbsCertificate);c.md.update(y.getBytes())}var v=u.md.sha1.create();c.issuer.getField=function(e){return n(c.issuer,e)},c.issuer.addField=function(e){a([e]),c.issuer.attributes.push(e)},c.issuer.attributes=h.RDNAttributesAsArray(r.certIssuer,v),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=v.digest().toHex();var m=u.md.sha1.create();return c.subject.getField=function(e){return n(c.subject,e)},c.subject.addField=function(e){a([e]),c.subject.attributes.push(e)},c.subject.attributes=h.RDNAttributesAsArray(r.certSubject,m),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=h.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=h.publicKeyFromAsn1(r.subjectPublicKeyInfo),c},h.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(h.certificateExtensionFromAsn1(n.value[i]));return t},h.certificateExtensionFromAsn1=function(e){var t={};if(t.id=l.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===l.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 f)if(t.name=f[t.id],"keyUsage"===t.name){var r=l.fromDer(t.value),n=0,i=0;r.value.length>1&&(n=r.value.charCodeAt(1),i=r.value.length>2?r.value.charCodeAt(2):0),t.digitalSignature=128==(128&n),t.nonRepudiation=64==(64&n),t.keyEncipherment=32==(32&n),t.dataEncipherment=16==(16&n),t.keyAgreement=8==(8&n),t.keyCertSign=4==(4&n),t.cRLSign=2==(2&n),t.encipherOnly=1==(1&n),t.decipherOnly=128==(128&i)}else if("basicConstraints"===t.name){var r=l.fromDer(t.value);r.value.length>0&&r.value[0].type===l.Type.BOOLEAN?t.cA=0!==r.value[0].value.charCodeAt(0):t.cA=!1;var a=null;r.value.length>0&&r.value[0].type===l.Type.INTEGER?a=r.value[0].value:r.value.length>1&&(a=r.value[1].value),null!==a&&(t.pathLenConstraint=l.derToInteger(a))}else if("extKeyUsage"===t.name)for(var r=l.fromDer(t.value),s=0;s<r.value.length;++s){var o=l.derToOid(r.value[s].value);o in f?t[f[o]]=!0:t[o]=!0}else if("nsCertType"===t.name){var r=l.fromDer(t.value),n=0;r.value.length>1&&(n=r.value.charCodeAt(1)),t.client=128==(128&n),t.server=64==(64&n),t.email=32==(32&n),t.objsign=16==(16&n),t.reserved=8==(8&n),t.sslCA=4==(4&n),t.emailCA=2==(2&n),t.objCA=1==(1&n)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){t.altNames=[];for(var c,r=l.fromDer(t.value),h=0;h<r.value.length;++h){c=r.value[h];var p={type:c.type,value:c.value};switch(t.altNames.push(p),c.type){case 1:case 2:case 6:break;case 7:p.ip=u.util.bytesToIP(c.value);break;case 8:p.oid=l.derToOid(c.value)}}}else if("subjectKeyIdentifier"===t.name){var r=l.fromDer(t.value);t.subjectKeyIdentifier=u.util.bytesToHex(r.value)}return t},h.certificationRequestFromAsn1=function(e,t){var r={},i=[];if(!l.validate(e,m,r,i)){var s=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw s.errors=i,s}var o=l.derToOid(r.publicKeyOid);if(o!==h.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var c=h.createCertificationRequest();if(c.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,c.signatureOid=u.asn1.derToOid(r.csrSignatureOid),c.signatureParameters=C(c.signatureOid,r.csrSignatureParams,!0),c.siginfo.algorithmOid=u.asn1.derToOid(r.csrSignatureOid),c.siginfo.parameters=C(c.siginfo.algorithmOid,r.csrSignatureParams,!1),c.signature=r.csrSignature,c.certificationRequestInfo=r.certificationRequestInfo,t){if(c.md=null,c.signatureOid in f){var o=f[c.signatureOid];switch(o){case"sha1WithRSAEncryption":c.md=u.md.sha1.create();break;case"md5WithRSAEncryption":c.md=u.md.md5.create();break;case"sha256WithRSAEncryption":c.md=u.md.sha256.create();break;case"sha512WithRSAEncryption":c.md=u.md.sha512.create();break;case"RSASSA-PSS":c.md=u.md.sha256.create()}}if(null===c.md){var s=new Error("Could not compute certification request digest. Unknown signature OID.");throw s.signatureOid=c.signatureOid,s}var p=l.toDer(c.certificationRequestInfo);c.md.update(p.getBytes())}var d=u.md.sha1.create();return c.subject.getField=function(e){return n(c.subject,e)},c.subject.addField=function(e){a([e]),c.subject.attributes.push(e)},c.subject.attributes=h.RDNAttributesAsArray(r.certificationRequestInfoSubject,d),c.subject.hash=d.digest().toHex(),c.publicKey=h.publicKeyFromAsn1(r.subjectPublicKeyInfo),c.getAttribute=function(e){return n(c,e)},c.addAttribute=function(e){a([e]),c.attributes.push(e)},c.attributes=h.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),c},h.createCertificationRequest=function(){var e={};return e.version=0,e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return n(e.subject,t)},e.subject.addField=function(t){a([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return n(e,t)},e.addAttribute=function(t){a([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){a(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){a(t),e.attributes=t},e.sign=function(t,r){e.md=r||u.md.sha1.create();var n=f[e.md.algorithm+"WithRSAEncryption"];if(!n){var i=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=n,e.certificationRequestInfo=h.getCertificationRequestInfo(e);var a=l.toDer(e.certificationRequestInfo);e.md.update(a.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(null===r){if(e.signatureOid in f){switch(f[e.signatureOid]){case"sha1WithRSAEncryption":r=u.md.sha1.create();break;case"md5WithRSAEncryption":r=u.md.md5.create();break;case"sha256WithRSAEncryption":r=u.md.sha256.create();break;case"sha512WithRSAEncryption":r=u.md.sha512.create();break;case"RSASSA-PSS":r=u.md.sha256.create()}}if(null===r){var n=new Error("Could not compute certification request digest. Unknown signature OID.");throw n.signatureOid=e.signatureOid,n}var i=e.certificationRequestInfo||h.getCertificationRequestInfo(e),a=l.toDer(i);r.update(a.getBytes())}if(null!==r){var s;switch(e.signatureOid){case f.sha1WithRSAEncryption:break;case f["RSASSA-PSS"]:var o,c;if(void 0===(o=f[e.signatureParameters.mgf.hash.algorithmOid])||void 0===u.md[o]){var n=new Error("Unsupported MGF hash function.");throw n.oid=e.signatureParameters.mgf.hash.algorithmOid,n.name=o,n}if(void 0===(c=f[e.signatureParameters.mgf.algorithmOid])||void 0===u.mgf[c]){var n=new Error("Unsupported MGF function.");throw n.oid=e.signatureParameters.mgf.algorithmOid,n.name=c,n}if(c=u.mgf[c].create(u.md[o].create()),void 0===(o=f[e.signatureParameters.hash.algorithmOid])||void 0===u.md[o]){var n=new Error("Unsupported RSASSA-PSS hash function.");throw n.oid=e.signatureParameters.hash.algorithmOid,n.name=o,n}s=u.pss.create(u.md[o].create(),c,e.signatureParameters.saltLength)}t=e.publicKey.verify(r.digest().getBytes(),e.signature,s)}return t},e},h.getTBSCertificate=function(e){var t=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.INTEGER,!1,l.integerToDer(e.version).getBytes())]),l.create(l.Class.UNIVERSAL,l.Type.INTEGER,!1,u.util.hexToBytes(e.serialNumber)),l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(e.siginfo.algorithmOid).getBytes()),o(e.siginfo.algorithmOid,e.siginfo.parameters)]),i(e.issuer),l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.UTCTIME,!1,l.dateToUtcTime(e.validity.notBefore)),l.create(l.Class.UNIVERSAL,l.Type.UTCTIME,!1,l.dateToUtcTime(e.validity.notAfter))]),i(e.subject),h.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&t.value.push(l.create(l.Class.CONTEXT_SPECIFIC,1,!0,[l.create(l.Class.UNIVERSAL,l.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&t.value.push(l.create(l.Class.CONTEXT_SPECIFIC,2,!0,[l.create(l.Class.UNIVERSAL,l.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&t.value.push(h.certificateExtensionsToAsn1(e.extensions)),t},h.getCertificationRequestInfo=function(e){return l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.INTEGER,!1,l.integerToDer(e.version).getBytes()),i(e.subject),h.publicKeyToAsn1(e.publicKey),c(e)])},h.distinguishedNameToAsn1=function(e){return i(e)},h.certificateToAsn1=function(e){var t=e.tbsCertificate||h.getTBSCertificate(e);return l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[t,l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(e.signatureOid).getBytes()),o(e.signatureOid,e.signatureParameters)]),l.create(l.Class.UNIVERSAL,l.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},h.certificateExtensionsToAsn1=function(e){var t=l.create(l.Class.CONTEXT_SPECIFIC,3,!0,[]),r=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;n<e.length;++n)r.value.push(h.certificateExtensionToAsn1(e[n]));return t},h.certificateExtensionToAsn1=function(e){var t=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[]);t.value.push(l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(e.id).getBytes())),e.critical&&t.value.push(l.create(l.Class.UNIVERSAL,l.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return"string"!=typeof e.value&&(r=l.toDer(r).getBytes()),t.value.push(l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,r)),t},h.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||h.getCertificationRequestInfo(e);return l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[t,l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(e.signatureOid).getBytes()),o(e.signatureOid,e.signatureParameters)]),l.create(l.Class.UNIVERSAL,l.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},h.createCaStore=function(e){function t(e){return r(e),n.certs[e.hash]||null}function r(e){if(!e.hash){var t=u.md.sha1.create();e.attributes=h.RDNAttributesAsArray(i(e),t),e.hash=t.digest().toHex()}}var n={certs:{}};if(n.getIssuer=function(e){return t(e.issuer)},n.addCertificate=function(e){if("string"==typeof e&&(e=u.pki.certificateFromPem(e)),r(e.subject),!n.hasCertificate(e))if(e.subject.hash in n.certs){var t=n.certs[e.subject.hash];u.util.isArray(t)||(t=[t]),t.push(e),n.certs[e.subject.hash]=t}else n.certs[e.subject.hash]=e},n.hasCertificate=function(e){"string"==typeof e&&(e=u.pki.certificateFromPem(e));var r=t(e.subject);if(!r)return!1;u.util.isArray(r)||(r=[r]);for(var n=l.toDer(h.certificateToAsn1(e)).getBytes(),i=0;i<r.length;++i){if(n===l.toDer(h.certificateToAsn1(r[i])).getBytes())return!0}return!1},n.listAllCertificates=function(){var e=[];for(var t in n.certs)if(n.certs.hasOwnProperty(t)){var r=n.certs[t];if(u.util.isArray(r))for(var i=0;i<r.length;++i)e.push(r[i]);else e.push(r)}return e},n.removeCertificate=function(e){var i;if("string"==typeof e&&(e=u.pki.certificateFromPem(e)),r(e.subject),!n.hasCertificate(e))return null;var a=t(e.subject);if(!u.util.isArray(a))return i=n.certs[e.subject.hash],delete n.certs[e.subject.hash],i;for(var s=l.toDer(h.certificateToAsn1(e)).getBytes(),o=0;o<a.length;++o){s===l.toDer(h.certificateToAsn1(a[o])).getBytes()&&(i=a[o],a.splice(o,1))}return 0===a.length&&delete n.certs[e.subject.hash],i},e)for(var a=0;a<e.length;++a){var s=e[a];n.addCertificate(s)}return n},h.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"},h.verifyCertificateChain=function(e,t,r){t=t.slice(0);var n=t.slice(0),i=new Date,a=!0,s=null,o=0;do{var c=t.shift(),l=null,f=!1;if((i<c.validity.notBefore||i>c.validity.notAfter)&&(s={message:"Certificate is not valid yet or has expired.",error:h.certificateError.certificate_expired,notBefore:c.validity.notBefore,notAfter:c.validity.notAfter,now:i}),null===s){if(l=t[0]||e.getIssuer(c),null===l&&c.isIssuer(c)&&(f=!0,l=c),l){var p=l;u.util.isArray(p)||(p=[p]);for(var d=!1;!d&&p.length>0;){l=p.shift();try{d=l.verify(c)}catch(e){}}d||(s={message:"Certificate signature is invalid.",error:h.certificateError.bad_certificate})}null!==s||l&&!f||e.hasCertificate(c)||(s={message:"Certificate is not trusted.",error:h.certificateError.unknown_ca})}if(null===s&&l&&!c.isIssuer(l)&&(s={message:"Certificate issuer is invalid.",error:h.certificateError.bad_certificate}),null===s)for(var g={keyUsage:!0,basicConstraints:!0},y=0;null===s&&y<c.extensions.length;++y){var v=c.extensions[y];!v.critical||v.name in g||(s={message:"Certificate has an unsupported critical extension.",error:h.certificateError.unsupported_certificate})}if(null===s&&(!a||0===t.length&&(!l||f))){var m=c.getExtension("basicConstraints"),C=c.getExtension("keyUsage");if(null!==C&&(C.keyCertSign&&null!==m||(s={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:h.certificateError.bad_certificate})),null!==s||null===m||m.cA||(s={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:h.certificateError.bad_certificate}),null===s&&null!==C&&"pathLenConstraint"in m){o-1>m.pathLenConstraint&&(s={message:"Certificate basicConstraints pathLenConstraint violated.",error:h.certificateError.bad_certificate})}}var E=null===s||s.error,S=r?r(E,o,n):E;if(!0!==S)throw!0===E&&(s={message:"The application rejected the certificate.",error:h.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||u.util.isArray(S)?"string"==typeof S&&(s.error=S):(S.message&&(s.message=S.message),S.error&&(s.error=S.error))),s;s=null,a=!1,++o}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=e.md,r=e.mgf,i=t.digestLength,a=e.salt||null;"string"==typeof a&&(a=n.util.createBuffer(a));var s;if("saltLength"in e)s=e.saltLength;else{if(null===a)throw new Error("Salt length not specified or specific salt not given.");s=a.length()}if(null!==a&&a.length()!==s)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||n.random,c={};return c.encode=function(e,c){var u,l=c-1,h=Math.ceil(l/8),f=e.digest().getBytes();if(h<i+s+2)throw new Error("Message is too long to encrypt.");var p;p=null===a?o.getBytesSync(s):a.bytes();var d=new n.util.ByteBuffer;d.fillWithByte(0,8),d.putBytes(f),d.putBytes(p),t.start(),t.update(d.getBytes());var g=t.digest().getBytes(),y=new n.util.ByteBuffer;y.fillWithByte(0,h-s-i-2),y.putByte(1),y.putBytes(p);var v=y.getBytes(),m=h-i-1,C=r.generate(g,m),E="";for(u=0;u<m;u++)E+=String.fromCharCode(v.charCodeAt(u)^C.charCodeAt(u));var S=65280>>8*h-l&255;return(E=String.fromCharCode(E.charCodeAt(0)&~S)+E.substr(1))+g+String.fromCharCode(188)},c.verify=function(e,a,o){var c,u=o-1,l=Math.ceil(u/8);if(a=a.substr(-l),l<i+s+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==a.charCodeAt(l-1))throw new Error("Encoded message does not end in 0xBC.");var h=l-i-1,f=a.substr(0,h),p=a.substr(h,i),d=65280>>8*l-u&255;if(0!=(f.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var g=r.generate(p,h),y="";for(c=0;c<h;c++)y+=String.fromCharCode(f.charCodeAt(c)^g.charCodeAt(c));y=String.fromCharCode(y.charCodeAt(0)&~d)+y.substr(1);var v=l-i-s-2;for(c=0;c<v;c++)if(0!==y.charCodeAt(c))throw new Error("Leftmost octets not zero as expected");if(1!==y.charCodeAt(v))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var m=y.substr(-s),C=new n.util.ByteBuffer;return C.fillWithByte(0,8),C.putBytes(e),C.putBytes(m),t.start(),t.update(C.getBytes()),p===t.digest().getBytes()},c}},function(e,t,r){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e,t,r){!function(n,i,a){e.exports=t=i(r(6),r(57),r(58))}(0,function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,a=t.algo,s=a.MD5,o=a.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=r.hasher.create(),a=i.create(),s=a.words,o=r.keySize,c=r.iterations;s.length<o;){u&&n.update(u);var u=n.update(e).finalize(t);n.reset();for(var l=1;l<c;l++)u=n.finalize(u),n.reset();a.concat(u)}return a.sigBytes=4*o,a}});t.EvpKDF=function(e,t,r){return o.create(r).compute(e,t)}}(),e.EvpKDF})},function(e,t,r){function n(e){if("string"==typeof e&&(e=s.util.createBuffer(e)),s.util.isArray(e)&&e.length>4){var t=e;e=s.util.createBuffer();for(var r=0;r<t.length;++r)e.putByte(t[r])}return s.util.isArray(e)||(e=[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]),e}function i(e){e[e.length-1]=e[e.length-1]+1&4294967295}function a(e){return[e/4294967296|0,4294967295&e]}var s=r(0);r(1),s.cipher=s.cipher||{};var o=e.exports=s.cipher.modes=s.cipher.modes||{};o.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)},o.ecb.prototype.start=function(e){},o.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(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},o.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(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},o.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},o.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)},o.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)},o.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=n(e.iv),this._prev=this._iv.slice(0)}},o.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(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},o.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(var n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},o.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},o.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)},o.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=s.util.createBuffer(),this._partialBytes=0},o.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=n(e.iv),this._inBlock=this._iv.slice(0),this._partialBytes=0},o.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 a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},o.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 a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},o.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=s.util.createBuffer(),this._partialBytes=0},o.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=n(e.iv),this._inBlock=this._iv.slice(0),this._partialBytes=0},o.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 a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},o.ofb.prototype.decrypt=o.ofb.prototype.encrypt,o.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=s.util.createBuffer(),this._partialBytes=0},o.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=n(e.iv),this._inBlock=this._iv.slice(0),this._partialBytes=0},o.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 a=0;a<this._ints;++a)t.putInt32(e.getInt32()^this._outBlock[a]);else{var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);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}i(this._inBlock)},o.ctr.prototype.decrypt=o.ctr.prototype.encrypt,o.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=s.util.createBuffer(),this._partialBytes=0,this._R=3774873600},o.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=s.util.createBuffer(e.iv);this._cipherLength=0;var r;if(r="additionalData"in e?s.util.createBuffer(e.additionalData):s.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=s.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 n=t.length();if(12===n)this._j0=[t.getInt32(),t.getInt32(),t.getInt32(),1];else{for(this._j0=[0,0,0,0];t.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(a(8*n)))}this._inBlock=this._j0.slice(0),i(this._inBlock),this._partialBytes=0,r=s.util.createBuffer(r),this._aDataLength=a(8*r.length());var o=r.length()%this.blockSize;for(o&&r.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])},o.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 a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]^=e.getInt32());this._cipherLength+=this.blockSize}else{var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);if(0===s||r){if(r){var o=n%this.blockSize;this._cipherLength+=o,this._partialOutput.truncate(this.blockSize-o)}else this._cipherLength+=this.blockSize;for(var a=0;a<this._ints;++a)this._outBlock[a]=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),i(this._inBlock)},o.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),i(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 a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]^this._hashBlock[a]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize},o.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=s.util.createBuffer();var n=this._aDataLength.concat(a(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,n);var i=[];this.cipher.encrypt(this._j0,i);for(var o=0;o<this._ints;++o)this.tag.putInt32(this._s[o]^i[o]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},o.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},o.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)},o.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=e[n]>>>4*(7-r%8)&15,a=this._m[r][i];t[0]^=a[0],t[1]^=a[1],t[2]^=a[2],t[3]^=a[3]}return t},o.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)},o.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),s=0;s<i;++s){var o=[0,0,0,0],c=s/n|0,u=(n-1-s%n)*t;o[c]=1<<t-1<<u,a[s]=this.generateSubHashTable(this.multiply(o,e),t)}return a},o.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var s=1;s<a;++s){var o=i[a],c=i[s];i[a+s]=[o[0]^c[0],o[1]^c[1],o[2]^c[2],o[3]^c[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var u=i[a^n];i[a]=[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(12),r(18),r(11),r(27),r(3),r(13),r(1);var i=function(e,t,r,i){var a=n.util.createBuffer(),s=e.length>>1,o=s+(1&e.length),c=e.substr(0,o),u=e.substr(s,o),l=n.util.createBuffer(),h=n.hmac.create();r=t+r;var f=Math.ceil(i/16),p=Math.ceil(i/20);h.start("MD5",c);var d=n.util.createBuffer();l.putBytes(r);for(var g=0;g<f;++g)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 y=n.util.createBuffer();l.clear(),l.putBytes(r);for(var g=0;g<p;++g)h.start(null,null),h.update(l.getBytes()),l.putBuffer(h.digest()),h.start(null,null),h.update(l.bytes()+r),y.putBuffer(h.digest());return a.putBytes(n.util.xorBytes(d.getBytes(),y.getBytes(),i)),a},a=function(e,t,r){var i=n.hmac.create();i.start("SHA1",e);var a=n.util.createBuffer();return a.putInt32(t[0]),a.putInt32(t[1]),a.putByte(r.type),a.putByte(r.version.major),a.putByte(r.version.minor),a.putInt16(r.length),a.putBytes(r.fragment.bytes()),i.update(a.getBytes()),i.digest().getBytes()},s=function(e,t,r){var i=!1;try{var a=e.deflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(a),t.length=a.length,i=!0}catch(e){}return i},o=function(e,t,r){var i=!1;try{var a=e.inflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(a),t.length=a.length,i=!0}catch(e){}return i},c=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))},u=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},l={};l.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}},l.SupportedVersions=[l.Versions.TLS_1_1,l.Versions.TLS_1_0],l.Version=l.SupportedVersions[0],l.MaxFragment=15360,l.ConnectionEnd={server:0,client:1},l.PRFAlgorithm={tls_prf_sha256:0},l.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},l.CipherType={stream:0,block:1,aead:2},l.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},l.CompressionMethod={none:0,deflate:1},l.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},l.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},l.Alert={},l.Alert.Level={warning:1,fatal:2},l.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},l.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},l.CipherSuites={},l.getCipherSuite=function(e){var t=null;for(var r in l.CipherSuites){var n=l.CipherSuites[r];if(n.id[0]===e.charCodeAt(0)&&n.id[1]===e.charCodeAt(1)){t=n;break}}return t},l.handleUnexpected=function(e,t){!e.open&&e.entity===l.ConnectionEnd.client||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unexpected_message}})},l.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(l.queue(e,l.createAlert(e,{level:l.Alert.Level.warning,description:l.Alert.Description.no_renegotiation})),l.flush(e)),e.process()},l.parseHelloMessage=function(e,t,r){var i=null,a=e.entity===l.ConnectionEnd.client;if(r<38)e.error(e,{message:a?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});else{var s=t.fragment,o=s.length();if(i={version:{major:s.getByte(),minor:s.getByte()},random:n.util.createBuffer(s.getBytes(32)),session_id:c(s,1),extensions:[]},a?(i.cipher_suite=s.getBytes(2),i.compression_method=s.getByte()):(i.cipher_suites=c(s,2),i.compression_methods=c(s,1)),(o=r-(o-s.length()))>0){for(var u=c(s,2);u.length()>0;)i.extensions.push({type:[u.getByte(),u.getByte()],data:c(u,2)});if(!a)for(var h=0;h<i.extensions.length;++h){var f=i.extensions[h];if(0===f.type[0]&&0===f.type[1])for(var p=c(f.data,2);p.length()>0;){var d=p.getByte();if(0!==d)break;e.session.extensions.server_name.serverNameList.push(c(p,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:l.Alert.Level.fatal,description:l.Alert.Description.protocol_version}});if(a)e.session.cipherSuite=l.getCipherSuite(i.cipher_suite);else for(var g=n.util.createBuffer(i.cipher_suites.bytes());g.length()>0&&(e.session.cipherSuite=l.getCipherSuite(g.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:l.Alert.Level.fatal,description:l.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(i.cipher_suite)});e.session.compressionMethod=a?i.compression_method:l.CompressionMethod.none}return i},l.createSecurityParameters=function(e,t){var r=e.entity===l.ConnectionEnd.client,n=t.random.bytes(),i=r?e.session.sp.client_random:n,a=r?n:l.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:l.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:a}},l.handleServerHello=function(e,t,r){var n=l.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:l.Alert.Level.fatal,description:l.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=g,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=h,e.session.resuming=!1,l.createSecurityParameters(e,n)),e.session.id=i,e.process()}},l.handleClientHello=function(e,t,r){var i=l.parseHelloMessage(e,t,r);if(!e.fail){var a=i.session_id.bytes(),s=null;if(e.sessionCache&&(s=e.sessionCache.getSession(a),null===s?a="":(s.version.major!==i.version.major||s.version.minor>i.version.minor)&&(s=null,a="")),0===a.length&&(a=n.random.getBytes(32)),e.session.id=a,e.session.clientHelloVersion=i.version,e.session.sp={},s)e.version=e.session.version=s.version,e.session.sp=s.sp;else{for(var o,c=1;c<l.SupportedVersions.length&&(o=l.SupportedVersions[c],!(o.minor<=i.version.minor));++c);e.version={major:o.major,minor:o.minor},e.session.version=e.version}null!==s?(e.expect=_,e.session.resuming=!0,e.session.sp.client_random=i.random.bytes()):(e.expect=!1!==e.verifyClient?C:E,e.session.resuming=!1,l.createSecurityParameters(e,i)),e.open=!0,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createServerHello(e)})),e.session.resuming?(l.queue(e,l.createRecord(e,{type:l.ContentType.change_cipher_spec,data:l.createChangeCipherSpec()})),e.state.pending=l.createConnectionState(e),e.state.current.write=e.state.pending.write,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createFinished(e)}))):(l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificate(e)})),e.fail||(l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createServerKeyExchange(e)})),!1!==e.verifyClient&&l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificateRequest(e)})),l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createServerHelloDone(e)})))),l.flush(e),e.process()}},l.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var i,a,s=t.fragment,o={certificate_list:c(s,3)},u=[];try{for(;o.certificate_list.length()>0;)i=c(o.certificate_list,3),a=n.asn1.fromDer(i),i=n.pki.certificateFromAsn1(a,!0),u.push(i)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.bad_certificate}})}var h=e.entity===l.ConnectionEnd.client;!h&&!0!==e.verifyClient||0!==u.length?0===u.length?e.expect=h?f:E:(h?e.session.serverCertificate=u[0]:e.session.clientCertificate=u[0],l.verifyCertificateChain(e,u)&&(e.expect=h?f:E)):e.error(e,{message:h?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}}),e.process()},l.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unsupported_certificate}});e.expect=p,e.process()},l.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unsupported_certificate}});var i=t.fragment,a={enc_pre_master_secret:c(i,2).getBytes()},s=null;if(e.getPrivateKey)try{s=e.getPrivateKey(e,e.session.serverCertificate),s=n.pki.privateKeyFromPem(s)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}})}if(null===s)return e.error(e,{message:"No private key set.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}});try{var o=e.session.sp;o.pre_master_secret=s.decrypt(a.enc_pre_master_secret);var u=e.session.clientHelloVersion;if(u.major!==o.pre_master_secret.charCodeAt(0)||u.minor!==o.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){o.pre_master_secret=n.random.getBytes(48)}e.expect=_,null!==e.session.clientCertificate&&(e.expect=S),e.process()},l.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var n=t.fragment,i={certificate_types:c(n,1),certificate_authorities:c(n,2)};e.session.certificateRequest=i,e.expect=d,e.process()},l.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var i=t.fragment;i.read-=4;var a=i.bytes();i.read+=4;var s={signature:c(i,2).getBytes()},o=n.util.createBuffer();o.putBuffer(e.session.md5.digest()),o.putBuffer(e.session.sha1.digest()),o=o.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(o,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(a),e.session.sha1.update(a)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.handshake_failure}})}e.expect=_,e.process()},l.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.record_overflow}});if(null===e.serverCertificate){var i={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.insufficient_security}},a=e.verify(e,i.alert.description,0,[]);if(!0!==a)return(a||0===a)&&("object"!=typeof a||n.util.isArray(a)?"number"==typeof a&&(i.alert.description=a):(a.message&&(i.message=a.message),a.alert&&(i.alert.description=a.alert))),e.error(e,i)}null!==e.session.certificateRequest&&(t=l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificate(e)}),l.queue(e,t)),t=l.createRecord(e,{type:l.ContentType.handshake,data:l.createClientKeyExchange(e)}),l.queue(e,t),e.expect=m;var s=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificateVerify(e,t)})),l.queue(e,l.createRecord(e,{type:l.ContentType.change_cipher_spec,data:l.createChangeCipherSpec()})),e.state.pending=l.createConnectionState(e),e.state.current.write=e.state.pending.write,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createFinished(e)})),e.expect=g,l.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return s(e,null);l.getClientSignature(e,s)},l.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var r=e.entity===l.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=l.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()},l.handleFinished=function(e,t,r){var a=t.fragment;a.read-=4;var s=a.bytes();a.read+=4;var o=t.fragment.getBytes();a=n.util.createBuffer(),a.putBuffer(e.session.md5.digest()),a.putBuffer(e.session.sha1.digest());var c=e.entity===l.ConnectionEnd.client,u=c?"server finished":"client finished",h=e.session.sp;if(a=i(h.master_secret,u,a.getBytes(),12),a.getBytes()!==o)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.decrypt_error}});e.session.md5.update(s),e.session.sha1.update(s),(e.session.resuming&&c||!e.session.resuming&&!c)&&(l.queue(e,l.createRecord(e,{type:l.ContentType.change_cipher_spec,data:l.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createFinished(e)}))),e.expect=c?v:T,e.handshaking=!1,++e.handshakes,e.peerCertificate=c?e.session.serverCertificate:e.session.clientCertificate,l.flush(e),e.isConnected=!0,e.connected(e),e.process()},l.handleAlert=function(e,t){var r,n=t.fragment,i={level:n.getByte(),description:n.getByte()};switch(i.description){case l.Alert.Description.close_notify:r="Connection closed.";break;case l.Alert.Description.unexpected_message:r="Unexpected message.";break;case l.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case l.Alert.Description.decryption_failed:r="Decryption failed.";break;case l.Alert.Description.record_overflow:r="Record overflow.";break;case l.Alert.Description.decompression_failure:r="Decompression failed.";break;case l.Alert.Description.handshake_failure:r="Handshake failure.";break;case l.Alert.Description.bad_certificate:r="Bad certificate.";break;case l.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case l.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case l.Alert.Description.certificate_expired:r="Certificate expired.";break;case l.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case l.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case l.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case l.Alert.Description.access_denied:r="Access denied.";break;case l.Alert.Description.decode_error:r="Decode error.";break;case l.Alert.Description.decrypt_error:r="Decrypt error.";break;case l.Alert.Description.export_restriction:r="Export restriction.";break;case l.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case l.Alert.Description.insufficient_security:r="Insufficient security.";break;case l.Alert.Description.internal_error:r="Internal error.";break;case l.Alert.Description.user_canceled:r="User canceled.";break;case l.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(i.description===l.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===l.ConnectionEnd.client?"server":"client",alert:i}),e.process()},l.handleHandshake=function(e,t){var r=t.fragment,i=r.getByte(),a=r.getInt24();if(a>r.length())return e.fragmented=t,t.fragment=n.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var s=r.bytes(a+4);r.read+=4,i in K[e.entity][e.expect]?(e.entity!==l.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!==l.HandshakeType.hello_request&&i!==l.HandshakeType.certificate_verify&&i!==l.HandshakeType.finished&&(e.session.md5.update(s),e.session.sha1.update(s)),K[e.entity][e.expect][i](e,t,a)):l.handleUnexpected(e,t)},l.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},l.handleHeartbeat=function(e,t){var r=t.fragment,i=r.getByte(),a=r.getInt16(),s=r.getBytes(a);if(i===l.HeartbeatMessageType.heartbeat_request){if(e.handshaking||a>s.length)return e.process();l.queue(e,l.createRecord(e,{type:l.ContentType.heartbeat,data:l.createHeartbeat(l.HeartbeatMessageType.heartbeat_response,s)})),l.flush(e)}else if(i===l.HeartbeatMessageType.heartbeat_response){if(s!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,n.util.createBuffer(s))}e.process()};var h=1,f=2,p=3,d=4,g=5,y=6,v=7,m=8,C=1,E=2,S=3,_=4,b=5,T=6,B=l.handleUnexpected,I=l.handleChangeCipherSpec,A=l.handleAlert,w=l.handleHandshake,k=l.handleApplicationData,N=l.handleHeartbeat,R=[];R[l.ConnectionEnd.client]=[[B,A,w,B,N],[B,A,w,B,N],[B,A,w,B,N],[B,A,w,B,N],[B,A,w,B,N],[I,A,B,B,N],[B,A,w,B,N],[B,A,w,k,N],[B,A,w,B,N]],R[l.ConnectionEnd.server]=[[B,A,w,B,N],[B,A,w,B,N],[B,A,w,B,N],[B,A,w,B,N],[I,A,B,B,N],[B,A,w,B,N],[B,A,w,k,N],[B,A,w,B,N]];var L=l.handleHelloRequest,D=l.handleServerHello,U=l.handleCertificate,x=l.handleServerKeyExchange,P=l.handleCertificateRequest,O=l.handleServerHelloDone,V=l.handleFinished,K=[];K[l.ConnectionEnd.client]=[[B,B,D,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B],[L,B,B,B,B,B,B,B,B,B,B,U,x,P,O,B,B,B,B,B,B],[L,B,B,B,B,B,B,B,B,B,B,B,x,P,O,B,B,B,B,B,B],[L,B,B,B,B,B,B,B,B,B,B,B,B,P,O,B,B,B,B,B,B],[L,B,B,B,B,B,B,B,B,B,B,B,B,B,O,B,B,B,B,B,B],[L,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B],[L,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,V],[L,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B],[L,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B]];var M=l.handleClientHello,F=l.handleClientKeyExchange,z=l.handleCertificateVerify;K[l.ConnectionEnd.server]=[[B,M,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B],[B,B,B,B,B,B,B,B,B,B,B,U,B,B,B,B,B,B,B,B,B],[B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,F,B,B,B,B],[B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,z,B,B,B,B,B],[B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B],[B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,V],[B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B],[B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B]],l.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 a=2*t.mac_key_length+2*t.enc_key_length,s=e.version.major===l.Versions.TLS_1_0.major&&e.version.minor===l.Versions.TLS_1_0.minor;s&&(a+=2*t.fixed_iv_length);var o=r(t.master_secret,"key expansion",n,a),c={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return s&&(c.client_write_IV=o.getBytes(t.fixed_iv_length),c.server_write_IV=o.getBytes(t.fixed_iv_length)),c},l.createConnectionState=function(e){var t=e.entity===l.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:l.Alert.Level.fatal,description:l.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.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:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=l.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 l.CompressionMethod.none:break;case l.CompressionMethod.deflate:n.read.compressFunction=o,n.write.compressFunction=s;break;default:throw new Error("Unsupported compression algorithm.")}}return n},l.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},l.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},l.createAlert=function(e,t){var r=n.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),l.createRecord(e,{type:l.ContentType.alert,data:r})},l.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 a=t.length(),s=n.util.createBuffer();s.putByte(l.CompressionMethod.none);var o=s.length(),c=n.util.createBuffer();if(e.virtualHost){var h=n.util.createBuffer();h.putByte(0),h.putByte(0);var f=n.util.createBuffer();f.putByte(0),u(f,2,n.util.createBuffer(e.virtualHost));var p=n.util.createBuffer();u(p,2,f),u(h,2,p),c.putBuffer(h)}var d=c.length();d>0&&(d+=2);var g=e.session.id,y=g.length+1+2+4+28+2+a+1+o+d,v=n.util.createBuffer();return v.putByte(l.HandshakeType.client_hello),v.putInt24(y),v.putByte(e.version.major),v.putByte(e.version.minor),v.putBytes(e.session.sp.client_random),u(v,1,n.util.createBuffer(g)),u(v,2,t),u(v,1,s),d>0&&u(v,2,c),v},l.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,i=n.util.createBuffer();return i.putByte(l.HandshakeType.server_hello),i.putInt24(r),i.putByte(e.version.major),i.putByte(e.version.minor),i.putBytes(e.session.sp.server_random),u(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},l.createCertificate=function(e){var t=e.entity===l.ConnectionEnd.client,r=null;if(e.getCertificate){var i;i=t?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,r=e.getCertificate(e,i)}var a=n.util.createBuffer();if(null!==r)try{n.util.isArray(r)||(r=[r]);for(var s=null,o=0;o<r.length;++o){var c=n.pem.decode(r[o])[0];if("CERTIFICATE"!==c.type&&"X509 CERTIFICATE"!==c.type&&"TRUSTED CERTIFICATE"!==c.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=c.type,h}if(c.procType&&"ENCRYPTED"===c.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var f=n.util.createBuffer(c.body);null===s&&(s=n.asn1.fromDer(f.bytes(),!1));var p=n.util.createBuffer();u(p,3,f),a.putBuffer(p)}r=n.pki.certificateFromAsn1(s),t?e.session.clientCertificate=r:e.session.serverCertificate=r}catch(t){return e.error(e,{message:"Could not send certificate list.",cause:t,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.bad_certificate}})}var d=3+a.length(),g=n.util.createBuffer();return g.putByte(l.HandshakeType.certificate),g.putInt24(d),u(g,3,a),g},l.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(),t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret);var i=t.length+2,a=n.util.createBuffer();return a.putByte(l.HandshakeType.client_key_exchange),a.putInt24(i),a.putInt16(t.length),a.putBytes(t),a},l.createServerKeyExchange=function(e){var t=n.util.createBuffer();return t},l.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:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}})}null===i?e.error(e,{message:"No private key set.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}):t=i.sign(t,null),r(e,t)},e.getSignature(e,r,t)},l.createCertificateVerify=function(e,t){var r=t.length+2,i=n.util.createBuffer();return i.putByte(l.HandshakeType.certificate_verify),i.putInt24(r),i.putInt16(t.length),i.putBytes(t),i},l.createCertificateRequest=function(e){var t=n.util.createBuffer();t.putByte(1);var r=n.util.createBuffer();for(var i in e.caStore.certs){var a=e.caStore.certs[i],s=n.pki.distinguishedNameToAsn1(a.subject),o=n.asn1.toDer(s);r.putInt16(o.length()),r.putBuffer(o)}var c=1+t.length()+2+r.length(),h=n.util.createBuffer();return h.putByte(l.HandshakeType.certificate_request),h.putInt24(c),u(h,1,t),u(h,2,r),h},l.createServerHelloDone=function(e){var t=n.util.createBuffer();return t.putByte(l.HandshakeType.server_hello_done),t.putInt24(0),t},l.createChangeCipherSpec=function(){var e=n.util.createBuffer();return e.putByte(1),e},l.createFinished=function(e){var t=n.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===l.ConnectionEnd.client,a=e.session.sp,s=i,o=r?"client finished":"server finished";t=s(a.master_secret,o,t.getBytes(),12);var c=n.util.createBuffer();return c.putByte(l.HandshakeType.finished),c.putInt24(t.length()),c.putBuffer(t),c},l.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 a=i.length(),s=Math.max(16,a-r-3);return i.putBytes(n.random.getBytes(s)),i},l.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==l.ContentType.handshake&&t.type!==l.ContentType.alert&&t.type!==l.ContentType.change_cipher_spec)){if(t.type===l.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()<=l.MaxFragment)i=[t];else{i=[];for(var a=t.fragment.bytes();a.length>l.MaxFragment;)i.push(l.createRecord(e,{type:t.type,data:n.util.createBuffer(a.slice(0,l.MaxFragment))})),a=a.slice(l.MaxFragment);a.length>0&&i.push(l.createRecord(e,{type:t.type,data:n.util.createBuffer(a)}))}for(var s=0;s<i.length&&!e.fail;++s){var o=i[s];e.state.current.write.update(e,o)&&e.records.push(o)}}},l.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 j=function(e){switch(e){case!0:return!0;case n.pki.certificateError.bad_certificate:return l.Alert.Description.bad_certificate;case n.pki.certificateError.unsupported_certificate:return l.Alert.Description.unsupported_certificate;case n.pki.certificateError.certificate_revoked:return l.Alert.Description.certificate_revoked;case n.pki.certificateError.certificate_expired:return l.Alert.Description.certificate_expired;case n.pki.certificateError.certificate_unknown:return l.Alert.Description.certificate_unknown;case n.pki.certificateError.unknown_ca:return l.Alert.Description.unknown_ca;default:return l.Alert.Description.bad_certificate}},H=function(e){switch(e){case!0:return!0;case l.Alert.Description.bad_certificate:return n.pki.certificateError.bad_certificate;case l.Alert.Description.unsupported_certificate:return n.pki.certificateError.unsupported_certificate;case l.Alert.Description.certificate_revoked:return n.pki.certificateError.certificate_revoked;case l.Alert.Description.certificate_expired:return n.pki.certificateError.certificate_expired;case l.Alert.Description.certificate_unknown:return n.pki.certificateError.certificate_unknown;case l.Alert.Description.unknown_ca:return n.pki.certificateError.unknown_ca;default:return n.pki.certificateError.bad_certificate}};l.verifyCertificateChain=function(e,t){try{n.pki.verifyCertificateChain(e.caStore,t,function(t,r,i){var a=(j(t),e.verify(e,t,r,i));if(!0!==a){if("object"==typeof a&&!n.util.isArray(a)){var s=new Error("The application rejected the certificate.");throw s.send=!0,s.alert={level:l.Alert.Level.fatal,description:l.Alert.Description.bad_certificate},a.message&&(s.message=a.message),a.alert&&(s.alert.description=a.alert),s}a!==t&&(a=H(a))}return a})}catch(t){var r=t;("object"!=typeof r||n.util.isArray(r))&&(r={send:!0,alert:{level:l.Alert.Level.fatal,description:j(t)}}),"send"in r||(r.send=!0),"alert"in r||(r.alert={level:l.Alert.Level.fatal,description:j(r.error)}),e.error(e,r)}return!e.fail},l.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{r={},r.cache=e||{},r.capacity=Math.max(t||100,1),r.order=[];for(var i in 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){t=r.cache[i],delete r.cache[i];for(var a in r.order)if(r.order[a]===i){r.order.splice(a,1);break}}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}var i=n.util.bytesToHex(e);r.order.push(i),r.cache[i]=t}}return r},l.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){r=[];for(var i in l.CipherSuites)r.push(l.CipherSuites[i])}var a=e.server?l.ConnectionEnd.server:l.ConnectionEnd.client,s=e.sessionCache?l.createSessionCache(e.sessionCache):null,o={version:{major:l.Version.major,minor:l.Version.minor},entity:a,sessionId:e.sessionId,caStore:t,sessionCache:s,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,n){return t},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===l.ConnectionEnd.client?"client":"server"),r.send&&(l.queue(t,l.createAlert(t,r.alert)),l.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};o.reset=function(e){o.version={major:l.Version.major,minor:l.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=(o.entity,l.ConnectionEnd.client,0),o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(e||void 0===e),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=l.createConnectionState(o)},o.reset();var c=function(e,t){var r=t.type-l.ContentType.change_cipher_spec,n=R[e.entity][e.expect];r in n?n[r](e,t):l.handleUnexpected(e,t)},u=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 a=e.record.version.major===e.version.major;a&&e.session&&e.session.version&&(a=e.record.version.minor===e.version.minor),a||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.protocol_version}})}return t},h=function(e){var t=0,r=e.input,n=r.length();if(n<e.record.length)t=e.record.length-n;else{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:l.Alert.Level.fatal,description:l.Alert.Description.unexpected_message}})),e.record.ready=!0)}return t};return o.handshake=function(e){if(o.entity!==l.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&0===o.handshakes&&(o.fail=!1),o.handshaking=!0,e=e||"";var t=null;e.length>0&&(o.sessionCache&&(t=o.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&o.sessionCache&&null!==(t=o.sessionCache.getSession())&&(e=t.id),o.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&&(o.version=t.version,o.session.sp=t.sp),o.session.sp.client_random=l.createRandom().getBytes(),o.open=!0,l.queue(o,l.createRecord(o,{type:l.ContentType.handshake,data:l.createClientHello(o)})),l.flush(o)}},o.process=function(e){var t=0;return e&&o.input.putBytes(e),o.fail||(null!==o.record&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),null===o.record&&(t=u(o)),o.fail||null===o.record||o.record.ready||(t=h(o)),!o.fail&&null!==o.record&&o.record.ready&&c(o,o.record)),t},o.prepare=function(e){return l.queue(o,l.createRecord(o,{type:l.ContentType.application_data,data:n.util.createBuffer(e)})),l.flush(o)},o.prepareHeartbeatRequest=function(e,t){return e instanceof n.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),o.expectedHeartbeatPayload=e,l.queue(o,l.createRecord(o,{type:l.ContentType.heartbeat,data:l.createHeartbeat(l.HeartbeatMessageType.heartbeat_request,e,t)})),l.flush(o)},o.close=function(e){if(!o.fail&&o.sessionCache&&o.session){var t={id:o.session.id,version:o.session.version,sp:o.session.sp};t.sp.keys=null,o.sessionCache.setSession(t.id,t)}o.open&&(o.open=!1,o.input.clear(),(o.isConnected||o.handshaking)&&(o.isConnected=o.handshaking=!1,l.queue(o,l.createAlert(o,{level:l.Alert.Level.warning,description:l.Alert.Description.close_notify})),l.flush(o)),o.closed(o)),o.reset(e)},o},e.exports=n.tls=n.tls||{};for(var q in l)"function"!=typeof l[q]&&(n.tls[q]=l[q]);n.tls.prf_tls1=i,n.tls.hmac_sha1=a,n.tls.createSessionCache=l.createSessionCache,n.tls.createConnection=l.createConnection},function(e,t,r){var n=r(0);r(4),r(10),r(28),r(11),r(19),r(35),r(22),r(15),r(1),r(21);var i=n.asn1,a=e.exports=n.pki=n.pki||{};a.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)},a.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 s=i.fromDer(t.body);return a.privateKeyFromAsn1(s)},a.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(a.privateKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.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){function n(e,t){return e.start().update(t).digest().getBytes()}function i(e){var t;if(e){if(!(t=l.oids[u.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 a(t)}function a(e){var t=o.md;switch(e){case"hmacWithSHA224":t=o.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()}function s(e,t,r,n){var i=u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OCTETSTRING,!1,e),u.create(u.Class.UNIVERSAL,u.Type.INTEGER,!1,t.getBytes())]);return"hmacWithSHA1"!==n&&i.value.push(u.create(u.Class.UNIVERSAL,u.Type.INTEGER,!1,o.util.hexToBytes(r.toString(16))),u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(l.oids[n]).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.NULL,!1,"")])),i}var o=r(0);if(r(9),r(4),r(14),r(5),r(10),r(19),r(11),r(3),r(32),r(15),r(1),void 0===c)var c=o.jsbn.BigInteger;var u=o.asn1,l=o.pki=o.pki||{};e.exports=l.pbe=o.pbe=o.pbe||{};var h=l.oids,f={name:"EncryptedPrivateKeyInfo",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:u.Class.UNIVERSAL,type:u.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:u.Class.UNIVERSAL,type:u.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},p={name:"PBES2Algorithms",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:u.Class.UNIVERSAL,type:u.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:u.Class.UNIVERSAL,type:u.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:u.Class.UNIVERSAL,type:u.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:u.Class.UNIVERSAL,type:u.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:u.Class.UNIVERSAL,type:u.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:u.Class.UNIVERSAL,type:u.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:u.Class.UNIVERSAL,type:u.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},d={name:"pkcs-12PbeParams",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:u.Class.UNIVERSAL,type:u.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:u.Class.UNIVERSAL,type:u.Type.INTEGER,constructed:!1,capture:"iterations"}]};l.encryptPrivateKeyInfo=function(e,t,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n,i,c,f=o.random.getBytesSync(r.saltSize),p=r.count,d=u.integerToDer(p);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var g,y,v;switch(r.algorithm){case"aes128":n=16,g=16,y=h["aes128-CBC"],v=o.aes.createEncryptionCipher;break;case"aes192":n=24,g=16,y=h["aes192-CBC"],v=o.aes.createEncryptionCipher;break;case"aes256":n=32,g=16,y=h["aes256-CBC"],v=o.aes.createEncryptionCipher;break;case"des":n=8,g=8,y=h.desCBC,v=o.des.createEncryptionCipher;break;default:var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}var C="hmacWith"+r.prfAlgorithm.toUpperCase(),E=a(C),S=o.pkcs5.pbkdf2(t,f,p,n,E),_=o.random.getBytesSync(g),b=v(S);b.start(_),b.update(u.toDer(e)),b.finish(),c=b.output.getBytes();var T=s(f,d,n,C);i=u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(h.pkcs5PBES2).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(h.pkcs5PBKDF2).getBytes()),T]),u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(y).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.OCTETSTRING,!1,_)])])])}else{if("3des"!==r.algorithm){var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}n=24;var B=new o.util.ByteBuffer(f),S=l.pbe.generatePkcs12Key(t,B,1,p,n),_=l.pbe.generatePkcs12Key(t,B,2,p,n),b=o.des.createEncryptionCipher(S);b.start(_),b.update(u.toDer(e)),b.finish(),c=b.output.getBytes(),i=u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(h["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OCTETSTRING,!1,f),u.create(u.Class.UNIVERSAL,u.Type.INTEGER,!1,d.getBytes())])])}return u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[i,u.create(u.Class.UNIVERSAL,u.Type.OCTETSTRING,!1,c)])},l.decryptPrivateKeyInfo=function(e,t){var r=null,n={},i=[];if(!u.validate(e,f,n,i)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var s=u.derToOid(n.encryptionOid),c=l.pbe.getCipher(s,n.encryptionParams,t),h=o.util.createBuffer(n.encryptedData);return c.update(h),c.finish()&&(r=u.fromDer(c.output)),r},l.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:u.toDer(e).getBytes()};return o.pem.encode(r,{maxline:t})},l.encryptedPrivateKeyFromPem=function(e){var t=o.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 u.fromDer(t.body)},l.encryptRsaPrivateKey=function(e,t,r){if(r=r||{},!r.legacy){var n=l.wrapRsaPrivateKey(l.privateKeyToAsn1(e));return n=l.encryptPrivateKeyInfo(n,t,r),l.encryptedPrivateKeyToPem(n)}var i,a,s,c;switch(r.algorithm){case"aes128":i="AES-128-CBC",s=16,a=o.random.getBytesSync(16),c=o.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",s=24,a=o.random.getBytesSync(16),c=o.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",s=32,a=o.random.getBytesSync(16),c=o.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",s=24,a=o.random.getBytesSync(8),c=o.des.createEncryptionCipher;break;case"des":i="DES-CBC",s=8,a=o.random.getBytesSync(8),c=o.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 f=o.pbe.opensslDeriveBytes(t,a.substr(0,8),s),p=c(f);p.start(a),p.update(u.toDer(l.privateKeyToAsn1(e))),p.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:o.util.bytesToHex(a).toUpperCase()},body:p.output.getBytes()};return o.pem.encode(d)},l.decryptRsaPrivateKey=function(e,t){var r=null,n=o.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==n.type&&"PRIVATE KEY"!==n.type&&"RSA PRIVATE KEY"!==n.type){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&"ENCRYPTED"===n.procType.type){var a,s;switch(n.dekInfo.algorithm){case"DES-CBC":a=8,s=o.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,s=o.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,s=o.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,s=o.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,s=o.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,s=function(e){return o.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":a=8,s=function(e){return o.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":a=16,s=function(e){return o.rc2.createDecryptionCipher(e,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var c=o.util.hexToBytes(n.dekInfo.parameters),h=o.pbe.opensslDeriveBytes(t,c.substr(0,8),a),f=s(h);if(f.start(c),f.update(o.util.createBuffer(n.body)),!f.finish())return r;r=f.output.getBytes()}else r=n.body;return r="ENCRYPTED PRIVATE KEY"===n.type?l.decryptPrivateKeyInfo(u.fromDer(r),t):u.fromDer(r),null!==r&&(r=l.privateKeyFromAsn1(r)),r},l.pbe.generatePkcs12Key=function(e,t,r,n,i,a){var s,c;if(void 0===a||null===a){if(!("sha1"in o.md))throw new Error('"sha1" hash algorithm unavailable.');a=o.md.sha1.create()}var u=a.digestLength,l=a.blockLength,h=new o.util.ByteBuffer,f=new o.util.ByteBuffer;if(null!==e&&void 0!==e){for(c=0;c<e.length;c++)f.putInt16(e.charCodeAt(c));f.putInt16(0)}var p=f.length(),d=t.length(),g=new o.util.ByteBuffer;g.fillWithByte(r,l);var y=l*Math.ceil(d/l),v=new o.util.ByteBuffer;for(c=0;c<y;c++)v.putByte(t.at(c%d));var m=l*Math.ceil(p/l),C=new o.util.ByteBuffer;for(c=0;c<m;c++)C.putByte(f.at(c%p));var E=v;E.putBuffer(C);for(var S=Math.ceil(i/u),_=1;_<=S;_++){var b=new o.util.ByteBuffer;b.putBytes(g.bytes()),b.putBytes(E.bytes());for(var T=0;T<n;T++)a.start(),a.update(b.getBytes()),b=a.digest();var B=new o.util.ByteBuffer;for(c=0;c<l;c++)B.putByte(b.at(c%u));var I=Math.ceil(d/l)+Math.ceil(p/l),A=new o.util.ByteBuffer;for(s=0;s<I;s++){var w=new o.util.ByteBuffer(E.getBytes(l)),k=511;for(c=B.length()-1;c>=0;c--)k>>=8,k+=B.at(c)+w.at(c),w.setAt(c,255&k);A.putBuffer(w)}E=A,h.putBuffer(b)}return h.truncate(h.length()-i),h},l.pbe.getCipher=function(e,t,r){switch(e){case l.oids.pkcs5PBES2:return l.pbe.getCipherForPBES2(e,t,r);case l.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case l.oids["pbewithSHAAnd40BitRC2-CBC"]:return l.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}},l.pbe.getCipherForPBES2=function(e,t,r){var n={},a=[];if(!u.validate(t,p,n,a)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=a,s}if((e=u.derToOid(n.kdfOid))!==l.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=e,s.supportedOids=["pkcs5PBKDF2"],s}if((e=u.derToOid(n.encOid))!==l.oids["aes128-CBC"]&&e!==l.oids["aes192-CBC"]&&e!==l.oids["aes256-CBC"]&&e!==l.oids["des-EDE3-CBC"]&&e!==l.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=e,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var c=n.kdfSalt,h=o.util.createBuffer(n.kdfIterationCount);h=h.getInt(h.length()<<3);var f,d;switch(l.oids[e]){case"aes128-CBC":f=16,d=o.aes.createDecryptionCipher;break;case"aes192-CBC":f=24,d=o.aes.createDecryptionCipher;break;case"aes256-CBC":f=32,d=o.aes.createDecryptionCipher;break;case"des-EDE3-CBC":f=24,d=o.des.createDecryptionCipher;break;case"desCBC":f=8,d=o.des.createDecryptionCipher}var g=i(n.prfOid),y=o.pkcs5.pbkdf2(r,c,h,f,g),v=n.encIv,m=d(y);return m.start(v),m},l.pbe.getCipherForPKCS12PBE=function(e,t,r){var n={},a=[];if(!u.validate(t,d,n,a)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=a,s}var c=o.util.createBuffer(n.salt),h=o.util.createBuffer(n.iterations);h=h.getInt(h.length()<<3);var f,p,g;switch(e){case l.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:f=24,p=8,g=o.des.startDecrypting;break;case l.oids["pbewithSHAAnd40BitRC2-CBC"]:f=5,p=8,g=function(e,t){var r=o.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=e,s}var y=i(n.prfOid),v=l.pbe.generatePkcs12Key(r,c,1,h,f,y);return y.start(),g(v,l.pbe.generatePkcs12Key(r,c,2,h,p,y))},l.pbe.opensslDeriveBytes=function(e,t,r,i){if(void 0===i||null===i){if(!("md5"in o.md))throw new Error('"md5" hash algorithm unavailable.');i=o.md.md5.create()}null===t&&(t="");for(var a=[n(i,e+t)],s=16,c=1;s<r;++c,s+=16)a.push(n(i,a[c-1]+e+t));return a.join("").substr(0,r)}},function(e,t){},function(e,t,r){function n(){o=String.fromCharCode(128),o+=a.util.fillString(String.fromCharCode(0),64),u=[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],c=!0}function i(e,t,r){for(var n,i,a,s,o,c,l,h,f,p,d,g,y,v,m,C=r.length();C>=64;){for(l=0;l<16;++l)t[l]=r.getInt32();for(;l<64;++l)n=t[l-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=t[l-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[l]=n+t[l-7]+i+t[l-16]|0;for(h=e.h0,f=e.h1,p=e.h2,d=e.h3,g=e.h4,y=e.h5,v=e.h6,m=e.h7,l=0;l<64;++l)s=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),o=v^g&(y^v),a=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),c=h&f|p&(h^f),n=m+s+o+u[l]+t[l],i=a+c,m=v,v=y,y=g,g=d+n>>>0,d=p,p=f,f=h,h=n+i>>>0;e.h0=e.h0+h|0,e.h1=e.h1+f|0,e.h2=e.h2+p|0,e.h3=e.h3+d|0,e.h4=e.h4+g|0,e.h5=e.h5+y|0,e.h6=e.h6+v|0,e.h7=e.h7+m|0,C-=64}}var a=r(0);r(5),r(1);var s=e.exports=a.sha256=a.sha256||{};a.md.sha256=a.md.algorithms.sha256=s,s.create=function(){c||n();var e=null,t=a.util.createBuffer(),r=new Array(64),s={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return s.start=function(){s.messageLength=0,s.fullMessageLength=s.messageLength64=[];for(var r=s.messageLengthSize/4,n=0;n<r;++n)s.fullMessageLength.push(0);return t=a.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},s},s.start(),s.update=function(n,o){"utf8"===o&&(n=a.util.encodeUtf8(n));var c=n.length;s.messageLength+=c,c=[c/4294967296>>>0,c>>>0];for(var u=s.fullMessageLength.length-1;u>=0;--u)s.fullMessageLength[u]+=c[1],c[1]=c[0]+(s.fullMessageLength[u]/4294967296>>>0),s.fullMessageLength[u]=s.fullMessageLength[u]>>>0,c[0]=c[1]/4294967296>>>0;return t.putBytes(n),i(e,r,t),(t.read>2048||0===t.length())&&t.compact(),s},s.digest=function(){var n=a.util.createBuffer();n.putBytes(t.bytes());var c=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize,u=c&s.blockLength-1;n.putBytes(o.substr(0,s.blockLength-u));for(var l,h,f=8*s.fullMessageLength[0],p=0;p<s.fullMessageLength.length-1;++p)l=8*s.fullMessageLength[p+1],h=l/4294967296>>>0,f+=h,n.putInt32(f>>>0),f=l>>>0;n.putInt32(f);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};i(d,r,n);var g=a.util.createBuffer();return g.putInt32(d.h0),g.putInt32(d.h1),g.putInt32(d.h2),g.putInt32(d.h3),g.putInt32(d.h4),g.putInt32(d.h5),g.putInt32(d.h6),g.putInt32(d.h7),g},s};var o=null,c=!1,u=null},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(29)),(e.exports=n.prng=n.prng||{}).create=function(e){function t(e){if(o.pools[0].messageLength>=32)return a(),e();var t=32-o.pools[0].messageLength<<5;o.seedFile(t,function(t,r){if(t)return e(t);o.collect(r),a(),e()})}function r(){if(o.pools[0].messageLength>=32)return a();var e=32-o.pools[0].messageLength<<5;o.collect(o.seedFileSync(e)),a()}function a(){var e=o.plugin.md.create();e.update(o.pools[0].digest().getBytes()),o.pools[0].start();for(var t=1,r=1;r<32;++r)(t=31===t?2147483648:t<<2)%o.reseeds==0&&(e.update(o.pools[r].digest().getBytes()),o.pools[r].start());var n=e.digest().getBytes();e.start(),e.update(n);var i=e.digest().getBytes();o.key=o.plugin.formatKey(n),o.seed=o.plugin.formatSeed(i),o.reseeds=4294967295===o.reseeds?0:o.reseeds+1,o.generated=0}function s(e){var t=null;if("undefined"!=typeof window){var r=window.crypto||window.msCrypto;r&&r.getRandomValues&&(t=function(e){return r.getRandomValues(e)})}var i=n.util.createBuffer();if(t)for(;i.length()<e;){var a=Math.max(1,Math.min(e-i.length(),65536)/4),s=new Uint32Array(Math.floor(a));try{t(s);for(var o=0;o<s.length;++o)i.putInt32(s[o])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(i.length()<e)for(var c,u,l,h=Math.floor(65536*Math.random());i.length()<e;){u=16807*(65535&h),c=16807*(h>>16),u+=(32767&c)<<16,u+=c>>15,u=(2147483647&u)+(u>>31),h=4294967295&u;for(var o=0;o<3;++o)l=h>>>(o<<3),l^=Math.floor(256*Math.random()),i.putByte(String.fromCharCode(255&l))}return i.getBytes(e)}for(var o={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0},c=e.md,u=new Array(32),l=0;l<32;++l)u[l]=c.create();return o.pools=u,o.pool=0,o.generate=function(e,r){function i(h){if(h)return r(h);if(l.length()>=e)return r(null,l.getBytes(e));if(o.generated>1048575&&(o.key=null),null===o.key)return n.util.nextTick(function(){t(i)});var f=a(o.key,o.seed);o.generated+=f.length,l.putBytes(f),o.key=c(a(o.key,s(o.seed))),o.seed=u(a(o.key,o.seed)),n.util.setImmediate(i)}if(!r)return o.generateSync(e);var a=o.plugin.cipher,s=o.plugin.increment,c=o.plugin.formatKey,u=o.plugin.formatSeed,l=n.util.createBuffer();o.key=null,i()},o.generateSync=function(e){var t=o.plugin.cipher,i=o.plugin.increment,a=o.plugin.formatKey,s=o.plugin.formatSeed;o.key=null;for(var c=n.util.createBuffer();c.length()<e;){o.generated>1048575&&(o.key=null),null===o.key&&r();var u=t(o.key,o.seed);o.generated+=u.length,c.putBytes(u),o.key=a(t(o.key,i(o.seed))),o.seed=s(t(o.key,o.seed))}return c.getBytes(e)},i?(o.seedFile=function(e,t){i.randomBytes(e,function(e,r){if(e)return t(e);t(null,r.toString())})},o.seedFileSync=function(e){return i.randomBytes(e).toString()}):(o.seedFile=function(e,t){try{t(null,s(e))}catch(e){t(e)}},o.seedFileSync=s),o.collect=function(e){for(var t=e.length,r=0;r<t;++r)o.pools[o.pool].update(e.substr(r,1)),o.pool=31===o.pool?0:o.pool+1},o.collectInt=function(e,t){for(var r="",n=0;n<t;n+=8)r+=String.fromCharCode(e>>n&255);o.collect(r)},o.registerWorker=function(e){if(e===self)o.seedFile=function(e,t){function r(e){var n=e.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",r),t(n.forge.prng.err,n.forge.prng.bytes))}self.addEventListener("message",r),self.postMessage({forge:{prng:{needed:e}}})};else{var t=function(t){var r=t.data;r.forge&&r.forge.prng&&o.seedFile(r.forge.prng.needed,function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})})};e.addEventListener("message",t)}},o}},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],a=[1,2,3,5],s=function(e,t){return e<<t&65535|(65535&e)>>16-t},o=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,a=e,s=e.length(),o=t,c=Math.ceil(o/8),u=255>>(7&o);for(r=s;r<128;r++)a.putByte(i[a.at(r-1)+a.at(r-s)&255]);for(a.setAt(128-c,i[a.at(128-c)&u]),r=127-c;r>=0;r--)a.setAt(r,i[a.at(r+1)^a.at(r+c)]);return a};var c=function(e,t,r){var i,c,u,l,h=!1,f=null,p=null,d=null,g=[];for(e=n.rc2.expandKey(e,t),u=0;u<64;u++)g.push(e.getInt16Le());r?(i=function(e){for(u=0;u<4;u++)e[u]+=g[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),e[u]=s(e[u],a[u]),l++},c=function(e){for(u=0;u<4;u++)e[u]+=g[63&e[(u+3)%4]]}):(i=function(e){for(u=3;u>=0;u--)e[u]=o(e[u],a[u]),e[u]-=g[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]-=g[63&e[(u+3)%4]]});var y=function(e){var t=[];for(u=0;u<4;u++){var n=f.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 a=0;a<e[i][0];a++)e[i][1](t);for(u=0;u<4;u++)null!==d&&(r?d.putInt16Le(t[u]):t[u]^=d.getInt16Le()),p.putInt16Le(t[u])},v=null;return v={start:function(e,t){e&&"string"==typeof e&&(e=n.util.createBuffer(e)),h=!1,f=n.util.createBuffer(),p=t||new n.util.createBuffer,d=e,v.output=p},update:function(e){for(h||f.putBuffer(e);f.length()>=8;)y([[5,i],[1,c],[6,i],[1,c],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,f,!r);else{var n=8===f.length()?8:8-f.length();f.fillWithByte(n,n)}if(t&&(h=!0,v.update()),!r&&(t=0===f.length()))if(e)t=e(8,p,!r);else{var i=p.length(),a=p.at(i-1);a>i?t=!1:p.truncate(a)}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){function n(e,t,r){r||(r=i.md.sha1.create());for(var n="",a=Math.ceil(t/r.digestLength),s=0;s<a;++s){var o=String.fromCharCode(s>>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(e+o),n+=r.digest().getBytes()}return n.substring(0,t)}var i=r(0);r(1),r(3),r(13);var a=e.exports=i.pkcs1=i.pkcs1||{};a.encode_rsa_oaep=function(e,t,r){var a,s,o,c;"string"==typeof r?(a=r,s=arguments[3]||void 0,o=arguments[4]||void 0):r&&(a=r.label||void 0,s=r.seed||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),o?o.start():o=i.md.sha1.create(),c||(c=o);var u=Math.ceil(e.n.bitLength()/8),l=u-2*o.digestLength-2;if(t.length>l){var h=new Error("RSAES-OAEP input message length is too long.");throw h.length=t.length,h.maxLength=l,h}a||(a=""),o.update(a,"raw");for(var f=o.digest(),p="",d=l-t.length,g=0;g<d;g++)p+="\0";var y=f.getBytes()+p+""+t;if(s){if(s.length!==o.digestLength){var h=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw h.seedLength=s.length,h.digestLength=o.digestLength,h}}else s=i.random.getBytes(o.digestLength);var v=n(s,u-o.digestLength-1,c),m=i.util.xorBytes(y,v,y.length),C=n(m,o.digestLength,c);return"\0"+i.util.xorBytes(s,C,s.length)+m},a.decode_rsa_oaep=function(e,t,r){var a,s,o;"string"==typeof r?(a=r,s=arguments[3]||void 0):r&&(a=r.label||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md));var c=Math.ceil(e.n.bitLength()/8);if(t.length!==c){var u=new Error("RSAES-OAEP encoded message length is invalid.");throw u.length=t.length,u.expectedLength=c,u}if(void 0===s?s=i.md.sha1.create():s.start(),o||(o=s),c<2*s.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");a||(a=""),s.update(a,"raw");for(var l=s.digest().getBytes(),h=t.charAt(0),f=t.substring(1,s.digestLength+1),p=t.substring(1+s.digestLength),d=n(p,s.digestLength,o),g=i.util.xorBytes(f,d,f.length),y=n(g,c-s.digestLength-1,o),v=i.util.xorBytes(p,y,p.length),m=v.substring(0,s.digestLength),u="\0"!==h,C=0;C<s.digestLength;++C)u|=l.charAt(C)!==m.charAt(C);for(var E=1,S=s.digestLength,_=s.digestLength;_<v.length;_++){var b=v.charCodeAt(_),T=1&b^1;u|=b&(E?65534:0),E&=T,S+=E}if(u||1!==v.charCodeAt(S))throw new Error("Invalid RSAES-OAEP padding.");return v.substring(S+1)}},function(e,t,r){var n=r(0);r(1),r(20),r(3),function(){function t(e,t,n,i){return"workers"in n?a(e,t,n,i):r(e,t,n,i)}function r(e,t,r,n){var a=s(e,t),c=o(a.bitLength());"millerRabinTests"in r&&(c=r.millerRabinTests);var u=10;"maxBlockTime"in r&&(u=r.maxBlockTime),i(a,e,t,0,c,u,n)}function i(e,t,r,a,o,c,u){var h=+new Date;do{if(e.bitLength()>t&&(e=s(t,r)),e.isProbablePrime(o))return u(null,e);e.dAddOffset(l[a++%8],0)}while(c<0||+new Date-h<c);n.util.setImmediate(function(){i(e,t,r,a,o,c,u)})}function a(e,t,i,a){function o(){function r(r){if(!d){--o;var i=r.data;if(i.found){for(var l=0;l<n.length;++l)n[l].terminate();return d=!0,a(null,new u(i.prime,16))}c.bitLength()>e&&(c=s(e,t));var p=c.toString(16);r.target.postMessage({hex:p,workLoad:h}),c.dAddOffset(f,0)}}l=Math.max(1,l);for(var n=[],i=0;i<l;++i)n[i]=new Worker(p);for(var o=l,i=0;i<l;++i)n[i].addEventListener("message",r);var d=!1}if("undefined"==typeof Worker)return r(e,t,i,a);var c=s(e,t),l=i.workers,h=i.workLoad||100,f=30*h/8,p=i.workerScript||"forge/prime.worker.js";if(-1===l)return n.util.estimateCores(function(e,t){e&&(t=2),l=t-1,o()});o()}function s(e,t){var r=new u(e,t),n=e-1;return r.testBit(n)||r.bitwiseTo(u.ONE.shiftLeft(n),f,r),r.dAddOffset(31-r.mod(h).byteValue(),0),r}function o(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}if(n.prime)return void(e.exports=n.prime);var c=e.exports=n.prime=n.prime||{},u=n.jsbn.BigInteger,l=[6,4,2,4,2,4,6,2],h=new u(null);h.fromInt(30);var f=function(e,t){return e|t};c.generateProbablePrime=function(e,r,i){"function"==typeof r&&(i=r,r={}),r=r||{};var a=r.algorithm||"PRIMEINC";"string"==typeof a&&(a={name:a}),a.options=a.options||{};var s=r.prng||n.random,o={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===a.name)return t(e,o,a.options,i);throw new Error("Invalid prime generation algorithm: "+a.name)}}()},function(e,t,r){function n(e,t,r,n){for(var i=[],a=0;a<e.length;a++)for(var s=0;s<e[a].safeBags.length;s++){var o=e[a].safeBags[s];void 0!==n&&o.type!==n||(null!==t?void 0!==o.attributes[t]&&o.attributes[t].indexOf(r)>=0&&i.push(o):i.push(o))}return i}function i(e){if(e.composed||e.constructed){for(var t=u.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 a(e,t,r,n){if(t=l.fromDer(t,r),t.tagClass!==l.Class.UNIVERSAL||t.type!==l.Type.SEQUENCE||!0!==t.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var a=0;a<t.value.length;a++){var c=t.value[a],u={},f=[];if(!l.validate(c,p,u,f)){var d=new Error("Cannot read ContentInfo.");throw d.errors=f,d}var g={encrypted:!1},y=null,v=u.content.value[0];switch(l.derToOid(u.contentType)){case h.oids.data:if(v.tagClass!==l.Class.UNIVERSAL||v.type!==l.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");y=i(v).value;break;case h.oids.encryptedData:y=s(v,n),g.encrypted=!0;break;default:var d=new Error("Unsupported PKCS#12 contentType.");throw d.contentType=l.derToOid(u.contentType),d}g.safeBags=o(y,r,n),e.safeContents.push(g)}}function s(e,t){var r={},n=[];if(!l.validate(e,u.pkcs7.asn1.encryptedDataValidator,r,n)){var a=new Error("Cannot read EncryptedContentInfo.");throw a.errors=n,a}var s=l.derToOid(r.contentType);if(s!==h.oids.data){var a=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw a.oid=s,a}s=l.derToOid(r.encAlgorithm);var o=h.pbe.getCipher(s,r.encParameter,t),c=i(r.encryptedContentAsn1),f=u.util.createBuffer(c.value);if(o.update(f),!o.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return o.output.getBytes()}function o(e,t,r){if(!t&&0===e.length)return[];if(e=l.fromDer(e,t),e.tagClass!==l.Class.UNIVERSAL||e.type!==l.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var n=[],i=0;i<e.value.length;i++){var a=e.value[i],s={},o=[];if(!l.validate(a,g,s,o)){var u=new Error("Cannot read SafeBag.");throw u.errors=o,u}var f={type:l.derToOid(s.bagId),attributes:c(s.bagAttributes)};n.push(f);var p,d,y=s.bagValue.value[0];switch(f.type){case h.oids.pkcs8ShroudedKeyBag:if(null===(y=h.decryptPrivateKeyInfo(y,r)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case h.oids.keyBag:try{f.key=h.privateKeyFromAsn1(y)}catch(e){f.key=null,f.asn1=y}continue;case h.oids.certBag:p=v,d=function(){if(l.derToOid(s.certId)!==h.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=l.derToOid(s.certId),e}var r=l.fromDer(s.cert,t);try{f.cert=h.certificateFromAsn1(r,!0)}catch(e){f.cert=null,f.asn1=r}};break;default:var u=new Error("Unsupported PKCS#12 SafeBag type.");throw u.oid=f.type,u}if(void 0!==p&&!l.validate(y,p,s,o)){var u=new Error("Cannot read PKCS#12 "+p.name);throw u.errors=o,u}d()}return n}function c(e){var t={};if(void 0!==e)for(var r=0;r<e.length;++r){var n={},i=[];if(!l.validate(e[r],y,n,i)){var a=new Error("Cannot read PKCS#12 BagAttribute.");throw a.errors=i,a}var s=l.derToOid(n.oid);if(void 0!==h.oids[s]){t[h.oids[s]]=[];for(var o=0;o<n.values.length;++o)t[h.oids[s]].push(n.values[o].value)}}return t}var u=r(0);r(4),r(12),r(10),r(36),r(28),r(3),r(15),r(13),r(1),r(21);var l=u.asn1,h=u.pki,f=e.exports=u.pkcs12=u.pkcs12||{},p={name:"ContentInfo",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:l.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},d={name:"PFX",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:l.Class.UNIVERSAL,type:l.Type.INTEGER,constructed:!1,capture:"version"},p,{name:"PFX.macData",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:l.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:l.Class.UNIVERSAL,type:l.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:l.Class.UNIVERSAL,type:l.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:l.Class.UNIVERSAL,type:l.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},g={name:"SafeBag",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:l.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:l.Class.UNIVERSAL,type:l.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},y={name:"Attribute",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:l.Class.UNIVERSAL,type:l.Type.SET,constructed:!0,capture:"values"}]},v={name:"CertBag",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:l.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:l.Class.UNIVERSAL,type:l.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};f.pkcs12FromAsn1=function(e,t,r){"string"==typeof t?(r=t,t=!0):void 0===t&&(t=!0);var s={},o=[];if(!l.validate(e,d,s,o)){var c=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw c.errors=c,c}var p={version:s.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=u.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(r[e.bagType]=n(p.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=n(p.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(r.friendlyName=n(p.safeContents,"friendlyName",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return n(p.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return n(p.safeContents,"localKeyId",e,t)}};if(3!==s.version.charCodeAt(0)){var c=new Error("PKCS#12 PFX of version other than 3 not supported.");throw c.version=s.version.charCodeAt(0),c}if(l.derToOid(s.contentType)!==h.oids.data){var c=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw c.oid=l.derToOid(s.contentType),c}var g=s.content.value[0];if(g.tagClass!==l.Class.UNIVERSAL||g.type!==l.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(g=i(g),s.mac){var y=null,v=0,m=l.derToOid(s.macAlgorithm);switch(m){case h.oids.sha1:y=u.md.sha1.create(),v=20;break;case h.oids.sha256:y=u.md.sha256.create(),v=32;break;case h.oids.sha384:y=u.md.sha384.create(),v=48;break;case h.oids.sha512:y=u.md.sha512.create(),v=64;break;case h.oids.md5:y=u.md.md5.create(),v=16}if(null===y)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+m);var C=new u.util.ByteBuffer(s.macSalt),E="macIterations"in s?parseInt(u.util.bytesToHex(s.macIterations),16):1,S=f.generateKey(r,C,3,E,v,y),_=u.hmac.create();_.start(y,S),_.update(g.value);if(_.getMac().getBytes()!==s.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return a(p,g.value,t,r),p},f.toPkcs12Asn1=function(e,t,r,n){n=n||{},n.saltSize=n.saltSize||8,n.count=n.count||2048,n.algorithm=n.algorithm||n.encAlgorithm||"aes128","useMac"in n||(n.useMac=!0),"localKeyId"in n||(n.localKeyId=null),"generateLocalKeyId"in n||(n.generateLocalKeyId=!0);var i,a=n.localKeyId;if(null!==a)a=u.util.hexToBytes(a);else if(n.generateLocalKeyId)if(t){var s=u.util.isArray(t)?t[0]:t;"string"==typeof s&&(s=h.certificateFromPem(s));var o=u.md.sha1.create();o.update(l.toDer(h.certificateToAsn1(s)).getBytes()),a=o.digest().getBytes()}else a=u.random.getBytes(20);var c=[];null!==a&&c.push(l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(h.oids.localKeyId).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.SET,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,a)])])),"friendlyName"in n&&c.push(l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(h.oids.friendlyName).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.SET,!0,[l.create(l.Class.UNIVERSAL,l.Type.BMPSTRING,!1,n.friendlyName)])])),c.length>0&&(i=l.create(l.Class.UNIVERSAL,l.Type.SET,!0,c));var p=[],d=[];null!==t&&(d=u.util.isArray(t)?t:[t]);for(var g=[],y=0;y<d.length;++y){t=d[y],"string"==typeof t&&(t=h.certificateFromPem(t));var v=0===y?i:void 0,m=h.certificateToAsn1(t),C=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(h.oids.certBag).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(h.oids.x509Certificate).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,l.toDer(m).getBytes())])])]),v]);g.push(C)}if(g.length>0){var E=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,g),S=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(h.oids.data).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,l.toDer(E).getBytes())])]);p.push(S)}var _=null;if(null!==e){var b=h.wrapRsaPrivateKey(h.privateKeyToAsn1(e));_=null===r?l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(h.oids.keyBag).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[b]),i]):l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(h.oids.pkcs8ShroudedKeyBag).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[h.encryptPrivateKeyInfo(b,r,n)]),i]);var T=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[_]),B=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(h.oids.data).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,l.toDer(T).getBytes())])]);p.push(B)}var I,A=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,p);if(n.useMac){var o=u.md.sha1.create(),w=new u.util.ByteBuffer(u.random.getBytes(n.saltSize)),k=n.count,e=f.generateKey(r,w,3,k,20),N=u.hmac.create();N.start(o,e),N.update(l.toDer(A).getBytes());var R=N.getMac();I=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(h.oids.sha1).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.NULL,!1,"")]),l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,R.getBytes())]),l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,w.getBytes()),l.create(l.Class.UNIVERSAL,l.Type.INTEGER,!1,l.integerToDer(k).getBytes())])}return l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.INTEGER,!1,l.integerToDer(3).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(h.oids.data).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,l.toDer(A).getBytes())])]),I])},f.generateKey=u.pbe.generatePkcs12Key},function(e,t,r){var n=r(0);r(4),r(1);var i=n.asn1,a=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=a;var s={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"}]};a.contentInfoValidator=s;var o={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"}]};a.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(o)},a.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(o)};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"}]};a.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"},s,{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]}]},a.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,a=Math.ceil(r/e.digestLength),s=0;s<a;s++){var o=new n.util.ByteBuffer;o.putInt32(s),e.start(),e.update(t+o.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(1),e.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var i={},a=[],s=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var o=0;o<n.log.levels.length;++o){var c=n.log.levels[o];i[c]={index:o,name:c.toUpperCase()}}n.log.logMessage=function(e){for(var t=i[e.level].index,r=0;r<a.length;++r){var s=a[r];if(s.flags&n.log.NO_LEVEL_CHECK)s.f(e);else{t<=i[s.level].index&&s.f(s,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([]||e.arguments),e.full=n.util.format.apply(this,t)}},n.log.prepareStandardFull=function(e){"standardFull"in e||(n.log.prepareStandard(e),e.standardFull=e.standard)};for(var u=["error","warning","info","debug","verbose"],o=0;o<u.length;++o)!function(e){n.log[e]=function(t,r){var i=Array.prototype.slice.call(arguments).slice(2),a={timestamp:new Date,level:e,category:t,message:r,arguments:i};n.log.logMessage(a)}}(u[o]);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){var a=n.log.levels[i];if(t==a){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){a.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},f=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(f)}else{var f=function(e,t){n.log.prepareStandardFull(t),console.log(t.standardFull)};l=n.log.makeLogger(f)}n.log.setLevel(l,"debug"),n.log.addLogger(l),s=l}else console={log:function(){}};if(null!==s){var p=n.util.getQueryVariables();if("console.level"in p&&n.log.setLevel(s,p["console.level"].slice(-1)[0]),"console.lock"in p){"true"==p["console.lock"].slice(-1)[0]&&n.log.lock(s)}}n.log.consoleLogger=s},function(e,t,r){"use strict";function n(e,t){var r=e.split(o),n=r[0],i=r[1];return(0,s.envelopeUnseal)(n,t).then(function(e){var t=a.util.hexToBytes(e.key),r=a.util.hexToBytes(e.iv),n=a.util.createBuffer(a.util.decode64(i)),s=a.cipher.createDecipher("AES-CBC",t);s.start({iv:r}),s.update(n),s.finish();var o=s.output.toString();if(!o)throw new Error("Unable to decrypt image.");return o})}t.__esModule=!0;var i=r(2),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),s=r(8),o="-";t.default=n},function(e,t,r){"use strict";function n(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return t}t.__esModule=!0,t.default=n},function(e,t,r){"use strict";function n(e){return e.replace(new RegExp("["+c.join("")+"]","g"),function(){for(var e=100;e--;){var t=s.random.getBytesSync(1);if(-1===c.indexOf(t))return t}throw new Error("Failed to regenerate reserved bytes in key/iv.")})}function i(){return new Promise(function(e){var t=n(s.util.bytesToHex(s.random.getBytesSync(32))),r=n(s.util.bytesToHex(s.random.getBytesSync(16)));e({key:t,iv:r,keyIV:[t,r].join(o)})})}t.__esModule=!0;var a=r(2),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(a),o="|",c=[o];t.default=i},function(e,t,r){"use strict";var n=r(7).assign,i=r(82),a=r(85),s=r(48),o={};n(o,i,a,s),e.exports=o},function(e,t,r){"use strict";function n(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,s=0;0!==r;){s=r>2e3?2e3:r,r-=s;do{i=i+t[n++]|0,a=a+i|0}while(--s);i%=65521,a%=65521}return i|a<<16|0}e.exports=n},function(e,t,r){"use strict";function n(e,t,r,n){var a=i,s=n+r;e^=-1;for(var o=n;o<s;o++)e=e>>>8^a[255&(e^t[o])];return-1^e}var i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=n},function(e,t,r){"use strict";function n(e,t){if(t<65534&&(e.subarray&&s||!e.subarray&&a))return String.fromCharCode.apply(null,i.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}var i=r(7),a=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(e){a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){s=!1}for(var o=new i.Buf8(256),c=0;c<256;c++)o[c]=c>=252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;o[254]=o[254]=1,t.string2buf=function(e){var t,r,n,a,s,o=e.length,c=0;for(a=0;a<o;a++)r=e.charCodeAt(a),55296==(64512&r)&&a+1<o&&56320==(64512&(n=e.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++),c+=r<128?1:r<2048?2:r<65536?3:4;for(t=new i.Buf8(c),s=0,a=0;s<c;a++)r=e.charCodeAt(a),55296==(64512&r)&&a+1<o&&56320==(64512&(n=e.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++),r<128?t[s++]=r:r<2048?(t[s++]=192|r>>>6,t[s++]=128|63&r):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|63&r):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|63&r);return t},t.buf2binstring=function(e){return n(e,e.length)},t.binstring2buf=function(e){for(var t=new i.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},t.buf2string=function(e,t){var r,i,a,s,c=t||e.length,u=new Array(2*c);for(i=0,r=0;r<c;)if((a=e[r++])<128)u[i++]=a;else if((s=o[a])>4)u[i++]=65533,r+=s-1;else{for(a&=2===s?31:3===s?15:7;s>1&&r<c;)a=a<<6|63&e[r++],s--;s>1?u[i++]=65533:a<65536?u[i++]=a:(a-=65536,u[i++]=55296|a>>10&1023,u[i++]=56320|1023&a)}return n(u,i)},t.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+o[e[r]]>t?r:t}},function(e,t,r){"use strict";function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=n},function(e,t,r){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t,r){"use strict";function n(e){for(var t=e.length(),r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;i<t;i++)n[i]=e.getByte();return r}t.__esModule=!0,t.default=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var i=r(51),a=n(i),s=r(52),o=n(s);self.Promise||(self.Promise=a.default),new o.default(function(e){return self.addEventListener("message",function(t){return e(t.data)})},function(e){return self.postMessage(e)})},function(e,t){!function(t){function r(){}function n(e,t){return function(){e.apply(t,arguments)}}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function a(e,t){for(;3===e._state;)e=e._value;if(0===e._state)return void e._deferreds.push(t);e._handled=!0,i._immediateFn(function(){var r=1===e._state?t.onFulfilled:t.onRejected;if(null===r)return void(1===e._state?s:o)(t.promise,e._value);var n;try{n=r(e._value)}catch(e){return void o(t.promise,e)}s(t.promise,n)})}function s(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var r=t.then;if(t instanceof i)return e._state=3,e._value=t,void c(e);if("function"==typeof r)return void l(n(r,t),e)}e._state=1,e._value=t,c(e)}catch(t){o(e,t)}}function o(e,t){e._state=2,e._value=t,c(e)}function c(e){2===e._state&&0===e._deferreds.length&&i._immediateFn(function(){e._handled||i._unhandledRejectionFn(e._value)});for(var t=0,r=e._deferreds.length;t<r;t++)a(e,e._deferreds[t]);e._deferreds=null}function u(e,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=r}function l(e,t){var r=!1;try{e(function(e){r||(r=!0,s(t,e))},function(e){r||(r=!0,o(t,e))})}catch(e){if(r)return;r=!0,o(t,e)}}var h=setTimeout;i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(r);return a(this,new u(e,t,n)),n},i.all=function(e){var t=Array.prototype.slice.call(e);return new i(function(e,r){function n(a,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var o=s.then;if("function"==typeof o)return void o.call(s,function(e){n(a,e)},r)}t[a]=s,0==--i&&e(t)}catch(e){r(e)}}if(0===t.length)return e([]);for(var i=t.length,a=0;a<t.length;a++)n(a,t[a])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(t){t(e)})},i.reject=function(e){return new i(function(t,r){r(e)})},i.race=function(e){return new i(function(t,r){for(var n=0,i=e.length;n<i;n++)e[n].then(t,r)})},i._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){h(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},void 0!==e&&e.exports?e.exports=i:t.Promise||(t.Promise=i)}(this)},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=r(53),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),s=r(91)("CryptoWorker"),o=function e(t,r){function i(e){var t=e.type,n=e.args,i=void 0===n?[]:n;if(t in a){s('Invoking "'+t+'" crypto function');var c=a[t];Promise.resolve(c.apply(void 0,i)).then(function(e){return r(e)}).catch(o)}else o(new Error('Unknown message type "'+t+'"'))}function o(e){s("Error handling message ("+e.message+")"),r({error:{message:e.message,stack:e.stack}})}n(this,e),t(i)};t.default=o},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.transformFile=t.decryptBytes=t.encryptComment=t.decryptManagedPrivateKey=t.generateWrappedSymmetricKey=t.generatePasswordHash=t.generateKeyPair=t.generateKeyIV=t.generateAuthorizationHeaders=t.envelopeUnseal=t.envelopeSeal=t.encryptPrivateKey=t.encryptFileBlock=t.decryptPrivateKey=t.decryptImage=t.decryptFileBlock=t.decryptData=t.decryptComment=void 0;var i=r(54),a=n(i),s=r(69),o=n(s),c=r(70),u=n(c),l=r(40),h=n(l),f=r(71),p=n(f),d=r(72),g=n(d),y=r(73),v=n(y),m=r(8),C=r(74),E=n(C),S=r(42),_=n(S),b=r(76),T=n(b),B=r(77),I=n(B),A=r(78),w=n(A),k=r(79),N=n(k),R=r(80),L=n(R),D=r(81),U=n(D),x=r(90),P=n(x);t.decryptComment=a.default,t.decryptData=o.default,t.decryptFileBlock=u.default,t.decryptImage=h.default,t.decryptPrivateKey=p.default,t.encryptFileBlock=g.default,t.encryptPrivateKey=v.default,t.envelopeSeal=m.envelopeSeal,t.envelopeUnseal=m.envelopeUnseal,t.generateAuthorizationHeaders=E.default,t.generateKeyIV=_.default,t.generateKeyPair=T.default,t.generatePasswordHash=I.default,t.generateWrappedSymmetricKey=w.default,t.decryptManagedPrivateKey=N.default,t.encryptComment=L.default,t.decryptBytes=U.default,t.transformFile=P.default},function(e,t,r){"use strict";function n(e,t,r){return(0,o.envelopeUnseal)(t,r).then(function(t){var r=t.key,n=t.iv,a=(0,i.decrypt)(e,r,{iv:n}).toString(s.default);if(!a)throw new Error("Unable to decrypt comment.");return a})}t.__esModule=!0;var i=r(16),a=r(60),s=function(e){return e&&e.__esModule?e:{default:e}}(a),o=r(8);t.default=n},function(e,t,r){!function(n,i){e.exports=t=i(r(6))}(0,function(e){return function(){function t(e,t,r){for(var n=[],a=0,s=0;s<t;s++)if(s%4){var o=r[e.charCodeAt(s-1)]<<s%4*2,c=r[e.charCodeAt(s)]>>>6-s%4*2;n[a>>>2]|=(o|c)<<24-a%4*8,a++}return i.create(n,a)}var r=e,n=r.lib,i=n.WordArray,a=r.enc;a.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a<r;a+=3)for(var s=t[a>>>2]>>>24-a%4*8&255,o=t[a+1>>>2]>>>24-(a+1)%4*8&255,c=t[a+2>>>2]>>>24-(a+2)%4*8&255,u=s<<16|o<<8|c,l=0;l<4&&a+.75*l<r;l++)i.push(n.charAt(u>>>6*(3-l)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(e){var r=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<n.length;a++)i[n.charCodeAt(a)]=a}var s=n.charAt(64);if(s){var o=e.indexOf(s);-1!==o&&(r=o)}return t(e,r,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64})},function(e,t,r){!function(n,i){e.exports=t=i(r(6))}(0,function(e){return function(t){function r(e,t,r,n,i,a,s){var o=e+(t&r|~t&n)+i+s;return(o<<a|o>>>32-a)+t}function n(e,t,r,n,i,a,s){var o=e+(t&n|r&~n)+i+s;return(o<<a|o>>>32-a)+t}function i(e,t,r,n,i,a,s){var o=e+(t^r^n)+i+s;return(o<<a|o>>>32-a)+t}function a(e,t,r,n,i,a,s){var o=e+(r^(t|~n))+i+s;return(o<<a|o>>>32-a)+t}var s=e,o=s.lib,c=o.WordArray,u=o.Hasher,l=s.algo,h=[];!function(){for(var e=0;e<64;e++)h[e]=4294967296*t.abs(t.sin(e+1))|0}();var f=l.MD5=u.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var s=0;s<16;s++){var o=t+s,c=e[o];e[o]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}var u=this._hash.words,l=e[t+0],f=e[t+1],p=e[t+2],d=e[t+3],g=e[t+4],y=e[t+5],v=e[t+6],m=e[t+7],C=e[t+8],E=e[t+9],S=e[t+10],_=e[t+11],b=e[t+12],T=e[t+13],B=e[t+14],I=e[t+15],A=u[0],w=u[1],k=u[2],N=u[3];A=r(A,w,k,N,l,7,h[0]),N=r(N,A,w,k,f,12,h[1]),k=r(k,N,A,w,p,17,h[2]),w=r(w,k,N,A,d,22,h[3]),A=r(A,w,k,N,g,7,h[4]),N=r(N,A,w,k,y,12,h[5]),k=r(k,N,A,w,v,17,h[6]),w=r(w,k,N,A,m,22,h[7]),A=r(A,w,k,N,C,7,h[8]),N=r(N,A,w,k,E,12,h[9]),k=r(k,N,A,w,S,17,h[10]),w=r(w,k,N,A,_,22,h[11]),A=r(A,w,k,N,b,7,h[12]),N=r(N,A,w,k,T,12,h[13]),k=r(k,N,A,w,B,17,h[14]),w=r(w,k,N,A,I,22,h[15]),A=n(A,w,k,N,f,5,h[16]),N=n(N,A,w,k,v,9,h[17]),k=n(k,N,A,w,_,14,h[18]),w=n(w,k,N,A,l,20,h[19]),A=n(A,w,k,N,y,5,h[20]),N=n(N,A,w,k,S,9,h[21]),k=n(k,N,A,w,I,14,h[22]),w=n(w,k,N,A,g,20,h[23]),A=n(A,w,k,N,E,5,h[24]),N=n(N,A,w,k,B,9,h[25]),k=n(k,N,A,w,d,14,h[26]),w=n(w,k,N,A,C,20,h[27]),A=n(A,w,k,N,T,5,h[28]),N=n(N,A,w,k,p,9,h[29]),k=n(k,N,A,w,m,14,h[30]),w=n(w,k,N,A,b,20,h[31]),A=i(A,w,k,N,y,4,h[32]),N=i(N,A,w,k,C,11,h[33]),k=i(k,N,A,w,_,16,h[34]),w=i(w,k,N,A,B,23,h[35]),A=i(A,w,k,N,f,4,h[36]),N=i(N,A,w,k,g,11,h[37]),k=i(k,N,A,w,m,16,h[38]),w=i(w,k,N,A,S,23,h[39]),A=i(A,w,k,N,T,4,h[40]),N=i(N,A,w,k,l,11,h[41]),k=i(k,N,A,w,d,16,h[42]),w=i(w,k,N,A,v,23,h[43]),A=i(A,w,k,N,E,4,h[44]),N=i(N,A,w,k,b,11,h[45]),k=i(k,N,A,w,I,16,h[46]),w=i(w,k,N,A,p,23,h[47]),A=a(A,w,k,N,l,6,h[48]),N=a(N,A,w,k,m,10,h[49]),k=a(k,N,A,w,B,15,h[50]),w=a(w,k,N,A,y,21,h[51]),A=a(A,w,k,N,b,6,h[52]),N=a(N,A,w,k,d,10,h[53]),k=a(k,N,A,w,S,15,h[54]),w=a(w,k,N,A,f,21,h[55]),A=a(A,w,k,N,C,6,h[56]),N=a(N,A,w,k,I,10,h[57]),k=a(k,N,A,w,v,15,h[58]),w=a(w,k,N,A,T,21,h[59]),A=a(A,w,k,N,g,6,h[60]),N=a(N,A,w,k,_,10,h[61]),k=a(k,N,A,w,p,15,h[62]),w=a(w,k,N,A,E,21,h[63]),u[0]=u[0]+A|0,u[1]=u[1]+w|0,u[2]=u[2]+k|0,u[3]=u[3]+N|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var a=t.floor(n/4294967296),s=n;r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(r.length+1),this._process();for(var o=this._hash,c=o.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return o},clone:function(){var e=u.clone.call(this);return e._hash=this._hash.clone(),e}});s.MD5=u._createHelper(f),s.HmacMD5=u._createHmacHelper(f)}(Math),e.MD5})},function(e,t,r){!function(n,i){e.exports=t=i(r(6))}(0,function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=r.Hasher,a=t.algo,s=[],o=a.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],c=r[4],u=0;u<80;u++){if(u<16)s[u]=0|e[t+u];else{var l=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=l<<1|l>>>31}var h=(n<<5|n>>>27)+c+s[u];h+=u<20?1518500249+(i&a|~i&o):u<40?1859775393+(i^a^o):u<60?(i&a|i&o|a&o)-1894007588:(i^a^o)-899497514,c=o,o=a,a=i<<30|i>>>2,i=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(o),t.HmacSHA1=i._createHmacHelper(o)}(),e.SHA1})},function(e,t,r){!function(n,i){e.exports=t=i(r(6))}(0,function(e){!function(){var t=e,r=t.lib,n=r.Base,i=t.enc,a=i.Utf8,s=t.algo;s.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),s=this._iKey=t.clone(),o=i.words,c=s.words,u=0;u<r;u++)o[u]^=1549556828,c[u]^=909522486;i.sigBytes=s.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})}()})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(6),r(24))}(0,function(e){e.lib.Cipher||function(t){var r=e,n=r.lib,i=n.Base,a=n.WordArray,s=n.BufferedBlockAlgorithm,o=r.enc,c=(o.Utf8,o.Base64),u=r.algo,l=u.EvpKDF,h=n.Cipher=s.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?b:E}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),f=(n.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),r.mode={}),p=n.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),d=f.CBC=function(){function e(e,r,n){var i=this._iv;if(i){var a=i;this._iv=t}else var a=this._prevBlock;for(var s=0;s<n;s++)e[r+s]^=a[s]}var r=p.extend();return r.Encryptor=r.extend({processBlock:function(t,r){var n=this._cipher,i=n.blockSize;e.call(this,t,r,i),n.encryptBlock(t,r),this._prevBlock=t.slice(r,r+i)}}),r.Decryptor=r.extend({processBlock:function(t,r){var n=this._cipher,i=n.blockSize,a=t.slice(r,r+i);n.decryptBlock(t,r),e.call(this,t,r,i),this._prevBlock=a}}),r}(),g=r.pad={},y=g.Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,i=n<<24|n<<16|n<<8|n,s=[],o=0;o<n;o+=4)s.push(i);var c=a.create(s,n);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},v=(n.BlockCipher=h.extend({cfg:h.cfg.extend({mode:d,padding:y}),reset:function(){h.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),n.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),m=r.format={},C=m.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=a.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(c)},parse:function(e){var t=c.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=a.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return v.create({ciphertext:t,salt:n})}},E=n.SerializableCipher=i.extend({cfg:i.extend({format:C}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),a=i.finalize(t),s=i.cfg;return v.create({ciphertext:a,key:r,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),S=r.kdf={},_=S.OpenSSL={execute:function(e,t,r,n){n||(n=a.random(8));var i=l.create({keySize:t+r}).compute(e,n),s=a.create(i.words.slice(t),4*r);return i.sigBytes=4*t,v.create({key:i,iv:s,salt:n})}},b=n.PasswordBasedCipher=E.extend({cfg:E.cfg.extend({kdf:_}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var a=E.encrypt.call(this,e,t,i.key,n);return a.mixIn(i),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,E.decrypt.call(this,e,t,i.key,n)}})}()})},function(e,t,r){!function(n,i){e.exports=t=i(r(6))}(0,function(e){return e.enc.Utf8})},function(e,t,r){function n(e,t,r){var n=t.entity===u.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:u.cipher.createDecipher("AES-CBC",n?r.keys.server_write_key:r.keys.client_write_key),iv:n?r.keys.server_write_IV:r.keys.client_write_IV},e.write.cipherState={init:!1,cipher:u.cipher.createCipher("AES-CBC",n?r.keys.client_write_key:r.keys.server_write_key),iv:n?r.keys.client_write_IV:r.keys.server_write_IV},e.read.cipherFunction=o,e.write.cipherFunction=i,e.read.macLength=e.write.macLength=r.mac_length,e.read.macFunction=e.write.macFunction=l.hmac_sha1}function i(e,t){var r=!1,n=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(n),t.updateSequenceNumber();var i;i=e.version.minor===l.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:u.random.getBytesSync(16),t.cipherState.init=!0;var s=t.cipherState.cipher;return s.start({iv:i}),e.version.minor>=l.Versions.TLS_1_1.minor&&s.output.putBytes(i),s.update(e.fragment),s.finish(a)&&(e.fragment=s.output,e.length=e.fragment.length(),r=!0),r}function a(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function s(e,t,r){var n=!0;if(r){for(var i=t.length(),a=t.last(),s=i-1-a;s<i-1;++s)n=n&&t.at(s)==a;n&&t.truncate(a+1)}return n}function o(e,t){var r=!1;++h;var n;n=e.version.minor===l.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:e.fragment.getBytes(16),t.cipherState.init=!0;var i=t.cipherState.cipher;i.start({iv:n}),i.update(e.fragment),r=i.finish(s);var a=t.macLength,o=u.random.getBytesSync(a),f=i.output.length();f>=a?(e.fragment=i.output.getBytes(f-a),o=i.output.getBytes(a)):e.fragment=i.output.getBytes(),e.fragment=u.util.createBuffer(e.fragment),e.length=e.fragment.length();var p=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),r=c(t.macKey,o,p)&&r}function c(e,t,r){var n=u.hmac.create();return n.start("SHA1",e),n.update(t),t=n.digest().getBytes(),n.start(null,null),n.update(r),r=n.digest().getBytes(),t===r}var u=r(0);r(9),r(26);var l=e.exports=u.tls;l.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=l.BulkCipherAlgorithm.aes,e.cipher_type=l.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=l.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:n},l.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=l.BulkCipherAlgorithm.aes,e.cipher_type=l.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=l.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:n};var h=0},function(e,t,r){var n=r(0);r(37),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},function(e,t,r){function n(e,t,r,n){e.generate=function(e,a){for(var s=new i.util.ByteBuffer,o=Math.ceil(a/n)+r,c=new i.util.ByteBuffer,u=r;u<o;++u){c.putInt32(u),t.start(),t.update(e+c.getBytes());var l=t.digest();s.putBytes(l.getBytes(n))}return s.truncate(s.length()-a),s.getBytes()}}var i=r(0);r(1),r(3),r(20),e.exports=i.kem=i.kem||{};var a=i.jsbn.BigInteger;i.kem.rsa={},i.kem.rsa.create=function(e,t){t=t||{};var r=t.prng||i.random,n={};return n.encrypt=function(t,n){var s,o=Math.ceil(t.n.bitLength()/8);do{s=new a(i.util.bytesToHex(r.getBytesSync(o)),16).mod(t.n)}while(s.equals(a.ZERO));s=i.util.hexToBytes(s.toString(16));var c=o-s.length;return c>0&&(s=i.util.fillString(String.fromCharCode(0),c)+s),{encapsulation:t.encrypt(s,"NONE"),key:e.generate(s,n)}},n.decrypt=function(t,r,n){var i=t.decrypt(r,"NONE");return e.generate(i,n)},n},i.kem.kdf1=function(e,t){n(this,e,0,t||e.digestLength)},i.kem.kdf2=function(e,t){n(this,e,1,t||e.digestLength)}},function(e,t,r){e.exports=r(5),r(18),r(13),r(30),r(65)},function(e,t,r){function n(){c=String.fromCharCode(128),c+=a.util.fillString(String.fromCharCode(0),128),l=[[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]],h={},h["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],h["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],h["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],h["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],u=!0}function i(e,t,r){for(var n,i,a,s,o,c,u,h,f,p,d,g,y,v,m,C,E,S,_,b,T,B,I,A,w,k,N,R,L,D,U,x,P,O,V,K=r.length();K>=128;){for(L=0;L<16;++L)t[L][0]=r.getInt32()>>>0,t[L][1]=r.getInt32()>>>0;for(;L<80;++L)x=t[L-2],D=x[0],U=x[1],n=((D>>>19|U<<13)^(U>>>29|D<<3)^D>>>6)>>>0,i=((D<<13|U>>>19)^(U<<3|D>>>29)^(D<<26|U>>>6))>>>0,O=t[L-15],D=O[0],U=O[1],a=((D>>>1|U<<31)^(D>>>8|U<<24)^D>>>7)>>>0,s=((D<<31|U>>>1)^(D<<24|U>>>8)^(D<<25|U>>>7))>>>0,P=t[L-7],V=t[L-16],U=i+P[1]+s+V[1],t[L][0]=n+P[0]+a+V[0]+(U/4294967296>>>0)>>>0,t[L][1]=U>>>0;for(y=e[0][0],v=e[0][1],m=e[1][0],C=e[1][1],E=e[2][0],S=e[2][1],_=e[3][0],b=e[3][1],T=e[4][0],B=e[4][1],I=e[5][0],A=e[5][1],w=e[6][0],k=e[6][1],N=e[7][0],R=e[7][1],L=0;L<80;++L)u=((T>>>14|B<<18)^(T>>>18|B<<14)^(B>>>9|T<<23))>>>0,h=((T<<18|B>>>14)^(T<<14|B>>>18)^(B<<23|T>>>9))>>>0,f=(w^T&(I^w))>>>0,p=(k^B&(A^k))>>>0,o=((y>>>28|v<<4)^(v>>>2|y<<30)^(v>>>7|y<<25))>>>0,c=((y<<4|v>>>28)^(v<<30|y>>>2)^(v<<25|y>>>7))>>>0,d=(y&m|E&(y^m))>>>0,g=(v&C|S&(v^C))>>>0,U=R+h+p+l[L][1]+t[L][1],n=N+u+f+l[L][0]+t[L][0]+(U/4294967296>>>0)>>>0,i=U>>>0,U=c+g,a=o+d+(U/4294967296>>>0)>>>0,s=U>>>0,N=w,R=k,w=I,k=A,I=T,A=B,U=b+i,T=_+n+(U/4294967296>>>0)>>>0,B=U>>>0,_=E,b=S,E=m,S=C,m=y,C=v,U=i+s,y=n+a+(U/4294967296>>>0)>>>0,v=U>>>0;U=e[0][1]+v,e[0][0]=e[0][0]+y+(U/4294967296>>>0)>>>0,e[0][1]=U>>>0,U=e[1][1]+C,e[1][0]=e[1][0]+m+(U/4294967296>>>0)>>>0,e[1][1]=U>>>0,U=e[2][1]+S,e[2][0]=e[2][0]+E+(U/4294967296>>>0)>>>0,e[2][1]=U>>>0,U=e[3][1]+b,e[3][0]=e[3][0]+_+(U/4294967296>>>0)>>>0,e[3][1]=U>>>0,U=e[4][1]+B,e[4][0]=e[4][0]+T+(U/4294967296>>>0)>>>0,e[4][1]=U>>>0,U=e[5][1]+A,e[5][0]=e[5][0]+I+(U/4294967296>>>0)>>>0,e[5][1]=U>>>0,U=e[6][1]+k,e[6][0]=e[6][0]+w+(U/4294967296>>>0)>>>0,e[6][1]=U>>>0,U=e[7][1]+R,e[7][0]=e[7][0]+N+(U/4294967296>>>0)>>>0,e[7][1]=U>>>0,K-=128}}var a=r(0);r(5),r(1);var s=e.exports=a.sha512=a.sha512||{};a.md.sha512=a.md.algorithms.sha512=s;var o=a.sha384=a.sha512.sha384=a.sha512.sha384||{};o.create=function(){return s.create("SHA-384")},a.md.sha384=a.md.algorithms.sha384=o,a.sha512.sha256=a.sha512.sha256||{create:function(){return s.create("SHA-512/256")}},a.md["sha512/256"]=a.md.algorithms["sha512/256"]=a.sha512.sha256,a.sha512.sha224=a.sha512.sha224||{create:function(){return s.create("SHA-512/224")}},a.md["sha512/224"]=a.md.algorithms["sha512/224"]=a.sha512.sha224,s.create=function(e){if(u||n(),void 0===e&&(e="SHA-512"),!(e in h))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=h[e],r=null,s=a.util.createBuffer(),o=new Array(80),l=0;l<80;++l)o[l]=new Array(2);var f=64;switch(e){case"SHA-384":f=48;break;case"SHA-512/256":f=32;break;case"SHA-512/224":f=28}var p={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:f,messageLength:0,fullMessageLength:null,messageLengthSize:16};return p.start=function(){p.messageLength=0,p.fullMessageLength=p.messageLength128=[];for(var e=p.messageLengthSize/4,n=0;n<e;++n)p.fullMessageLength.push(0);s=a.util.createBuffer(),r=new Array(t.length);for(var n=0;n<t.length;++n)r[n]=t[n].slice(0);return p},p.start(),p.update=function(e,t){"utf8"===t&&(e=a.util.encodeUtf8(e));var n=e.length;p.messageLength+=n,n=[n/4294967296>>>0,n>>>0];for(var c=p.fullMessageLength.length-1;c>=0;--c)p.fullMessageLength[c]+=n[1],n[1]=n[0]+(p.fullMessageLength[c]/4294967296>>>0),p.fullMessageLength[c]=p.fullMessageLength[c]>>>0,n[0]=n[1]/4294967296>>>0;return s.putBytes(e),i(r,o,s),(s.read>2048||0===s.length())&&s.compact(),p},p.digest=function(){var t=a.util.createBuffer();t.putBytes(s.bytes());var n=p.fullMessageLength[p.fullMessageLength.length-1]+p.messageLengthSize,u=n&p.blockLength-1;t.putBytes(c.substr(0,p.blockLength-u));for(var l,h,f=8*p.fullMessageLength[0],d=0;d<p.fullMessageLength.length-1;++d)l=8*p.fullMessageLength[d+1],h=l/4294967296>>>0,f+=h,t.putInt32(f>>>0),f=l>>>0;t.putInt32(f);for(var g=new Array(r.length),d=0;d<r.length;++d)g[d]=r[d].slice(0);i(g,o,t);var y,v=a.util.createBuffer();y="SHA-512"===e?g.length:"SHA-384"===e?g.length-2:g.length-4;for(var d=0;d<y;++d)v.putInt32(g[d][0]),d===y-1&&"SHA-512/224"===e||v.putInt32(g[d][1]);return v},p};var c=null,u=!1,l=null,h=null},function(e,t,r){function n(e){var t={},r=[];if(!d.validate(e,g.asn1.recipientInfoValidator,t,r)){var n=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw n.errors=r,n}return{version:t.version.charCodeAt(0),issuer:p.pki.RDNAttributesAsArray(t.issuer),serialNumber:p.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:d.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function i(e){return d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,d.integerToDer(e.version).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[p.pki.distinguishedNameToAsn1({attributes:e.issuer}),d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,p.util.hexToBytes(e.serialNumber))]),d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(e.encryptedContent.algorithm).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.NULL,!1,"")]),d.create(d.Class.UNIVERSAL,d.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function a(e){for(var t=[],r=0;r<e.length;++r)t.push(n(e[r]));return t}function s(e){for(var t=[],r=0;r<e.length;++r)t.push(i(e[r]));return t}function o(e){var t=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,d.integerToDer(e.version).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[p.pki.distinguishedNameToAsn1({attributes:e.issuer}),d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,p.util.hexToBytes(e.serialNumber))]),d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(e.digestAlgorithm).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(e.signatureAlgorithm).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.NULL,!1,"")])),t.value.push(d.create(d.Class.UNIVERSAL,d.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=d.create(d.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n<e.unauthenticatedAttributes.length;++n){var i=e.unauthenticatedAttributes[n];r.values.push(u(i))}t.value.push(r)}return t}function c(e){for(var t=[],r=0;r<e.length;++r)t.push(o(e[r]));return t}function u(e){var t;if(e.type===p.pki.oids.contentType)t=d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(e.value).getBytes());else if(e.type===p.pki.oids.messageDigest)t=d.create(d.Class.UNIVERSAL,d.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===p.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),n=new Date("2050-01-01T00:00:00Z"),i=e.value;if("string"==typeof i){var a=Date.parse(i);i=isNaN(a)?13===i.length?d.utcTimeToDate(i):d.generalizedTimeToDate(i):new Date(a)}t=i>=r&&i<n?d.create(d.Class.UNIVERSAL,d.Type.UTCTIME,!1,d.dateToUtcTime(i)):d.create(d.Class.UNIVERSAL,d.Type.GENERALIZEDTIME,!1,d.dateToGeneralizedTime(i))}return d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(e.type).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.SET,!0,[t])])}function l(e){return[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(p.pki.oids.data).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(e.algorithm).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.OCTETSTRING,!1,e.parameter.getBytes())]),d.create(d.Class.CONTEXT_SPECIFIC,0,!0,[d.create(d.Class.UNIVERSAL,d.Type.OCTETSTRING,!1,e.content.getBytes())])]}function h(e,t,r){var n={},i=[];if(!d.validate(t,r,n,i)){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw a.errors=a,a}if(d.derToOid(n.contentType)!==p.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(n.encryptedContent){var s="";if(p.util.isArray(n.encryptedContent))for(var o=0;o<n.encryptedContent.length;++o){if(n.encryptedContent[o].type!==d.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");s+=n.encryptedContent[o].value}else s=n.encryptedContent;e.encryptedContent={algorithm:d.derToOid(n.encAlgorithm),parameter:p.util.createBuffer(n.encParameter.value),content:p.util.createBuffer(s)}}if(n.content){var s="";if(p.util.isArray(n.content))for(var o=0;o<n.content.length;++o){if(n.content[o].type!==d.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");s+=n.content[o].value}else s=n.content;e.content=p.util.createBuffer(s)}return e.version=n.version.charCodeAt(0),e.rawCapture=n,n}function f(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 p.pki.oids["aes128-CBC"]:case p.pki.oids["aes192-CBC"]:case p.pki.oids["aes256-CBC"]:t=p.aes.createDecryptionCipher(e.encryptedContent.key);break;case p.pki.oids.desCBC:case p.pki.oids["des-EDE3-CBC"]:t=p.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}}var p=r(0);r(9),r(4),r(14),r(10),r(11),r(36),r(3),r(1),r(21);var d=p.asn1,g=e.exports=p.pkcs7=p.pkcs7||{};g.messageFromPem=function(e){var t=p.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 n=d.fromDer(t.body);return g.messageFromAsn1(n)},g.messageToPem=function(e,t){var r={type:"PKCS7",body:d.toDer(e.toAsn1()).getBytes()};return p.pem.encode(r,{maxline:t})},g.messageFromAsn1=function(e){var t={},r=[];if(!d.validate(e,g.asn1.contentInfoValidator,t,r)){var n=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw n.errors=r,n}var i,a=d.derToOid(t.contentType);switch(a){case p.pki.oids.envelopedData:i=g.createEnvelopedData();break;case p.pki.oids.encryptedData:i=g.createEncryptedData();break;case p.pki.oids.signedData:i=g.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+a+" is not (yet) supported.")}return i.fromAsn1(t.content.value[0]),i},g.createSignedData=function(){function e(){for(var e={},t=0;t<r.signers.length;++t){var n=r.signers[t],i=n.digestAlgorithm;i in e||(e[i]=p.md[p.pki.oids[i]].create()),0===n.authenticatedAttributes.length?n.md=e[i]:n.md=p.md[p.pki.oids[i]].create()}r.digestAlgorithmIdentifiers=[];for(var i in e)r.digestAlgorithmIdentifiers.push(d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(i).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.NULL,!1,"")]));return e}function t(e){if(r.contentInfo.value.length<2)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var t=d.derToOid(r.contentInfo.value[0].value),n=r.contentInfo.value[1];n=n.value[0];var i=d.toDer(n);i.getByte(),d.getBerValueLength(i),i=i.getBytes();for(var a in e)e[a].start().update(i);for(var s=new Date,o=0;o<r.signers.length;++o){var l=r.signers[o];if(0===l.authenticatedAttributes.length){if(t!==p.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{l.authenticatedAttributesAsn1=d.create(d.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var h=d.create(d.Class.UNIVERSAL,d.Type.SET,!0,[]),f=0;f<l.authenticatedAttributes.length;++f){var g=l.authenticatedAttributes[f];g.type===p.pki.oids.messageDigest?g.value=e[l.digestAlgorithm].digest():g.type===p.pki.oids.signingTime&&(g.value||(g.value=s)),h.value.push(u(g)),l.authenticatedAttributesAsn1.value.push(u(g))}i=d.toDer(h).getBytes(),l.md.start().update(i)}l.signature=l.key.sign(l.md,"RSASSA-PKCS1-V1_5")}r.signerInfos=c(r.signers)}var r=null;return r={type:p.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(e){h(r,e,g.asn1.signedDataValidator),r.certificates=[],r.crls=[],r.digestAlgorithmIdentifiers=[],r.contentInfo=null,r.signerInfos=[];for(var t=r.rawCapture.certificates.value,n=0;n<t.length;++n)r.certificates.push(p.pki.certificateFromAsn1(t[n]))},toAsn1:function(){r.contentInfo||r.sign();for(var e=[],t=0;t<r.certificates.length;++t)e.push(p.pki.certificateToAsn1(r.certificates[t]));var n=[],i=d.create(d.Class.CONTEXT_SPECIFIC,0,!0,[d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,d.integerToDer(r.version).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.SET,!0,r.digestAlgorithmIdentifiers),r.contentInfo])]);return e.length>0&&i.value[0].value.push(d.create(d.Class.CONTEXT_SPECIFIC,0,!0,e)),n.length>0&&i.value[0].value.push(d.create(d.Class.CONTEXT_SPECIFIC,1,!0,n)),i.value[0].value.push(d.create(d.Class.UNIVERSAL,d.Type.SET,!0,r.signerInfos)),d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(r.type).getBytes()),i])},addSigner:function(e){var t=e.issuer,n=e.serialNumber;if(e.certificate){var i=e.certificate;"string"==typeof i&&(i=p.pki.certificateFromPem(i)),t=i.issuer.attributes,n=i.serialNumber}var a=e.key;if(!a)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof a&&(a=p.pki.privateKeyFromPem(a));var s=e.digestAlgorithm||p.pki.oids.sha1;switch(s){case p.pki.oids.sha1:case p.pki.oids.sha256:case p.pki.oids.sha384:case p.pki.oids.sha512:case p.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+s)}var o=e.authenticatedAttributes||[];if(o.length>0){for(var c=!1,u=!1,l=0;l<o.length;++l){var h=o[l];if(c||h.type!==p.pki.oids.contentType){if(u||h.type!==p.pki.oids.messageDigest);else if(u=!0,c)break}else if(c=!0,u)break}if(!c||!u)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.")}r.signers.push({key:a,version:1,issuer:t,serialNumber:n,digestAlgorithm:s,signatureAlgorithm:p.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:o,unauthenticatedAttributes:[]})},sign:function(){if(("object"!=typeof r.content||null===r.contentInfo)&&(r.contentInfo=d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(p.pki.oids.data).getBytes())]),"content"in r)){var n;r.content instanceof p.util.ByteBuffer?n=r.content.bytes():"string"==typeof r.content&&(n=p.util.encodeUtf8(r.content)),r.contentInfo.value.push(d.create(d.Class.CONTEXT_SPECIFIC,0,!0,[d.create(d.Class.UNIVERSAL,d.Type.OCTETSTRING,!1,n)]))}if(0!==r.signers.length){t(e())}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(e){"string"==typeof e&&(e=p.pki.certificateFromPem(e)),r.certificates.push(e)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}}},g.createEncryptedData=function(){var e=null;return e={type:p.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:p.pki.oids["aes256-CBC"]},fromAsn1:function(t){h(e,t,g.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),f(e)}}},g.createEnvelopedData=function(){var e=null;return e={type:p.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:p.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=h(e,t,g.asn1.envelopedDataValidator);e.recipients=a(r.recipientInfos.value)},toAsn1:function(){return d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.OID,!1,d.oidToDer(e.type).getBytes()),d.create(d.Class.CONTEXT_SPECIFIC,0,!0,[d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,[d.create(d.Class.UNIVERSAL,d.Type.INTEGER,!1,d.integerToDer(e.version).getBytes()),d.create(d.Class.UNIVERSAL,d.Type.SET,!0,s(e.recipients)),d.create(d.Class.UNIVERSAL,d.Type.SEQUENCE,!0,l(e.encryptedContent))])])])},findRecipient:function(t){for(var r=t.issuer.attributes,n=0;n<e.recipients.length;++n){var i=e.recipients[n],a=i.issuer;if(i.serialNumber===t.serialNumber&&a.length===r.length){for(var s=!0,o=0;o<r.length;++o)if(a[o].type!==r[o].type||a[o].value!==r[o].value){s=!1;break}if(s)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 p.pki.oids.rsaEncryption:case p.pki.oids.desCBC:var n=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=p.util.createBuffer(n);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}f(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:p.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key;var n,i,a;switch(r){case p.pki.oids["aes128-CBC"]:n=16,i=16,a=p.aes.createEncryptionCipher;break;case p.pki.oids["aes192-CBC"]:n=24,i=16,a=p.aes.createEncryptionCipher;break;case p.pki.oids["aes256-CBC"]:n=32,i=16,a=p.aes.createEncryptionCipher;break;case p.pki.oids["des-EDE3-CBC"]:n=24,i=8,a=p.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=p.util.createBuffer(p.random.getBytes(n));else if(t.length()!=n)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+n+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=p.util.createBuffer(p.random.getBytes(i));var s=a(t);if(s.start(e.encryptedContent.parameter.copy()),s.update(e.content),!s.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=s.output}for(var o=0;o<e.recipients.length;++o){var c=e.recipients[o];if(void 0===c.encryptedContent.content)switch(c.encryptedContent.algorithm){case p.pki.oids.rsaEncryption:c.encryptedContent.content=c.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm)}}}}}},function(e,t,r){function n(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var n=s.util.hexToBytes(r);e.putInt32(n.length),e.putBytes(n)}function i(e,t){e.putInt32(t.length),e.putString(t)}function a(){for(var e=s.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}var s=r(0);r(9),r(12),r(18),r(13),r(1);var o=e.exports=s.ssh=s.ssh||{};o.privateKeyToPutty=function(e,t,r){r=r||"",t=t||"";var o=""===t?"none":"aes256-cbc",c="PuTTY-User-Key-File-2: ssh-rsa\r\n";c+="Encryption: "+o+"\r\n",c+="Comment: "+r+"\r\n";var u=s.util.createBuffer();i(u,"ssh-rsa"),n(u,e.e),n(u,e.n);var l=s.util.encode64(u.bytes(),64),h=Math.floor(l.length/66)+1;c+="Public-Lines: "+h+"\r\n",c+=l;var f=s.util.createBuffer();n(f,e.d),n(f,e.p),n(f,e.q),n(f,e.qInv);var p;if(t){var d=f.length()+16-1;d-=d%16;var g=a(f.bytes());g.truncate(g.length()-d+f.length()),f.putBuffer(g);var y=s.util.createBuffer();y.putBuffer(a("\0\0\0\0",t)),y.putBuffer(a("\0\0\0",t));var v=s.aes.createEncryptionCipher(y.truncate(8),"CBC");v.start(s.util.createBuffer().fillWithByte(0,16)),v.update(f.copy()),v.finish();var m=v.output;m.truncate(16),p=s.util.encode64(m.bytes(),64)}else p=s.util.encode64(f.bytes(),64);h=Math.floor(p.length/66)+1,c+="\r\nPrivate-Lines: "+h+"\r\n",c+=p;var C=a("putty-private-key-file-mac-key",t),E=s.util.createBuffer();i(E,"ssh-rsa"),i(E,o),i(E,r),E.putInt32(u.length()),E.putBuffer(u),E.putInt32(f.length()),E.putBuffer(f);var S=s.hmac.create();return S.start("sha1",C),S.update(E.bytes()),c+="\r\nPrivate-MAC: "+S.digest().toHex()+"\r\n"},o.publicKeyToOpenSSH=function(e,t){t=t||"";var r=s.util.createBuffer();return i(r,"ssh-rsa"),n(r,e.e),n(r,e.n),"ssh-rsa "+s.util.encode64(r.bytes())+" "+t},o.privateKeyToOpenSSH=function(e,t){return t?s.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):s.pki.privateKeyToPem(e)},o.getPublicKeyFingerprint=function(e,t){t=t||{};var r=t.md||s.md.md5.create(),a=s.util.createBuffer();i(a,"ssh-rsa"),n(a,e.e),n(a,e.n),r.start(),r.update(a.getBytes());var o=r.digest();if("hex"===t.encoding){var c=o.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if("binary"===t.encoding)return o.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return o}},function(e,t,r){var n=r(0);r(38),r(39),r(1);var i="forge.task",a={},s=0;n.debug.set(i,"tasks",a);var o={};n.debug.set(i,"queues",o);var c="ready",u="running",l="blocked",h="sleeping",f="done",p="error",d="stop",g="start",y={};y[c]={},y[c][d]=c,y[c][g]=u,y[c].cancel=f,y[c].fail=p,y[u]={},y[u][d]=c,y[u][g]=u,y[u].block=l,y[u].unblock=u,y[u].sleep=h,y[u].wakeup=u,y[u].cancel=f,y[u].fail=p,y[l]={},y[l][d]=l,y[l][g]=l,y[l].block=l,y[l].unblock=l,y[l].sleep=l,y[l].wakeup=l,y[l].cancel=f,y[l].fail=p,y[h]={},y[h][d]=h,y[h][g]=h,y[h].block=h,y[h].unblock=h,y[h].sleep=h,y[h].wakeup=h,y[h].cancel=f,y[h].fail=p,y[f]={},y[f][d]=f,y[f][g]=f,y[f].block=f,y[f].unblock=f,y[f].sleep=f,y[f].wakeup=f,y[f].cancel=f,y[f].fail=p,y[p]={},y[p][d]=p,y[p][g]=p,y[p].block=p,y[p].unblock=p,y[p].sleep=p,y[p].wakeup=p,y[p].cancel=p,y[p].fail=p;var v=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=s++,a[this.id]=this};v.prototype.debug=function(e){e=e||"",n.log.debug(i,e,"[%s][%s] task:",this.id,this.name,this,"subtasks:",this.subtasks.length,"queue:",o)},v.prototype.next=function(e,t){"function"==typeof e&&(t=e,e=this.name);var r=new v({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},v.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 a=0;a<t.length;a++){var s=e+"__parallel-"+r.id+"-"+a,o=a;!function(e,r){n.task.start({type:e,run:function(e){t[r](e)},success:function(e){i.unblock()},failure:function(e){i.unblock()}})}(s,o)}})},v.prototype.stop=function(){this.state=y[this.state][d]},v.prototype.start=function(){this.error=!1,this.state=y[this.state][g],this.state===u&&(this.start=new Date,this.run(this),C(this,0))},v.prototype.block=function(e){e=void 0===e?1:e,this.blocks+=e,this.blocks>0&&(this.state=y[this.state].block)},v.prototype.unblock=function(e){return e=void 0===e?1:e,this.blocks-=e,0===this.blocks&&this.state!==f&&(this.state=u,C(this,0)),this.blocks},v.prototype.sleep=function(e){e=void 0===e?0:e,this.state=y[this.state].sleep;var t=this;this.timeoutId=setTimeout(function(){t.timeoutId=null,t.state=u,C(t,0)},e)},v.prototype.wait=function(e){e.wait(this)},v.prototype.wakeup=function(){this.state===h&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state=u,C(this,0))},v.prototype.cancel=function(){this.state=y[this.state].cancel,this.permitsNeeded=0,null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null),this.subtasks=[]},v.prototype.fail=function(e){if(this.error=!0,E(this,!0),e)e.error=this.error,e.swapTime=this.swapTime,e.userData=this.userData,C(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;E(t,!0)}this.failureCallback&&this.failureCallback(this)}};var m=function(e){e.error=!1,e.state=y[e.state][g],setTimeout(function(){e.state===u&&(e.swapTime=+new Date,e.run(e),C(e,0))},0)},C=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||C(n,t)}else E(e),e.error||null!==e.parent&&(e.parent.error=e.error,e.parent.swapTime=e.swapTime,e.parent.userData=e.userData,C(e.parent,t))};r?setTimeout(n,0):n(t)},E=function(e,t){e.state=f,delete a[e.id],null===e.parent&&(e.type in o?0===o[e.type].length?n.log.error(i,"[%s][%s] task queue empty [%s]",e.id,e.name,e.type):o[e.type][0]!==e?n.log.error(i,"[%s][%s] task not first in queue [%s]",e.id,e.name,e.type):(o[e.type].shift(),0===o[e.type].length?delete o[e.type]:o[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 v({run:e.run,name:e.name||"?"});t.type=e.type,t.successCallback=e.success||null,t.failureCallback=e.failure||null,t.type in o?o[e.type].push(t):(o[t.type]=[t],m(t))},n.task.cancel=function(e){e in o&&(o[e]=[o[e][0]])},n.task.createCondition=function(){var e={tasks:{}};return e.wait=function(t){t.id in e.tasks||(t.block(),e.tasks[t.id]=t)},e.notify=function(){var t=e.tasks;e.tasks={};for(var r in t)t[r].unblock()},e}},function(e,t,r){"use strict";function n(e,t,r,n){switch(e){case 1:return(0,s.envelopeUnseal)(r,n).then(function(e){var r=a.util.hexToBytes(e.key),n=a.util.hexToBytes(e.iv),i=a.util.createBuffer(a.util.decode64(t)),s=a.cipher.createDecipher("AES-CBC",r);s.start({iv:n}),s.update(i),s.finish();var o=s.output.toString();if(!o)throw new Error("Unable to decrypt data.");return a.util.decode64(o)});default:return Promise.reject(new Error("Unsupported encryption version - a newer version of the SDK is required to decrypt this data."))}}t.__esModule=!0;var i=r(2),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),s=r(8);t.default=n},function(e,t,r){"use strict";function n(e,t){return(0,o.default)(e,t).then(function(e){return a.util.decode64(e)})}t.__esModule=!0;var i=r(2),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),s=r(40),o=function(e){return e&&e.__esModule?e:{default:e}}(s);t.default=n},function(e,t,r){"use strict";function n(e,t){return new Promise(function(r,n){var i=a.util.decode64(e);i=a.util.createBuffer(i,"binary"),i.getBytes("Salted__".length);var c=i.getBytes(8),u=a.pbe.opensslDeriveBytes(t,c,s+o),l=a.util.createBuffer(u),h=l.getBytes(s),f=l.getBytes(o),p=a.cipher.createDecipher("AES-CBC",h);(p.start({iv:f}),p.update(i),p.finish())?r(p.output.getBytes()):n(new Error("Could not decrypt private key."))})}t.__esModule=!0;var i=r(2),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),s=32,o=16;t.default=n},function(e,t,r){"use strict";function n(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Promise(function(n,i){var s=a.util.hexToBytes(e.key),c=a.util.hexToBytes(e.iv),u=null;r&&(t=a.util.decode64(t),t=(0,o.default)(t)),u=a.util.createBuffer(t);var l=a.cipher.createCipher("AES-CBC",s);if(l.start({iv:c}),l.update(u),!l.finish())return void i(new Error("Failed to encrypt file block."));var h=l.output.getBytes();n(a.util.encode64(h))})}t.__esModule=!0;var i=r(2),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),s=r(41),o=function(e){return e&&e.__esModule?e:{default:e}}(s);t.default=n},function(e,t,r){"use strict";function n(e,t){return new Promise(function(r){r((0,i.encrypt)(e,t).toString())})}t.__esModule=!0;var i=r(16);t.default=n},function(e,t,r){"use strict";function n(e,t,r){return new Promise(function(n){var i,o=String(Date.now()),c=(i={},i[s.TIMESTAMP_HEADER]=o,i);if(r){var u=r.userId===s.BRIAN_USER_ID,l=u?s.BRIAN_TOKEN_HEADER:s.TOKEN_HEADER,h=u?s.BRIAN_HMAC_HEADER:s.HMAC_HEADER,f=a.hmac.create();f.start("sha256",r.sharedKey),f.update(r.token),f.update(e),f.update(o),f.update((u?r.origin:"")+t),c[l]=r.token,c[h]=a.util.encode64(f.digest().data)}n(c)})}t.__esModule=!0;var i=r(2),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),s=r(75);t.default=n},function(e,t,r){"use strict";t.__esModule=!0;t.TOKEN_HEADER="x-authorization-token",t.HMAC_HEADER="x-authorization-hmac",t.TIMESTAMP_HEADER="x-timestamp",t.DEVICE_ID_HEADER="x-device-id",t.SUBSCRIPTION_KEY_HEADER="ocp-apim-subscription-key",t.LOCAL_ENCODED_METADATA_HEADER="x-p-lem",t.SDK_VERSION_HEADER="x-pageproof-javascript-sdk",t.RETRY_AFTER_HEADER="retry-after",t.BYTES_PER_BLOCK=2097152,t.MENTION_REGEX=/@{(U[a-zA-Z0-9]{15}|~everyone)}{(.*?)}/,t.COMMENT_LABEL_REGEX=/^(approved|highlight):/i,t.ISO_REGEX=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,t.DEFAULT_ISO_DATE="0001-01-01T00:00:00",t.DAY_IN_MS=864e5,t.COMMENT_CACHE_PREFIX="comment",t.THUMBNAIL_CACHE_PREFIX="thumbnail",t.BRIAN_USER_ID="__brian__",t.BRIAN_TOKEN_HEADER="x-authorization-apitoken",t.BRIAN_HMAC_HEADER="x-authorization-api_hmac",t.DEFAULT_FILE_ENCRYPTION_VERSION="0001"},function(e,t,r){"use strict";function n(){return new Promise(function(e){var t=a.pki.rsa.generateKeyPair({bits:2048,e:65537});e({privateKeyPEM:a.pki.privateKeyToPem(t.privateKey),publicKeyPEM:a.pki.publicKeyToPem(t.publicKey)})})}t.__esModule=!0;var i=r(2),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i);t.default=n},function(e,t,r){"use strict";function n(e){return new Promise(function(t){var r=a.md.sha512.create();r.update(e);var n=r.digest().toHex();r=a.md.sha512.create(),r.update(n);var i=r.digest().toHex();t(String(i))})}t.__esModule=!0;var i=r(2),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i);t.default=n},function(e,t,r){"use strict";function n(e){return new Promise(function(t){var r=a.random.getBytesSync(c),n=a.pki.publicKeyFromPem(e),i=n.encrypt(r,s),u=a.util.encode64(i),l=a.pki.getPublicKeyFingerprint(n,{md:a.md.sha1.create(),encoding:"hex",delimiter:":"}),h={a:o,r:l,e:"base64",k:u},f=JSON.stringify(h,null,"");t({key:a.util.encode64(r),key$:a.util.encode64(f)})})}t.__esModule=!0;var i=r(2),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),s="RSAES-PKCS1-V1_5",o="AES-CBC",c=32;t.default=n},function(e,t,r){"use strict";function n(e,t){return new Promise(function(r,n){var i=a.util.createBuffer(a.util.decode64(e),"binary"),o=a.util.createBuffer(a.util.decode64(t),"binary"),c=i.getBytes(s),u=a.cipher.createDecipher("AES-CBC",o);(u.start({iv:c}),u.update(i),u.finish())?r(u.output.getBytes()):n(new Error("Could not decrypt private key."))})}t.__esModule=!0;var i=r(2),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),s=16;t.default=n},function(e,t,r){"use strict";function n(e,t){return(0,o.default)().then(function(e){var r=e.key,n=e.iv,i=e.keyIV;return Promise.all([r,n,(0,a.envelopeSeal)(i,t)])}).then(function(t){var r=t[0],n=t[1];return{envelope:t[2],comment$:(0,i.encrypt)(e,r,{iv:n}).toString()}})}t.__esModule=!0;var i=r(16),a=r(8),s=r(42),o=function(e){return e&&e.__esModule?e:{default:e}}(s);t.default=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r,n,i){function a(e){try{switch(e){case"unzip":o=c.default.ungzip(o).buffer;break;case"zip":o=c.default.gzip(o).buffer;break;default:throw new Error('Unknown transform "'+e+'".')}}catch(e){throw new Error(e)}}var o=void 0;return(0,h.envelopeUnseal)(t,r).then(function(t){o=(0,l.default)(s.util.createBuffer(s.util.decode64(e))),n&&n.length&&n.forEach(a);var r=s.util.hexToBytes(t.key),c=s.util.hexToBytes(t.iv),u=s.cipher.createDecipher("AES-CBC",r);if(u.start({iv:c}),u.update(s.util.createBuffer(o)),!u.finish())throw new Error("Failed to decrypt bytes.");return o=(0,l.default)(u.output),i&&i.length&&i.forEach(a),s.util.encode64(s.util.createBuffer(o).bytes())})}t.__esModule=!0,t.default=i;var a=r(2),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(a),o=r(43),c=n(o),u=r(49),l=n(u),h=r(8)},function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.options=c.assign({level:d,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:g,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var r=o.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==p)throw new Error(l[r]);if(t.header&&o.deflateSetHeader(this.strm,t.header),t.dictionary){var i;if(i="string"==typeof t.dictionary?u.string2buf(t.dictionary):"[object ArrayBuffer]"===f.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=o.deflateSetDictionary(this.strm,i))!==p)throw new Error(l[r]);this._dict_set=!0}}function i(e,t){var r=new n(t);if(r.push(e,!0),r.err)throw r.msg||l[r.err];return r.result}function a(e,t){return t=t||{},t.raw=!0,i(e,t)}function s(e,t){return t=t||{},t.gzip=!0,i(e,t)}var o=r(83),c=r(7),u=r(46),l=r(23),h=r(47),f=Object.prototype.toString,p=0,d=-1,g=0,y=8;n.prototype.push=function(e,t){var r,n,i=this.strm,a=this.options.chunkSize;if(this.ended)return!1;n=t===~~t?t:!0===t?4:0,"string"==typeof e?i.input=u.string2buf(e):"[object ArrayBuffer]"===f.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new c.Buf8(a),i.next_out=0,i.avail_out=a),1!==(r=o.deflate(i,n))&&r!==p)return this.onEnd(r),this.ended=!0,!1;0!==i.avail_out&&(0!==i.avail_in||4!==n&&2!==n)||("string"===this.options.to?this.onData(u.buf2binstring(c.shrinkBuf(i.output,i.next_out))):this.onData(c.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&1!==r);return 4===n?(r=o.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===p):2!==n||(this.onEnd(p),i.avail_out=0,!0)},n.prototype.onData=function(e){this.chunks.push(e)},n.prototype.onEnd=function(e){e===p&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=c.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=n,t.deflate=i,t.deflateRaw=a,t.gzip=s},function(e,t,r){"use strict";function n(e,t){return e.msg=U[t],t}function i(e){return(e<<1)-(e>4?9:0)}function a(e){for(var t=e.length;--t>=0;)e[t]=0}function s(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(N.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function o(e,t){R._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,s(e.strm)}function c(e,t){e.pending_buf[e.pending++]=t}function u(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function l(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,N.arraySet(t,e.input,e.next_in,i,r),1===e.state.wrap?e.adler=L(e.adler,t,i,r):2===e.state.wrap&&(e.adler=D(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function h(e,t){var r,n,i=e.max_chain_length,a=e.strstart,s=e.prev_length,o=e.nice_match,c=e.strstart>e.w_size-ue?e.strstart-(e.w_size-ue):0,u=e.window,l=e.w_mask,h=e.prev,f=e.strstart+ce,p=u[a+s-1],d=u[a+s];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do{if(r=t,u[r+s]===d&&u[r+s-1]===p&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&a<f);if(n=ce-(f-a),a=f-ce,n>s){if(e.match_start=t,s=n,n>=o)break;p=u[a+s-1],d=u[a+s]}}}while((t=h[t&l])>c&&0!=--i);return s<=e.lookahead?s:e.lookahead}function f(e){var t,r,n,i,a,s=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=s+(s-ue)){N.arraySet(e.window,e.window,s,s,0),e.match_start-=s,e.strstart-=s,e.block_start-=s,r=e.hash_size,t=r;do{n=e.head[--t],e.head[t]=n>=s?n-s:0}while(--r);r=s,t=r;do{n=e.prev[--t],e.prev[t]=n>=s?n-s:0}while(--r);i+=s}if(0===e.strm.avail_in)break;if(r=l(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=r,e.lookahead+e.insert>=oe)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+oe-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<oe)););}while(e.lookahead<ue&&0!==e.strm.avail_in)}function p(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(f(e),0===e.lookahead&&t===x)return me;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,o(e,!1),0===e.strm.avail_out))return me;if(e.strstart-e.block_start>=e.w_size-ue&&(o(e,!1),0===e.strm.avail_out))return me}return e.insert=0,t===V?(o(e,!0),0===e.strm.avail_out?Ee:Se):(e.strstart>e.block_start&&(o(e,!1),e.strm.avail_out),me)}function d(e,t){for(var r,n;;){if(e.lookahead<ue){if(f(e),e.lookahead<ue&&t===x)return me;if(0===e.lookahead)break}if(r=0,e.lookahead>=oe&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+oe-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-ue&&(e.match_length=h(e,r)),e.match_length>=oe)if(n=R._tr_tally(e,e.strstart-e.match_start,e.match_length-oe),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=oe){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+oe-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=R._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(o(e,!1),0===e.strm.avail_out))return me}return e.insert=e.strstart<oe-1?e.strstart:oe-1,t===V?(o(e,!0),0===e.strm.avail_out?Ee:Se):e.last_lit&&(o(e,!1),0===e.strm.avail_out)?me:Ce}function g(e,t){for(var r,n,i;;){if(e.lookahead<ue){if(f(e),e.lookahead<ue&&t===x)return me;if(0===e.lookahead)break}if(r=0,e.lookahead>=oe&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+oe-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=oe-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-ue&&(e.match_length=h(e,r),e.match_length<=5&&(e.strategy===G||e.match_length===oe&&e.strstart-e.match_start>4096)&&(e.match_length=oe-1)),e.prev_length>=oe&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-oe,n=R._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-oe),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+oe-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=oe-1,e.strstart++,n&&(o(e,!1),0===e.strm.avail_out))return me}else if(e.match_available){if(n=R._tr_tally(e,0,e.window[e.strstart-1]),n&&o(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return me}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=R._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<oe-1?e.strstart:oe-1,t===V?(o(e,!0),0===e.strm.avail_out?Ee:Se):e.last_lit&&(o(e,!1),0===e.strm.avail_out)?me:Ce}function y(e,t){for(var r,n,i,a,s=e.window;;){if(e.lookahead<=ce){if(f(e),e.lookahead<=ce&&t===x)return me;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=oe&&e.strstart>0&&(i=e.strstart-1,(n=s[i])===s[++i]&&n===s[++i]&&n===s[++i])){a=e.strstart+ce;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);e.match_length=ce-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=oe?(r=R._tr_tally(e,1,e.match_length-oe),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=R._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(o(e,!1),0===e.strm.avail_out))return me}return e.insert=0,t===V?(o(e,!0),0===e.strm.avail_out?Ee:Se):e.last_lit&&(o(e,!1),0===e.strm.avail_out)?me:Ce}function v(e,t){for(var r;;){if(0===e.lookahead&&(f(e),0===e.lookahead)){if(t===x)return me;break}if(e.match_length=0,r=R._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(o(e,!1),0===e.strm.avail_out))return me}return e.insert=0,t===V?(o(e,!0),0===e.strm.avail_out?Ee:Se):e.last_lit&&(o(e,!1),0===e.strm.avail_out)?me:Ce}function m(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function C(e){e.window_size=2*e.w_size,a(e.head),e.max_lazy_match=k[e.level].max_lazy,e.good_match=k[e.level].good_length,e.nice_match=k[e.level].nice_length,e.max_chain_length=k[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=oe-1,e.match_available=0,e.ins_h=0}function E(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=J,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new N.Buf16(2*ae),this.dyn_dtree=new N.Buf16(2*(2*ne+1)),this.bl_tree=new N.Buf16(2*(2*ie+1)),a(this.dyn_ltree),a(this.dyn_dtree),a(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new N.Buf16(se+1),this.heap=new N.Buf16(2*re+1),a(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new N.Buf16(2*re+1),a(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function S(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=Y,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?he:ye,e.adler=2===t.wrap?0:1,t.last_flush=x,R._tr_init(t),M):n(e,z)}function _(e){var t=S(e);return t===M&&C(e.state),t}function b(e,t){return e&&e.state?2!==e.state.wrap?z:(e.state.gzhead=t,M):z}function T(e,t,r,i,a,s){if(!e)return z;var o=1;if(t===q&&(t=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),a<1||a>$||r!==J||i<8||i>15||t<0||t>9||s<0||s>X)return n(e,z);8===i&&(i=9);var c=new E;return e.state=c,c.strm=e,c.wrap=o,c.gzhead=null,c.w_bits=i,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=a+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+oe-1)/oe),c.window=new N.Buf8(2*c.w_size),c.head=new N.Buf16(c.hash_size),c.prev=new N.Buf16(c.w_size),c.lit_bufsize=1<<a+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new N.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=t,c.strategy=s,c.method=r,_(e)}function B(e,t){return T(e,t,J,ee,te,Z)}function I(e,t){var r,o,l,h;if(!e||!e.state||t>K||t<0)return e?n(e,z):z;if(o=e.state,!e.output||!e.input&&0!==e.avail_in||o.status===ve&&t!==V)return n(e,0===e.avail_out?H:z);if(o.strm=e,r=o.last_flush,o.last_flush=t,o.status===he)if(2===o.wrap)e.adler=0,c(o,31),c(o,139),c(o,8),o.gzhead?(c(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),c(o,255&o.gzhead.time),c(o,o.gzhead.time>>8&255),c(o,o.gzhead.time>>16&255),c(o,o.gzhead.time>>24&255),c(o,9===o.level?2:o.strategy>=Q||o.level<2?4:0),c(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(c(o,255&o.gzhead.extra.length),c(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(e.adler=D(e.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=fe):(c(o,0),c(o,0),c(o,0),c(o,0),c(o,0),c(o,9===o.level?2:o.strategy>=Q||o.level<2?4:0),c(o,_e),o.status=ye);else{var f=J+(o.w_bits-8<<4)<<8,p=-1;p=o.strategy>=Q||o.level<2?0:o.level<6?1:6===o.level?2:3,f|=p<<6,0!==o.strstart&&(f|=le),f+=31-f%31,o.status=ye,u(o,f),0!==o.strstart&&(u(o,e.adler>>>16),u(o,65535&e.adler)),e.adler=1}if(o.status===fe)if(o.gzhead.extra){for(l=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>l&&(e.adler=D(e.adler,o.pending_buf,o.pending-l,l)),s(e),l=o.pending,o.pending!==o.pending_buf_size));)c(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>l&&(e.adler=D(e.adler,o.pending_buf,o.pending-l,l)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=pe)}else o.status=pe;if(o.status===pe)if(o.gzhead.name){l=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>l&&(e.adler=D(e.adler,o.pending_buf,o.pending-l,l)),s(e),l=o.pending,o.pending===o.pending_buf_size)){h=1;break}h=o.gzindex<o.gzhead.name.length?255&o.gzhead.name.charCodeAt(o.gzindex++):0,c(o,h)}while(0!==h);o.gzhead.hcrc&&o.pending>l&&(e.adler=D(e.adler,o.pending_buf,o.pending-l,l)),0===h&&(o.gzindex=0,o.status=de)}else o.status=de;if(o.status===de)if(o.gzhead.comment){l=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>l&&(e.adler=D(e.adler,o.pending_buf,o.pending-l,l)),s(e),l=o.pending,o.pending===o.pending_buf_size)){h=1;break}h=o.gzindex<o.gzhead.comment.length?255&o.gzhead.comment.charCodeAt(o.gzindex++):0,c(o,h)}while(0!==h);o.gzhead.hcrc&&o.pending>l&&(e.adler=D(e.adler,o.pending_buf,o.pending-l,l)),0===h&&(o.status=ge)}else o.status=ge;if(o.status===ge&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&s(e),o.pending+2<=o.pending_buf_size&&(c(o,255&e.adler),c(o,e.adler>>8&255),e.adler=0,o.status=ye)):o.status=ye),0!==o.pending){if(s(e),0===e.avail_out)return o.last_flush=-1,M}else if(0===e.avail_in&&i(t)<=i(r)&&t!==V)return n(e,H);if(o.status===ve&&0!==e.avail_in)return n(e,H);if(0!==e.avail_in||0!==o.lookahead||t!==x&&o.status!==ve){var d=o.strategy===Q?v(o,t):o.strategy===W?y(o,t):k[o.level].func(o,t);if(d!==Ee&&d!==Se||(o.status=ve),d===me||d===Ee)return 0===e.avail_out&&(o.last_flush=-1),M;if(d===Ce&&(t===P?R._tr_align(o):t!==K&&(R._tr_stored_block(o,0,0,!1),t===O&&(a(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),s(e),0===e.avail_out))return o.last_flush=-1,M}return t!==V?M:o.wrap<=0?F:(2===o.wrap?(c(o,255&e.adler),c(o,e.adler>>8&255),c(o,e.adler>>16&255),c(o,e.adler>>24&255),c(o,255&e.total_in),c(o,e.total_in>>8&255),c(o,e.total_in>>16&255),c(o,e.total_in>>24&255)):(u(o,e.adler>>>16),u(o,65535&e.adler)),s(e),o.wrap>0&&(o.wrap=-o.wrap),0!==o.pending?M:F)}function A(e){var t;return e&&e.state?(t=e.state.status)!==he&&t!==fe&&t!==pe&&t!==de&&t!==ge&&t!==ye&&t!==ve?n(e,z):(e.state=null,t===ye?n(e,j):M):z}function w(e,t){var r,n,i,s,o,c,u,l,h=t.length;if(!e||!e.state)return z;if(r=e.state,2===(s=r.wrap)||1===s&&r.status!==he||r.lookahead)return z;for(1===s&&(e.adler=L(e.adler,t,h,0)),r.wrap=0,h>=r.w_size&&(0===s&&(a(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new N.Buf8(r.w_size),N.arraySet(l,t,h-r.w_size,r.w_size,0),t=l,h=r.w_size),o=e.avail_in,c=e.next_in,u=e.input,e.avail_in=h,e.next_in=0,e.input=t,f(r);r.lookahead>=oe;){n=r.strstart,i=r.lookahead-(oe-1);do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+oe-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--i);r.strstart=n,r.lookahead=oe-1,f(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=oe-1,r.match_available=0,e.next_in=c,e.input=u,e.avail_in=o,r.wrap=s,M}var k,N=r(7),R=r(84),L=r(44),D=r(45),U=r(23),x=0,P=1,O=3,V=4,K=5,M=0,F=1,z=-2,j=-3,H=-5,q=-1,G=1,Q=2,W=3,X=4,Z=0,Y=2,J=8,$=9,ee=15,te=8,re=286,ne=30,ie=19,ae=2*re+1,se=15,oe=3,ce=258,ue=ce+oe+1,le=32,he=42,fe=69,pe=73,de=91,ge=103,ye=113,ve=666,me=1,Ce=2,Ee=3,Se=4,_e=3;k=[new m(0,0,0,0,p),new m(4,4,8,4,d),new m(4,5,16,8,d),new m(4,6,32,32,d),new m(4,4,16,16,g),new m(8,16,32,32,g),new m(8,16,128,128,g),new m(8,32,128,256,g),new m(32,128,258,1024,g),new m(32,258,258,4096,g)],t.deflateInit=B,t.deflateInit2=T,t.deflateReset=_,t.deflateResetKeep=S,t.deflateSetHeader=b,t.deflate=I,t.deflateEnd=A,t.deflateSetDictionary=w,t.deflateInfo="pako deflate (from Nodeca project)"},function(e,t,r){"use strict";function n(e){for(var t=e.length;--t>=0;)e[t]=0}function i(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function a(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function s(e){return e<256?ae[e]:ae[256+(e>>>7)]}function o(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function c(e,t,r){e.bi_valid>Q-r?(e.bi_buf|=t<<e.bi_valid&65535,o(e,e.bi_buf),e.bi_buf=t>>Q-e.bi_valid,e.bi_valid+=r-Q):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function u(e,t,r){c(e,r[2*t],r[2*t+1])}function l(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function h(e){16===e.bi_valid?(o(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}function f(e,t){var r,n,i,a,s,o,c=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,h=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,d=t.stat_desc.max_length,g=0;for(a=0;a<=G;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<q;r++)n=e.heap[r],a=c[2*c[2*n+1]+1]+1,a>d&&(a=d,g++),c[2*n+1]=a,n>u||(e.bl_count[a]++,s=0,n>=p&&(s=f[n-p]),o=c[2*n],e.opt_len+=o*(a+s),h&&(e.static_len+=o*(l[2*n+1]+s)));if(0!==g){do{for(a=d-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[d]--,g-=2}while(g>0);for(a=d;0!==a;a--)for(n=e.bl_count[a];0!==n;)(i=e.heap[--r])>u||(c[2*i+1]!==a&&(e.opt_len+=(a-c[2*i+1])*c[2*i],c[2*i+1]=a),n--)}}function p(e,t,r){var n,i,a=new Array(G+1),s=0;for(n=1;n<=G;n++)a[n]=s=s+r[n-1]<<1;for(i=0;i<=t;i++){var o=e[2*i+1];0!==o&&(e[2*i]=l(a[o]++,o))}}function d(){var e,t,r,n,a,s=new Array(G+1);for(r=0,n=0;n<M-1;n++)for(oe[n]=r,e=0;e<1<<$[n];e++)se[r++]=n;for(se[r-1]=n,a=0,n=0;n<16;n++)for(ce[n]=a,e=0;e<1<<ee[n];e++)ae[a++]=n;for(a>>=7;n<j;n++)for(ce[n]=a<<7,e=0;e<1<<ee[n]-7;e++)ae[256+a++]=n;for(t=0;t<=G;t++)s[t]=0;for(e=0;e<=143;)ne[2*e+1]=8,e++,s[8]++;for(;e<=255;)ne[2*e+1]=9,e++,s[9]++;for(;e<=279;)ne[2*e+1]=7,e++,s[7]++;for(;e<=287;)ne[2*e+1]=8,e++,s[8]++;for(p(ne,z+1,s),e=0;e<j;e++)ie[2*e+1]=5,ie[2*e]=l(e,5);ue=new i(ne,$,F+1,z,G),le=new i(ie,ee,0,j,G),he=new i(new Array(0),te,0,H,W)}function g(e){var t;for(t=0;t<z;t++)e.dyn_ltree[2*t]=0;for(t=0;t<j;t++)e.dyn_dtree[2*t]=0;for(t=0;t<H;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*X]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function y(e){e.bi_valid>8?o(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function v(e,t,r,n){y(e),n&&(o(e,r),o(e,~r)),L.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function m(e,t,r,n){var i=2*t,a=2*r;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]}function C(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&m(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!m(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function E(e,t,r){var n,i,a,o,l=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*l]<<8|e.pending_buf[e.d_buf+2*l+1],i=e.pending_buf[e.l_buf+l],l++,0===n?u(e,i,t):(a=se[i],u(e,a+F+1,t),o=$[a],0!==o&&(i-=oe[a],c(e,i,o)),n--,a=s(n),u(e,a,r),0!==(o=ee[a])&&(n-=ce[a],c(e,n,o)))}while(l<e.last_lit);u(e,X,t)}function S(e,t){var r,n,i,a=t.dyn_tree,s=t.stat_desc.static_tree,o=t.stat_desc.has_stree,c=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=q,r=0;r<c;r++)0!==a[2*r]?(e.heap[++e.heap_len]=u=r,e.depth[r]=0):a[2*r+1]=0;for(;e.heap_len<2;)i=e.heap[++e.heap_len]=u<2?++u:0,a[2*i]=1,e.depth[i]=0,e.opt_len--,o&&(e.static_len-=s[2*i+1]);for(t.max_code=u,r=e.heap_len>>1;r>=1;r--)C(e,a,r);i=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],C(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,C(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],f(e,t),p(a,u,e.bl_count)}function _(e,t,r){var n,i,a=-1,s=t[1],o=0,c=7,u=4;for(0===s&&(c=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++o<c&&i===s||(o<u?e.bl_tree[2*i]+=o:0!==i?(i!==a&&e.bl_tree[2*i]++,e.bl_tree[2*Z]++):o<=10?e.bl_tree[2*Y]++:e.bl_tree[2*J]++,o=0,a=i,0===s?(c=138,u=3):i===s?(c=6,u=3):(c=7,u=4))}function b(e,t,r){var n,i,a=-1,s=t[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),n=0;n<=r;n++)if(i=s,s=t[2*(n+1)+1],!(++o<l&&i===s)){if(o<h)do{u(e,i,e.bl_tree)}while(0!=--o);else 0!==i?(i!==a&&(u(e,i,e.bl_tree),o--),u(e,Z,e.bl_tree),c(e,o-3,2)):o<=10?(u(e,Y,e.bl_tree),c(e,o-3,3)):(u(e,J,e.bl_tree),c(e,o-11,7));o=0,a=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4)}}function T(e){var t;for(_(e,e.dyn_ltree,e.l_desc.max_code),_(e,e.dyn_dtree,e.d_desc.max_code),S(e,e.bl_desc),t=H-1;t>=3&&0===e.bl_tree[2*re[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}function B(e,t,r,n){var i;for(c(e,t-257,5),c(e,r-1,5),c(e,n-4,4),i=0;i<n;i++)c(e,e.bl_tree[2*re[i]+1],3);b(e,e.dyn_ltree,t-1),b(e,e.dyn_dtree,r-1)}function I(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return U;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return x;for(t=32;t<F;t++)if(0!==e.dyn_ltree[2*t])return x;return U}function A(e){fe||(d(),fe=!0),e.l_desc=new a(e.dyn_ltree,ue),e.d_desc=new a(e.dyn_dtree,le),e.bl_desc=new a(e.bl_tree,he),e.bi_buf=0,e.bi_valid=0,g(e)}function w(e,t,r,n){c(e,(O<<1)+(n?1:0),3),v(e,t,r,!0)}function k(e){c(e,V<<1,3),u(e,X,ne),h(e)}function N(e,t,r,n){var i,a,s=0;e.level>0?(e.strm.data_type===P&&(e.strm.data_type=I(e)),S(e,e.l_desc),S(e,e.d_desc),s=T(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?w(e,t,r,n):e.strategy===D||a===i?(c(e,(V<<1)+(n?1:0),3),E(e,ne,ie)):(c(e,(K<<1)+(n?1:0),3),B(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),E(e,e.dyn_ltree,e.dyn_dtree)),g(e),n&&y(e)}function R(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(se[r]+F+1)]++,e.dyn_dtree[2*s(t)]++),e.last_lit===e.lit_bufsize-1}var L=r(7),D=4,U=0,x=1,P=2,O=0,V=1,K=2,M=29,F=256,z=F+1+M,j=30,H=19,q=2*z+1,G=15,Q=16,W=7,X=256,Z=16,Y=17,J=18,$=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ee=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],te=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],re=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ne=new Array(2*(z+2));n(ne);var ie=new Array(2*j);n(ie);var ae=new Array(512);n(ae);var se=new Array(256);n(se);var oe=new Array(M);n(oe);var ce=new Array(j);n(ce);var ue,le,he,fe=!1;t._tr_init=A,t._tr_stored_block=w,t._tr_flush_block=N,t._tr_tally=R,t._tr_align=k},function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var r=s.inflateInit2(this.strm,t.windowBits);if(r!==u.Z_OK)throw new Error(l[r]);if(this.header=new f,s.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=c.string2buf(t.dictionary):"[object ArrayBuffer]"===p.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=s.inflateSetDictionary(this.strm,t.dictionary))!==u.Z_OK))throw new Error(l[r])}function i(e,t){var r=new n(t);if(r.push(e,!0),r.err)throw r.msg||l[r.err];return r.result}function a(e,t){return t=t||{},t.raw=!0,i(e,t)}var s=r(86),o=r(7),c=r(46),u=r(48),l=r(23),h=r(47),f=r(89),p=Object.prototype.toString;n.prototype.push=function(e,t){var r,n,i,a,l,h=this.strm,f=this.options.chunkSize,d=this.options.dictionary,g=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?u.Z_FINISH:u.Z_NO_FLUSH,"string"==typeof e?h.input=c.binstring2buf(e):"[object ArrayBuffer]"===p.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new o.Buf8(f),h.next_out=0,h.avail_out=f),r=s.inflate(h,u.Z_NO_FLUSH),r===u.Z_NEED_DICT&&d&&(r=s.inflateSetDictionary(this.strm,d)),r===u.Z_BUF_ERROR&&!0===g&&(r=u.Z_OK,g=!1),r!==u.Z_STREAM_END&&r!==u.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==u.Z_STREAM_END&&(0!==h.avail_in||n!==u.Z_FINISH&&n!==u.Z_SYNC_FLUSH)||("string"===this.options.to?(i=c.utf8border(h.output,h.next_out),a=h.next_out-i,l=c.buf2string(h.output,i),h.next_out=a,h.avail_out=f-a,a&&o.arraySet(h.output,h.output,i,a,0),this.onData(l)):this.onData(o.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(g=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==u.Z_STREAM_END);return r===u.Z_STREAM_END&&(n=u.Z_FINISH),n===u.Z_FINISH?(r=s.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===u.Z_OK):n!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),h.avail_out=0,!0)},n.prototype.onData=function(e){this.chunks.push(e)},n.prototype.onEnd=function(e){e===u.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=n,t.inflate=i,t.inflateRaw=a,t.ungzip=i},function(e,t,r){"use strict";function n(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function i(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new m.Buf16(320),this.work=new m.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=O,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new m.Buf32(ge),t.distcode=t.distdyn=new m.Buf32(ye),t.sane=1,t.back=-1,k):L}function s(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,a(e)):L}function o(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?L:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,s(e))):L}function c(e,t){var r,n;return e?(n=new i,e.state=n,n.window=null,r=o(e,t),r!==k&&(e.state=null),r):L}function u(e){return c(e,ve)}function l(e){if(me){var t;for(y=new m.Buf32(512),v=new m.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(_(T,e.lens,0,288,y,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;_(B,e.lens,0,32,v,0,e.work,{bits:5}),me=!1}e.lencode=y,e.lenbits=9,e.distcode=v,e.distbits=5}function h(e,t,r,n){var i,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new m.Buf8(a.wsize)),n>=a.wsize?(m.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),m.arraySet(a.window,t,r-n,i,a.wnext),n-=i,n?(m.arraySet(a.window,t,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0}function f(e,t){var r,i,a,s,o,c,u,f,p,d,g,y,v,ge,ye,ve,me,Ce,Ee,Se,_e,be,Te,Be,Ie=0,Ae=new m.Buf8(4),we=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return L;r=e.state,r.mode===W&&(r.mode=X),o=e.next_out,a=e.output,u=e.avail_out,s=e.next_in,i=e.input,c=e.avail_in,f=r.hold,p=r.bits,d=c,g=u,be=k;e:for(;;)switch(r.mode){case O:if(0===r.wrap){r.mode=X;break}for(;p<16;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}if(2&r.wrap&&35615===f){r.check=0,Ae[0]=255&f,Ae[1]=f>>>8&255,r.check=E(r.check,Ae,2,0),f=0,p=0,r.mode=V;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&f)<<8)+(f>>8))%31){e.msg="incorrect header check",r.mode=fe;break}if((15&f)!==P){e.msg="unknown compression method",r.mode=fe;break}if(f>>>=4,p-=4,_e=8+(15&f),0===r.wbits)r.wbits=_e;else if(_e>r.wbits){e.msg="invalid window size",r.mode=fe;break}r.dmax=1<<_e,e.adler=r.check=1,r.mode=512&f?G:W,f=0,p=0;break;case V:for(;p<16;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}if(r.flags=f,(255&r.flags)!==P){e.msg="unknown compression method",r.mode=fe;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=fe;break}r.head&&(r.head.text=f>>8&1),512&r.flags&&(Ae[0]=255&f,Ae[1]=f>>>8&255,r.check=E(r.check,Ae,2,0)),f=0,p=0,r.mode=K;case K:for(;p<32;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}r.head&&(r.head.time=f),512&r.flags&&(Ae[0]=255&f,Ae[1]=f>>>8&255,Ae[2]=f>>>16&255,Ae[3]=f>>>24&255,r.check=E(r.check,Ae,4,0)),f=0,p=0,r.mode=M;case M:for(;p<16;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}r.head&&(r.head.xflags=255&f,r.head.os=f>>8),512&r.flags&&(Ae[0]=255&f,Ae[1]=f>>>8&255,r.check=E(r.check,Ae,2,0)),f=0,p=0,r.mode=F;case F:if(1024&r.flags){for(;p<16;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}r.length=f,r.head&&(r.head.extra_len=f),512&r.flags&&(Ae[0]=255&f,Ae[1]=f>>>8&255,r.check=E(r.check,Ae,2,0)),f=0,p=0}else r.head&&(r.head.extra=null);r.mode=z;case z:if(1024&r.flags&&(y=r.length,y>c&&(y=c),y&&(r.head&&(_e=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),m.arraySet(r.head.extra,i,s,y,_e)),512&r.flags&&(r.check=E(r.check,i,y,s)),c-=y,s+=y,r.length-=y),r.length))break e;r.length=0,r.mode=j;case j:if(2048&r.flags){if(0===c)break e;y=0;do{_e=i[s+y++],r.head&&_e&&r.length<65536&&(r.head.name+=String.fromCharCode(_e))}while(_e&&y<c);if(512&r.flags&&(r.check=E(r.check,i,y,s)),c-=y,s+=y,_e)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=H;case H:if(4096&r.flags){if(0===c)break e;y=0;do{_e=i[s+y++],r.head&&_e&&r.length<65536&&(r.head.comment+=String.fromCharCode(_e))}while(_e&&y<c);if(512&r.flags&&(r.check=E(r.check,i,y,s)),c-=y,s+=y,_e)break e}else r.head&&(r.head.comment=null);r.mode=q;case q:if(512&r.flags){for(;p<16;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}if(f!==(65535&r.check)){e.msg="header crc mismatch",r.mode=fe;break}f=0,p=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=W;break;case G:for(;p<32;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}e.adler=r.check=n(f),f=0,p=0,r.mode=Q;case Q:if(0===r.havedict)return e.next_out=o,e.avail_out=u,e.next_in=s,e.avail_in=c,r.hold=f,r.bits=p,R;e.adler=r.check=1,r.mode=W;case W:if(t===A||t===w)break e;case X:if(r.last){f>>>=7&p,p-=7&p,r.mode=ue;break}for(;p<3;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}switch(r.last=1&f,f>>>=1,p-=1,3&f){case 0:r.mode=Z;break;case 1:if(l(r),r.mode=re,t===w){f>>>=2,p-=2;break e}break;case 2:r.mode=$;break;case 3:e.msg="invalid block type",r.mode=fe}f>>>=2,p-=2;break;case Z:for(f>>>=7&p,p-=7&p;p<32;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}if((65535&f)!=(f>>>16^65535)){e.msg="invalid stored block lengths",r.mode=fe;break}if(r.length=65535&f,f=0,p=0,r.mode=Y,t===w)break e;case Y:r.mode=J;case J:if(y=r.length){if(y>c&&(y=c),y>u&&(y=u),0===y)break e;m.arraySet(a,i,s,y,o),c-=y,s+=y,u-=y,o+=y,r.length-=y;break}r.mode=W;break;case $:for(;p<14;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}if(r.nlen=257+(31&f),f>>>=5,p-=5,r.ndist=1+(31&f),f>>>=5,p-=5,r.ncode=4+(15&f),f>>>=4,p-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=fe;break}r.have=0,r.mode=ee;case ee:for(;r.have<r.ncode;){for(;p<3;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}r.lens[we[r.have++]]=7&f,f>>>=3,p-=3}for(;r.have<19;)r.lens[we[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Te={bits:r.lenbits},be=_(b,r.lens,0,19,r.lencode,0,r.work,Te),r.lenbits=Te.bits,be){e.msg="invalid code lengths set",r.mode=fe;break}r.have=0,r.mode=te;case te:for(;r.have<r.nlen+r.ndist;){for(;Ie=r.lencode[f&(1<<r.lenbits)-1],ye=Ie>>>24,ve=Ie>>>16&255,me=65535&Ie,!(ye<=p);){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}if(me<16)f>>>=ye,p-=ye,r.lens[r.have++]=me;else{if(16===me){for(Be=ye+2;p<Be;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}if(f>>>=ye,p-=ye,0===r.have){e.msg="invalid bit length repeat",r.mode=fe;break}_e=r.lens[r.have-1],y=3+(3&f),f>>>=2,p-=2}else if(17===me){for(Be=ye+3;p<Be;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}f>>>=ye,p-=ye,_e=0,y=3+(7&f),f>>>=3,p-=3}else{for(Be=ye+7;p<Be;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}f>>>=ye,p-=ye,_e=0,y=11+(127&f),f>>>=7,p-=7}if(r.have+y>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=fe;break}for(;y--;)r.lens[r.have++]=_e}}if(r.mode===fe)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=fe;break}if(r.lenbits=9,Te={bits:r.lenbits},be=_(T,r.lens,0,r.nlen,r.lencode,0,r.work,Te),r.lenbits=Te.bits,be){e.msg="invalid literal/lengths set",r.mode=fe;break}if(r.distbits=6,r.distcode=r.distdyn,Te={bits:r.distbits},be=_(B,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Te),r.distbits=Te.bits,be){e.msg="invalid distances set",r.mode=fe;break}if(r.mode=re,t===w)break e;case re:r.mode=ne;case ne:if(c>=6&&u>=258){e.next_out=o,e.avail_out=u,e.next_in=s,e.avail_in=c,r.hold=f,r.bits=p,S(e,g),o=e.next_out,a=e.output,u=e.avail_out,s=e.next_in,i=e.input,c=e.avail_in,f=r.hold,p=r.bits,r.mode===W&&(r.back=-1);break}for(r.back=0;Ie=r.lencode[f&(1<<r.lenbits)-1],ye=Ie>>>24,ve=Ie>>>16&255,me=65535&Ie,!(ye<=p);){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}if(ve&&0==(240&ve)){for(Ce=ye,Ee=ve,Se=me;Ie=r.lencode[Se+((f&(1<<Ce+Ee)-1)>>Ce)],ye=Ie>>>24,ve=Ie>>>16&255,me=65535&Ie,!(Ce+ye<=p);){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}f>>>=Ce,p-=Ce,r.back+=Ce}if(f>>>=ye,p-=ye,r.back+=ye,r.length=me,0===ve){r.mode=ce;break}if(32&ve){r.back=-1,r.mode=W;break}if(64&ve){e.msg="invalid literal/length code",r.mode=fe;break}r.extra=15&ve,r.mode=ie;case ie:if(r.extra){for(Be=r.extra;p<Be;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}r.length+=f&(1<<r.extra)-1,f>>>=r.extra,p-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=ae;case ae:for(;Ie=r.distcode[f&(1<<r.distbits)-1],ye=Ie>>>24,ve=Ie>>>16&255,me=65535&Ie,!(ye<=p);){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}if(0==(240&ve)){for(Ce=ye,Ee=ve,Se=me;Ie=r.distcode[Se+((f&(1<<Ce+Ee)-1)>>Ce)],ye=Ie>>>24,ve=Ie>>>16&255,me=65535&Ie,!(Ce+ye<=p);){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}f>>>=Ce,p-=Ce,r.back+=Ce}if(f>>>=ye,p-=ye,r.back+=ye,64&ve){e.msg="invalid distance code",r.mode=fe;break}r.offset=me,r.extra=15&ve,r.mode=se;case se:if(r.extra){for(Be=r.extra;p<Be;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}r.offset+=f&(1<<r.extra)-1,f>>>=r.extra,p-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=fe;break}r.mode=oe;case oe:if(0===u)break e;if(y=g-u,r.offset>y){if((y=r.offset-y)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=fe;break}y>r.wnext?(y-=r.wnext,v=r.wsize-y):v=r.wnext-y,y>r.length&&(y=r.length),ge=r.window}else ge=a,v=o-r.offset,y=r.length;y>u&&(y=u),u-=y,r.length-=y;do{a[o++]=ge[v++]}while(--y);0===r.length&&(r.mode=ne);break;case ce:if(0===u)break e;a[o++]=r.length,u--,r.mode=ne;break;case ue:if(r.wrap){for(;p<32;){if(0===c)break e;c--,f|=i[s++]<<p,p+=8}if(g-=u,e.total_out+=g,r.total+=g,g&&(e.adler=r.check=r.flags?E(r.check,a,g,o-g):C(r.check,a,g,o-g)),g=u,(r.flags?f:n(f))!==r.check){e.msg="incorrect data check",r.mode=fe;break}f=0,p=0}r.mode=le;case le:if(r.wrap&&r.flags){for(;p<32;){if(0===c)break e;c--,f+=i[s++]<<p,p+=8}if(f!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=fe;break}f=0,p=0}r.mode=he;case he:be=N;break e;case fe:be=D;break e;case pe:return U;case de:default:return L}return e.next_out=o,e.avail_out=u,e.next_in=s,e.avail_in=c,r.hold=f,r.bits=p,(r.wsize||g!==e.avail_out&&r.mode<fe&&(r.mode<ue||t!==I))&&h(e,e.output,e.next_out,g-e.avail_out)?(r.mode=pe,U):(d-=e.avail_in,g-=e.avail_out,e.total_in+=d,e.total_out+=g,r.total+=g,r.wrap&&g&&(e.adler=r.check=r.flags?E(r.check,a,g,e.next_out-g):C(r.check,a,g,e.next_out-g)),e.data_type=r.bits+(r.last?64:0)+(r.mode===W?128:0)+(r.mode===re||r.mode===Y?256:0),(0===d&&0===g||t===I)&&be===k&&(be=x),be)}function p(e){if(!e||!e.state)return L;var t=e.state;return t.window&&(t.window=null),e.state=null,k}function d(e,t){var r;return e&&e.state?(r=e.state,0==(2&r.wrap)?L:(r.head=t,t.done=!1,k)):L}function g(e,t){var r,n,i=t.length;return e&&e.state?(r=e.state,0!==r.wrap&&r.mode!==Q?L:r.mode===Q&&(n=1,(n=C(n,t,i,0))!==r.check)?D:h(e,t,i,i)?(r.mode=pe,U):(r.havedict=1,k)):L}var y,v,m=r(7),C=r(44),E=r(45),S=r(87),_=r(88),b=0,T=1,B=2,I=4,A=5,w=6,k=0,N=1,R=2,L=-2,D=-3,U=-4,x=-5,P=8,O=1,V=2,K=3,M=4,F=5,z=6,j=7,H=8,q=9,G=10,Q=11,W=12,X=13,Z=14,Y=15,J=16,$=17,ee=18,te=19,re=20,ne=21,ie=22,ae=23,se=24,oe=25,ce=26,ue=27,le=28,he=29,fe=30,pe=31,de=32,ge=852,ye=592,ve=15,me=!0;t.inflateReset=s,t.inflateReset2=o,t.inflateResetKeep=a,t.inflateInit=u,t.inflateInit2=c,t.inflate=f,t.inflateEnd=p,t.inflateGetHeader=d,t.inflateSetDictionary=g,t.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,r){"use strict";e.exports=function(e,t){var r,n,i,a,s,o,c,u,l,h,f,p,d,g,y,v,m,C,E,S,_,b,T,B,I;r=e.state,n=e.next_in,B=e.input,i=n+(e.avail_in-5),a=e.next_out,I=e.output,s=a-(t-e.avail_out),o=a+(e.avail_out-257),c=r.dmax,u=r.wsize,l=r.whave,h=r.wnext,f=r.window,p=r.hold,d=r.bits,g=r.lencode,y=r.distcode,v=(1<<r.lenbits)-1,m=(1<<r.distbits)-1;e:do{d<15&&(p+=B[n++]<<d,d+=8,p+=B[n++]<<d,d+=8),C=g[p&v];t:for(;;){if(E=C>>>24,p>>>=E,d-=E,0===(E=C>>>16&255))I[a++]=65535&C;else{if(!(16&E)){if(0==(64&E)){C=g[(65535&C)+(p&(1<<E)-1)];continue t}if(32&E){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}S=65535&C,E&=15,E&&(d<E&&(p+=B[n++]<<d,d+=8),S+=p&(1<<E)-1,p>>>=E,d-=E),d<15&&(p+=B[n++]<<d,d+=8,p+=B[n++]<<d,d+=8),C=y[p&m];r:for(;;){if(E=C>>>24,p>>>=E,d-=E,!(16&(E=C>>>16&255))){if(0==(64&E)){C=y[(65535&C)+(p&(1<<E)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(_=65535&C,E&=15,d<E&&(p+=B[n++]<<d,(d+=8)<E&&(p+=B[n++]<<d,d+=8)),(_+=p&(1<<E)-1)>c){e.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=E,d-=E,E=a-s,_>E){if((E=_-E)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(b=0,T=f,0===h){if(b+=u-E,E<S){S-=E;do{I[a++]=f[b++]}while(--E);b=a-_,T=I}}else if(h<E){if(b+=u+h-E,(E-=h)<S){S-=E;do{I[a++]=f[b++]}while(--E);if(b=0,h<S){E=h,S-=E;do{I[a++]=f[b++]}while(--E);b=a-_,T=I}}}else if(b+=h-E,E<S){S-=E;do{I[a++]=f[b++]}while(--E);b=a-_,T=I}for(;S>2;)I[a++]=T[b++],I[a++]=T[b++],I[a++]=T[b++],S-=3;S&&(I[a++]=T[b++],S>1&&(I[a++]=T[b++]))}else{b=a-_;do{I[a++]=I[b++],I[a++]=I[b++],I[a++]=I[b++],S-=3}while(S>2);S&&(I[a++]=I[b++],S>1&&(I[a++]=I[b++]))}break}}break}}while(n<i&&a<o);S=d>>3,n-=S,d-=S<<3,p&=(1<<d)-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=a<o?o-a+257:257-(a-o),r.hold=p,r.bits=d}},function(e,t,r){"use strict";var n=r(7),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],o=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,r,c,u,l,h,f){var p,d,g,y,v,m,C,E,S,_=f.bits,b=0,T=0,B=0,I=0,A=0,w=0,k=0,N=0,R=0,L=0,D=null,U=0,x=new n.Buf16(16),P=new n.Buf16(16),O=null,V=0;for(b=0;b<=15;b++)x[b]=0;for(T=0;T<c;T++)x[t[r+T]]++;for(A=_,I=15;I>=1&&0===x[I];I--);if(A>I&&(A=I),0===I)return u[l++]=20971520,u[l++]=20971520,f.bits=1,0;for(B=1;B<I&&0===x[B];B++);for(A<B&&(A=B),N=1,b=1;b<=15;b++)if(N<<=1,(N-=x[b])<0)return-1;if(N>0&&(0===e||1!==I))return-1;for(P[1]=0,b=1;b<15;b++)P[b+1]=P[b]+x[b];for(T=0;T<c;T++)0!==t[r+T]&&(h[P[t[r+T]]++]=T);if(0===e?(D=O=h,m=19):1===e?(D=i,U-=257,O=a,V-=257,m=256):(D=s,O=o,m=-1),L=0,T=0,b=B,v=l,w=A,k=0,g=-1,R=1<<A,y=R-1,1===e&&R>852||2===e&&R>592)return 1;for(;;){C=b-k,h[T]<m?(E=0,S=h[T]):h[T]>m?(E=O[V+h[T]],S=D[U+h[T]]):(E=96,S=0),p=1<<b-k,d=1<<w,B=d;do{d-=p,u[v+(L>>k)+d]=C<<24|E<<16|S|0}while(0!==d);for(p=1<<b-1;L&p;)p>>=1;if(0!==p?(L&=p-1,L+=p):L=0,T++,0==--x[b]){if(b===I)break;b=t[r+h[T]]}if(b>A&&(L&y)!==g){for(0===k&&(k=A),v+=B,w=b-k,N=1<<w;w+k<I&&!((N-=x[w+k])<=0);)w++,N<<=1;if(R+=1<<w,1===e&&R>852||2===e&&R>592)return 1;g=L&y,u[g]=A<<24|w<<16|v-l|0}}return 0!==L&&(u[v+L]=b-k<<24|64<<16|0),f.bits=A,0}},function(e,t,r){"use strict";function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=t.key,n=t.iv,i=d.util.hexToBytes(r),a=d.util.hexToBytes(n),s=d.cipher.createCipher("AES-CBC",i);if(s.start({iv:a}),s.update(d.util.createBuffer(e)),!s.finish())throw new Error("Failed to encrypt.");return(0,m.default)(s.output)}function a(e,t){var r=t.key,n=t.iv,i=d.util.hexToBytes(r),a=d.util.hexToBytes(n),s=d.cipher.createDecipher("AES-CBC",i);if(s.start({iv:a}),s.update(d.util.createBuffer(e)),!s.finish())throw new Error("Failed to decrypt.");return(0,m.default)(s.output)}function s(e){return y.default.gzip(e)}function o(e){return y.default.ungzip(e)}function c(e){return l(h(e,"base64"),"binary")}function u(e){return l(h(e,"binary"),"base64")}function l(e,t){if(!t)throw new Error("toArrayBuffer: Must provide an encoding - none specified.");switch(t){case"binary":return(0,m.default)(d.util.createBuffer(e));case"base64":return(0,S.default)(d.util.decode64(e));case"utf8":return(0,m.default)(d.util.createBuffer(e,"utf8"));default:throw new Error('toArrayBuffer: Unsupported encoding "'+t+'".')}}function h(e,t){if(!t)throw new Error("toString: Must provide an encoding - none specified.");switch(t){case"binary":return d.util.createBuffer(e).bytes();case"utf8":return d.util.encodeUtf8(e);case"base64":return d.util.encode64(d.util.createBuffer(e).bytes());default:throw new Error('toString: Unsupported encoding: "'+t+'".')}}function f(e,t,r,n,i,a,s){return new Promise(function(o,c){try{var u=a.map(function(e){var t=b[e];if(!t)throw new Error('Operation "'+e+'" unsupported in this version of the SDK.');return t[s?1:0]}),f=-1!==a.indexOf("encrypt"),p={},d=[];if(f)if("string"==typeof n)d.push((0,C.envelopeUnseal)(n,i).then(function(e){p.key=e.key,p.iv=e.iv}));else{if(!n.key||!n.iv)throw new Error("File requires an envelope for encryption/decryption, none was provided.");p.key=n.key,p.iv=n.iv}Promise.all(d).then(function(){_&&console.debug("Instructions:",u.map(function(e){return e.operationName})),_&&console.debug("Decoding input as "+t);var n=l(e,t);_&&console.debug("Data:",Buffer.from(n));for(var i=0;i<u.length;i++)try{_&&console.debug("Running operation "+u[i].operationName),n=u[i](n,p),_&&console.debug("Data:",Buffer.from(n))}catch(e){throw new Error('Failed operation "'+u[i].operationName+'" (index '+i+") - "+e)}_&&console.log("Encoding output as "+r),n=h(n,r),o(n)}).catch(function(e){c(e)})}catch(e){c(e)}})}t.__esModule=!0,t.default=f;var p=r(2),d=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(p),g=r(43),y=n(g),v=r(49),m=n(v),C=r(8),E=r(41),S=n(E),_=!1,b={encrypt:[i,a],"base64.encode":[c,u],"gzip.compress":[s,o]};i.operationName="encrypt",a.operationName="decrypt",s.operationName="gzip.compress",o.operationName="gzip.decompress",c.operationName="base64.encode",u.operationName="base64.decode"},function(e,t,r){"use strict";e.exports=function e(){return e}}]);
|
|
2
|
-
//# sourceMappingURL=worker.a2f0a156.js.map
|