@circle-fin/smart-contract-platform 10.5.1 → 10.5.5

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.
@@ -1,46 +1,22 @@
1
- import ha from"util";import We,{Readable as lm}from"stream";import bp,{resolve as Ep}from"path";import Sl from"http";import Tl from"https";import wl from"url";import um from"fs";import tr,{randomUUID as pm}from"crypto";import Cp from"http2";import dm from"assert";import Sp from"tty";import fm from"os";import ta from"zlib";import{EventEmitter as mm}from"events";function Tp(e,t){return function(){return e.apply(t,arguments)}}const{toString:hm}=Object.prototype,{getPrototypeOf:Sc}=Object,{iterator:Tc,toStringTag:wp}=Symbol,wc=(e=>t=>{const r=hm.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Ot=e=>(e=e.toLowerCase(),t=>wc(t)===e),Ac=e=>t=>typeof t===e,{isArray:La}=Array,Ua=Ac("undefined");function ar(e){return e!==null&&!Ua(e)&&e.constructor!==null&&!Ua(e.constructor)&&mt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ap=Ot("ArrayBuffer");function vm(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ap(e.buffer),t}const gm=Ac("string"),mt=Ac("function"),Ip=Ac("number"),rr=e=>e!==null&&typeof e=="object",xm=e=>e===!0||e===!1,Ic=e=>{if(wc(e)!=="object")return!1;const t=Sc(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(wp in e)&&!(Tc in e)},ym=e=>{if(!rr(e)||ar(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},bm=Ot("Date"),Em=Ot("File"),Cm=e=>!!(e&&typeof e.uri<"u"),Sm=e=>e&&typeof e.getParts<"u",Tm=Ot("Blob"),wm=Ot("FileList"),Am=e=>rr(e)&&mt(e.pipe);function Im(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Bp=Im(),_p=typeof Bp.FormData<"u"?Bp.FormData:void 0,Bm=e=>{if(!e)return!1;if(_p&&e instanceof _p)return!0;const t=Sc(e);if(!t||t===Object.prototype||!mt(e.append))return!1;const r=wc(e);return r==="formdata"||r==="object"&&mt(e.toString)&&e.toString()==="[object FormData]"},_m=Ot("URLSearchParams"),[Rm,km,Nm,Lm]=["ReadableStream","Request","Response","Headers"].map(Ot),Um=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function nr(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let a,n;if(typeof e!="object"&&(e=[e]),La(e))for(a=0,n=e.length;a<n;a++)t.call(null,e[a],a,e);else{if(ar(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let o;for(a=0;a<i;a++)o=s[a],t.call(null,e[o],o,e)}}function Rp(e,t){if(ar(e))return null;t=t.toLowerCase();const r=Object.keys(e);let a=r.length,n;for(;a-- >0;)if(n=r[a],t===n.toLowerCase())return n;return null}const va=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,kp=e=>!Ua(e)&&e!==va;function Al(){const{caseless:e,skipUndefined:t}=kp(this)&&this||{},r={},a=(n,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const i=e&&Rp(r,s)||s;Ic(r[i])&&Ic(n)?r[i]=Al(r[i],n):Ic(n)?r[i]=Al({},n):La(n)?r[i]=n.slice():(!t||!Ua(n))&&(r[i]=n)};for(let n=0,s=arguments.length;n<s;n++)arguments[n]&&nr(arguments[n],a);return r}const Pm=(e,t,r,{allOwnKeys:a}={})=>(nr(t,(n,s)=>{r&&mt(n)?Object.defineProperty(e,s,{value:Tp(n,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:a}),e),Dm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Om=(e,t,r,a)=>{e.prototype=Object.create(t.prototype,a),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Fm=(e,t,r,a)=>{let n,s,i;const o={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),s=n.length;s-- >0;)i=n[s],(!a||a(i,e,t))&&!o[i]&&(t[i]=e[i],o[i]=!0);e=r!==!1&&Sc(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Mm=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const a=e.indexOf(t,r);return a!==-1&&a===r},Vm=e=>{if(!e)return null;if(La(e))return e;let t=e.length;if(!Ip(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},qm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Sc(Uint8Array)),jm=(e,t)=>{const a=(e&&e[Tc]).call(e);let n;for(;(n=a.next())&&!n.done;){const s=n.value;t.call(e,s[0],s[1])}},Km=(e,t)=>{let r;const a=[];for(;(r=e.exec(t))!==null;)a.push(r);return a},zm=Ot("HTMLFormElement"),Hm=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,a,n){return a.toUpperCase()+n}),Np=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),$m=Ot("RegExp"),Lp=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),a={};nr(r,(n,s)=>{let i;(i=t(n,s,e))!==!1&&(a[s]=i||n)}),Object.defineProperties(e,a)},Gm=e=>{Lp(e,(t,r)=>{if(mt(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const a=e[r];if(mt(a)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Qm=(e,t)=>{const r={},a=n=>{n.forEach(s=>{r[s]=!0})};return La(e)?a(e):a(String(e).split(t)),r},Wm=()=>{},Xm=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Ym(e){return!!(e&&mt(e.append)&&e[wp]==="FormData"&&e[Tc])}const Jm=e=>{const t=new Array(10),r=(a,n)=>{if(rr(a)){if(t.indexOf(a)>=0)return;if(ar(a))return a;if(!("toJSON"in a)){t[n]=a;const s=La(a)?[]:{};return nr(a,(i,o)=>{const c=r(i,n+1);!Ua(c)&&(s[o]=c)}),t[n]=void 0,s}}return a};return r(e,0)},Zm=Ot("AsyncFunction"),eh=e=>e&&(rr(e)||mt(e))&&mt(e.then)&&mt(e.catch),Up=((e,t)=>e?setImmediate:t?((r,a)=>(va.addEventListener("message",({source:n,data:s})=>{n===va&&s===r&&a.length&&a.shift()()},!1),n=>{a.push(n),va.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",mt(va.postMessage)),th=typeof queueMicrotask<"u"?queueMicrotask.bind(va):typeof process<"u"&&process.nextTick||Up,ah=e=>e!=null&&mt(e[Tc]);var A={isArray:La,isArrayBuffer:Ap,isBuffer:ar,isFormData:Bm,isArrayBufferView:vm,isString:gm,isNumber:Ip,isBoolean:xm,isObject:rr,isPlainObject:Ic,isEmptyObject:ym,isReadableStream:Rm,isRequest:km,isResponse:Nm,isHeaders:Lm,isUndefined:Ua,isDate:bm,isFile:Em,isReactNativeBlob:Cm,isReactNative:Sm,isBlob:Tm,isRegExp:$m,isFunction:mt,isStream:Am,isURLSearchParams:_m,isTypedArray:qm,isFileList:wm,forEach:nr,merge:Al,extend:Pm,trim:Um,stripBOM:Dm,inherits:Om,toFlatObject:Fm,kindOf:wc,kindOfTest:Ot,endsWith:Mm,toArray:Vm,forEachEntry:jm,matchAll:Km,isHTMLForm:zm,hasOwnProperty:Np,hasOwnProp:Np,reduceDescriptors:Lp,freezeMethods:Gm,toObjectSet:Qm,toCamelCase:Hm,noop:Wm,toFiniteNumber:Xm,findKey:Rp,global:va,isContextDefined:kp,isSpecCompliantForm:Ym,toJSONObject:Jm,isAsyncFn:Zm,isThenable:eh,setImmediate:Up,asap:th,isIterable:ah};let O=class om extends Error{static from(t,r,a,n,s,i){const o=new om(t.message,r||t.code,a,n,s);return o.cause=t,o.name=t.name,t.status!=null&&o.status==null&&(o.status=t.status),i&&Object.assign(o,i),o}constructor(t,r,a,n,s){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),a&&(this.config=a),n&&(this.request=n),s&&(this.response=s,this.status=s.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:A.toJSONObject(this.config),code:this.code,status:this.status}}};O.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",O.ERR_BAD_OPTION="ERR_BAD_OPTION",O.ECONNABORTED="ECONNABORTED",O.ETIMEDOUT="ETIMEDOUT",O.ERR_NETWORK="ERR_NETWORK",O.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",O.ERR_DEPRECATED="ERR_DEPRECATED",O.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",O.ERR_BAD_REQUEST="ERR_BAD_REQUEST",O.ERR_CANCELED="ERR_CANCELED",O.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",O.ERR_INVALID_URL="ERR_INVALID_URL",O.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var rh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dp=We.Stream,nh=ha,ih=Ft;function Ft(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}nh.inherits(Ft,Dp),Ft.create=function(e,t){var r=new this;t=t||{};for(var a in t)r[a]=t[a];r.source=e;var n=e.emit;return e.emit=function(){return r._handleEmit(arguments),n.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r},Object.defineProperty(Ft.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),Ft.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},Ft.prototype.resume=function(){this._released||this.release(),this.source.resume()},Ft.prototype.pause=function(){this.source.pause()},Ft.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},Ft.prototype.pipe=function(){var e=Dp.prototype.pipe.apply(this,arguments);return this.resume(),e},Ft.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)},Ft.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}};var sh=ha,Op=We.Stream,Fp=ih,oh=Oe;function Oe(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}sh.inherits(Oe,Op),Oe.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t},Oe.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)},Oe.prototype.append=function(e){var t=Oe.isStreamLike(e);if(t){if(!(e instanceof Fp)){var r=Fp.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},Oe.prototype.pipe=function(e,t){return Op.prototype.pipe.call(this,e,t),this.resume(),e},Oe.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}},Oe.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var a=Oe.isStreamLike(r);a&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))},Oe.prototype._pipeNext=function(e){this._currentStream=e;var t=Oe.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()},Oe.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})},Oe.prototype.write=function(e){this.emit("data",e)},Oe.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))},Oe.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")},Oe.prototype.end=function(){this._reset(),this.emit("end")},Oe.prototype.destroy=function(){this._reset(),this.emit("close")},Oe.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},Oe.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}},Oe.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},Oe.prototype._emitError=function(e){this._reset(),this.emit("error",e)};var Mp={},ch={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}};/*!
2
- * mime-db
3
- * Copyright(c) 2014 Jonathan Ong
4
- * Copyright(c) 2015-2022 Douglas Christopher Wilson
5
- * MIT Licensed
6
- */var lh=ch;/*!
7
- * mime-types
8
- * Copyright(c) 2014 Jonathan Ong
9
- * Copyright(c) 2015 Douglas Christopher Wilson
10
- * MIT Licensed
11
- */(function(e){var t=lh,r=bp.extname,a=/^\s*([^;\s]*)(?:;|\s|$)/,n=/^text\//i;e.charset=s,e.charsets={lookup:s},e.contentType=i,e.extension=o,e.extensions=Object.create(null),e.lookup=c,e.types=Object.create(null),l(e.extensions,e.types);function s(u){if(!u||typeof u!="string")return!1;var p=a.exec(u),d=p&&t[p[1].toLowerCase()];return d&&d.charset?d.charset:p&&n.test(p[1])?"UTF-8":!1}function i(u){if(!u||typeof u!="string")return!1;var p=u.indexOf("/")===-1?e.lookup(u):u;if(!p)return!1;if(p.indexOf("charset")===-1){var d=e.charset(p);d&&(p+="; charset="+d.toLowerCase())}return p}function o(u){if(!u||typeof u!="string")return!1;var p=a.exec(u),d=p&&e.extensions[p[1].toLowerCase()];return!d||!d.length?!1:d[0]}function c(u){if(!u||typeof u!="string")return!1;var p=r("x."+u).toLowerCase().substr(1);return p&&e.types[p]||!1}function l(u,p){var d=["nginx","apache",void 0,"iana"];Object.keys(t).forEach(function(m){var y=t[m],b=y.extensions;if(!(!b||!b.length)){u[m]=b;for(var C=0;C<b.length;C++){var B=b[C];if(p[B]){var _=d.indexOf(t[p[B]].source),k=d.indexOf(y.source);if(p[B]!=="application/octet-stream"&&(_>k||_===k&&p[B].substr(0,12)==="application/"))continue}p[B]=m}}})}})(Mp);var uh=ph;function ph(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}var Vp=uh,qp=dh;function dh(e){var t=!1;return Vp(function(){t=!0}),function(a,n){t?e(a,n):Vp(function(){e(a,n)})}}var jp=fh;function fh(e){Object.keys(e.jobs).forEach(mh.bind(e)),e.jobs={}}function mh(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}var Kp=qp,hh=jp,zp=vh;function vh(e,t,r,a){var n=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[n]=gh(t,n,e[n],function(s,i){n in r.jobs&&(delete r.jobs[n],s?hh(r):r.results[n]=i,a(s,r.results))})}function gh(e,t,r,a){var n;return e.length==2?n=e(r,Kp(a)):n=e(r,t,Kp(a)),n}var Hp=xh;function xh(e,t){var r=!Array.isArray(e),a={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&a.keyedList.sort(r?t:function(n,s){return t(e[n],e[s])}),a}var yh=jp,bh=qp,$p=Eh;function Eh(e){Object.keys(this.jobs).length&&(this.index=this.size,yh(this),bh(e)(null,this.results))}var Ch=zp,Sh=Hp,Th=$p,wh=Ah;function Ah(e,t,r){for(var a=Sh(e);a.index<(a.keyedList||e).length;)Ch(e,t,a,function(n,s){if(n){r(n,s);return}if(Object.keys(a.jobs).length===0){r(null,a.results);return}}),a.index++;return Th.bind(a,r)}var Bc={exports:{}},Gp=zp,Ih=Hp,Bh=$p;Bc.exports=_h,Bc.exports.ascending=Qp,Bc.exports.descending=Rh;function _h(e,t,r,a){var n=Ih(e,r);return Gp(e,t,n,function s(i,o){if(i){a(i,o);return}if(n.index++,n.index<(n.keyedList||e).length){Gp(e,t,n,s);return}a(null,n.results)}),Bh.bind(n,a)}function Qp(e,t){return e<t?-1:e>t?1:0}function Rh(e,t){return-1*Qp(e,t)}var Wp=Bc.exports,kh=Wp,Nh=Lh;function Lh(e,t,r){return kh(e,t,null,r)}var Uh={parallel:wh,serial:Nh,serialOrdered:Wp},Xp=Object,Ph=Error,Dh=EvalError,Oh=RangeError,Fh=ReferenceError,Mh=SyntaxError,Il,Yp;function Bl(){return Yp||(Yp=1,Il=TypeError),Il}var Vh=URIError,qh=Math.abs,jh=Math.floor,Kh=Math.max,zh=Math.min,Hh=Math.pow,$h=Math.round,Gh=Number.isNaN||function(t){return t!==t},Qh=Gh,Wh=function(t){return Qh(t)||t===0?t:t<0?-1:1},Xh=Object.getOwnPropertyDescriptor,_c=Xh;if(_c)try{_c([],"length")}catch{_c=null}var Jp=_c,Rc=Object.defineProperty||!1;if(Rc)try{Rc({},"a",{value:1})}catch{Rc=!1}var Yh=Rc,_l,Zp;function ed(){return Zp||(Zp=1,_l=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),a=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var n=42;t[r]=n;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var i=Object.getOwnPropertySymbols(t);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(t,r);if(o.value!==n||o.enumerable!==!0)return!1}return!0}),_l}var Rl,td;function Jh(){if(td)return Rl;td=1;var e=typeof Symbol<"u"&&Symbol,t=ed();return Rl=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Rl}var kl,ad;function rd(){return ad||(ad=1,kl=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),kl}var Nl,nd;function id(){if(nd)return Nl;nd=1;var e=Xp;return Nl=e.getPrototypeOf||null,Nl}var Zh="Function.prototype.bind called on incompatible ",ev=Object.prototype.toString,tv=Math.max,av="[object Function]",sd=function(t,r){for(var a=[],n=0;n<t.length;n+=1)a[n]=t[n];for(var s=0;s<r.length;s+=1)a[s+t.length]=r[s];return a},rv=function(t,r){for(var a=[],n=r||0,s=0;n<t.length;n+=1,s+=1)a[s]=t[n];return a},nv=function(e,t){for(var r="",a=0;a<e.length;a+=1)r+=e[a],a+1<e.length&&(r+=t);return r},iv=function(t){var r=this;if(typeof r!="function"||ev.apply(r)!==av)throw new TypeError(Zh+r);for(var a=rv(arguments,1),n,s=function(){if(this instanceof n){var u=r.apply(this,sd(a,arguments));return Object(u)===u?u:this}return r.apply(t,sd(a,arguments))},i=tv(0,r.length-a.length),o=[],c=0;c<i;c++)o[c]="$"+c;if(n=Function("binder","return function ("+nv(o,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var l=function(){};l.prototype=r.prototype,n.prototype=new l,l.prototype=null}return n},sv=iv,kc=Function.prototype.bind||sv,Ll,od;function Ul(){return od||(od=1,Ll=Function.prototype.call),Ll}var Pl,cd;function ld(){return cd||(cd=1,Pl=Function.prototype.apply),Pl}var Dl,ud;function ov(){return ud||(ud=1,Dl=typeof Reflect<"u"&&Reflect&&Reflect.apply),Dl}var Ol,pd;function cv(){if(pd)return Ol;pd=1;var e=kc,t=ld(),r=Ul(),a=ov();return Ol=a||e.call(r,t),Ol}var Fl,dd;function lv(){if(dd)return Fl;dd=1;var e=kc,t=Bl(),r=Ul(),a=cv();return Fl=function(s){if(s.length<1||typeof s[0]!="function")throw new t("a function is required");return a(e,r,s)},Fl}var Ml,fd;function uv(){if(fd)return Ml;fd=1;var e=lv(),t=Jp,r;try{r=[].__proto__===Array.prototype}catch(i){if(!i||typeof i!="object"||!("code"in i)||i.code!=="ERR_PROTO_ACCESS")throw i}var a=!!r&&t&&t(Object.prototype,"__proto__"),n=Object,s=n.getPrototypeOf;return Ml=a&&typeof a.get=="function"?e([a.get]):typeof s=="function"?function(o){return s(o==null?o:n(o))}:!1,Ml}var Vl,md;function pv(){if(md)return Vl;md=1;var e=rd(),t=id(),r=uv();return Vl=e?function(n){return e(n)}:t?function(n){if(!n||typeof n!="object"&&typeof n!="function")throw new TypeError("getProto: not an object");return t(n)}:r?function(n){return r(n)}:null,Vl}var dv=Function.prototype.call,fv=Object.prototype.hasOwnProperty,mv=kc,ql=mv.call(dv,fv),oe,hv=Xp,vv=Ph,gv=Dh,xv=Oh,yv=Fh,Pa=Mh,Da=Bl(),bv=Vh,Ev=qh,Cv=jh,Sv=Kh,Tv=zh,wv=Hh,Av=$h,Iv=Wh,hd=Function,jl=function(e){try{return hd('"use strict"; return ('+e+").constructor;")()}catch{}},ir=Jp,Bv=Yh,Kl=function(){throw new Da},_v=ir?(function(){try{return arguments.callee,Kl}catch{try{return ir(arguments,"callee").get}catch{return Kl}}})():Kl,Oa=Jh()(),ze=pv(),Rv=id(),kv=rd(),vd=ld(),sr=Ul(),Fa={},Nv=typeof Uint8Array>"u"||!ze?oe:ze(Uint8Array),ga={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?oe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?oe:ArrayBuffer,"%ArrayIteratorPrototype%":Oa&&ze?ze([][Symbol.iterator]()):oe,"%AsyncFromSyncIteratorPrototype%":oe,"%AsyncFunction%":Fa,"%AsyncGenerator%":Fa,"%AsyncGeneratorFunction%":Fa,"%AsyncIteratorPrototype%":Fa,"%Atomics%":typeof Atomics>"u"?oe:Atomics,"%BigInt%":typeof BigInt>"u"?oe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?oe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?oe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?oe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":vv,"%eval%":eval,"%EvalError%":gv,"%Float16Array%":typeof Float16Array>"u"?oe:Float16Array,"%Float32Array%":typeof Float32Array>"u"?oe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?oe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?oe:FinalizationRegistry,"%Function%":hd,"%GeneratorFunction%":Fa,"%Int8Array%":typeof Int8Array>"u"?oe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?oe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?oe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Oa&&ze?ze(ze([][Symbol.iterator]())):oe,"%JSON%":typeof JSON=="object"?JSON:oe,"%Map%":typeof Map>"u"?oe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Oa||!ze?oe:ze(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":hv,"%Object.getOwnPropertyDescriptor%":ir,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?oe:Promise,"%Proxy%":typeof Proxy>"u"?oe:Proxy,"%RangeError%":xv,"%ReferenceError%":yv,"%Reflect%":typeof Reflect>"u"?oe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?oe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Oa||!ze?oe:ze(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?oe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Oa&&ze?ze(""[Symbol.iterator]()):oe,"%Symbol%":Oa?Symbol:oe,"%SyntaxError%":Pa,"%ThrowTypeError%":_v,"%TypedArray%":Nv,"%TypeError%":Da,"%Uint8Array%":typeof Uint8Array>"u"?oe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?oe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?oe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?oe:Uint32Array,"%URIError%":bv,"%WeakMap%":typeof WeakMap>"u"?oe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?oe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?oe:WeakSet,"%Function.prototype.call%":sr,"%Function.prototype.apply%":vd,"%Object.defineProperty%":Bv,"%Object.getPrototypeOf%":Rv,"%Math.abs%":Ev,"%Math.floor%":Cv,"%Math.max%":Sv,"%Math.min%":Tv,"%Math.pow%":wv,"%Math.round%":Av,"%Math.sign%":Iv,"%Reflect.getPrototypeOf%":kv};if(ze)try{null.error}catch(e){var Lv=ze(ze(e));ga["%Error.prototype%"]=Lv}var Uv=function e(t){var r;if(t==="%AsyncFunction%")r=jl("async function () {}");else if(t==="%GeneratorFunction%")r=jl("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=jl("async function* () {}");else if(t==="%AsyncGenerator%"){var a=e("%AsyncGeneratorFunction%");a&&(r=a.prototype)}else if(t==="%AsyncIteratorPrototype%"){var n=e("%AsyncGenerator%");n&&ze&&(r=ze(n.prototype))}return ga[t]=r,r},gd={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},or=kc,Nc=ql,Pv=or.call(sr,Array.prototype.concat),Dv=or.call(vd,Array.prototype.splice),xd=or.call(sr,String.prototype.replace),Lc=or.call(sr,String.prototype.slice),Ov=or.call(sr,RegExp.prototype.exec),Fv=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Mv=/\\(\\)?/g,Vv=function(t){var r=Lc(t,0,1),a=Lc(t,-1);if(r==="%"&&a!=="%")throw new Pa("invalid intrinsic syntax, expected closing `%`");if(a==="%"&&r!=="%")throw new Pa("invalid intrinsic syntax, expected opening `%`");var n=[];return xd(t,Fv,function(s,i,o,c){n[n.length]=o?xd(c,Mv,"$1"):i||s}),n},qv=function(t,r){var a=t,n;if(Nc(gd,a)&&(n=gd[a],a="%"+n[0]+"%"),Nc(ga,a)){var s=ga[a];if(s===Fa&&(s=Uv(a)),typeof s>"u"&&!r)throw new Da("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:a,value:s}}throw new Pa("intrinsic "+t+" does not exist!")},jv=function(t,r){if(typeof t!="string"||t.length===0)throw new Da("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Da('"allowMissing" argument must be a boolean');if(Ov(/^%?[^%]*%?$/,t)===null)throw new Pa("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var a=Vv(t),n=a.length>0?a[0]:"",s=qv("%"+n+"%",r),i=s.name,o=s.value,c=!1,l=s.alias;l&&(n=l[0],Dv(a,Pv([0,1],l)));for(var u=1,p=!0;u<a.length;u+=1){var d=a[u],x=Lc(d,0,1),m=Lc(d,-1);if((x==='"'||x==="'"||x==="`"||m==='"'||m==="'"||m==="`")&&x!==m)throw new Pa("property names with quotes must have matching quotes");if((d==="constructor"||!p)&&(c=!0),n+="."+d,i="%"+n+"%",Nc(ga,i))o=ga[i];else if(o!=null){if(!(d in o)){if(!r)throw new Da("base intrinsic for "+t+" exists, but the property is not available.");return}if(ir&&u+1>=a.length){var y=ir(o,d);p=!!y,p&&"get"in y&&!("originalValue"in y.get)?o=y.get:o=o[d]}else p=Nc(o,d),o=o[d];p&&!c&&(ga[i]=o)}}return o},zl,yd;function Kv(){if(yd)return zl;yd=1;var e=ed();return zl=function(){return e()&&!!Symbol.toStringTag},zl}var zv=jv,bd=zv("%Object.defineProperty%",!0),Hv=Kv()(),$v=ql,Gv=Bl(),Uc=Hv?Symbol.toStringTag:null,Qv=function(t,r){var a=arguments.length>2&&!!arguments[2]&&arguments[2].force,n=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof a<"u"&&typeof a!="boolean"||typeof n<"u"&&typeof n!="boolean")throw new Gv("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Uc&&(a||!$v(t,Uc))&&(bd?bd(t,Uc,{configurable:!n,enumerable:!1,value:r,writable:!1}):t[Uc]=r)},Wv=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e},Hl=oh,Xv=ha,$l=bp,Yv=Sl,Jv=Tl,Zv=wl.parse,eg=um,tg=We.Stream,ag=tr,Gl=Mp,rg=Uh,ng=Qv,aa=ql,Ql=Wv;function he(e){if(!(this instanceof he))return new he(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Hl.call(this),e=e||{};for(var t in e)this[t]=e[t]}Xv.inherits(he,Hl),he.LINE_BREAK=`\r
12
- `,he.DEFAULT_CONTENT_TYPE="application/octet-stream",he.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var a=Hl.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var n=this._multiPartHeader(e,t,r),s=this._multiPartFooter();a(n),a(t),a(s),this._trackLength(n,t,r)},he.prototype._trackLength=function(e,t,r){var a=0;r.knownLength!=null?a+=Number(r.knownLength):Buffer.isBuffer(t)?a=t.length:typeof t=="string"&&(a=Buffer.byteLength(t)),this._valueLength+=a,this._overheadLength+=Buffer.byteLength(e)+he.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&aa(t,"httpVersion"))&&!(t instanceof tg))&&(r.knownLength||this._valuesToMeasure.push(t))},he.prototype._lengthRetriever=function(e,t){aa(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):eg.stat(e.path,function(r,a){if(r){t(r);return}var n=a.size-(e.start?e.start:0);t(null,n)}):aa(e,"httpVersion")?t(null,Number(e.headers["content-length"])):aa(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")},he.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var a=this._getContentDisposition(t,r),n=this._getContentType(t,r),s="",i={"Content-Disposition":["form-data",'name="'+e+'"'].concat(a||[]),"Content-Type":[].concat(n||[])};typeof r.header=="object"&&Ql(i,r.header);var o;for(var c in i)if(aa(i,c)){if(o=i[c],o==null)continue;Array.isArray(o)||(o=[o]),o.length&&(s+=c+": "+o.join("; ")+he.LINE_BREAK)}return"--"+this.getBoundary()+he.LINE_BREAK+s+he.LINE_BREAK},he.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=$l.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=$l.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&aa(e,"httpVersion")&&(r=$l.basename(e.client._httpMessage.path||"")),r)return'filename="'+r+'"'},he.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=Gl.lookup(e.name)),!r&&e&&e.path&&(r=Gl.lookup(e.path)),!r&&e&&e.readable&&aa(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=Gl.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=he.DEFAULT_CONTENT_TYPE),r},he.prototype._multiPartFooter=function(){return function(e){var t=he.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)},he.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+he.LINE_BREAK},he.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)aa(e,t)&&(r[t.toLowerCase()]=e[t]);return r},he.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e},he.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},he.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,a=this._streams.length;r<a;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(he.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},he.prototype._generateBoundary=function(){this._boundary="--------------------------"+ag.randomBytes(12).toString("hex")},he.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},he.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},he.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}rg.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,a){if(r){e(r);return}a.forEach(function(n){t+=n}),e(null,t)})},he.prototype.submit=function(e,t){var r,a,n={method:"post"};return typeof e=="string"?(e=Zv(e),a=Ql({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},n)):(a=Ql(e,n),a.port||(a.port=a.protocol==="https:"?443:80)),a.headers=this.getHeaders(e.headers),a.protocol==="https:"?r=Jv.request(a):r=Yv.request(a),this.getLength(function(s,i){if(s&&s!=="Unknown stream"){this._error(s);return}if(i&&r.setHeader("Content-Length",i),this.pipe(r),t){var o,c=function(l,u){return r.removeListener("error",c),r.removeListener("response",o),t.call(this,l,u)};o=c.bind(this,null),r.on("error",c),r.on("response",o)}}.bind(this)),r},he.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},he.prototype.toString=function(){return"[object FormData]"},ng(he.prototype,"FormData");var ig=he,Ed=Pp(ig);function Wl(e){return A.isPlainObject(e)||A.isArray(e)}function Cd(e){return A.endsWith(e,"[]")?e.slice(0,-2):e}function Xl(e,t,r){return e?e.concat(t).map(function(n,s){return n=Cd(n),!r&&s?"["+n+"]":n}).join(r?".":""):t}function sg(e){return A.isArray(e)&&!e.some(Wl)}const og=A.toFlatObject(A,{},null,function(t){return/^is[A-Z]/.test(t)});function Pc(e,t,r){if(!A.isObject(e))throw new TypeError("target must be an object");t=t||new(Ed||FormData),r=A.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,C){return!A.isUndefined(C[b])});const a=r.metaTokens,n=r.visitor||p,s=r.dots,i=r.indexes,o=r.Blob||typeof Blob<"u"&&Blob,c=r.maxDepth===void 0?100:r.maxDepth,l=o&&A.isSpecCompliantForm(t);if(!A.isFunction(n))throw new TypeError("visitor must be a function");function u(y){if(y===null)return"";if(A.isDate(y))return y.toISOString();if(A.isBoolean(y))return y.toString();if(!l&&A.isBlob(y))throw new O("Blob is not supported. Use a Buffer instead.");return A.isArrayBuffer(y)||A.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function p(y,b,C){let B=y;if(A.isReactNative(t)&&A.isReactNativeBlob(y))return t.append(Xl(C,b,s),u(y)),!1;if(y&&!C&&typeof y=="object"){if(A.endsWith(b,"{}"))b=a?b:b.slice(0,-2),y=JSON.stringify(y);else if(A.isArray(y)&&sg(y)||(A.isFileList(y)||A.endsWith(b,"[]"))&&(B=A.toArray(y)))return b=Cd(b),B.forEach(function(k,N){!(A.isUndefined(k)||k===null)&&t.append(i===!0?Xl([b],N,s):i===null?b:b+"[]",u(k))}),!1}return Wl(y)?!0:(t.append(Xl(C,b,s),u(y)),!1)}const d=[],x=Object.assign(og,{defaultVisitor:p,convertValue:u,isVisitable:Wl});function m(y,b,C=0){if(!A.isUndefined(y)){if(C>c)throw new O("Object is too deeply nested ("+C+" levels). Max depth: "+c,O.ERR_FORM_DATA_DEPTH_EXCEEDED);if(d.indexOf(y)!==-1)throw Error("Circular reference detected in "+b.join("."));d.push(y),A.forEach(y,function(_,k){(!(A.isUndefined(_)||_===null)&&n.call(t,_,A.isString(k)?k.trim():k,b,x))===!0&&m(_,b?b.concat(k):[k],C+1)}),d.pop()}}if(!A.isObject(e))throw new TypeError("data must be an object");return m(e),t}function Sd(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(a){return t[a]})}function Td(e,t){this._pairs=[],e&&Pc(e,this,t)}const wd=Td.prototype;wd.append=function(t,r){this._pairs.push([t,r])},wd.toString=function(t){const r=t?function(a){return t.call(this,a,Sd)}:Sd;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};function cg(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Yl(e,t,r){if(!t)return e;const a=r&&r.encode||cg,n=A.isFunction(r)?{serialize:r}:r,s=n&&n.serialize;let i;if(s?i=s(t,n):i=A.isURLSearchParams(t)?t.toString():new Td(t,n).toString(a),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ad{constructor(){this.handlers=[]}use(t,r,a){return this.handlers.push({fulfilled:t,rejected:r,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){A.forEach(this.handlers,function(a){a!==null&&t(a)})}}var Dc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},lg=wl.URLSearchParams;const Jl="abcdefghijklmnopqrstuvwxyz",Id="0123456789",Bd={DIGIT:Id,ALPHA:Jl,ALPHA_DIGIT:Jl+Jl.toUpperCase()+Id},ug=(e=16,t=Bd.ALPHA_DIGIT)=>{let r="";const{length:a}=t,n=new Uint32Array(e);tr.randomFillSync(n);for(let s=0;s<e;s++)r+=t[n[s]%a];return r};var pg={isNode:!0,classes:{URLSearchParams:lg,FormData:Ed,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:Bd,generateString:ug,protocols:["http","https","file","data"]};const Zl=typeof window<"u"&&typeof document<"u",eu=typeof navigator=="object"&&navigator||void 0,dg=Zl&&(!eu||["ReactNative","NativeScript","NS"].indexOf(eu.product)<0),fg=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",mg=Zl&&window.location.href||"http://localhost";var hg=Object.freeze({__proto__:null,hasBrowserEnv:Zl,hasStandardBrowserEnv:dg,hasStandardBrowserWebWorkerEnv:fg,navigator:eu,origin:mg}),Fe={...hg,...pg};function vg(e,t){return Pc(e,new Fe.classes.URLSearchParams,{visitor:function(r,a,n,s){return Fe.isNode&&A.isBuffer(r)?(this.append(a,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function gg(e){return A.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function xg(e){const t={},r=Object.keys(e);let a;const n=r.length;let s;for(a=0;a<n;a++)s=r[a],t[s]=e[s];return t}function _d(e){function t(r,a,n,s){let i=r[s++];if(i==="__proto__")return!0;const o=Number.isFinite(+i),c=s>=r.length;return i=!i&&A.isArray(n)?n.length:i,c?(A.hasOwnProp(n,i)?n[i]=A.isArray(n[i])?n[i].concat(a):[n[i],a]:n[i]=a,!o):((!n[i]||!A.isObject(n[i]))&&(n[i]=[]),t(r,a,n[i],s)&&A.isArray(n[i])&&(n[i]=xg(n[i])),!o)}if(A.isFormData(e)&&A.isFunction(e.entries)){const r={};return A.forEachEntry(e,(a,n)=>{t(gg(a),n,r,0)}),r}return null}const Ma=(e,t)=>e!=null&&A.hasOwnProp(e,t)?e[t]:void 0;function yg(e,t,r){if(A.isString(e))try{return(t||JSON.parse)(e),A.trim(e)}catch(a){if(a.name!=="SyntaxError")throw a}return(r||JSON.stringify)(e)}const cr={transitional:Dc,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const a=r.getContentType()||"",n=a.indexOf("application/json")>-1,s=A.isObject(t);if(s&&A.isHTMLForm(t)&&(t=new FormData(t)),A.isFormData(t))return n?JSON.stringify(_d(t)):t;if(A.isArrayBuffer(t)||A.isBuffer(t)||A.isStream(t)||A.isFile(t)||A.isBlob(t)||A.isReadableStream(t))return t;if(A.isArrayBufferView(t))return t.buffer;if(A.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(s){const c=Ma(this,"formSerializer");if(a.indexOf("application/x-www-form-urlencoded")>-1)return vg(t,c).toString();if((o=A.isFileList(t))||a.indexOf("multipart/form-data")>-1){const l=Ma(this,"env"),u=l&&l.FormData;return Pc(o?{"files[]":t}:t,u&&new u,c)}}return s||n?(r.setContentType("application/json",!1),yg(t)):t}],transformResponse:[function(t){const r=Ma(this,"transitional")||cr.transitional,a=r&&r.forcedJSONParsing,n=Ma(this,"responseType"),s=n==="json";if(A.isResponse(t)||A.isReadableStream(t))return t;if(t&&A.isString(t)&&(a&&!n||s)){const o=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t,Ma(this,"parseReviver"))}catch(c){if(o)throw c.name==="SyntaxError"?O.from(c,O.ERR_BAD_RESPONSE,this,null,Ma(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Fe.classes.FormData,Blob:Fe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};A.forEach(["delete","get","head","post","put","patch"],e=>{cr.headers[e]={}});const bg=A.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var Eg=e=>{const t={};let r,a,n;return e&&e.split(`
13
- `).forEach(function(i){n=i.indexOf(":"),r=i.substring(0,n).trim().toLowerCase(),a=i.substring(n+1).trim(),!(!r||t[r]&&bg[r])&&(r==="set-cookie"?t[r]?t[r].push(a):t[r]=[a]:t[r]=t[r]?t[r]+", "+a:a)}),t};const Rd=Symbol("internals"),Cg=/[^\x09\x20-\x7E\x80-\xFF]/g;function Sg(e){let t=0,r=e.length;for(;t<r;){const a=e.charCodeAt(t);if(a!==9&&a!==32)break;t+=1}for(;r>t;){const a=e.charCodeAt(r-1);if(a!==9&&a!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}function lr(e){return e&&String(e).trim().toLowerCase()}function Tg(e){return Sg(e.replace(Cg,""))}function Oc(e){return e===!1||e==null?e:A.isArray(e)?e.map(Oc):Tg(String(e))}function wg(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=r.exec(e);)t[a[1]]=a[2];return t}const Ag=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function tu(e,t,r,a,n){if(A.isFunction(a))return a.call(this,t,r);if(n&&(t=r),!!A.isString(t)){if(A.isString(a))return t.indexOf(a)!==-1;if(A.isRegExp(a))return a.test(t)}}function Ig(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,a)=>r.toUpperCase()+a)}function Bg(e,t){const r=A.toCamelCase(" "+t);["get","set","has"].forEach(a=>{Object.defineProperty(e,a+r,{value:function(n,s,i){return this[a].call(this,t,n,s,i)},configurable:!0})})}let Xe=class{constructor(t){t&&this.set(t)}set(t,r,a){const n=this;function s(o,c,l){const u=lr(c);if(!u)throw new Error("header name must be a non-empty string");const p=A.findKey(n,u);(!p||n[p]===void 0||l===!0||l===void 0&&n[p]!==!1)&&(n[p||c]=Oc(o))}const i=(o,c)=>A.forEach(o,(l,u)=>s(l,u,c));if(A.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(A.isString(t)&&(t=t.trim())&&!Ag(t))i(Eg(t),r);else if(A.isObject(t)&&A.isIterable(t)){let o={},c,l;for(const u of t){if(!A.isArray(u))throw TypeError("Object iterator must return a key-value pair");o[l=u[0]]=(c=o[l])?A.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}i(o,r)}else t!=null&&s(r,t,a);return this}get(t,r){if(t=lr(t),t){const a=A.findKey(this,t);if(a){const n=this[a];if(!r)return n;if(r===!0)return wg(n);if(A.isFunction(r))return r.call(this,n,a);if(A.isRegExp(r))return r.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=lr(t),t){const a=A.findKey(this,t);return!!(a&&this[a]!==void 0&&(!r||tu(this,this[a],a,r)))}return!1}delete(t,r){const a=this;let n=!1;function s(i){if(i=lr(i),i){const o=A.findKey(a,i);o&&(!r||tu(a,a[o],o,r))&&(delete a[o],n=!0)}}return A.isArray(t)?t.forEach(s):s(t),n}clear(t){const r=Object.keys(this);let a=r.length,n=!1;for(;a--;){const s=r[a];(!t||tu(this,this[s],s,t,!0))&&(delete this[s],n=!0)}return n}normalize(t){const r=this,a={};return A.forEach(this,(n,s)=>{const i=A.findKey(a,s);if(i){r[i]=Oc(n),delete r[s];return}const o=t?Ig(s):String(s).trim();o!==s&&delete r[s],r[o]=Oc(n),a[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return A.forEach(this,(a,n)=>{a!=null&&a!==!1&&(r[n]=t&&A.isArray(a)?a.join(", "):a)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
14
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const a=new this(t);return r.forEach(n=>a.set(n)),a}static accessor(t){const a=(this[Rd]=this[Rd]={accessors:{}}).accessors,n=this.prototype;function s(i){const o=lr(i);a[o]||(Bg(n,i),a[o]=!0)}return A.isArray(t)?t.forEach(s):s(t),this}};Xe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),A.reduceDescriptors(Xe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(a){this[r]=a}}}),A.freezeMethods(Xe);function au(e,t){const r=this||cr,a=t||r,n=Xe.from(a.headers);let s=a.data;return A.forEach(e,function(o){s=o.call(r,s,n.normalize(),t?t.status:void 0)}),n.normalize(),s}function kd(e){return!!(e&&e.__CANCEL__)}let xa=class extends O{constructor(t,r,a){super(t??"canceled",O.ERR_CANCELED,r,a),this.name="CanceledError",this.__CANCEL__=!0}};function Va(e,t,r){const a=r.config.validateStatus;!r.status||!a||a(r.status)?e(r):t(new O("Request failed with status code "+r.status,[O.ERR_BAD_REQUEST,O.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function _g(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Rg(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ru(e,t,r){let a=!_g(t);return e&&(a||r===!1)?Rg(e,t):t}var kg={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function Ng(e){try{return new URL(e)}catch{return null}}function Lg(e){var t=(typeof e=="string"?Ng(e):e)||{},r=t.protocol,a=t.host,n=t.port;if(typeof a!="string"||!a||typeof r!="string"||(r=r.split(":",1)[0],a=a.replace(/:\d*$/,""),n=parseInt(n)||kg[r]||0,!Ug(a,n)))return"";var s=nu(r+"_proxy")||nu("all_proxy");return s&&s.indexOf("://")===-1&&(s=r+"://"+s),s}function Ug(e,t){var r=nu("no_proxy").toLowerCase();return r?r==="*"?!1:r.split(/[,\s]/).every(function(a){if(!a)return!0;var n=a.match(/^(.+):(\d+)$/),s=n?n[1]:a,i=n?parseInt(n[2]):0;return i&&i!==t?!0:/^[.*]/.test(s)?(s.charAt(0)==="*"&&(s=s.slice(1)),!e.endsWith(s)):e!==s}):!0}function nu(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var iu={exports:{}},Fc={exports:{}},Mc={exports:{}},su,Nd;function Pg(){if(Nd)return su;Nd=1;var e=1e3,t=e*60,r=t*60,a=r*24,n=a*7,s=a*365.25;su=function(u,p){p=p||{};var d=typeof u;if(d==="string"&&u.length>0)return i(u);if(d==="number"&&isFinite(u))return p.long?c(u):o(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function i(u){if(u=String(u),!(u.length>100)){var p=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(p){var d=parseFloat(p[1]),x=(p[2]||"ms").toLowerCase();switch(x){case"years":case"year":case"yrs":case"yr":case"y":return d*s;case"weeks":case"week":case"w":return d*n;case"days":case"day":case"d":return d*a;case"hours":case"hour":case"hrs":case"hr":case"h":return d*r;case"minutes":case"minute":case"mins":case"min":case"m":return d*t;case"seconds":case"second":case"secs":case"sec":case"s":return d*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:return}}}}function o(u){var p=Math.abs(u);return p>=a?Math.round(u/a)+"d":p>=r?Math.round(u/r)+"h":p>=t?Math.round(u/t)+"m":p>=e?Math.round(u/e)+"s":u+"ms"}function c(u){var p=Math.abs(u);return p>=a?l(u,p,a,"day"):p>=r?l(u,p,r,"hour"):p>=t?l(u,p,t,"minute"):p>=e?l(u,p,e,"second"):u+" ms"}function l(u,p,d,x){var m=p>=d*1.5;return Math.round(u/d)+" "+x+(m?"s":"")}return su}var ou,Ld;function Ud(){if(Ld)return ou;Ld=1;function e(t){a.debug=a,a.default=a,a.coerce=l,a.disable=o,a.enable=s,a.enabled=c,a.humanize=Pg(),a.destroy=u,Object.keys(t).forEach(p=>{a[p]=t[p]}),a.names=[],a.skips=[],a.formatters={};function r(p){let d=0;for(let x=0;x<p.length;x++)d=(d<<5)-d+p.charCodeAt(x),d|=0;return a.colors[Math.abs(d)%a.colors.length]}a.selectColor=r;function a(p){let d,x=null,m,y;function b(...C){if(!b.enabled)return;const B=b,_=Number(new Date),k=_-(d||_);B.diff=k,B.prev=d,B.curr=_,d=_,C[0]=a.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let N=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(K,W)=>{if(K==="%%")return"%";N++;const X=a.formatters[W];if(typeof X=="function"){const pe=C[N];K=X.call(B,pe),C.splice(N,1),N--}return K}),a.formatArgs.call(B,C),(B.log||a.log).apply(B,C)}return b.namespace=p,b.useColors=a.useColors(),b.color=a.selectColor(p),b.extend=n,b.destroy=a.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>x!==null?x:(m!==a.namespaces&&(m=a.namespaces,y=a.enabled(p)),y),set:C=>{x=C}}),typeof a.init=="function"&&a.init(b),b}function n(p,d){const x=a(this.namespace+(typeof d>"u"?":":d)+p);return x.log=this.log,x}function s(p){a.save(p),a.namespaces=p,a.names=[],a.skips=[];const d=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const x of d)x[0]==="-"?a.skips.push(x.slice(1)):a.names.push(x)}function i(p,d){let x=0,m=0,y=-1,b=0;for(;x<p.length;)if(m<d.length&&(d[m]===p[x]||d[m]==="*"))d[m]==="*"?(y=m,b=x,m++):(x++,m++);else if(y!==-1)m=y+1,b++,x=b;else return!1;for(;m<d.length&&d[m]==="*";)m++;return m===d.length}function o(){const p=[...a.names,...a.skips.map(d=>"-"+d)].join(",");return a.enable(""),p}function c(p){for(const d of a.skips)if(i(p,d))return!1;for(const d of a.names)if(i(p,d))return!0;return!1}function l(p){return p instanceof Error?p.stack||p.message:p}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return a.enable(a.load()),a}return ou=e,ou}var Pd;function Dg(){return Pd||(Pd=1,(function(e,t){t.formatArgs=a,t.save=n,t.load=s,t.useColors=r,t.storage=i(),t.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let c;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(c=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(c[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;c.splice(1,0,l,"color: inherit");let u=0,p=0;c[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(u++,d==="%c"&&(p=u))}),c.splice(p,0,l)}t.log=console.debug||console.log||(()=>{});function n(c){try{c?t.storage.setItem("debug",c):t.storage.removeItem("debug")}catch{}}function s(){let c;try{c=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c=process.env.DEBUG),c}function i(){try{return localStorage}catch{}}e.exports=Ud()(t);const{formatters:o}=e.exports;o.j=function(c){try{return JSON.stringify(c)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(Mc,Mc.exports)),Mc.exports}var Vc={exports:{}},cu,Dd;function Og(){return Dd||(Dd=1,cu=(e,t=process.argv)=>{const r=e.startsWith("-")?"":e.length===1?"-":"--",a=t.indexOf(r+e),n=t.indexOf("--");return a!==-1&&(n===-1||a<n)}),cu}var lu,Od;function Fg(){if(Od)return lu;Od=1;const e=fm,t=Sp,r=Og(),{env:a}=process;let n;r("no-color")||r("no-colors")||r("color=false")||r("color=never")?n=0:(r("color")||r("colors")||r("color=true")||r("color=always"))&&(n=1),"FORCE_COLOR"in a&&(a.FORCE_COLOR==="true"?n=1:a.FORCE_COLOR==="false"?n=0:n=a.FORCE_COLOR.length===0?1:Math.min(parseInt(a.FORCE_COLOR,10),3));function s(c){return c===0?!1:{level:c,hasBasic:!0,has256:c>=2,has16m:c>=3}}function i(c,l){if(n===0)return 0;if(r("color=16m")||r("color=full")||r("color=truecolor"))return 3;if(r("color=256"))return 2;if(c&&!l&&n===void 0)return 0;const u=n||0;if(a.TERM==="dumb")return u;if(process.platform==="win32"){const p=e.release().split(".");return Number(p[0])>=10&&Number(p[2])>=10586?Number(p[2])>=14931?3:2:1}if("CI"in a)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(p=>p in a)||a.CI_NAME==="codeship"?1:u;if("TEAMCITY_VERSION"in a)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION)?1:0;if(a.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in a){const p=parseInt((a.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(a.TERM_PROGRAM){case"iTerm.app":return p>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(a.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)||"COLORTERM"in a?1:u}function o(c){const l=i(c,c&&c.isTTY);return s(l)}return lu={supportsColor:o,stdout:s(i(!0,t.isatty(1))),stderr:s(i(!0,t.isatty(2)))},lu}var Fd;function Mg(){return Fd||(Fd=1,(function(e,t){const r=Sp,a=ha;t.init=u,t.log=o,t.formatArgs=s,t.save=c,t.load=l,t.useColors=n,t.destroy=a.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const d=Fg();d&&(d.stderr||d).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}t.inspectOpts=Object.keys(process.env).filter(d=>/^debug_/i.test(d)).reduce((d,x)=>{const m=x.substring(6).toLowerCase().replace(/_([a-z])/g,(b,C)=>C.toUpperCase());let y=process.env[x];return/^(yes|on|true|enabled)$/i.test(y)?y=!0:/^(no|off|false|disabled)$/i.test(y)?y=!1:y==="null"?y=null:y=Number(y),d[m]=y,d},{});function n(){return"colors"in t.inspectOpts?!!t.inspectOpts.colors:r.isatty(process.stderr.fd)}function s(d){const{namespace:x,useColors:m}=this;if(m){const y=this.color,b="\x1B[3"+(y<8?y:"8;5;"+y),C=` ${b};1m${x} \x1B[0m`;d[0]=C+d[0].split(`
15
- `).join(`
16
- `+C),d.push(b+"m+"+e.exports.humanize(this.diff)+"\x1B[0m")}else d[0]=i()+x+" "+d[0]}function i(){return t.inspectOpts.hideDate?"":new Date().toISOString()+" "}function o(...d){return process.stderr.write(a.formatWithOptions(t.inspectOpts,...d)+`
17
- `)}function c(d){d?process.env.DEBUG=d:delete process.env.DEBUG}function l(){return process.env.DEBUG}function u(d){d.inspectOpts={};const x=Object.keys(t.inspectOpts);for(let m=0;m<x.length;m++)d.inspectOpts[x[m]]=t.inspectOpts[x[m]]}e.exports=Ud()(t);const{formatters:p}=e.exports;p.o=function(d){return this.inspectOpts.colors=this.useColors,a.inspect(d,this.inspectOpts).split(`
18
- `).map(x=>x.trim()).join(" ")},p.O=function(d){return this.inspectOpts.colors=this.useColors,a.inspect(d,this.inspectOpts)}})(Vc,Vc.exports)),Vc.exports}var Md;function Vg(){return Md||(Md=1,typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Fc.exports=Dg():Fc.exports=Mg()),Fc.exports}var ur,qg=function(){if(!ur){try{ur=Vg()("follow-redirects")}catch{}typeof ur!="function"&&(ur=function(){})}ur.apply(null,arguments)},pr=wl,dr=pr.URL,jg=Sl,Kg=Tl,uu=We.Writable,pu=dm,Vd=qg;(function(){var t=typeof process<"u",r=typeof window<"u"&&typeof document<"u",a=ba(Error.captureStackTrace);!t&&(r||!a)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var du=!1;try{pu(new dr(""))}catch(e){du=e.code==="ERR_INVALID_URL"}var zg=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],fu=["abort","aborted","connect","error","socket","timeout"],mu=Object.create(null);fu.forEach(function(e){mu[e]=function(t,r,a){this._redirectable.emit(e,t,r,a)}});var hu=fr("ERR_INVALID_URL","Invalid URL",TypeError),vu=fr("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Hg=fr("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",vu),$g=fr("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Gg=fr("ERR_STREAM_WRITE_AFTER_END","write after end"),Qg=uu.prototype.destroy||jd;function ht(e,t){uu.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var r=this;this._onNativeResponse=function(a){try{r._processResponse(a)}catch(n){r.emit("error",n instanceof vu?n:new vu({cause:n}))}},this._performRequest()}ht.prototype=Object.create(uu.prototype),ht.prototype.abort=function(){bu(this._currentRequest),this._currentRequest.abort(),this.emit("abort")},ht.prototype.destroy=function(e){return bu(this._currentRequest,e),Qg.call(this,e),this},ht.prototype.write=function(e,t,r){if(this._ending)throw new Gg;if(!ya(e)&&!Yg(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(ba(t)&&(r=t,t=null),e.length===0){r&&r();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new $g),this.abort())},ht.prototype.end=function(e,t,r){if(ba(e)?(r=e,e=t=null):ba(t)&&(r=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var a=this,n=this._currentRequest;this.write(e,t,function(){a._ended=!0,n.end(null,null,r)}),this._ending=!0}},ht.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},ht.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},ht.prototype.setTimeout=function(e,t){var r=this;function a(i){i.setTimeout(e),i.removeListener("timeout",i.destroy),i.addListener("timeout",i.destroy)}function n(i){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),s()},e),a(i)}function s(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",s),r.removeListener("error",s),r.removeListener("response",s),r.removeListener("close",s),t&&r.removeListener("timeout",t),r.socket||r._currentRequest.removeListener("socket",n)}return t&&this.on("timeout",t),this.socket?n(this.socket):this._currentRequest.once("socket",n),this.on("socket",a),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){ht.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}}),["aborted","connection","socket"].forEach(function(e){Object.defineProperty(ht.prototype,e,{get:function(){return this._currentRequest[e]}})}),ht.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}},ht.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var a=this._currentRequest=t.request(this._options,this._onNativeResponse);a._redirectable=this;for(var n of fu)a.on(n,mu[n]);if(this._currentUrl=/^\//.test(this._options.path)?pr.format(this._options):this._options.path,this._isRedirect){var s=0,i=this,o=this._requestBodyBuffers;(function c(l){if(a===i._currentRequest)if(l)i.emit("error",l);else if(s<o.length){var u=o[s++];a.finished||a.write(u.data,u.encoding,c)}else i._ended&&a.end()})()}},ht.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var r=e.headers.location;if(!r||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(bu(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Hg;var a,n=this._options.beforeRedirect;n&&(a=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var s=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],yu(/^content-/i,this._options.headers));var i=yu(/^host$/i,this._options.headers),o=gu(this._currentUrl),c=i||o.host,l=/^\w+:/.test(r)?this._currentUrl:pr.format(Object.assign(o,{host:c})),u=Wg(r,l);if(Vd("redirecting to",u.href),this._isRedirect=!0,xu(u,this._options),(u.protocol!==o.protocol&&u.protocol!=="https:"||u.host!==c&&!Xg(u.host,c))&&yu(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),ba(n)){var p={headers:e.headers,statusCode:t},d={url:l,method:s,headers:a};n(this._options,p,d),this._sanitizeOptions(this._options)}this._performRequest()};function qd(e){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(e).forEach(function(a){var n=a+":",s=r[n]=e[a],i=t[a]=Object.create(s);function o(l,u,p){return Jg(l)?l=xu(l):ya(l)?l=xu(gu(l)):(p=u,u=Kd(l),l={protocol:n}),ba(u)&&(p=u,u=null),u=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},l,u),u.nativeProtocols=r,!ya(u.host)&&!ya(u.hostname)&&(u.hostname="::1"),pu.equal(u.protocol,n,"protocol mismatch"),Vd("options",u),new ht(u,p)}function c(l,u,p){var d=i.request(l,u,p);return d.end(),d}Object.defineProperties(i,{request:{value:o,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),t}function jd(){}function gu(e){var t;if(du)t=new dr(e);else if(t=Kd(pr.parse(e)),!ya(t.protocol))throw new hu({input:e});return t}function Wg(e,t){return du?new dr(e,t):gu(pr.resolve(t,e))}function Kd(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new hu({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new hu({input:e.href||e});return e}function xu(e,t){var r=t||{};for(var a of zg)r[a]=e[a];return r.hostname.startsWith("[")&&(r.hostname=r.hostname.slice(1,-1)),r.port!==""&&(r.port=Number(r.port)),r.path=r.search?r.pathname+r.search:r.pathname,r}function yu(e,t){var r;for(var a in t)e.test(a)&&(r=t[a],delete t[a]);return r===null||typeof r>"u"?void 0:String(r).trim()}function fr(e,t,r){function a(n){ba(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return a.prototype=new(r||Error),Object.defineProperties(a.prototype,{constructor:{value:a,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),a}function bu(e,t){for(var r of fu)e.removeListener(r,mu[r]);e.on("error",jd),e.destroy(t)}function Xg(e,t){pu(ya(e)&&ya(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}function ya(e){return typeof e=="string"||e instanceof String}function ba(e){return typeof e=="function"}function Yg(e){return typeof e=="object"&&"length"in e}function Jg(e){return dr&&e instanceof dr}iu.exports=qd({http:jg,https:Kg}),iu.exports.wrap=qd;var Zg=iu.exports,ex=Pp(Zg);const qc="1.15.2";function zd(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}const tx=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function ax(e,t,r){const a=r&&r.Blob||Fe.classes.Blob,n=zd(e);if(t===void 0&&a&&(t=!0),n==="data"){e=n.length?e.slice(n.length+1):e;const s=tx.exec(e);if(!s)throw new O("Invalid URL",O.ERR_INVALID_URL);const i=s[1],o=s[2],c=s[3],l=Buffer.from(decodeURIComponent(c),o?"base64":"utf8");if(t){if(!a)throw new O("Blob is not supported",O.ERR_NOT_SUPPORT);return new a([l],{type:i})}return l}throw new O("Unsupported protocol "+n,O.ERR_NOT_SUPPORT)}const Eu=Symbol("internals");class Hd extends We.Transform{constructor(t){t=A.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(a,n)=>!A.isUndefined(n[a])),super({readableHighWaterMark:t.chunkSize});const r=this[Eu]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",a=>{a==="progress"&&(r.isCaptured||(r.isCaptured=!0))})}_read(t){const r=this[Eu];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,a){const n=this[Eu],s=n.maxRate,i=this.readableHighWaterMark,o=n.timeWindow,c=1e3/o,l=s/c,u=n.minChunkSize!==!1?Math.max(n.minChunkSize,l*.01):0,p=(x,m)=>{const y=Buffer.byteLength(x);n.bytesSeen+=y,n.bytes+=y,n.isCaptured&&this.emit("progress",n.bytesSeen),this.push(x)?process.nextTick(m):n.onReadCallback=()=>{n.onReadCallback=null,process.nextTick(m)}},d=(x,m)=>{const y=Buffer.byteLength(x);let b=null,C=i,B,_=0;if(s){const k=Date.now();(!n.ts||(_=k-n.ts)>=o)&&(n.ts=k,B=l-n.bytes,n.bytes=B<0?-B:0,_=0),B=l-n.bytes}if(s){if(B<=0)return setTimeout(()=>{m(null,x)},o-_);B<C&&(C=B)}C&&y>C&&y-C>u&&(b=x.subarray(C),x=x.subarray(0,C)),p(x,b?()=>{process.nextTick(m,null,b)}:m)};d(t,function x(m,y){if(m)return a(m);y?d(y,x):a(null)})}}const{asyncIterator:$d}=Symbol,Gd=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[$d]?yield*e[$d]():yield e},rx=Fe.ALPHABET.ALPHA_DIGIT+"-_",mr=typeof TextEncoder=="function"?new TextEncoder:new ha.TextEncoder,Ea=`\r
19
- `,nx=mr.encode(Ea),ix=2;class sx{constructor(t,r){const{escapeName:a}=this.constructor,n=A.isString(r);let s=`Content-Disposition: form-data; name="${a(t)}"${!n&&r.name?`; filename="${a(r.name)}"`:""}${Ea}`;if(n)r=mr.encode(String(r).replace(/\r?\n|\r\n?/g,Ea));else{const i=String(r.type||"application/octet-stream").replace(/[\r\n]/g,"");s+=`Content-Type: ${i}${Ea}`}this.headers=mr.encode(s+Ea),this.contentLength=n?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+ix,this.name=t,this.value=r}async*encode(){yield this.headers;const{value:t}=this;A.isTypedArray(t)?yield t:yield*Gd(t),yield nx}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}}const ox=(e,t,r)=>{const{tag:a="form-data-boundary",size:n=25,boundary:s=a+"-"+Fe.generateString(n,rx)}=r||{};if(!A.isFormData(e))throw TypeError("FormData instance required");if(s.length<1||s.length>70)throw Error("boundary must be 10-70 characters long");const i=mr.encode("--"+s+Ea),o=mr.encode("--"+s+"--"+Ea);let c=o.byteLength;const l=Array.from(e.entries()).map(([p,d])=>{const x=new sx(p,d);return c+=x.size,x});c+=i.byteLength*l.length,c=A.toFiniteNumber(c);const u={"Content-Type":`multipart/form-data; boundary=${s}`};return Number.isFinite(c)&&(u["Content-Length"]=c),t&&t(u),lm.from((async function*(){for(const p of l)yield i,yield*p.encode();yield o})())};class cx extends We.Transform{__transform(t,r,a){this.push(t),a()}_transform(t,r,a){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){const n=Buffer.alloc(2);n[0]=120,n[1]=156,this.push(n,r)}this.__transform(t,r,a)}}const lx=(e,t)=>A.isAsyncFn(e)?function(...r){const a=r.pop();e.apply(this,r).then(n=>{try{t?a(null,...t(n)):a(null,n)}catch(s){a(s)}},a)}:e,ux=new Set(["localhost"]),Qd=e=>{const t=e.split(".");return t.length!==4||t[0]!=="127"?!1:t.every(r=>/^\d+$/.test(r)&&Number(r)>=0&&Number(r)<=255)},px=e=>{if(e==="::1")return!0;const t=e.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return Qd(t[1]);const r=e.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(r){const n=parseInt(r[1],16);return n>=32512&&n<=32767}const a=e.split(":");if(a.length===8){for(let n=0;n<7;n++)if(!/^0+$/.test(a[n]))return!1;return/^0*1$/.test(a[7])}return!1},Wd=e=>e?ux.has(e)||Qd(e)?!0:px(e):!1,dx={http:80,https:443,ws:80,wss:443,ftp:21},fx=e=>{let t=e,r=0;if(t.charAt(0)==="["){const s=t.indexOf("]");if(s!==-1){const i=t.slice(1,s),o=t.slice(s+1);return o.charAt(0)===":"&&/^\d+$/.test(o.slice(1))&&(r=Number.parseInt(o.slice(1),10)),[i,r]}}const a=t.indexOf(":"),n=t.lastIndexOf(":");return a!==-1&&a===n&&/^\d+$/.test(t.slice(n+1))&&(r=Number.parseInt(t.slice(n+1),10),t=t.slice(0,n)),[t,r]},Xd=e=>e&&(e.charAt(0)==="["&&e.charAt(e.length-1)==="]"&&(e=e.slice(1,-1)),e.replace(/\.+$/,""));function mx(e){let t;try{t=new URL(e)}catch{return!1}const r=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!r)return!1;if(r==="*")return!0;const a=Number.parseInt(t.port,10)||dx[t.protocol.split(":",1)[0]]||0,n=Xd(t.hostname.toLowerCase());return r.split(/[\s,]+/).some(s=>{if(!s)return!1;let[i,o]=fx(s);return i=Xd(i),!i||o&&o!==a?!1:(i.charAt(0)==="*"&&(i=i.slice(1)),i.charAt(0)==="."?n.endsWith(i):n===i||Wd(n)&&Wd(i))})}function hx(e,t){e=e||10;const r=new Array(e),a=new Array(e);let n=0,s=0,i;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=a[s];i||(i=l),r[n]=c,a[n]=l;let p=s,d=0;for(;p!==n;)d+=r[p++],p=p%e;if(n=(n+1)%e,n===s&&(s=(s+1)%e),l-i<t)return;const x=u&&l-u;return x?Math.round(d*1e3/x):void 0}}function vx(e,t){let r=0,a=1e3/t,n,s;const i=(l,u=Date.now())=>{r=u,n=null,s&&(clearTimeout(s),s=null),e(...l)};return[(...l)=>{const u=Date.now(),p=u-r;p>=a?i(l,u):(n=l,s||(s=setTimeout(()=>{s=null,i(n)},a-p)))},()=>n&&i(n)]}const qa=(e,t,r=3)=>{let a=0;const n=hx(50,250);return vx(s=>{const i=s.loaded,o=s.lengthComputable?s.total:void 0,c=o!=null?Math.min(i,o):i,l=Math.max(0,c-a),u=n(l);a=Math.max(a,c);const p={loaded:c,total:o,progress:o?c/o:void 0,bytes:l,rate:u||void 0,estimated:u&&o?(o-c)/u:void 0,event:s,lengthComputable:o!=null,[t?"download":"upload"]:!0};e(p)},r)},jc=(e,t)=>{const r=e!=null;return[a=>t[0]({lengthComputable:r,total:e,loaded:a}),t[1]]},Kc=e=>(...t)=>A.asap(()=>e(...t));function gx(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const r=e.slice(5,t),a=e.slice(t+1);if(/;base64/i.test(r)){let s=a.length;const i=a.length;for(let d=0;d<i;d++)if(a.charCodeAt(d)===37&&d+2<i){const x=a.charCodeAt(d+1),m=a.charCodeAt(d+2);(x>=48&&x<=57||x>=65&&x<=70||x>=97&&x<=102)&&(m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102)&&(s-=2,d+=2)}let o=0,c=i-1;const l=d=>d>=2&&a.charCodeAt(d-2)===37&&a.charCodeAt(d-1)===51&&(a.charCodeAt(d)===68||a.charCodeAt(d)===100);c>=0&&(a.charCodeAt(c)===61?(o++,c--):l(c)&&(o++,c-=3)),o===1&&c>=0&&(a.charCodeAt(c)===61||l(c))&&o++;const p=Math.floor(s/4)*3-(o||0);return p>0?p:0}return Buffer.byteLength(a,"utf8")}const Yd={flush:ta.constants.Z_SYNC_FLUSH,finishFlush:ta.constants.Z_SYNC_FLUSH},xx={flush:ta.constants.BROTLI_OPERATION_FLUSH,finishFlush:ta.constants.BROTLI_OPERATION_FLUSH},Jd=A.isFunction(ta.createBrotliDecompress),{http:yx,https:bx}=ex,Ex=/https:?/,Zd=Symbol("axios.http.socketListener"),zc=Symbol("axios.http.currentReq"),ef=Fe.protocols.map(e=>e+":"),tf=(e,[t,r])=>(e.on("end",r).on("error",r),t);class Cx{constructor(){this.sessions=Object.create(null)}getSession(t,r){r=Object.assign({sessionTimeout:1e3},r);let a=this.sessions[t];if(a){let u=a.length;for(let p=0;p<u;p++){const[d,x]=a[p];if(!d.destroyed&&!d.closed&&ha.isDeepStrictEqual(x,r))return d}}const n=Cp.connect(t,r);let s;const i=()=>{if(s)return;s=!0;let u=a,p=u.length,d=p;for(;d--;)if(u[d][0]===n){p===1?delete this.sessions[t]:u.splice(d,1),n.closed||n.close();return}},o=n.request,{sessionTimeout:c}=r;if(c!=null){let u,p=0;n.request=function(){const d=o.apply(this,arguments);return p++,u&&(clearTimeout(u),u=null),d.once("close",()=>{--p||(u=setTimeout(()=>{u=null,i()},c))}),d}}n.once("close",i);let l=[n,r];return a?a.push(l):a=this.sessions[t]=[l],n}}const Sx=new Cx;function Tx(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function af(e,t,r){let a=t;if(!a&&a!==!1){const n=Lg(r);n&&(mx(r)||(a=new URL(n)))}if(a){if(a.username&&(a.auth=(a.username||"")+":"+(a.password||"")),a.auth){if(!!(a.auth.username||a.auth.password))a.auth=(a.auth.username||"")+":"+(a.auth.password||"");else if(typeof a.auth=="object")throw new O("Invalid proxy authorization",O.ERR_BAD_OPTION,{proxy:a});const i=Buffer.from(a.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+i}e.headers.host=e.hostname+(e.port?":"+e.port:"");const n=a.hostname||a.host;e.hostname=n,e.host=n,e.port=a.port,e.path=r,a.protocol&&(e.protocol=a.protocol.includes(":")?a.protocol:`${a.protocol}:`)}e.beforeRedirects.proxy=function(s){af(s,t,s.href)}}const wx=typeof process<"u"&&A.kindOf(process)==="process",Ax=e=>new Promise((t,r)=>{let a,n;const s=(c,l)=>{n||(n=!0,a&&a(c,l))},i=c=>{s(c),t(c)},o=c=>{s(c,!0),r(c)};e(i,o,c=>a=c).catch(o)}),Ix=({address:e,family:t})=>{if(!A.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},rf=(e,t)=>Ix(A.isObject(e)?e:{address:e,family:t}),Bx={request(e,t){const r=e.protocol+"//"+e.hostname+":"+(e.port||(e.protocol==="https:"?443:80)),{http2Options:a,headers:n}=e,s=Sx.getSession(r,a),{HTTP2_HEADER_SCHEME:i,HTTP2_HEADER_METHOD:o,HTTP2_HEADER_PATH:c,HTTP2_HEADER_STATUS:l}=Cp.constants,u={[i]:e.protocol.replace(":",""),[o]:e.method,[c]:e.path};A.forEach(n,(d,x)=>{x.charAt(0)!==":"&&(u[x]=d)});const p=s.request(u);return p.once("response",d=>{const x=p;d=Object.assign({},d);const m=d[l];delete d[l],x.headers=d,x.statusCode=+m,t(x)}),p}};var _x=wx&&function(t){return Ax(async function(a,n,s){const i=q=>A.hasOwnProp(t,q)?t[q]:void 0;let o=i("data"),c=i("lookup"),l=i("family"),u=i("httpVersion");u===void 0&&(u=1);let p=i("http2Options");const d=i("responseType"),x=i("responseEncoding"),m=t.method.toUpperCase();let y,b=!1,C;if(u=+u,Number.isNaN(u))throw TypeError(`Invalid protocol version: '${t.httpVersion}' is not a number`);if(u!==1&&u!==2)throw TypeError(`Unsupported protocol version '${u}'`);const B=u===2;if(c){const q=lx(c,M=>A.isArray(M)?M:[M]);c=(M,J,ne)=>{q(M,J,(ee,Ee,Ae)=>{if(ee)return ne(ee);const se=A.isArray(Ee)?Ee.map(Pe=>rf(Pe)):[rf(Ee,Ae)];J.all?ne(ee,se):ne(ee,se[0].address,se[0].family)})}}const _=new mm;function k(q){try{_.emit("abort",!q||q.type?new xa(null,t,C):q)}catch(M){console.warn("emit error",M)}}_.once("abort",n);const N=()=>{t.cancelToken&&t.cancelToken.unsubscribe(k),t.signal&&t.signal.removeEventListener("abort",k),_.removeAllListeners()};(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(k),t.signal&&(t.signal.aborted?k():t.signal.addEventListener("abort",k))),s((q,M)=>{if(y=!0,M){b=!0,N();return}const{data:J}=q;if(J instanceof We.Readable||J instanceof We.Duplex){const ne=We.finished(J,()=>{ne(),N()})}else N()});const D=ru(t.baseURL,t.url,t.allowAbsoluteUrls),K=new URL(D,Fe.hasBrowserEnv?Fe.origin:void 0),W=K.protocol||ef[0];if(W==="data:"){if(t.maxContentLength>-1){const M=String(t.url||D||"");if(gx(M)>t.maxContentLength)return n(new O("maxContentLength size of "+t.maxContentLength+" exceeded",O.ERR_BAD_RESPONSE,t))}let q;if(m!=="GET")return Va(a,n,{status:405,statusText:"method not allowed",headers:{},config:t});try{q=ax(t.url,d==="blob",{Blob:t.env&&t.env.Blob})}catch(M){throw O.from(M,O.ERR_BAD_REQUEST,t)}return d==="text"?(q=q.toString(x),(!x||x==="utf8")&&(q=A.stripBOM(q))):d==="stream"&&(q=We.Readable.from(q)),Va(a,n,{data:q,status:200,statusText:"OK",headers:new Xe,config:t})}if(ef.indexOf(W)===-1)return n(new O("Unsupported protocol "+W,O.ERR_BAD_REQUEST,t));const X=Xe.from(t.headers).normalize();X.set("User-Agent","axios/"+qc,!1);const{onUploadProgress:pe,onDownloadProgress:me}=t,xe=t.maxRate;let Ne,_e;if(A.isSpecCompliantForm(o)){const q=X.getContentType(/boundary=([-_\w\d]{10,70})/i);o=ox(o,M=>{X.set(M)},{tag:`axios-${qc}-boundary`,boundary:q&&q[1]||void 0})}else if(A.isFormData(o)&&A.isFunction(o.getHeaders)&&o.getHeaders!==Object.prototype.getHeaders){if(X.set(o.getHeaders()),!X.hasContentLength())try{const q=await ha.promisify(o.getLength).call(o);Number.isFinite(q)&&q>=0&&X.setContentLength(q)}catch{}}else if(A.isBlob(o)||A.isFile(o))o.size&&X.setContentType(o.type||"application/octet-stream"),X.setContentLength(o.size||0),o=We.Readable.from(Gd(o));else if(o&&!A.isStream(o)){if(!Buffer.isBuffer(o))if(A.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else if(A.isString(o))o=Buffer.from(o,"utf-8");else return n(new O("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",O.ERR_BAD_REQUEST,t));if(X.setContentLength(o.length,!1),t.maxBodyLength>-1&&o.length>t.maxBodyLength)return n(new O("Request body larger than maxBodyLength limit",O.ERR_BAD_REQUEST,t))}const be=A.toFiniteNumber(X.getContentLength());A.isArray(xe)?(Ne=xe[0],_e=xe[1]):Ne=_e=xe,o&&(pe||Ne)&&(A.isStream(o)||(o=We.Readable.from(o,{objectMode:!1})),o=We.pipeline([o,new Hd({maxRate:A.toFiniteNumber(Ne)})],A.noop),pe&&o.on("progress",tf(o,jc(be,qa(Kc(pe),!1,3)))));let te;const $=i("auth");if($){const q=$.username||"",M=$.password||"";te=q+":"+M}if(!te&&K.username){const q=K.username,M=K.password;te=q+":"+M}te&&X.delete("authorization");let je;try{je=Yl(K.pathname+K.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(q){const M=new Error(q.message);return M.config=t,M.url=t.url,M.exists=!0,n(M)}X.set("Accept-Encoding","gzip, compress, deflate"+(Jd?", br":""),!1);const Le=Object.assign(Object.create(null),{path:je,method:m,headers:X.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:te,protocol:W,family:l,beforeRedirect:Tx,beforeRedirects:Object.create(null),http2Options:p});if(!A.isUndefined(c)&&(Le.lookup=c),t.socketPath){if(typeof t.socketPath!="string")return n(new O("socketPath must be a string",O.ERR_BAD_OPTION_VALUE,t));if(t.allowedSocketPaths!=null){const q=Array.isArray(t.allowedSocketPaths)?t.allowedSocketPaths:[t.allowedSocketPaths],M=Ep(t.socketPath);if(!q.some(ne=>typeof ne=="string"&&Ep(ne)===M))return n(new O(`socketPath "${t.socketPath}" is not permitted by allowedSocketPaths`,O.ERR_BAD_OPTION_VALUE,t))}Le.socketPath=t.socketPath}else Le.hostname=K.hostname.startsWith("[")?K.hostname.slice(1,-1):K.hostname,Le.port=K.port,af(Le,t.proxy,W+"//"+K.hostname+(K.port?":"+K.port:"")+Le.path);let Te;const ie=Ex.test(Le.protocol);if(Le.agent=ie?t.httpsAgent:t.httpAgent,B)Te=Bx;else{const q=i("transport");if(q)Te=q;else if(t.maxRedirects===0)Te=ie?Tl:Sl;else{t.maxRedirects&&(Le.maxRedirects=t.maxRedirects);const M=i("beforeRedirect");M&&(Le.beforeRedirects.config=M),Te=ie?bx:yx}}if(t.maxBodyLength>-1?Le.maxBodyLength=t.maxBodyLength:Le.maxBodyLength=1/0,Le.insecureHTTPParser=!!i("insecureHTTPParser"),C=Te.request(Le,function(M){if(C.destroyed)return;const J=[M],ne=A.toFiniteNumber(M.headers["content-length"]);if(me||_e){const se=new Hd({maxRate:A.toFiniteNumber(_e)});me&&se.on("progress",tf(se,jc(ne,qa(Kc(me),!0,3)))),J.push(se)}let ee=M;const Ee=M.req||C;if(t.decompress!==!1&&M.headers["content-encoding"])switch((m==="HEAD"||M.statusCode===204)&&delete M.headers["content-encoding"],(M.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":J.push(ta.createUnzip(Yd)),delete M.headers["content-encoding"];break;case"deflate":J.push(new cx),J.push(ta.createUnzip(Yd)),delete M.headers["content-encoding"];break;case"br":Jd&&(J.push(ta.createBrotliDecompress(xx)),delete M.headers["content-encoding"])}ee=J.length>1?We.pipeline(J,A.noop):J[0];const Ae={status:M.statusCode,statusText:M.statusMessage,headers:new Xe(M.headers),config:t,request:Ee};if(d==="stream"){if(t.maxContentLength>-1){const se=t.maxContentLength,Pe=ee;async function*De(){let fe=0;for await(const Ke of Pe){if(fe+=Ke.length,fe>se)throw new O("maxContentLength size of "+se+" exceeded",O.ERR_BAD_RESPONSE,t,Ee);yield Ke}}ee=We.Readable.from(De(),{objectMode:!1})}Ae.data=ee,Va(a,n,Ae)}else{const se=[];let Pe=0;ee.on("data",function(fe){se.push(fe),Pe+=fe.length,t.maxContentLength>-1&&Pe>t.maxContentLength&&(b=!0,ee.destroy(),k(new O("maxContentLength size of "+t.maxContentLength+" exceeded",O.ERR_BAD_RESPONSE,t,Ee)))}),ee.on("aborted",function(){if(b)return;const fe=new O("stream has been aborted",O.ERR_BAD_RESPONSE,t,Ee);ee.destroy(fe),n(fe)}),ee.on("error",function(fe){C.destroyed||n(O.from(fe,null,t,Ee))}),ee.on("end",function(){try{let fe=se.length===1?se[0]:Buffer.concat(se);d!=="arraybuffer"&&(fe=fe.toString(x),(!x||x==="utf8")&&(fe=A.stripBOM(fe))),Ae.data=fe}catch(fe){return n(O.from(fe,null,t,Ae.request,Ae))}Va(a,n,Ae)})}_.once("abort",se=>{ee.destroyed||(ee.emit("error",se),ee.destroy())})}),_.once("abort",q=>{C.close?C.close():C.destroy(q)}),C.on("error",function(M){n(O.from(M,null,t,C))}),C.on("socket",function(M){M.setKeepAlive(!0,1e3*60),M[Zd]||(M.on("error",function(ne){const ee=M[zc];ee&&!ee.destroyed&&ee.destroy(ne)}),M[Zd]=!0),M[zc]=C,C.once("close",function(){M[zc]===C&&(M[zc]=null)})}),t.timeout){const q=parseInt(t.timeout,10);if(Number.isNaN(q)){k(new O("error trying to parse `config.timeout` to int",O.ERR_BAD_OPTION_VALUE,t,C));return}C.setTimeout(q,function(){if(y)return;let J=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const ne=t.transitional||Dc;t.timeoutErrorMessage&&(J=t.timeoutErrorMessage),k(new O(J,ne.clarifyTimeoutError?O.ETIMEDOUT:O.ECONNABORTED,t,C))})}else C.setTimeout(0);if(A.isStream(o)){let q=!1,M=!1;o.on("end",()=>{q=!0}),o.once("error",ne=>{M=!0,C.destroy(ne)}),o.on("close",()=>{!q&&!M&&k(new xa("Request stream has been aborted",t,C))});let J=o;if(t.maxBodyLength>-1&&t.maxRedirects===0){const ne=t.maxBodyLength;let ee=0;J=We.pipeline([o,new We.Transform({transform(Ee,Ae,se){if(ee+=Ee.length,ee>ne)return se(new O("Request body larger than maxBodyLength limit",O.ERR_BAD_REQUEST,t,C));se(null,Ee)}})],A.noop),J.on("error",Ee=>{C.destroyed||C.destroy(Ee)})}J.pipe(C)}else o&&C.write(o),C.end()})},Rx=Fe.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Fe.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Fe.origin),Fe.navigator&&/(msie|trident)/i.test(Fe.navigator.userAgent)):()=>!0,kx=Fe.hasStandardBrowserEnv?{write(e,t,r,a,n,s,i){if(typeof document>"u")return;const o=[`${e}=${encodeURIComponent(t)}`];A.isNumber(r)&&o.push(`expires=${new Date(r).toUTCString()}`),A.isString(a)&&o.push(`path=${a}`),A.isString(n)&&o.push(`domain=${n}`),s===!0&&o.push("secure"),A.isString(i)&&o.push(`SameSite=${i}`),document.cookie=o.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};const nf=e=>e instanceof Xe?{...e}:e;function Ca(e,t){t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function a(l,u,p,d){return A.isPlainObject(l)&&A.isPlainObject(u)?A.merge.call({caseless:d},l,u):A.isPlainObject(u)?A.merge({},u):A.isArray(u)?u.slice():u}function n(l,u,p,d){if(A.isUndefined(u)){if(!A.isUndefined(l))return a(void 0,l,p,d)}else return a(l,u,p,d)}function s(l,u){if(!A.isUndefined(u))return a(void 0,u)}function i(l,u){if(A.isUndefined(u)){if(!A.isUndefined(l))return a(void 0,l)}else return a(void 0,u)}function o(l,u,p){if(A.hasOwnProp(t,p))return a(l,u);if(A.hasOwnProp(e,p))return a(void 0,l)}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:o,headers:(l,u,p)=>n(nf(l),nf(u),p,!0)};return A.forEach(Object.keys({...e,...t}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const p=A.hasOwnProp(c,u)?c[u]:n,d=A.hasOwnProp(e,u)?e[u]:void 0,x=A.hasOwnProp(t,u)?t[u]:void 0,m=p(d,x,u);A.isUndefined(m)&&p!==o||(r[u]=m)}),r}var sf=e=>{const t=Ca({},e),r=d=>A.hasOwnProp(t,d)?t[d]:void 0,a=r("data");let n=r("withXSRFToken");const s=r("xsrfHeaderName"),i=r("xsrfCookieName");let o=r("headers");const c=r("auth"),l=r("baseURL"),u=r("allowAbsoluteUrls"),p=r("url");if(t.headers=o=Xe.from(o),t.url=Yl(ru(l,p,u),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),A.isFormData(a)){if(Fe.hasStandardBrowserEnv||Fe.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(A.isFunction(a.getHeaders)){const d=a.getHeaders(),x=["content-type","content-length"];Object.entries(d).forEach(([m,y])=>{x.includes(m.toLowerCase())&&o.set(m,y)})}}if(Fe.hasStandardBrowserEnv&&(A.isFunction(n)&&(n=n(t)),n===!0||n==null&&Rx(t.url))){const x=s&&i&&kx.read(i);x&&o.set(s,x)}return t};const Nx=typeof XMLHttpRequest<"u";var Lx=Nx&&function(e){return new Promise(function(r,a){const n=sf(e);let s=n.data;const i=Xe.from(n.headers).normalize();let{responseType:o,onUploadProgress:c,onDownloadProgress:l}=n,u,p,d,x,m;function y(){x&&x(),m&&m(),n.cancelToken&&n.cancelToken.unsubscribe(u),n.signal&&n.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(n.method.toUpperCase(),n.url,!0),b.timeout=n.timeout;function C(){if(!b)return;const _=Xe.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),N={data:!o||o==="text"||o==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:_,config:e,request:b};Va(function(K){r(K),y()},function(K){a(K),y()},N),b=null}"onloadend"in b?b.onloadend=C:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(C)},b.onabort=function(){b&&(a(new O("Request aborted",O.ECONNABORTED,e,b)),b=null)},b.onerror=function(k){const N=k&&k.message?k.message:"Network Error",D=new O(N,O.ERR_NETWORK,e,b);D.event=k||null,a(D),b=null},b.ontimeout=function(){let k=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const N=n.transitional||Dc;n.timeoutErrorMessage&&(k=n.timeoutErrorMessage),a(new O(k,N.clarifyTimeoutError?O.ETIMEDOUT:O.ECONNABORTED,e,b)),b=null},s===void 0&&i.setContentType(null),"setRequestHeader"in b&&A.forEach(i.toJSON(),function(k,N){b.setRequestHeader(N,k)}),A.isUndefined(n.withCredentials)||(b.withCredentials=!!n.withCredentials),o&&o!=="json"&&(b.responseType=n.responseType),l&&([d,m]=qa(l,!0),b.addEventListener("progress",d)),c&&b.upload&&([p,x]=qa(c),b.upload.addEventListener("progress",p),b.upload.addEventListener("loadend",x)),(n.cancelToken||n.signal)&&(u=_=>{b&&(a(!_||_.type?new xa(null,e,b):_),b.abort(),b=null)},n.cancelToken&&n.cancelToken.subscribe(u),n.signal&&(n.signal.aborted?u():n.signal.addEventListener("abort",u)));const B=zd(n.url);if(B&&Fe.protocols.indexOf(B)===-1){a(new O("Unsupported protocol "+B+":",O.ERR_BAD_REQUEST,e));return}b.send(s||null)})};const Ux=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let a=new AbortController,n;const s=function(l){if(!n){n=!0,o();const u=l instanceof Error?l:this.reason;a.abort(u instanceof O?u:new xa(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,s(new O(`timeout of ${t}ms exceeded`,O.ETIMEDOUT))},t);const o=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),e=null)};e.forEach(l=>l.addEventListener("abort",s));const{signal:c}=a;return c.unsubscribe=()=>A.asap(o),c}},Px=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let a=0,n;for(;a<r;)n=a+t,yield e.slice(a,n),a=n},Dx=async function*(e,t){for await(const r of Ox(e))yield*Px(r,t)},Ox=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:a}=await t.read();if(r)break;yield a}}finally{await t.cancel()}},of=(e,t,r,a)=>{const n=Dx(e,t);let s=0,i,o=c=>{i||(i=!0,a&&a(c))};return new ReadableStream({async pull(c){try{const{done:l,value:u}=await n.next();if(l){o(),c.close();return}let p=u.byteLength;if(r){let d=s+=p;r(d)}c.enqueue(new Uint8Array(u))}catch(l){throw o(l),l}},cancel(c){return o(c),n.return()}},{highWaterMark:2})},cf=64*1024,{isFunction:Hc}=A,Fx=(({Request:e,Response:t})=>({Request:e,Response:t}))(A.global),{ReadableStream:lf,TextEncoder:uf}=A.global,pf=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Mx=e=>{e=A.merge.call({skipUndefined:!0},Fx,e);const{fetch:t,Request:r,Response:a}=e,n=t?Hc(t):typeof fetch=="function",s=Hc(r),i=Hc(a);if(!n)return!1;const o=n&&Hc(lf),c=n&&(typeof uf=="function"?(m=>y=>m.encode(y))(new uf):async m=>new Uint8Array(await new r(m).arrayBuffer())),l=s&&o&&pf(()=>{let m=!1;const y=new r(Fe.origin,{body:new lf,method:"POST",get duplex(){return m=!0,"half"}}),b=y.headers.has("Content-Type");return y.body!=null&&y.body.cancel(),m&&!b}),u=i&&o&&pf(()=>A.isReadableStream(new a("").body)),p={stream:u&&(m=>m.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!p[m]&&(p[m]=(y,b)=>{let C=y&&y[m];if(C)return C.call(y);throw new O(`Response type '${m}' is not supported`,O.ERR_NOT_SUPPORT,b)})});const d=async m=>{if(m==null)return 0;if(A.isBlob(m))return m.size;if(A.isSpecCompliantForm(m))return(await new r(Fe.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(A.isArrayBufferView(m)||A.isArrayBuffer(m))return m.byteLength;if(A.isURLSearchParams(m)&&(m=m+""),A.isString(m))return(await c(m)).byteLength},x=async(m,y)=>{const b=A.toFiniteNumber(m.getContentLength());return b??d(y)};return async m=>{let{url:y,method:b,data:C,signal:B,cancelToken:_,timeout:k,onDownloadProgress:N,onUploadProgress:D,responseType:K,headers:W,withCredentials:X="same-origin",fetchOptions:pe}=sf(m),me=t||fetch;K=K?(K+"").toLowerCase():"text";let xe=Ux([B,_&&_.toAbortSignal()],k),Ne=null;const _e=xe&&xe.unsubscribe&&(()=>{xe.unsubscribe()});let be;try{if(D&&l&&b!=="get"&&b!=="head"&&(be=await x(W,C))!==0){let ie=new r(y,{method:"POST",body:C,duplex:"half"}),q;if(A.isFormData(C)&&(q=ie.headers.get("content-type"))&&W.setContentType(q),ie.body){const[M,J]=jc(be,qa(Kc(D)));C=of(ie.body,cf,M,J)}}A.isString(X)||(X=X?"include":"omit");const te=s&&"credentials"in r.prototype;if(A.isFormData(C)){const ie=W.getContentType();ie&&/^multipart\/form-data/i.test(ie)&&!/boundary=/i.test(ie)&&W.delete("content-type")}const $={...pe,signal:xe,method:b.toUpperCase(),headers:W.normalize().toJSON(),body:C,duplex:"half",credentials:te?X:void 0};Ne=s&&new r(y,$);let je=await(s?me(Ne,pe):me(y,$));const Le=u&&(K==="stream"||K==="response");if(u&&(N||Le&&_e)){const ie={};["status","statusText","headers"].forEach(ne=>{ie[ne]=je[ne]});const q=A.toFiniteNumber(je.headers.get("content-length")),[M,J]=N&&jc(q,qa(Kc(N),!0))||[];je=new a(of(je.body,cf,M,()=>{J&&J(),_e&&_e()}),ie)}K=K||"text";let Te=await p[A.findKey(p,K)||"text"](je,m);return!Le&&_e&&_e(),await new Promise((ie,q)=>{Va(ie,q,{data:Te,headers:Xe.from(je.headers),status:je.status,statusText:je.statusText,config:m,request:Ne})})}catch(te){throw _e&&_e(),te&&te.name==="TypeError"&&/Load failed|fetch/i.test(te.message)?Object.assign(new O("Network Error",O.ERR_NETWORK,m,Ne,te&&te.response),{cause:te.cause||te}):O.from(te,te&&te.code,m,Ne,te&&te.response)}}},Vx=new Map,df=e=>{let t=e&&e.env||{};const{fetch:r,Request:a,Response:n}=t,s=[a,n,r];let i=s.length,o=i,c,l,u=Vx;for(;o--;)c=s[o],l=u.get(c),l===void 0&&u.set(c,l=o?new Map:Mx(t)),u=l;return l};df();const Cu={http:_x,xhr:Lx,fetch:{get:df}};A.forEach(Cu,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ff=e=>`- ${e}`,qx=e=>A.isFunction(e)||e===null||e===!1;function jx(e,t){e=A.isArray(e)?e:[e];const{length:r}=e;let a,n;const s={};for(let i=0;i<r;i++){a=e[i];let o;if(n=a,!qx(a)&&(n=Cu[(o=String(a)).toLowerCase()],n===void 0))throw new O(`Unknown adapter '${o}'`);if(n&&(A.isFunction(n)||(n=n.get(t))))break;s[o||"#"+i]=n}if(!n){const i=Object.entries(s).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=r?i.length>1?`since :
20
- `+i.map(ff).join(`
21
- `):" "+ff(i[0]):"as no adapter specified";throw new O("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n}var mf={getAdapter:jx,adapters:Cu};function Su(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xa(null,e)}function hf(e){return Su(e),e.headers=Xe.from(e.headers),e.data=au.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),mf.getAdapter(e.adapter||cr.adapter,e)(e).then(function(a){return Su(e),a.data=au.call(e,e.transformResponse,a),a.headers=Xe.from(a.headers),a},function(a){return kd(a)||(Su(e),a&&a.response&&(a.response.data=au.call(e,e.transformResponse,a.response),a.response.headers=Xe.from(a.response.headers))),Promise.reject(a)})}const $c={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{$c[e]=function(a){return typeof a===e||"a"+(t<1?"n ":" ")+e}});const vf={};$c.transitional=function(t,r,a){function n(s,i){return"[Axios v"+qc+"] Transitional option '"+s+"'"+i+(a?". "+a:"")}return(s,i,o)=>{if(t===!1)throw new O(n(i," has been removed"+(r?" in "+r:"")),O.ERR_DEPRECATED);return r&&!vf[i]&&(vf[i]=!0,console.warn(n(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,i,o):!0}},$c.spelling=function(t){return(r,a)=>(console.warn(`${a} is likely a misspelling of ${t}`),!0)};function Kx(e,t,r){if(typeof e!="object")throw new O("options must be an object",O.ERR_BAD_OPTION_VALUE);const a=Object.keys(e);let n=a.length;for(;n-- >0;){const s=a[n],i=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(i){const o=e[s],c=o===void 0||i(o,s,e);if(c!==!0)throw new O("option "+s+" must be "+c,O.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new O("Unknown option "+s,O.ERR_BAD_OPTION)}}var Gc={assertOptions:Kx,validators:$c};const Rt=Gc.validators;let Sa=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ad,response:new Ad}}async request(t,r){try{return await this._request(t,r)}catch(a){if(a instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const s=(()=>{if(!n.stack)return"";const i=n.stack.indexOf(`
22
- `);return i===-1?"":n.stack.slice(i+1)})();try{if(!a.stack)a.stack=s;else if(s){const i=s.indexOf(`
23
- `),o=i===-1?-1:s.indexOf(`
24
- `,i+1),c=o===-1?"":s.slice(o+1);String(a.stack).endsWith(c)||(a.stack+=`
25
- `+s)}}catch{}}throw a}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ca(this.defaults,r);const{transitional:a,paramsSerializer:n,headers:s}=r;a!==void 0&&Gc.assertOptions(a,{silentJSONParsing:Rt.transitional(Rt.boolean),forcedJSONParsing:Rt.transitional(Rt.boolean),clarifyTimeoutError:Rt.transitional(Rt.boolean),legacyInterceptorReqResOrdering:Rt.transitional(Rt.boolean)},!1),n!=null&&(A.isFunction(n)?r.paramsSerializer={serialize:n}:Gc.assertOptions(n,{encode:Rt.function,serialize:Rt.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Gc.assertOptions(r,{baseUrl:Rt.spelling("baseURL"),withXsrfToken:Rt.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=s&&A.merge(s.common,s[r.method]);s&&A.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),r.headers=Xe.concat(i,s);const o=[];let c=!0;this.interceptors.request.forEach(function(y){if(typeof y.runWhen=="function"&&y.runWhen(r)===!1)return;c=c&&y.synchronous;const b=r.transitional||Dc;b&&b.legacyInterceptorReqResOrdering?o.unshift(y.fulfilled,y.rejected):o.push(y.fulfilled,y.rejected)});const l=[];this.interceptors.response.forEach(function(y){l.push(y.fulfilled,y.rejected)});let u,p=0,d;if(!c){const m=[hf.bind(this),void 0];for(m.unshift(...o),m.push(...l),d=m.length,u=Promise.resolve(r);p<d;)u=u.then(m[p++],m[p++]);return u}d=o.length;let x=r;for(;p<d;){const m=o[p++],y=o[p++];try{x=m(x)}catch(b){y.call(this,b);break}}try{u=hf.call(this,x)}catch(m){return Promise.reject(m)}for(p=0,d=l.length;p<d;)u=u.then(l[p++],l[p++]);return u}getUri(t){t=Ca(this.defaults,t);const r=ru(t.baseURL,t.url,t.allowAbsoluteUrls);return Yl(r,t.params,t.paramsSerializer)}};A.forEach(["delete","get","head","options"],function(t){Sa.prototype[t]=function(r,a){return this.request(Ca(a||{},{method:t,url:r,data:(a||{}).data}))}}),A.forEach(["post","put","patch"],function(t){function r(a){return function(s,i,o){return this.request(Ca(o||{},{method:t,headers:a?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}Sa.prototype[t]=r(),Sa.prototype[t+"Form"]=r(!0)});let zx=class cm{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const a=this;this.promise.then(n=>{if(!a._listeners)return;let s=a._listeners.length;for(;s-- >0;)a._listeners[s](n);a._listeners=null}),this.promise.then=n=>{let s;const i=new Promise(o=>{a.subscribe(o),s=o}).then(n);return i.cancel=function(){a.unsubscribe(s)},i},t(function(s,i,o){a.reason||(a.reason=new xa(s,i,o),r(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=a=>{t.abort(a)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new cm(function(n){t=n}),cancel:t}}};function Hx(e){return function(r){return e.apply(null,r)}}function $x(e){return A.isObject(e)&&e.isAxiosError===!0}const Tu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Tu).forEach(([e,t])=>{Tu[t]=e});function gf(e){const t=new Sa(e),r=Tp(Sa.prototype.request,t);return A.extend(r,Sa.prototype,t,{allOwnKeys:!0}),A.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return gf(Ca(e,n))},r}const Ve=gf(cr);Ve.Axios=Sa,Ve.CanceledError=xa,Ve.CancelToken=zx,Ve.isCancel=kd,Ve.VERSION=qc,Ve.toFormData=Pc,Ve.AxiosError=O,Ve.Cancel=Ve.CanceledError,Ve.all=function(t){return Promise.all(t)},Ve.spread=Hx,Ve.isAxiosError=$x,Ve.mergeConfig=Ca,Ve.AxiosHeaders=Xe,Ve.formToJSON=e=>_d(A.isHTMLForm(e)?new FormData(e):e),Ve.getAdapter=mf.getAdapter,Ve.HttpStatusCode=Tu,Ve.default=Ve;var Ce=Ve;const{Axios:dS,AxiosError:fS,CanceledError:mS,isCancel:hS,CancelToken:vS,VERSION:gS,all:xS,Cancel:yS,isAxiosError:rt,spread:bS,toFormData:ES,AxiosHeaders:CS,HttpStatusCode:SS,formToJSON:TS,getAdapter:wS,mergeConfig:AS}=Ce,nt="https://api.circle.com".replace(/\/+$/,"");let Gx=class extends Error{constructor(t,r){super(r),this.field=t,this.name="RequiredError"}};const it={},st="https://example.com",qt=function(e,t,r){if(r==null)throw new Gx(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},vt=async function(e,t){if(t&&t.accessToken){const r=typeof t.accessToken=="function"?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+r}};function wu(e,t,r=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(a=>wu(e,a,r)):Object.keys(t).forEach(a=>wu(e,t[a],`${r}${r!==""?".":""}${a}`)):e.has(r)?e.append(r,t):e.set(r,t))}const ot=function(e,...t){const r=new URLSearchParams(e.search);wu(r,t),e.search=r.toString()},Ta=function(e,t,r){const a=typeof e!="string";return(a&&r&&r.isJsonMime?r.isJsonMime(t.headers["Content-Type"]):a)?JSON.stringify(e!==void 0?e:{}):e||""},ct=function(e){return e.pathname+e.search+e.hash},lt=function(e,t,r,a){return(n=t,s=r)=>{const i={...e.options,url:(a?.basePath||n.defaults.baseURL||s)+e.url};return n.request(i)}},Qx=function(e){return{getEntityConfig:async(t={})=>{const r="/v1/w3s/config/entity",a=new URL(r,st);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...t},i={},o={};await vt(i,e),ot(a,o);let c=n&&n.headers?n.headers:{};return s.headers={...i,...c,...t.headers},{url:ct(a),options:s}},getPublicKey:async(t={})=>{const r="/v1/w3s/config/entity/publicKey",a=new URL(r,st);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...t},i={},o={};await vt(i,e),ot(a,o);let c=n&&n.headers?n.headers:{};return s.headers={...i,...c,...t.headers},{url:ct(a),options:s}}}},Wx=function(e){const t=Qx(e);return{async getEntityConfig(r){const a=await t.getEntityConfig(r),n=e?.serverIndex??0,s=it["DeveloperAccountApi.getEntityConfig"]?.[n]?.url;return(i,o)=>lt(a,Ce,nt,e)(i,s||o)},async getPublicKey(r){const a=await t.getPublicKey(r),n=e?.serverIndex??0,s=it["DeveloperAccountApi.getPublicKey"]?.[n]?.url;return(i,o)=>lt(a,Ce,nt,e)(i,s||o)}}},Xx=function(e,t,r){const a=Wx(e);return{getEntityConfig(n){return a.getEntityConfig(n).then(s=>s(r,t))},getPublicKey(n){return a.getPublicKey(n).then(s=>s(r,t))}}},Yx=function(e){return{requestTestnetTokens:async(t,r,a={})=>{const n="/v1/faucet/drips",s=new URL(n,st);let i;e&&(i=e.baseOptions);const o={method:"POST",...i,...a},c={},l={};await vt(c,e),t!=null&&(c["X-Request-Id"]=String(t)),c["Content-Type"]="application/json",ot(s,l);let u=i&&i.headers?i.headers:{};return o.headers={...c,...u,...a.headers},o.data=Ta(r,o,e),{url:ct(s),options:o}}}},Jx=function(e){const t=Yx(e);return{async requestTestnetTokens(r,a,n){const s=await t.requestTestnetTokens(r,a,n),i=e?.serverIndex??0,o=it["FaucetApi.requestTestnetTokens"]?.[i]?.url;return(c,l)=>lt(s,Ce,nt,e)(c,o||l)}}},Zx=function(e,t,r){const a=Jx(e);return{requestTestnetTokens(n,s,i){return a.requestTestnetTokens(n,s,i).then(o=>o(r,t))}}},ey=function(e){return{ping:async(t={})=>{const r="/ping",a=new URL(r,st);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...t},i={};ot(a,{});let o=n&&n.headers?n.headers:{};return s.headers={...i,...o,...t.headers},{url:ct(a),options:s}}}},ty=function(e){const t=ey(e);return{async ping(r){const a=await t.ping(r),n=e?.serverIndex??0,s=it["HealthApi.ping"]?.[n]?.url;return(i,o)=>lt(a,Ce,nt,e)(i,s||o)}}},ay=function(e,t,r){const a=ty(e);return{ping(n){return a.ping(n).then(s=>s(r,t))}}},ry=function(e){return{createMonitoredTokens:async(t,r={})=>{qt("createMonitoredTokens","createMonitoredTokensRequest",t);const a="/v1/w3s/config/entity/monitoredTokens",n=new URL(a,st);let s;e&&(s=e.baseOptions);const i={method:"POST",...s,...r},o={},c={};await vt(o,e),o["Content-Type"]="application/json",ot(n,c);let l=s&&s.headers?s.headers:{};return i.headers={...o,...l,...r.headers},i.data=Ta(t,i,e),{url:ct(n),options:i}},deleteMonitoredTokens:async(t,r={})=>{qt("deleteMonitoredTokens","deleteMonitoredTokensRequest",t);const a="/v1/w3s/config/entity/monitoredTokens/delete",n=new URL(a,st);let s;e&&(s=e.baseOptions);const i={method:"POST",...s,...r},o={},c={};await vt(o,e),o["Content-Type"]="application/json",ot(n,c);let l=s&&s.headers?s.headers:{};return i.headers={...o,...l,...r.headers},i.data=Ta(t,i,e),{url:ct(n),options:i}},listMonitoredTokens:async(t,r,a,n,s,i,o,c,l={})=>{const u="/v1/w3s/config/entity/monitoredTokens",p=new URL(u,st);let d;e&&(d=e.baseOptions);const x={method:"GET",...d,...l},m={},y={};await vt(m,e),t!==void 0&&(y.blockchain=t),r!==void 0&&(y.tokenAddress=r),a!==void 0&&(y.symbol=a),n!==void 0&&(y.from=n instanceof Date?n.toISOString():n),s!==void 0&&(y.to=s instanceof Date?s.toISOString():s),i!==void 0&&(y.pageBefore=i),o!==void 0&&(y.pageAfter=o),c!==void 0&&(y.pageSize=c),ot(p,y);let b=d&&d.headers?d.headers:{};return x.headers={...m,...b,...l.headers},{url:ct(p),options:x}},updateMonitoredTokens:async(t,r={})=>{qt("updateMonitoredTokens","updateMonitoredTokensRequest",t);const a="/v1/w3s/config/entity/monitoredTokens",n=new URL(a,st);let s;e&&(s=e.baseOptions);const i={method:"PUT",...s,...r},o={},c={};await vt(o,e),o["Content-Type"]="application/json",ot(n,c);let l=s&&s.headers?s.headers:{};return i.headers={...o,...l,...r.headers},i.data=Ta(t,i,e),{url:ct(n),options:i}},updateMonitoredTokensScope:async(t,r={})=>{qt("updateMonitoredTokensScope","updateMonitoredTokensScopeRequest",t);const a="/v1/w3s/config/entity/monitoredTokens/scope",n=new URL(a,st);let s;e&&(s=e.baseOptions);const i={method:"PUT",...s,...r},o={},c={};await vt(o,e),o["Content-Type"]="application/json",ot(n,c);let l=s&&s.headers?s.headers:{};return i.headers={...o,...l,...r.headers},i.data=Ta(t,i,e),{url:ct(n),options:i}}}},ny=function(e){const t=ry(e);return{async createMonitoredTokens(r,a){const n=await t.createMonitoredTokens(r,a),s=e?.serverIndex??0,i=it["MonitorTokensApi.createMonitoredTokens"]?.[s]?.url;return(o,c)=>lt(n,Ce,nt,e)(o,i||c)},async deleteMonitoredTokens(r,a){const n=await t.deleteMonitoredTokens(r,a),s=e?.serverIndex??0,i=it["MonitorTokensApi.deleteMonitoredTokens"]?.[s]?.url;return(o,c)=>lt(n,Ce,nt,e)(o,i||c)},async listMonitoredTokens(r,a,n,s,i,o,c,l,u){const p=await t.listMonitoredTokens(r,a,n,s,i,o,c,l,u),d=e?.serverIndex??0,x=it["MonitorTokensApi.listMonitoredTokens"]?.[d]?.url;return(m,y)=>lt(p,Ce,nt,e)(m,x||y)},async updateMonitoredTokens(r,a){const n=await t.updateMonitoredTokens(r,a),s=e?.serverIndex??0,i=it["MonitorTokensApi.updateMonitoredTokens"]?.[s]?.url;return(o,c)=>lt(n,Ce,nt,e)(o,i||c)},async updateMonitoredTokensScope(r,a){const n=await t.updateMonitoredTokensScope(r,a),s=e?.serverIndex??0,i=it["MonitorTokensApi.updateMonitoredTokensScope"]?.[s]?.url;return(o,c)=>lt(n,Ce,nt,e)(o,i||c)}}},iy=function(e,t,r){const a=ny(e);return{createMonitoredTokens(n,s){return a.createMonitoredTokens(n,s).then(i=>i(r,t))},deleteMonitoredTokens(n,s){return a.deleteMonitoredTokens(n,s).then(i=>i(r,t))},listMonitoredTokens(n,s,i,o,c,l,u,p,d){return a.listMonitoredTokens(n,s,i,o,c,l,u,p,d).then(x=>x(r,t))},updateMonitoredTokens(n,s){return a.updateMonitoredTokens(n,s).then(i=>i(r,t))},updateMonitoredTokensScope(n,s){return a.updateMonitoredTokensScope(n,s).then(i=>i(r,t))}}},sy=function(e){return{createSubscription:async(t,r,a={})=>{qt("createSubscription","createSubscriptionRequest",t);const n="/v2/notifications/subscriptions",s=new URL(n,st);let i;e&&(i=e.baseOptions);const o={method:"POST",...i,...a},c={},l={};await vt(c,e),r!=null&&(c["X-Request-Id"]=String(r)),c["Content-Type"]="application/json",ot(s,l);let u=i&&i.headers?i.headers:{};return o.headers={...c,...u,...a.headers},o.data=Ta(t,o,e),{url:ct(s),options:o}},deleteSubscription:async(t,r,a={})=>{qt("deleteSubscription","id",t);const n="/v2/notifications/subscriptions/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(n,st);let i;e&&(i=e.baseOptions);const o={method:"DELETE",...i,...a},c={},l={};await vt(c,e),r!=null&&(c["X-Request-Id"]=String(r)),ot(s,l);let u=i&&i.headers?i.headers:{};return o.headers={...c,...u,...a.headers},{url:ct(s),options:o}},getNotificationSignature:async(t,r,a={})=>{qt("getNotificationSignature","id",t);const n="/v2/notifications/publicKey/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(n,st);let i;e&&(i=e.baseOptions);const o={method:"GET",...i,...a},c={},l={};await vt(c,e),r!=null&&(c["X-Request-Id"]=String(r)),ot(s,l);let u=i&&i.headers?i.headers:{};return o.headers={...c,...u,...a.headers},{url:ct(s),options:o}},getSubscription:async(t,r,a={})=>{qt("getSubscription","id",t);const n="/v2/notifications/subscriptions/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(n,st);let i;e&&(i=e.baseOptions);const o={method:"GET",...i,...a},c={},l={};await vt(c,e),r!=null&&(c["X-Request-Id"]=String(r)),ot(s,l);let u=i&&i.headers?i.headers:{};return o.headers={...c,...u,...a.headers},{url:ct(s),options:o}},getSubscriptions:async(t={})=>{const r="/v2/notifications/subscriptions",a=new URL(r,st);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...t},i={},o={};await vt(i,e),ot(a,o);let c=n&&n.headers?n.headers:{};return s.headers={...i,...c,...t.headers},{url:ct(a),options:s}},updateSubscription:async(t,r,a,n={})=>{qt("updateSubscription","id",t),qt("updateSubscription","updateSubscriptionRequest",r);const s="/v2/notifications/subscriptions/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(s,st);let o;e&&(o=e.baseOptions);const c={method:"PATCH",...o,...n},l={},u={};await vt(l,e),a!=null&&(l["X-Request-Id"]=String(a)),l["Content-Type"]="application/json",ot(i,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Ta(r,c,e),{url:ct(i),options:c}}}},oy=function(e){const t=sy(e);return{async createSubscription(r,a,n){const s=await t.createSubscription(r,a,n),i=e?.serverIndex??0,o=it["WebhookSubscriptionsApi.createSubscription"]?.[i]?.url;return(c,l)=>lt(s,Ce,nt,e)(c,o||l)},async deleteSubscription(r,a,n){const s=await t.deleteSubscription(r,a,n),i=e?.serverIndex??0,o=it["WebhookSubscriptionsApi.deleteSubscription"]?.[i]?.url;return(c,l)=>lt(s,Ce,nt,e)(c,o||l)},async getNotificationSignature(r,a,n){const s=await t.getNotificationSignature(r,a,n),i=e?.serverIndex??0,o=it["WebhookSubscriptionsApi.getNotificationSignature"]?.[i]?.url;return(c,l)=>lt(s,Ce,nt,e)(c,o||l)},async getSubscription(r,a,n){const s=await t.getSubscription(r,a,n),i=e?.serverIndex??0,o=it["WebhookSubscriptionsApi.getSubscription"]?.[i]?.url;return(c,l)=>lt(s,Ce,nt,e)(c,o||l)},async getSubscriptions(r){const a=await t.getSubscriptions(r),n=e?.serverIndex??0,s=it["WebhookSubscriptionsApi.getSubscriptions"]?.[n]?.url;return(i,o)=>lt(a,Ce,nt,e)(i,s||o)},async updateSubscription(r,a,n,s){const i=await t.updateSubscription(r,a,n,s),o=e?.serverIndex??0,c=it["WebhookSubscriptionsApi.updateSubscription"]?.[o]?.url;return(l,u)=>lt(i,Ce,nt,e)(l,c||u)}}},cy=function(e,t,r){const a=oy(e);return{createSubscription(n,s,i){return a.createSubscription(n,s,i).then(o=>o(r,t))},deleteSubscription(n,s,i){return a.deleteSubscription(n,s,i).then(o=>o(r,t))},getNotificationSignature(n,s,i){return a.getNotificationSignature(n,s,i).then(o=>o(r,t))},getSubscription(n,s,i){return a.getSubscription(n,s,i).then(o=>o(r,t))},getSubscriptions(n){return a.getSubscriptions(n).then(s=>s(r,t))},updateSubscription(n,s,i,o){return a.updateSubscription(n,s,i,o).then(c=>c(r,t))}}};var ly=Object.defineProperty,uy=(e,t,r)=>t in e?ly(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ra=(e,t,r)=>uy(e,typeof t!="symbol"?t+"":t,r);let py=class{constructor(t={}){ra(this,"apiKey"),ra(this,"username"),ra(this,"password"),ra(this,"accessToken"),ra(this,"basePath"),ra(this,"serverIndex"),ra(this,"baseOptions"),ra(this,"formDataCtor"),this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions=t.baseOptions,this.formDataCtor=t.formDataCtor}isJsonMime(t){const r=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(r.test(t)||t.toLowerCase()==="application/json-patch+json")}};var dy=Object.defineProperty,fy=(e,t,r)=>t in e?dy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hr=(e,t,r)=>fy(e,typeof t!="symbol"?t+"":t,r);class my{constructor(t,r,a={}){hr(this,"DeveloperAccount"),hr(this,"Faucet"),hr(this,"Health"),hr(this,"MonitorTokens"),hr(this,"WebhookSubscriptions");const n=new py({basePath:t,baseOptions:{headers:{...a,Authorization:`Bearer ${r.apiKey}`,"Content-Type":"application/json","User-Agent":`${r.userAgent?r.userAgent+" / ":""}CircleNodeJS / Configurations / ${r.version}`}}});this.DeveloperAccount=Xx(n),this.Faucet=Zx(n),this.Health=ay(n),this.MonitorTokens=iy(n),this.WebhookSubscriptions=cy(n)}}const gt="https://api.circle.com".replace(/\/+$/,"");class hy extends Error{constructor(t,r){super(r),this.field=t,this.name="RequiredError"}}const xt={},yt="https://example.com",It=function(e,t,r){if(r==null)throw new hy(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},bt=async function(e,t){if(t&&t.accessToken){const r=typeof t.accessToken=="function"?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+r}};function Au(e,t,r=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(a=>Au(e,a,r)):Object.keys(t).forEach(a=>Au(e,t[a],`${r}${r!==""?".":""}${a}`)):e.has(r)?e.append(r,t):e.set(r,t))}const Et=function(e,...t){const r=new URLSearchParams(e.search);Au(r,t),e.search=r.toString()},Xt=function(e,t,r){const a=typeof e!="string";return(a&&r&&r.isJsonMime?r.isJsonMime(t.headers["Content-Type"]):a)?JSON.stringify(e!==void 0?e:{}):e||""},Ct=function(e){return e.pathname+e.search+e.hash},St=function(e,t,r,a){return(n=t,s=r)=>{const i={...e.options,url:(a?.basePath||n.defaults.baseURL||s)+e.url};return n.request(i)}},vy=function(e){return{deployContract:async(t,r,a={})=>{It("deployContract","contractDeploymentRequest",t);const n="/v1/w3s/contracts/deploy",s=new URL(n,yt);let i;e&&(i=e.baseOptions);const o={method:"POST",...i,...a},c={},l={};await bt(c,e),r!=null&&(c["X-Request-Id"]=String(r)),c["Content-Type"]="application/json",Et(s,l);let u=i&&i.headers?i.headers:{};return o.headers={...c,...u,...a.headers},o.data=Xt(t,o,e),{url:Ct(s),options:o}},estimateContractDeploy:async(t,r,a={})=>{It("estimateContractDeploy","contractDeploymentEstimateFeeRequest",t);const n="/v1/w3s/contracts/deploy/estimateFee",s=new URL(n,yt);let i;e&&(i=e.baseOptions);const o={method:"POST",...i,...a},c={},l={};await bt(c,e),r!=null&&(c["X-Request-Id"]=String(r)),c["Content-Type"]="application/json",Et(s,l);let u=i&&i.headers?i.headers:{};return o.headers={...c,...u,...a.headers},o.data=Xt(t,o,e),{url:Ct(s),options:o}},importContract:async(t,r,a={})=>{It("importContract","importContractRequest",t);const n="/v1/w3s/contracts/import",s=new URL(n,yt);let i;e&&(i=e.baseOptions);const o={method:"POST",...i,...a},c={},l={};await bt(c,e),r!=null&&(c["X-Request-Id"]=String(r)),c["Content-Type"]="application/json",Et(s,l);let u=i&&i.headers?i.headers:{};return o.headers={...c,...u,...a.headers},o.data=Xt(t,o,e),{url:Ct(s),options:o}}}},gy=function(e){const t=vy(e);return{async deployContract(r,a,n){const s=await t.deployContract(r,a,n),i=e?.serverIndex??0,o=xt["DeployImportApi.deployContract"]?.[i]?.url;return(c,l)=>St(s,Ce,gt,e)(c,o||l)},async estimateContractDeploy(r,a,n){const s=await t.estimateContractDeploy(r,a,n),i=e?.serverIndex??0,o=xt["DeployImportApi.estimateContractDeploy"]?.[i]?.url;return(c,l)=>St(s,Ce,gt,e)(c,o||l)},async importContract(r,a,n){const s=await t.importContract(r,a,n),i=e?.serverIndex??0,o=xt["DeployImportApi.importContract"]?.[i]?.url;return(c,l)=>St(s,Ce,gt,e)(c,o||l)}}},xy=function(e,t,r){const a=gy(e);return{deployContract(n,s,i){return a.deployContract(n,s,i).then(o=>o(r,t))},estimateContractDeploy(n,s,i){return a.estimateContractDeploy(n,s,i).then(o=>o(r,t))},importContract(n,s,i){return a.importContract(n,s,i).then(o=>o(r,t))}}},yy=function(e){return{createEventMonitor:async(t,r,a={})=>{const n="/v1/w3s/contracts/monitors",s=new URL(n,yt);let i;e&&(i=e.baseOptions);const o={method:"POST",...i,...a},c={},l={};await bt(c,e),t!=null&&(c["X-Request-Id"]=String(t)),c["Content-Type"]="application/json",Et(s,l);let u=i&&i.headers?i.headers:{};return o.headers={...c,...u,...a.headers},o.data=Xt(r,o,e),{url:Ct(s),options:o}},deleteEventMonitor:async(t,r,a={})=>{It("deleteEventMonitor","id",t);const n="/v1/w3s/contracts/monitors/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(n,yt);let i;e&&(i=e.baseOptions);const o={method:"DELETE",...i,...a},c={},l={};await bt(c,e),r!=null&&(c["X-Request-Id"]=String(r)),Et(s,l);let u=i&&i.headers?i.headers:{};return o.headers={...c,...u,...a.headers},{url:Ct(s),options:o}},getEventMonitors:async(t,r,a,n,s,i,o,c,l,u={})=>{const p="/v1/w3s/contracts/monitors",d=new URL(p,yt);let x;e&&(x=e.baseOptions);const m={method:"GET",...x,...u},y={},b={};await bt(y,e),t!==void 0&&(b.contractAddress=t),r!==void 0&&(b.blockchain=r),a!==void 0&&(b.eventSignature=a),n!==void 0&&(b.from=n instanceof Date?n.toISOString():n),s!==void 0&&(b.to=s instanceof Date?s.toISOString():s),i!==void 0&&(b.pageBefore=i),o!==void 0&&(b.pageAfter=o),c!==void 0&&(b.pageSize=c),l!=null&&(y["X-Request-Id"]=String(l)),Et(d,b);let C=x&&x.headers?x.headers:{};return m.headers={...y,...C,...u.headers},{url:Ct(d),options:m}},listEventLogs:async(t,r,a,n,s,i,o,c,l={})=>{const u="/v1/w3s/contracts/events",p=new URL(u,yt);let d;e&&(d=e.baseOptions);const x={method:"GET",...d,...l},m={},y={};await bt(m,e),t!==void 0&&(y.contractAddress=t),r!==void 0&&(y.blockchain=r),a!==void 0&&(y.from=a instanceof Date?a.toISOString():a),n!==void 0&&(y.to=n instanceof Date?n.toISOString():n),s!==void 0&&(y.pageBefore=s),i!==void 0&&(y.pageAfter=i),o!==void 0&&(y.pageSize=o),c!=null&&(m["X-Request-Id"]=String(c)),Et(p,y);let b=d&&d.headers?d.headers:{};return x.headers={...m,...b,...l.headers},{url:Ct(p),options:x}},updateEventMonitor:async(t,r,a,n={})=>{It("updateEventMonitor","id",t);const s="/v1/w3s/contracts/monitors/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(s,yt);let o;e&&(o=e.baseOptions);const c={method:"PUT",...o,...n},l={},u={};await bt(l,e),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",Et(i,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Xt(a,c,e),{url:Ct(i),options:c}}}},by=function(e){const t=yy(e);return{async createEventMonitor(r,a,n){const s=await t.createEventMonitor(r,a,n),i=e?.serverIndex??0,o=xt["EventMonitorsApi.createEventMonitor"]?.[i]?.url;return(c,l)=>St(s,Ce,gt,e)(c,o||l)},async deleteEventMonitor(r,a,n){const s=await t.deleteEventMonitor(r,a,n),i=e?.serverIndex??0,o=xt["EventMonitorsApi.deleteEventMonitor"]?.[i]?.url;return(c,l)=>St(s,Ce,gt,e)(c,o||l)},async getEventMonitors(r,a,n,s,i,o,c,l,u,p){const d=await t.getEventMonitors(r,a,n,s,i,o,c,l,u,p),x=e?.serverIndex??0,m=xt["EventMonitorsApi.getEventMonitors"]?.[x]?.url;return(y,b)=>St(d,Ce,gt,e)(y,m||b)},async listEventLogs(r,a,n,s,i,o,c,l,u){const p=await t.listEventLogs(r,a,n,s,i,o,c,l,u),d=e?.serverIndex??0,x=xt["EventMonitorsApi.listEventLogs"]?.[d]?.url;return(m,y)=>St(p,Ce,gt,e)(m,x||y)},async updateEventMonitor(r,a,n,s){const i=await t.updateEventMonitor(r,a,n,s),o=e?.serverIndex??0,c=xt["EventMonitorsApi.updateEventMonitor"]?.[o]?.url;return(l,u)=>St(i,Ce,gt,e)(l,c||u)}}},Ey=function(e,t,r){const a=by(e);return{createEventMonitor(n,s,i){return a.createEventMonitor(n,s,i).then(o=>o(r,t))},deleteEventMonitor(n,s,i){return a.deleteEventMonitor(n,s,i).then(o=>o(r,t))},getEventMonitors(n,s,i,o,c,l,u,p,d,x){return a.getEventMonitors(n,s,i,o,c,l,u,p,d,x).then(m=>m(r,t))},listEventLogs(n,s,i,o,c,l,u,p,d){return a.listEventLogs(n,s,i,o,c,l,u,p,d).then(x=>x(r,t))},updateEventMonitor(n,s,i,o){return a.updateEventMonitor(n,s,i,o).then(c=>c(r,t))}}},Cy=function(e){return{queryContract:async(t,r,a={})=>{It("queryContract","readContractStateRequest",t);const n="/v1/w3s/contracts/query",s=new URL(n,yt);let i;e&&(i=e.baseOptions);const o={method:"POST",...i,...a},c={},l={};await bt(c,e),r!=null&&(c["X-Request-Id"]=String(r)),c["Content-Type"]="application/json",Et(s,l);let u=i&&i.headers?i.headers:{};return o.headers={...c,...u,...a.headers},o.data=Xt(t,o,e),{url:Ct(s),options:o}}}},Sy=function(e){const t=Cy(e);return{async queryContract(r,a,n){const s=await t.queryContract(r,a,n),i=e?.serverIndex??0,o=xt["InteractApi.queryContract"]?.[i]?.url;return(c,l)=>St(s,Ce,gt,e)(c,o||l)}}},Ty=function(e,t,r){const a=Sy(e);return{queryContract(n,s,i){return a.queryContract(n,s,i).then(o=>o(r,t))}}},wy=function(e){return{deployContractTemplate:async(t,r,a,n={})=>{It("deployContractTemplate","id",t),It("deployContractTemplate","templateContractDeploymentRequest",r);const s="/v1/w3s/templates/{id}/deploy".replace("{id}",encodeURIComponent(String(t))),i=new URL(s,yt);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await bt(l,e),a!=null&&(l["X-Request-Id"]=String(a)),l["Content-Type"]="application/json",Et(i,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Xt(r,c,e),{url:Ct(i),options:c}},estimateContractTemplateDeploy:async(t,r,a,n={})=>{It("estimateContractTemplateDeploy","id",t),It("estimateContractTemplateDeploy","contractDeploymentEstimateRequest",r);const s="/v1/w3s/templates/{id}/deploy/estimateFee".replace("{id}",encodeURIComponent(String(t))),i=new URL(s,yt);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await bt(l,e),a!=null&&(l["X-Request-Id"]=String(a)),l["Content-Type"]="application/json",Et(i,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Xt(r,c,e),{url:Ct(i),options:c}}}},Ay=function(e){const t=wy(e);return{async deployContractTemplate(r,a,n,s){const i=await t.deployContractTemplate(r,a,n,s),o=e?.serverIndex??0,c=xt["TemplatesApi.deployContractTemplate"]?.[o]?.url;return(l,u)=>St(i,Ce,gt,e)(l,c||u)},async estimateContractTemplateDeploy(r,a,n,s){const i=await t.estimateContractTemplateDeploy(r,a,n,s),o=e?.serverIndex??0,c=xt["TemplatesApi.estimateContractTemplateDeploy"]?.[o]?.url;return(l,u)=>St(i,Ce,gt,e)(l,c||u)}}},Iy=function(e,t,r){const a=Ay(e);return{deployContractTemplate(n,s,i,o){return a.deployContractTemplate(n,s,i,o).then(c=>c(r,t))},estimateContractTemplateDeploy(n,s,i,o){return a.estimateContractTemplateDeploy(n,s,i,o).then(c=>c(r,t))}}},By=function(e){return{getContract:async(t,r,a={})=>{It("getContract","id",t);const n="/v1/w3s/contracts/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(n,yt);let i;e&&(i=e.baseOptions);const o={method:"GET",...i,...a},c={},l={};await bt(c,e),r!=null&&(c["X-Request-Id"]=String(r)),Et(s,l);let u=i&&i.headers?i.headers:{};return o.headers={...c,...u,...a.headers},{url:Ct(s),options:o}},listContracts:async(t,r,a,n,s,i,o,c,l,u,p,d={})=>{const x="/v1/w3s/contracts",m=new URL(x,yt);let y;e&&(y=e.baseOptions);const b={method:"GET",...y,...d},C={},B={};await bt(C,e),t!==void 0&&(B.blockchain=t),r!==void 0&&(B.contractInputType=r),a!==void 0&&(B.deployerAddress=a),n!==void 0&&(B.name=n),s!==void 0&&(B.status=s),i!==void 0&&(B.from=i instanceof Date?i.toISOString():i),o!==void 0&&(B.to=o instanceof Date?o.toISOString():o),c!==void 0&&(B.pageBefore=c),l!==void 0&&(B.pageAfter=l),u!==void 0&&(B.pageSize=u),p!=null&&(C["X-Request-Id"]=String(p)),Et(m,B);let _=y&&y.headers?y.headers:{};return b.headers={...C,..._,...d.headers},{url:Ct(m),options:b}},updateContract:async(t,r,a,n={})=>{It("updateContract","id",t),It("updateContract","patchContractRequest",r);const s="/v1/w3s/contracts/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(s,yt);let o;e&&(o=e.baseOptions);const c={method:"PATCH",...o,...n},l={},u={};await bt(l,e),a!=null&&(l["X-Request-Id"]=String(a)),l["Content-Type"]="application/json",Et(i,u);let p=o&&o.headers?o.headers:{};return c.headers={...l,...p,...n.headers},c.data=Xt(r,c,e),{url:Ct(i),options:c}}}},_y=function(e){const t=By(e);return{async getContract(r,a,n){const s=await t.getContract(r,a,n),i=e?.serverIndex??0,o=xt["ViewUpdateApi.getContract"]?.[i]?.url;return(c,l)=>St(s,Ce,gt,e)(c,o||l)},async listContracts(r,a,n,s,i,o,c,l,u,p,d,x){const m=await t.listContracts(r,a,n,s,i,o,c,l,u,p,d,x),y=e?.serverIndex??0,b=xt["ViewUpdateApi.listContracts"]?.[y]?.url;return(C,B)=>St(m,Ce,gt,e)(C,b||B)},async updateContract(r,a,n,s){const i=await t.updateContract(r,a,n,s),o=e?.serverIndex??0,c=xt["ViewUpdateApi.updateContract"]?.[o]?.url;return(l,u)=>St(i,Ce,gt,e)(l,c||u)}}},Ry=function(e,t,r){const a=_y(e);return{getContract(n,s,i){return a.getContract(n,s,i).then(o=>o(r,t))},listContracts(n,s,i,o,c,l,u,p,d,x,m,y){return a.listContracts(n,s,i,o,c,l,u,p,d,x,m,y).then(b=>b(r,t))},updateContract(n,s,i,o){return a.updateContract(n,s,i,o).then(c=>c(r,t))}}};var ky=Object.defineProperty,Ny=(e,t,r)=>t in e?ky(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,na=(e,t,r)=>Ny(e,typeof t!="symbol"?t+"":t,r);class Ly{constructor(t={}){na(this,"apiKey"),na(this,"username"),na(this,"password"),na(this,"accessToken"),na(this,"basePath"),na(this,"serverIndex"),na(this,"baseOptions"),na(this,"formDataCtor"),this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions=t.baseOptions,this.formDataCtor=t.formDataCtor}isJsonMime(t){const r=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(r.test(t)||t.toLowerCase()==="application/json-patch+json")}}const Uy={Eth:"ETH",EthSepolia:"ETH-SEPOLIA",Matic:"MATIC",MaticAmoy:"MATIC-AMOY",Arb:"ARB",ArbSepolia:"ARB-SEPOLIA",Uni:"UNI",UniSepolia:"UNI-SEPOLIA",Base:"BASE",BaseSepolia:"BASE-SEPOLIA",Op:"OP",OpSepolia:"OP-SEPOLIA",Avax:"AVAX",AvaxFuji:"AVAX-FUJI",ArcTestnet:"ARC-TESTNET",Monad:"MONAD",MonadTestnet:"MONAD-TESTNET"};var Py=Object.defineProperty,Dy=(e,t,r)=>t in e?Py(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vr=(e,t,r)=>Dy(e,typeof t!="symbol"?t+"":t,r);class Oy{constructor(t,r,a={}){vr(this,"DeployImport"),vr(this,"EventMonitors"),vr(this,"Interact"),vr(this,"Templates"),vr(this,"ViewUpdate");const n=new Ly({basePath:t,baseOptions:{headers:{...a,Authorization:`Bearer ${r.apiKey}`,"Content-Type":"application/json","User-Agent":`${r.userAgent?r.userAgent+" / ":""}CircleNodeJS / SmartContractPlatform / ${r.version}`}}});this.DeployImport=xy(n),this.EventMonitors=Ey(n),this.Interact=Ty(n),this.Templates=Iy(n),this.ViewUpdate=Ry(n)}}var Fy=Object.defineProperty,xf=e=>{throw TypeError(e)},My=(e,t,r)=>t in e?Fy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ja=(e,t,r)=>My(e,typeof t!="symbol"?t+"":t,r),yf=(e,t,r)=>t.has(e)||xf("Cannot "+r),Vy=(e,t,r)=>(yf(e,t,"read from private field"),r?r.call(e):t.get(e)),qy=(e,t,r)=>t.has(e)?xf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),jy=(e,t,r,a)=>(yf(e,t,"write to private field"),a?a.call(e,r):t.set(e,r),r),Qc;class gr extends Error{constructor({message:t,code:r,url:a,method:n,error:s}){super(t),ja(this,"code"),ja(this,"message"),ja(this,"url"),ja(this,"method"),qy(this,Qc),this.message=t??new.target.message,this.code=r??new.target.code,this.url=a,this.method=n,jy(this,Qc,s)}get error(){return Vy(this,Qc)}}Qc=new WeakMap,ja(gr,"code","UNKNOWN"),ja(gr,"message","HTTP Error");var Ky=Object.defineProperty,zy=(e,t,r)=>t in e?Ky(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Iu=(e,t,r)=>zy(e,typeof t!="symbol"?t+"":t,r);class E extends gr{constructor({message:t,code:r,url:a,method:n,status:s,error:i}){super({message:t,code:r,url:a,method:n,error:i}),Iu(this,"status"),this.status=s}}Iu(E,"code",-1),Iu(E,"message","HTTP Response Error");var Hy=Object.defineProperty,$y=(e,t,r)=>t in e?Hy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bf=(e,t,r)=>$y(e,typeof t!="symbol"?t+"":t,r);class kt extends gr{}bf(kt,"code","UNKNOWN"),bf(kt,"message","Unknown HTTP request error");var Gy=Object.defineProperty,Qy=(e,t,r)=>t in e?Gy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ef=(e,t,r)=>Qy(e,typeof t!="symbol"?t+"":t,r);class xr extends E{}Ef(xr,"code",400),Ef(xr,"message","Bad Request");var Wy=Object.defineProperty,Xy=(e,t,r)=>t in e?Wy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Cf=(e,t,r)=>Xy(e,typeof t!="symbol"?t+"":t,r);class yr extends E{}Cf(yr,"code",401),Cf(yr,"message","Unauthorized");var Yy=Object.defineProperty,Jy=(e,t,r)=>t in e?Yy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Sf=(e,t,r)=>Jy(e,typeof t!="symbol"?t+"":t,r);class br extends E{}Sf(br,"code",403),Sf(br,"message","Forbidden");var Zy=Object.defineProperty,e1=(e,t,r)=>t in e?Zy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tf=(e,t,r)=>e1(e,typeof t!="symbol"?t+"":t,r);class Er extends E{}Tf(Er,"code",404),Tf(Er,"message","Not Found");var t1=Object.defineProperty,a1=(e,t,r)=>t in e?t1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wf=(e,t,r)=>a1(e,typeof t!="symbol"?t+"":t,r);class Cr extends E{}wf(Cr,"code",429),wf(Cr,"message","Too Many Requests");var r1=Object.defineProperty,n1=(e,t,r)=>t in e?r1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Af=(e,t,r)=>n1(e,typeof t!="symbol"?t+"":t,r);class Sr extends E{}Af(Sr,"code",500),Af(Sr,"message","Internal Server Error");var i1=Object.defineProperty,s1=(e,t,r)=>t in e?i1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,If=(e,t,r)=>s1(e,typeof t!="symbol"?t+"":t,r);class Tr extends E{}If(Tr,"code",501),If(Tr,"message","Not Implemented");var o1=Object.defineProperty,c1=(e,t,r)=>t in e?o1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Bf=(e,t,r)=>c1(e,typeof t!="symbol"?t+"":t,r);class wr extends E{}Bf(wr,"code",502),Bf(wr,"message","Bad Gateway");var l1=Object.defineProperty,u1=(e,t,r)=>t in e?l1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_f=(e,t,r)=>u1(e,typeof t!="symbol"?t+"":t,r);class Ar extends E{}_f(Ar,"code",503),_f(Ar,"message","Service Unavailable");var p1=Object.defineProperty,d1=(e,t,r)=>t in e?p1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Rf=(e,t,r)=>d1(e,typeof t!="symbol"?t+"":t,r);class Ir extends E{}Rf(Ir,"code",504),Rf(Ir,"message","Gateway Timeout");var f1=Object.defineProperty,m1=(e,t,r)=>t in e?f1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kf=(e,t,r)=>m1(e,typeof t!="symbol"?t+"":t,r);class Br extends kt{}kf(Br,"code","ECONNREFUSED"),kf(Br,"message","Connection refused");var h1=Object.defineProperty,v1=(e,t,r)=>t in e?h1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Nf=(e,t,r)=>v1(e,typeof t!="symbol"?t+"":t,r);class _r extends kt{}Nf(_r,"code","ETIMEDOUT"),Nf(_r,"message","Connection timeout");var g1=Object.defineProperty,x1=(e,t,r)=>t in e?g1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Lf=(e,t,r)=>x1(e,typeof t!="symbol"?t+"":t,r);class Rr extends kt{}Lf(Rr,"code","ECONNABORTED"),Lf(Rr,"message","Request timeout");var y1=Object.defineProperty,b1=(e,t,r)=>t in e?y1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Uf=(e,t,r)=>b1(e,typeof t!="symbol"?t+"":t,r);class kr extends kt{}Uf(kr,"code","ENOTFOUND"),Uf(kr,"message","DNS lookup failed - host not found");var E1=Object.defineProperty,C1=(e,t,r)=>t in e?E1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pf=(e,t,r)=>C1(e,typeof t!="symbol"?t+"":t,r);class Nr extends kt{}Pf(Nr,"code","EAI_AGAIN"),Pf(Nr,"message","DNS lookup failed - timeout");var S1=Object.defineProperty,T1=(e,t,r)=>t in e?S1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Df=(e,t,r)=>T1(e,typeof t!="symbol"?t+"":t,r);class Lr extends kt{}Df(Lr,"code","ENETUNREACH"),Df(Lr,"message","Network unreachable");var w1=Object.defineProperty,A1=(e,t,r)=>t in e?w1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Of=(e,t,r)=>A1(e,typeof t!="symbol"?t+"":t,r);class Ur extends kt{}Of(Ur,"code","ECONNRESET"),Of(Ur,"message","Connection reset");var I1=Object.defineProperty,B1=(e,t,r)=>t in e?I1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ff=(e,t,r)=>B1(e,typeof t!="symbol"?t+"":t,r);class Pr extends kt{}Ff(Pr,"code","EHOSTUNREACH"),Ff(Pr,"message","Host unreachable");const Mf={undefined:kt,[Br.code]:Br,[_r.code]:_r,[Rr.code]:Rr,[Ur.code]:Ur,[kr.code]:kr,[Nr.code]:Nr,[Lr.code]:Lr,[Pr.code]:Pr};function _1(e){return Mf[e]??Mf.undefined}function R1(e){return k1({code:e.code,message:e.message,url:e.config.url,method:e.config.method.toUpperCase(),error:e})}function k1({code:e,message:t,url:r,method:a,error:n}){const s=_1(e);return new s({message:t,code:e,url:r,method:a,error:n})}var N1=Object.defineProperty,L1=(e,t,r)=>t in e?N1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,f=(e,t,r)=>L1(e,typeof t!="symbol"?t+"":t,r);class Bu extends E{}f(Bu,"code",110700),f(Bu,"message","The input amount is outside trade limit.");class _u extends E{}f(_u,"code",110701),f(_u,"message","No quote is available with given input.");class Ru extends E{}f(Ru,"code",110702),f(Ru,"message","No supported configurations with given input.");class ku extends E{}f(ku,"code",110703),f(ku,"message","refId already exists, should be unique.");class Dr extends E{}f(Dr,"code",155101),f(Dr,"message","Existing user already created with the provided userId.");class Or extends E{}f(Or,"code",155102),f(Or,"message","Cannot find the user id in the system.");class Fr extends E{}f(Fr,"code",155103),f(Fr,"message","Cannot find the user token in the system.");class Mr extends E{}f(Mr,"code",155104),f(Mr,"message","The userToken had expired.");class Vr extends E{}f(Vr,"code",155105),f(Vr,"message","The userToken is invalid.");class qr extends E{}f(qr,"code",155106),f(qr,"message","The user had already been initialized.");class jr extends E{}f(jr,"code",155107),f(jr,"message","User has previously set a PIN. Use PUT /user/pin to reset the PIN.");class Kr extends E{}f(Kr,"code",155108),f(Kr,"message","User has previously set up their security questions, and they can't be reset.");class zr extends E{}f(zr,"code",155109),f(zr,"message","The specified user has been disabled.");class Hr extends E{}f(Hr,"code",155110),f(Hr,"message","User has not set up a PIN yet.");class $r extends E{}f($r,"code",155111),f($r,"message","User hasn't set the security questions for PIN backup yet.");class Gr extends E{}f(Gr,"code",155112),f(Gr,"message","The user has inputted the incorrect pin.");class Qr extends E{}f(Qr,"code",155113),f(Qr,"message","Provided device ID is not found in the system.");class Wr extends E{}f(Wr,"code",155114),f(Wr,"message","Provided app ID is not recognized in the system.");class Xr extends E{}f(Xr,"code",155115),f(Xr,"message","The user has inputted the incorrect security answers");class Yr extends E{}f(Yr,"code",155116),f(Yr,"message","The challenge ID doesn't exist in the system.");class Jr extends E{}f(Jr,"code",155117),f(Jr,"message","The content provided for approval is not correct.");class Zr extends E{}f(Zr,"code",155118),f(Zr,"message","Encryption key does not match with the user's token. Call POST /users/token to get the correct token encryption key pair.");class en extends E{}f(en,"code",155119),f(en,"message","The user's PIN input is locked. It will be unlocked after the cooldown period.");class tn extends E{}f(tn,"code",155120),f(tn,"message","The user's security questions input is locked. It will be unlocked after the cooldown period.");class an extends E{}f(an,"code",155121),f(an,"message","The provided challengeId has expired.");class rn extends E{}f(rn,"code",155122),f(rn,"message","The provided challengeId is invalid");class nn extends E{}f(nn,"code",155123),f(nn,"message","No extra information provided when adding PIN-related requests.");class sn extends E{}f(sn,"code",155124),f(sn,"message","The extra information provided for PIN-related requests is invalid.");class on extends E{}f(on,"code",155130),f(on,"message","User OTP token is expired.");class cn extends E{}f(cn,"code",155131),f(cn,"message","User OTP token is invalid.");class ln extends E{}f(ln,"code",155132),f(ln,"message","User OTP value is not found.");class un extends E{}f(un,"code",155133),f(un,"message","User OTP value is invalid.");class pn extends E{}f(pn,"code",155134),f(pn,"message","User OTP value is not matched.");class dn extends E{}f(dn,"code",155135),f(dn,"message","User's email is invalid.");class fn extends E{}f(fn,"code",155136),f(fn,"message","User's email is not matched.");class mn extends E{}f(mn,"code",155137),f(mn,"message","User's device ID is invalid.");class hn extends E{}f(hn,"code",155138),f(hn,"message","Failed to send the email.");class vn extends E{}f(vn,"code",155139),f(vn,"message","The idToken / accessToken of SSO is expired.");class gn extends E{}f(gn,"code",155140),f(gn,"message","Failed to validate the idToken/ accessToken.");class xn extends E{}f(xn,"code",155141),f(xn,"message","The user has exceeded the max limit (5) of entering OTP at the moment.");class yn extends E{}f(yn,"code",155142),f(yn,"message","The max limit (5) of sending OTP has been exceeded at the moment.");class bn extends E{}f(bn,"code",155143),f(bn,"message","The device token is expired.");class En extends E{}f(En,"code",155144),f(En,"message","The device token is invalid.");class Cn extends E{}f(Cn,"code",155145),f(Cn,"message","The device token is not found.");class Sn extends E{}f(Sn,"code",155146),f(Sn,"message","The one-time password token is invalid as the user has entered it incorrectly three times.");class Tn extends E{}f(Tn,"code",155150),f(Tn,"message","The SMTP server configuration is not found.");class wn extends E{}f(wn,"code",155151),f(wn,"message","The SMTP server configuration is invalid.");class An extends E{}f(An,"code",155152),f(An,"message","The SSO provider configuration is not found.");class In extends E{}f(In,"code",155154),f(In,"message","The OTP email template is invalid.");class Bn extends E{}f(Bn,"code",155155),f(Bn,"message","The OTP email template is not found.");class _n extends E{}f(_n,"code",155156),f(_n,"message","Failed to update the email template.");class Rn extends E{}f(Rn,"code",155157),f(Rn,"message","Failed to update the SMTP server configuration.");class kn extends E{}f(kn,"code",155158),f(kn,"message","Failed to dial to the SMTP server.");class Nn extends E{}f(Nn,"code",155159),f(Nn,"message","Failed to auth to the SMTP server.");class Ln extends E{}f(Ln,"code",155160),f(Ln,"message","Failed to send to the SMTP server.");class Un extends E{}f(Un,"code",155201),f(Un,"message","Not enough funds to fulfill the withdraw request.");class Pn extends E{}f(Pn,"code",155202),f(Pn,"message","Transaction nonce is inconsistent with sender's latest nonce.");class Dn extends E{}f(Dn,"code",155203),f(Dn,"message","User op nonce can not be larger than 0 when the smart contract wallet hasn't been deployed.");class On extends E{}f(On,"code",155204),f(On,"message","The total cost of executing transaction is higher than the balance of the user's account when estimating fee.");class Fn extends E{}f(Fn,"code",155205),f(Fn,"message","Failed to execute this request on EVM due to insufficient tokens when the estimating gas fee.");class Mn extends E{}f(Mn,"code",155206),f(Mn,"message","The sender address is not the token owner or the sender wasn't approved to commit this transaction.");class Vn extends E{}f(Vn,"code",155207),f(Vn,"message","Gas required exceeds the maximum allowance for the account. This is based on the gas fee estimate amount.");class qn extends E{}f(qn,"code",155208),f(qn,"message","Estimate fee execution reverted.");class jn extends E{}f(jn,"code",155209),f(jn,"message","ABI function signature can't pack ABI parameter.");class Kn extends E{}f(Kn,"code",155210),f(Kn,"message","Fails to perform transaction estimation.");class zn extends E{}f(zn,"code",155211),f(zn,"message","MaxFee * GasLimit exceeded the maximum permitted transaction gas fee.");class Hn extends E{}f(Hn,"code",155215),f(Hn,"message","Unsupported operation for transaction.");class $n extends E{}f($n,"code",155218),f($n,"message","Invalid number of nft in transaction request.");class Gn extends E{}f(Gn,"code",155219),f(Gn,"message","Invalid destination address.");class Qn extends E{}f(Qn,"code",155220),f(Qn,"message","Wallet and token's blockchain mismatch.");class Wn extends E{}f(Wn,"code",155221),f(Wn,"message","Invalid amounts in transfer request.");class Xn extends E{}f(Xn,"code",155222),f(Xn,"message","NFT metadata can not be found.");class Yn extends E{}f(Yn,"code",155223),f(Yn,"message","Unsupported userId for get transactions.");class Jn extends E{}f(Jn,"code",155224),f(Jn,"message","Failed to parse the provided amounts in request to decimals.");class Zn extends E{}f(Zn,"code",155225),f(Zn,"message","Wallet and request's blockchain mismatch.");class ei extends E{}f(ei,"code",155226),f(ei,"message","Invalid source address.");class ti extends E{}f(ti,"code",155227),f(ti,"message","Invalid transaction type.");class ai extends E{}f(ai,"code",155228),f(ai,"message","Missing token ID.");class ri extends E{}f(ri,"code",155229),f(ri,"message","Transaction is not eligible for operation.");class ni extends E{}f(ni,"code",155230),f(ni,"message","No abi signature provided.");class ii extends E{}f(ii,"code",155231),f(ii,"message","Transaction needs feeLevel or gasLimit provided.");class si extends E{}f(si,"code",155232),f(si,"message","SCA transaction needs feeLevel provided.");class oi extends E{}f(oi,"code",155233),f(oi,"message","Provided gasLimit is too low to complete the requested transaction.");class ci extends E{}f(ci,"code",155234),f(ci,"message","Transaction can't have both feeLevel and fee parameters provided.");class li extends E{}f(li,"code",155235),f(li,"message","EIP1559 chains need maxFee/priorityFee provided.");class ui extends E{}f(ui,"code",155236),f(ui,"message","The provided fee in request is invalid.");class pi extends E{}f(pi,"code",155237),f(pi,"message","PriorityFee cannot be larger than maxFee in creating transaction request.");class di extends E{}f(di,"code",155238),f(di,"message","Non-EIP1559 chains need gasPrice provided.");class fi extends E{}f(fi,"code",155239),f(fi,"message","Invalid token address for transfer.");class mi extends E{}f(mi,"code",155240),f(mi,"message","Invalid token standard for transfer.");class hi extends E{}f(hi,"code",155241),f(hi,"message","Invalid token decimal for transfer.");class vi extends E{}f(vi,"code",155242),f(vi,"message","The lengths of amounts and nft tokens don't match.");class gi extends E{}f(gi,"code",155243),f(gi,"message","Missing bytecode for contract deployment.");class xi extends E{}f(xi,"code",155244),f(xi,"message","Cannot provide both WalletID and SourceAddress/Blockchain.");class yi extends E{}f(yi,"code",155245),f(yi,"message","Invalid amount in contract execution request.");class bi extends E{}f(bi,"code",155247),f(bi,"message","Cannot provide both CallData and AbiFunctionSignature/AbiParameters.");class Ei extends E{}f(Ei,"code",155254),f(Ei,"message","Non-EIP1559 chains don't support maxFee/priorityFee.");class Ci extends E{}f(Ci,"code",155257),f(Ci,"message","the transfer amount is insufficient to make the destination account rent exempted or the balance of the source account is insufficient to remain rent exempted. The source address's remaining balance after transfer must be either zero or above the rent exemption threshold.");class Si extends E{}f(Si,"code",155258),f(Si,"message","The asset amount owned by the wallet is insufficient for the transaction.");class Ti extends E{}f(Ti,"code",155262),f(Ti,"message","Account is not found, could be caused by transacting from a Solana account with zero balance.");class wi extends E{}f(wi,"code",155264),f(wi,"message","Wait for pending transactions to be included on the blockchain before submitting new requests. EVM chains restrict the number of queued transactions per sender address.");class Ai extends E{}f(Ai,"code",155501),f(Ai,"message","Frozen wallets can not be updated or interact with, only query.");class Ii extends E{}f(Ii,"code",155502),f(Ii,"message","Max amount of wallets (tentative 1M) reached under 1 wallet set.");class Bi extends E{}f(Bi,"code",155503),f(Bi,"message","Metadata array length needs to match wallet count in create developer wallets request.");class _i extends E{}f(_i,"code",155504),f(_i,"message","Metadata array length needs to match number of blockchains in create user wallets request.");class Ri extends E{}f(Ri,"code",155505),f(Ri,"message","SCA wallet needs to wait for first-time transaction to be queued before processing more transactions.");class ki extends E{}f(ki,"code",155506),f(ki,"message","SCA wallet config is invalid.");class Ni extends E{}f(Ni,"code",155507),f(Ni,"message","SCA account is not supported on the given blockchain.");class Li extends E{}f(Li,"code",155508),f(Li,"message","Can't create multiple user-controlled SCA wallets across multiple blockchains at a time.");class Ui extends E{}f(Ui,"code",155509),f(Ui,"message","Entity needs to setup paymaster policy in developer console before sending transaction on mainnet");class Pi extends E{}f(Pi,"code",155510),f(Pi,"message","The operation is not supported on the blockchain you specify.");class Di extends E{}f(Di,"code",155511),f(Di,"message","Blockchain is not supported for wallet creation.");class Oi extends E{}f(Oi,"code",155512),f(Oi,"message","The owner of the SCA wallet can not be found.");class Fi extends E{}f(Fi,"code",155514),f(Fi,"message","circle_4337_v1 SCA wallet must be deployed before being upgraded.");class Mi extends E{}f(Mi,"code",155515),f(Mi,"message","The provided wallet account type is not supported by this API.");class Vi extends E{}f(Vi,"code",155516),f(Vi,"message","The source wallet was originally created on an SCA version that does not support wallet derivation.");class qi extends E{}f(qi,"code",155517),f(qi,"message","The SCA wallet is not deployed onchain.");class ji extends E{}f(ji,"code",155601),f(ji,"message","Failed to retrieve wallet set which already exists.");class Ki extends E{}f(Ki,"code",155701),f(Ki,"message","User canceled");class zi extends E{}f(zi,"code",155702),f(zi,"message","<Launch UI failed reason>");class Hi extends E{}f(Hi,"code",155703),f(Hi,"message","The code you entered is not the same as the first one.");class $i extends E{}f($i,"code",155704),f($i,"message","Your PIN can't have repeating or consecutive numbers.");class Gi extends E{}f(Gi,"code",155705),f(Gi,"message","Your hint can't be the same as the answer.");class Qi extends E{}f(Qi,"code",155706),f(Qi,"message","Network error");class Wi extends E{}f(Wi,"code",155707),f(Wi,"message","Failed to encrypt data");class Xi extends E{}f(Xi,"code",155708),f(Xi,"message",'"Biometrics instead of PIN" is disabled');class Yi extends E{}f(Yi,"code",155709),f(Yi,"message","The device system doesn't support biometrics");class Ji extends E{}f(Ji,"code",155710),f(Ji,"message","Failed to decrypt biometrics key");class Zi extends E{}f(Zi,"code",155711),f(Zi,"message","The user has not enabled biometrics yet");class es extends E{}f(es,"code",155712),f(es,"message","The user refused to enable biometrics");class ts extends E{}f(ts,"code",155713),f(ts,"message","Too many requests. Try again later");class as extends E{}f(as,"code",155714),f(as,"message","Too many requests. The biometrics sensor on the device is locked.");class rs extends E{}f(rs,"code",155715),f(rs,"message","The user didn't enable biometrics");class ns extends E{}f(ns,"code",155716),f(ns,"message","Unexpected error for biometrics");class is extends E{}f(is,"code",155717),f(is,"message","User secret is missing.");class ss extends E{}f(ss,"code",155718),f(ss,"message","User secret is invalid.");class os extends E{}f(os,"code",155719),f(os,"message","User token and SDK API execute function does not match.");class cs extends E{}f(cs,"code",155720),f(cs,"message","Social login failed.");class ls extends E{}f(ls,"code",155721),f(ls,"message","Login info is missing.");class us extends E{}f(us,"code",155801),f(us,"message","Transaction or rawTransaction is invalid.");class ps extends E{}f(ps,"code",155802),f(ps,"message","Account not found.");class ds extends E{}f(ds,"code",155803),f(ds,"message","Not signer account.");class fs extends E{}f(fs,"code",155804),f(fs,"message","Transaction already signed.");class ms extends E{}f(ms,"code",155805),f(ms,"message","Transaction failed to deserialize.");class hs extends E{}f(hs,"code",155806),f(hs,"message","The transaction size exceeds blockchain limit.");class vs extends E{}f(vs,"code",155807),f(vs,"message","The chain ID is not supported for signing.");class gs extends E{}f(gs,"code",155808),f(gs,"message","The chain ID is missing in sign request.");class xs extends E{}f(xs,"code",156001),f(xs,"message","Cannot find target wallet in the system. Either the specified wallet doesn't exist or it's not accessible to the caller.");class ys extends E{}f(ys,"code",156002),f(ys,"message","Cannot find target token in the system. Either the specified token doesn't exist or it's not accessible to the caller.");class bs extends E{}f(bs,"code",156003),f(bs,"message","Cannot find target transaction in the system. Either the specified transaction doesn't exist or it's not accessible to the caller.");class Es extends E{}f(Es,"code",156004),f(Es,"message","Reusing an entity secret ciphertext is not allowed. Please re-encrypt the entity secret to generate new ciphertext.");class Cs extends E{}f(Cs,"code",156005),f(Cs,"message","Cannot find target wallet set in the system. Either no such wallet set, or it's not accessible to the caller.");class Ss extends E{}f(Ss,"code",156006),f(Ss,"message","TEST_API key cannot be used with blockchain mainnets, or LIVE_API key cannot be used with blockchain testnets.");class Ts extends E{}f(Ts,"code",156007),f(Ts,"message","TEST_API key or LIVE_API key is not found for the request.");class ws extends E{}f(ws,"code",156008),f(ws,"message","Cannot find target entity config in the system. Either no such entity config, or it's not accessible to the caller.");class As extends E{}f(As,"code",156009),f(As,"message","Fail to parse id as UUID in url.");class Is extends E{}f(Is,"code",156010),f(Is,"message","Cannot find the corresponding entity in the system.");class Bs extends E{}f(Bs,"code",156011),f(Bs,"message","Cannot find target nftTokenId in the system.");class _s extends E{}f(_s,"code",156012),f(_s,"message","Cannot find corresponding pagination cursor in the system.");class Rs extends E{}f(Rs,"code",156013),f(Rs,"message","The provided entity secret is invalid.");class ks extends E{}f(ks,"code",156014),f(ks,"message","Pagination params are invalid. Only UUID format is supported for pageBefore and pageAfter.");class Ns extends E{}f(Ns,"code",156015),f(Ns,"message","The secret for this entity has already been set.");class Ls extends E{}f(Ls,"code",156016),f(Ls,"message","The entity secret has not been set yet. Please provide encrypted ciphertext in the console.");class Us extends E{}f(Us,"code",156017),f(Us,"message","The specified blockchain parameters are incorrect.");class Ps extends E{}f(Ps,"code",156018),f(Ps,"message","The uploaded recovery file is invalid.");class Ds extends E{}f(Ds,"code",156019),f(Ds,"message","Current entity secret is invalid. Please rotate the entity secret first.");class Os extends E{}f(Os,"code",156020),f(Os,"message","Please use a new idempotency key.");class Fs extends E{}f(Fs,"code",156021),f(Fs,"message","A new wallet set ID is required.");class Ms extends E{}f(Ms,"code",156023),f(Ms,"message","EncodedByHex is true in sign request, but the message is not hex encoded.");class Vs extends E{}f(Vs,"code",156024),f(Vs,"message","Data is not a valid JSON string in sign request.");class qs extends E{}f(qs,"code",156025),f(qs,"message","Invalid message in request.");class js extends E{}f(js,"code",156026),f(js,"message","Invalid typed data in request.");class Ks extends E{}f(Ks,"code",156027),f(Ks,"message","The specified blockchain is either not supported or deprecated.");class zs extends E{}f(zs,"code",156030),f(zs,"message","Invalid unsigned delegate action in request.");class Hs extends E{}f(Hs,"code",156031),f(Hs,"message","The specified token address is not supported.");class $s extends E{}f($s,"code",156032),f($s,"message","The provided amount is invalid.");class Gs extends E{}f(Gs,"code",175001),f(Gs,"message","contract not found");class Qs extends E{}f(Qs,"code",175002),f(Qs,"message","no ABI JSON for the target contract");class Ws extends E{}f(Ws,"code",175003),f(Ws,"message","constructor parameters length must match constructor signature");class Xs extends E{}f(Xs,"code",175004),f(Xs,"message","contract already exists");class Ys extends E{}f(Ys,"code",175005),f(Ys,"message","address is not a contract address");class Js extends E{}f(Js,"code",175006),f(Js,"message","contract is archived");class Zs extends E{}f(Zs,"code",175007),f(Zs,"message","invalid ABI JSON");class eo extends E{}f(eo,"code",175008),f(eo,"message","multi-layered proxies are not supported");class to extends E{}f(to,"code",175009),f(to,"message","contract deployment pending");class ao extends E{}f(ao,"code",175010),f(ao,"message","ABI function not found");class ro extends E{}f(ro,"code",175011),f(ro,"message","empty update on a contract");class no extends E{}f(no,"code",175012),f(no,"message","unable to query contract");class io extends E{}f(io,"code",175013),f(io,"message","ABI function is not supported");class so extends E{}f(so,"code",175201),f(so,"message","template not found");class oo extends E{}f(oo,"code",175202),f(oo,"message","deploying this template is temporarily disabled");class co extends E{}f(co,"code",175203),f(co,"message","invalid template deployment parameter");class lo extends E{}f(lo,"code",175204),f(lo,"message","missing required template deployment parameter");class uo extends E{}f(uo,"code",175205),f(uo,"message","estimation is not supported");class po extends E{}f(po,"code",175301),f(po,"message","event subscription not found");class fo extends E{}f(fo,"code",175302),f(fo,"message","event subscription already exists");class mo extends E{}f(mo,"code",175303),f(mo,"message","the specified event signature does not exist");class ho extends E{}f(ho,"code",175401),f(ho,"message","failed to parse id as UUID in url");class vo extends E{}f(vo,"code",175402),f(vo,"message","the specified blockchain is either not supported or deprecated");class go extends E{}f(go,"code",175403),f(go,"message","please use a new idempotency key");class xo extends E{}f(xo,"code",175404),f(xo,"message","TEST_API key cannot be used with blockchain mainnets, or LIVE_API key cannot be used with blockchain testnets");class yo extends E{}f(yo,"code",175405),f(yo,"message","TEST_API key or LIVE_API key is not found for the request");class bo extends E{}f(bo,"code",175406),f(bo,"message","this feature is temporarily disabled");class Eo extends E{}f(Eo,"code",175407),f(Eo,"message","the specified blockchain is currently unavailable");class Co extends E{}f(Co,"code",175408),f(Co,"message","can not find corresponding pagination cursor in the system");class So extends E{}f(So,"code",175409),f(So,"message","restricted entity cannot perform this operation");class To extends E{}f(To,"code",175410),f(To,"message","invalid address format");class wo extends E{}f(wo,"code",177001),f(wo,"message","transaction nonce is inconsistent with sender's latest nonce");class Ao extends E{}f(Ao,"code",177002),f(Ao,"message","user op nonce can not be larger than 0 when smart contract wallet hasn't been deployed");class Io extends E{}f(Io,"code",177003),f(Io,"message","failed to execute this request on EVM due to insufficient token when estimating fee");class Bo extends E{}f(Bo,"code",177004),f(Bo,"message","the total cost of executing transaction is higher than the balance of the user's account when estimating fee");class _o extends E{}f(_o,"code",177005),f(_o,"message","the sender address is not token owner or approved when estimating token transfer");class Ro extends E{}f(Ro,"code",177006),f(Ro,"message","gas required exceeds allowance when estimating fee");class ko extends E{}f(ko,"code",177007),f(ko,"message","estimate fee execution reverted");class No extends E{}f(No,"code",177008),f(No,"message","ABI function signature can't pack ABI parameter");class Lo extends E{}f(Lo,"code",177009),f(Lo,"message","fails to perform transaction estimation");class Uo extends E{}f(Uo,"code",177010),f(Uo,"message","MaxFee * GasLimit exceeds configurable max transaction fee (default is 1 native token)");class Po extends E{}f(Po,"code",177011),f(Po,"message","transaction needs feeLevel or gasLimit provided");class Do extends E{}f(Do,"code",177012),f(Do,"message","SCA transaction needs feeLevel provided");class Oo extends E{}f(Oo,"code",177013),f(Oo,"message","EIP1559 chains need maxFee/priorityFee provided");class Fo extends E{}f(Fo,"code",177014),f(Fo,"message","priorityFee cannot be larger than maxFee in creating transaction request");class Mo extends E{}f(Mo,"code",177015),f(Mo,"message","missing bytecode for contract deployment");class Vo extends E{}f(Vo,"code",177016),f(Vo,"message","cannot provide both WalletID and SourceAddress/Blockchain");class qo extends E{}f(qo,"code",177017),f(qo,"message","invalid amount in contract execution request");class jo extends E{}f(jo,"code",177018),f(jo,"message","policy is not activated and cannot be used");class Ko extends E{}f(Ko,"code",177019),f(Ko,"message","exceeded max daily transaction of the policy");class zo extends E{}f(zo,"code",177020),f(zo,"message","exceeded max spend USD per transaction of the policy");class Ho extends E{}f(Ho,"code",177021),f(Ho,"message","exceeded max spend USD daily of the policy");class $o extends E{}f($o,"code",177022),f($o,"message","exceeded max native token daily of the policy");class Go extends E{}f(Go,"code",177023),f(Go,"message","sender is in policy blocklist");class Qo extends E{}f(Qo,"code",177024),f(Qo,"message","Wallet and request's blockchain mismatch.");class Wo extends E{}f(Wo,"code",177025),f(Wo,"message","the asset amount owned by the wallet is insufficient for the transaction");class Xo extends E{}f(Xo,"code",177026),f(Xo,"message","Wait for pending transactions to be included on the blockchain before submitting new requests. EVM chains restrict the number of queued transactions per sender address.");class Yo extends E{}f(Yo,"code",177301),f(Yo,"message","wallet is Frozen");class Jo extends E{}f(Jo,"code",177302),f(Jo,"message","invalid sca wallet config");class Zo extends E{}f(Zo,"code",177303),f(Zo,"message","SCA wallet first-time transaction is still in progress");class ec extends E{}f(ec,"code",177304),f(ec,"message","SCA account is not supported on the given blockchain");class tc extends E{}f(tc,"code",177305),f(tc,"message","entity is not eligible for SCA account creation. Please check paymaster policy setup");class ac extends E{}f(ac,"code",177601),f(ac,"message","cannot find target wallet in the system. Either the specified wallet doesn't exist or it's not accessible to the caller");class rc extends E{}f(rc,"code",177602),f(rc,"message","reusing an entity secret ciphertext is not allowed. Please re-encrypt the entity secret to generate new ciphertext");class nc extends E{}f(nc,"code",177603),f(nc,"message","cannot find the corresponding entity in the system");class ic extends E{}f(ic,"code",177604),f(ic,"message","the provided entity secret is invalid");class sc extends E{}f(sc,"code",177605),f(sc,"message","the entity secret has not been set yet. Please provide encrypted ciphertext in the console");class oc extends E{}f(oc,"code",177606),f(oc,"message","current entity secret is invalid. Please rotate the entity secret first");class cc extends E{}f(cc,"code",177607),f(cc,"message","please use a new idempotency key");class lc extends E{}f(lc,"code",177901),f(lc,"message","smart contract query failed");const Vf={undefined:E,[xr.code]:xr,[yr.code]:yr,[br.code]:br,[Er.code]:Er,[Cr.code]:Cr,[Sr.code]:Sr,[Tr.code]:Tr,[wr.code]:wr,[Ar.code]:Ar,[Ir.code]:Ir,[Dr.code]:Dr,[Or.code]:Or,[Fr.code]:Fr,[Mr.code]:Mr,[Vr.code]:Vr,[qr.code]:qr,[jr.code]:jr,[Kr.code]:Kr,[zr.code]:zr,[Hr.code]:Hr,[$r.code]:$r,[Gr.code]:Gr,[Qr.code]:Qr,[Wr.code]:Wr,[Xr.code]:Xr,[Yr.code]:Yr,[Jr.code]:Jr,[Zr.code]:Zr,[en.code]:en,[tn.code]:tn,[an.code]:an,[rn.code]:rn,[nn.code]:nn,[sn.code]:sn,[on.code]:on,[cn.code]:cn,[ln.code]:ln,[un.code]:un,[pn.code]:pn,[dn.code]:dn,[fn.code]:fn,[mn.code]:mn,[hn.code]:hn,[vn.code]:vn,[gn.code]:gn,[xn.code]:xn,[yn.code]:yn,[bn.code]:bn,[En.code]:En,[Cn.code]:Cn,[Sn.code]:Sn,[Tn.code]:Tn,[wn.code]:wn,[An.code]:An,[In.code]:In,[Bn.code]:Bn,[_n.code]:_n,[Rn.code]:Rn,[kn.code]:kn,[Nn.code]:Nn,[Ln.code]:Ln,[Un.code]:Un,[Pn.code]:Pn,[Dn.code]:Dn,[On.code]:On,[Fn.code]:Fn,[Mn.code]:Mn,[Vn.code]:Vn,[qn.code]:qn,[jn.code]:jn,[Kn.code]:Kn,[zn.code]:zn,[Hn.code]:Hn,[$n.code]:$n,[Gn.code]:Gn,[Qn.code]:Qn,[Wn.code]:Wn,[Xn.code]:Xn,[Yn.code]:Yn,[Jn.code]:Jn,[Zn.code]:Zn,[ei.code]:ei,[ti.code]:ti,[ai.code]:ai,[ri.code]:ri,[ni.code]:ni,[ii.code]:ii,[si.code]:si,[oi.code]:oi,[ci.code]:ci,[li.code]:li,[ui.code]:ui,[pi.code]:pi,[di.code]:di,[fi.code]:fi,[mi.code]:mi,[hi.code]:hi,[vi.code]:vi,[gi.code]:gi,[xi.code]:xi,[yi.code]:yi,[bi.code]:bi,[Ei.code]:Ei,[Ci.code]:Ci,[Si.code]:Si,[Ti.code]:Ti,[wi.code]:wi,[Ai.code]:Ai,[Ii.code]:Ii,[Bi.code]:Bi,[_i.code]:_i,[Ri.code]:Ri,[ki.code]:ki,[Ni.code]:Ni,[Li.code]:Li,[Ui.code]:Ui,[Pi.code]:Pi,[Di.code]:Di,[Oi.code]:Oi,[Fi.code]:Fi,[Mi.code]:Mi,[Vi.code]:Vi,[qi.code]:qi,[ji.code]:ji,[Ki.code]:Ki,[zi.code]:zi,[Hi.code]:Hi,[$i.code]:$i,[Gi.code]:Gi,[Qi.code]:Qi,[Wi.code]:Wi,[Xi.code]:Xi,[Yi.code]:Yi,[Ji.code]:Ji,[Zi.code]:Zi,[es.code]:es,[ts.code]:ts,[as.code]:as,[rs.code]:rs,[ns.code]:ns,[is.code]:is,[ss.code]:ss,[os.code]:os,[cs.code]:cs,[ls.code]:ls,[us.code]:us,[ps.code]:ps,[ds.code]:ds,[fs.code]:fs,[ms.code]:ms,[hs.code]:hs,[vs.code]:vs,[gs.code]:gs,[xs.code]:xs,[ys.code]:ys,[bs.code]:bs,[Es.code]:Es,[Cs.code]:Cs,[Ss.code]:Ss,[Ts.code]:Ts,[ws.code]:ws,[As.code]:As,[Is.code]:Is,[Bs.code]:Bs,[_s.code]:_s,[Rs.code]:Rs,[ks.code]:ks,[Ns.code]:Ns,[Ls.code]:Ls,[Us.code]:Us,[Ps.code]:Ps,[Ds.code]:Ds,[Os.code]:Os,[Fs.code]:Fs,[Ms.code]:Ms,[Vs.code]:Vs,[qs.code]:qs,[js.code]:js,[Ks.code]:Ks,[zs.code]:zs,[Hs.code]:Hs,[$s.code]:$s,[Gs.code]:Gs,[Qs.code]:Qs,[Ws.code]:Ws,[Xs.code]:Xs,[Ys.code]:Ys,[Js.code]:Js,[Zs.code]:Zs,[eo.code]:eo,[to.code]:to,[ao.code]:ao,[ro.code]:ro,[no.code]:no,[io.code]:io,[so.code]:so,[oo.code]:oo,[co.code]:co,[lo.code]:lo,[uo.code]:uo,[po.code]:po,[fo.code]:fo,[mo.code]:mo,[ho.code]:ho,[vo.code]:vo,[go.code]:go,[xo.code]:xo,[yo.code]:yo,[bo.code]:bo,[Eo.code]:Eo,[Co.code]:Co,[So.code]:So,[To.code]:To,[wo.code]:wo,[Ao.code]:Ao,[Io.code]:Io,[Bo.code]:Bo,[_o.code]:_o,[Ro.code]:Ro,[ko.code]:ko,[No.code]:No,[Lo.code]:Lo,[Uo.code]:Uo,[Po.code]:Po,[Do.code]:Do,[Oo.code]:Oo,[Fo.code]:Fo,[Mo.code]:Mo,[Vo.code]:Vo,[qo.code]:qo,[jo.code]:jo,[Ko.code]:Ko,[zo.code]:zo,[Ho.code]:Ho,[$o.code]:$o,[Go.code]:Go,[Qo.code]:Qo,[Wo.code]:Wo,[Xo.code]:Xo,[Yo.code]:Yo,[Jo.code]:Jo,[Zo.code]:Zo,[ec.code]:ec,[tc.code]:tc,[ac.code]:ac,[rc.code]:rc,[nc.code]:nc,[ic.code]:ic,[sc.code]:sc,[oc.code]:oc,[cc.code]:cc,[lc.code]:lc};function U1(e){return Vf[e]??Vf.undefined}function P1(e){const t=e.response.data,r=e.response.status;return D1({code:t?.code??r,status:r,message:t?.message,url:e.config.url,method:e.config.method.toUpperCase(),error:e})}function D1({code:e,status:t,message:r,url:a,method:n,error:s}){const i=U1(e);return new i({message:r,code:e,url:a,method:n,status:t,error:s})}function at(e){return e.response?P1(e):R1(e)}const Tt=e=>{const{data:t,headers:r,...a}=e;return{...a,data:t.data,headers:r}},O1=({configurationsClient:e})=>async()=>{try{return Tt(await e.DeveloperAccount.getPublicKey())}catch(t){throw rt(t)?at(t):t}};var F1=Object.defineProperty,M1=(e,t,r)=>t in e?F1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,V1=(e,t,r)=>M1(e,typeof t!="symbol"?t+"":t,r);class q1{constructor(){V1(this,"data",{})}get(t){return Promise.resolve(this.data[t]??void 0)}set(t,r){return r===void 0?delete this.data[t]:this.data[t]=r,Promise.resolve()}}var re={options:{usePureJavaScript:!1}},Nu={},j1=Nu,qf={};Nu.encode=function(e,t,r){if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var a="";if(!(e instanceof Uint8Array))a=K1(e,t);else{var n=0,s=t.length,i=t.charAt(0),o=[0];for(n=0;n<e.length;++n){for(var c=0,l=e[n];c<o.length;++c)l+=o[c]<<8,o[c]=l%s,l=l/s|0;for(;l>0;)o.push(l%s),l=l/s|0}for(n=0;e[n]===0&&n<e.length-1;++n)a+=i;for(n=o.length-1;n>=0;--n)a+=t[o[n]]}if(r){var u=new RegExp(".{1,"+r+"}","g");a=a.match(u).join(`\r
26
- `)}return a},Nu.decode=function(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');var r=qf[t];if(!r){r=qf[t]=[];for(var a=0;a<t.length;++a)r[t.charCodeAt(a)]=a}e=e.replace(/\s/g,"");for(var n=t.length,s=t.charAt(0),i=[0],a=0;a<e.length;a++){var o=r[e.charCodeAt(a)];if(o===void 0)return;for(var c=0,l=o;c<i.length;++c)l+=i[c]*n,i[c]=l&255,l>>=8;for(;l>0;)i.push(l&255),l>>=8}for(var u=0;e[u]===s&&u<e.length-1;++u)i.push(0);return typeof Buffer<"u"?Buffer.from(i.reverse()):new Uint8Array(i.reverse())};function K1(e,t){var r=0,a=t.length,n=t.charAt(0),s=[0];for(r=0;r<e.length();++r){for(var i=0,o=e.at(r);i<s.length;++i)o+=s[i]<<8,s[i]=o%a,o=o/a|0;for(;o>0;)s.push(o%a),o=o/a|0}var c="";for(r=0;e.at(r)===0&&r<e.length()-1;++r)c+=n;for(r=s.length-1;r>=0;--r)c+=t[s[r]];return c}var jf=re,Kf=j1,w=jf.util=jf.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){w.nextTick=process.nextTick,typeof setImmediate=="function"?w.setImmediate=setImmediate:w.setImmediate=w.nextTick;return}if(typeof setImmediate=="function"){w.setImmediate=function(){return setImmediate.apply(void 0,arguments)},w.nextTick=function(i){return setImmediate(i)};return}if(w.setImmediate=function(i){setTimeout(i,0)},typeof window<"u"&&typeof window.postMessage=="function"){let i=function(o){if(o.source===window&&o.data===e){o.stopPropagation();var c=t.slice();t.length=0,c.forEach(function(l){l()})}};var e="forge.setImmediate",t=[];w.setImmediate=function(o){t.push(o),t.length===1&&window.postMessage(e,"*")},window.addEventListener("message",i,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),a=!0,n=document.createElement("div"),t=[];new MutationObserver(function(){var o=t.slice();t.length=0,o.forEach(function(c){c()})}).observe(n,{attributes:!0});var s=w.setImmediate;w.setImmediate=function(o){Date.now()-r>15?(r=Date.now(),s(o)):(t.push(o),t.length===1&&n.setAttribute("a",a=!a))}}w.nextTick=w.setImmediate})(),w.isNodejs=typeof process<"u"&&process.versions&&process.versions.node,w.globalScope=(function(){return w.isNodejs?rh:typeof self>"u"?window:self})(),w.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},w.isArrayBuffer=function(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer},w.isArrayBufferView=function(e){return e&&w.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function uc(e){if(!(e===8||e===16||e===24||e===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}w.ByteBuffer=Lu;function Lu(e){if(this.data="",this.read=0,typeof e=="string")this.data=e;else if(w.isArrayBuffer(e)||w.isArrayBufferView(e))if(typeof Buffer<"u"&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch{for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof Lu||typeof e=="object"&&typeof e.data=="string"&&typeof e.read=="number")&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}w.ByteStringBuffer=Lu;var z1=4096;w.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>z1&&(this.data.substr(0,1),this._constructedStringLength=0)},w.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},w.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},w.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},w.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)t&1&&(r+=e),t>>>=1,t>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},w.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},w.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(w.encodeUtf8(e))},w.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},w.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},w.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(e&255))},w.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))},w.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},w.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},w.ByteStringBuffer.prototype.putInt=function(e,t){uc(t);var r="";do t-=8,r+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(r)},w.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},w.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},w.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},w.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},w.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},w.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},w.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},w.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},w.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},w.ByteStringBuffer.prototype.getInt=function(e){uc(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0);return t},w.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},w.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):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t},w.ByteStringBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},w.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},w.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},w.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},w.ByteStringBuffer.prototype.copy=function(){var e=w.createBuffer(this.data);return e.read=this.read,e},w.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},w.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},w.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},w.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},w.ByteStringBuffer.prototype.toString=function(){return w.decodeUtf8(this.bytes())};function H1(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=w.isArrayBuffer(e),a=w.isArrayBufferView(e);if(r||a){r?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,e!=null&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}w.DataBuffer=H1,w.DataBuffer.prototype.length=function(){return this.write-this.read},w.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},w.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),a=new Uint8Array(this.length()+t);return a.set(r),this.data=new DataView(a.buffer),this},w.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},w.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},w.DataBuffer.prototype.putBytes=function(e,t){if(w.isArrayBufferView(e)){var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=r.byteLength-r.byteOffset;this.accommodate(a);var n=new Uint8Array(this.data.buffer,this.write);return n.set(r),this.write+=a,this}if(w.isArrayBuffer(e)){var r=new Uint8Array(e);this.accommodate(r.byteLength);var n=new Uint8Array(this.data.buffer);return n.set(r,this.write),this.write+=r.byteLength,this}if(e instanceof w.DataBuffer||typeof e=="object"&&typeof e.read=="number"&&typeof e.write=="number"&&w.isArrayBufferView(e.data)){var r=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(r.byteLength);var n=new Uint8Array(e.data.byteLength,this.write);return n.set(r),this.write+=r.byteLength,this}if(e instanceof w.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary",typeof e=="string"){var s;if(t==="hex")return this.accommodate(Math.ceil(e.length/2)),s=new Uint8Array(this.data.buffer,this.write),this.write+=w.binary.hex.decode(e,s,this.write),this;if(t==="base64")return this.accommodate(Math.ceil(e.length/4)*3),s=new Uint8Array(this.data.buffer,this.write),this.write+=w.binary.base64.decode(e,s,this.write),this;if(t==="utf8"&&(e=w.encodeUtf8(e),t="binary"),t==="binary"||t==="raw")return this.accommodate(e.length),s=new Uint8Array(this.data.buffer,this.write),this.write+=w.binary.raw.decode(s),this;if(t==="utf16")return this.accommodate(e.length*2),s=new Uint16Array(this.data.buffer,this.write),this.write+=w.text.utf16.encode(s),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},w.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},w.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},w.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},w.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},w.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},w.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},w.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},w.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},w.DataBuffer.prototype.putInt=function(e,t){uc(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this},w.DataBuffer.prototype.putSignedInt=function(e,t){return uc(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},w.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},w.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},w.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},w.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},w.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},w.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},w.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},w.DataBuffer.prototype.getInt=function(e){uc(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0);return t},w.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},w.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):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t},w.DataBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},w.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},w.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},w.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},w.DataBuffer.prototype.copy=function(){return new w.DataBuffer(this)},w.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},w.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},w.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},w.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},w.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(e=e||"utf8",e==="binary"||e==="raw")return w.binary.raw.encode(t);if(e==="hex")return w.binary.hex.encode(t);if(e==="base64")return w.binary.base64.encode(t);if(e==="utf8")return w.text.utf8.decode(t);if(e==="utf16")return w.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},w.createBuffer=function(e,t){return t=t||"raw",e!==void 0&&t==="utf8"&&(e=w.encodeUtf8(e)),new w.ByteBuffer(e)},w.fillString=function(e,t){for(var r="";t>0;)t&1&&(r+=e),t>>>=1,t>0&&(e+=e);return r},w.xorBytes=function(e,t,r){for(var a="",n="",s="",i=0,o=0;r>0;--r,++i)n=e.charCodeAt(i)^t.charCodeAt(i),o>=10&&(a+=s,s="",o=0),s+=String.fromCharCode(n),++o;return a+=s,a},w.hexToBytes=function(e){var t="",r=0;for(e.length&!0&&(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},w.bytesToHex=function(e){return w.createBuffer(e).toHex()},w.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var ia="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",sa=[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],zf="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";w.encode64=function(e,t){for(var r="",a="",n,s,i,o=0;o<e.length;)n=e.charCodeAt(o++),s=e.charCodeAt(o++),i=e.charCodeAt(o++),r+=ia.charAt(n>>2),r+=ia.charAt((n&3)<<4|s>>4),isNaN(s)?r+="==":(r+=ia.charAt((s&15)<<2|i>>6),r+=isNaN(i)?"=":ia.charAt(i&63)),t&&r.length>t&&(a+=r.substr(0,t)+`\r
27
- `,r=r.substr(t));return a+=r,a},w.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t="",r,a,n,s,i=0;i<e.length;)r=sa[e.charCodeAt(i++)-43],a=sa[e.charCodeAt(i++)-43],n=sa[e.charCodeAt(i++)-43],s=sa[e.charCodeAt(i++)-43],t+=String.fromCharCode(r<<2|a>>4),n!==64&&(t+=String.fromCharCode((a&15)<<4|n>>2),s!==64&&(t+=String.fromCharCode((n&3)<<6|s)));return t},w.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},w.decodeUtf8=function(e){return decodeURIComponent(escape(e))},w.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:Kf.encode,decode:Kf.decode}},w.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},w.binary.raw.decode=function(e,t,r){var a=t;a||(a=new Uint8Array(e.length)),r=r||0;for(var n=r,s=0;s<e.length;++s)a[n++]=e.charCodeAt(s);return t?n-r:a},w.binary.hex.encode=w.bytesToHex,w.binary.hex.decode=function(e,t,r){var a=t;a||(a=new Uint8Array(Math.ceil(e.length/2))),r=r||0;var n=0,s=r;for(e.length&1&&(n=1,a[s++]=parseInt(e[0],16));n<e.length;n+=2)a[s++]=parseInt(e.substr(n,2),16);return t?s-r:a},w.binary.base64.encode=function(e,t){for(var r="",a="",n,s,i,o=0;o<e.byteLength;)n=e[o++],s=e[o++],i=e[o++],r+=ia.charAt(n>>2),r+=ia.charAt((n&3)<<4|s>>4),isNaN(s)?r+="==":(r+=ia.charAt((s&15)<<2|i>>6),r+=isNaN(i)?"=":ia.charAt(i&63)),t&&r.length>t&&(a+=r.substr(0,t)+`\r
28
- `,r=r.substr(t));return a+=r,a},w.binary.base64.decode=function(e,t,r){var a=t;a||(a=new Uint8Array(Math.ceil(e.length/4)*3)),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var n,s,i,o,c=0,l=r;c<e.length;)n=sa[e.charCodeAt(c++)-43],s=sa[e.charCodeAt(c++)-43],i=sa[e.charCodeAt(c++)-43],o=sa[e.charCodeAt(c++)-43],a[l++]=n<<2|s>>4,i!==64&&(a[l++]=(s&15)<<4|i>>2,o!==64&&(a[l++]=(i&3)<<6|o));return t?l-r:a.subarray(0,l)},w.binary.base58.encode=function(e,t){return w.binary.baseN.encode(e,zf,t)},w.binary.base58.decode=function(e,t){return w.binary.baseN.decode(e,zf,t)},w.text={utf8:{},utf16:{}},w.text.utf8.encode=function(e,t,r){e=w.encodeUtf8(e);var a=t;a||(a=new Uint8Array(e.length)),r=r||0;for(var n=r,s=0;s<e.length;++s)a[n++]=e.charCodeAt(s);return t?n-r:a},w.text.utf8.decode=function(e){return w.decodeUtf8(String.fromCharCode.apply(null,e))},w.text.utf16.encode=function(e,t,r){var a=t;a||(a=new Uint8Array(e.length*2));var n=new Uint16Array(a.buffer);r=r||0;for(var s=r,i=r,o=0;o<e.length;++o)n[i++]=e.charCodeAt(o),s+=2;return t?s-r:a},w.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},w.deflate=function(e,t,r){if(t=w.decode64(e.deflate(w.encode64(t)).rval),r){var a=2,n=t.charCodeAt(1);n&32&&(a=6),t=t.substring(a,t.length-4)}return t},w.inflate=function(e,t,r){var a=e.inflate(w.encode64(t)).rval;return a===null?null:w.decode64(a)};var Uu=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var a;if(r===null?a=e.removeItem(t):(r=w.encode64(JSON.stringify(r)),a=e.setItem(t,r)),typeof a<"u"&&a.rval!==!0){var n=new Error(a.error.message);throw n.id=a.error.id,n.name=a.error.name,n}},Pu=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(r.rval===null){if(r.error){var a=new Error(r.error.message);throw a.id=r.error.id,a.name=r.error.name,a}r=null}else r=r.rval;return r!==null&&(r=JSON.parse(w.decode64(r))),r},$1=function(e,t,r,a){var n=Pu(e,t);n===null&&(n={}),n[r]=a,Uu(e,t,n)},G1=function(e,t,r){var a=Pu(e,t);return a!==null&&(a=r in a?a[r]:null),a},Q1=function(e,t,r){var a=Pu(e,t);if(a!==null&&r in a){delete a[r];var n=!0;for(var s in a){n=!1;break}n&&(a=null),Uu(e,t,a)}},W1=function(e,t){Uu(e,t,null)},Wc=function(e,t,r){var a=null;typeof r>"u"&&(r=["web","flash"]);var n,s=!1,i=null;for(var o in r){n=r[o];try{if(n==="flash"||n==="both"){if(t[0]===null)throw new Error("Flash local storage not available.");a=e.apply(this,t),s=n==="flash"}(n==="web"||n==="both")&&(t[0]=localStorage,a=e.apply(this,t),s=!0)}catch(c){i=c}if(s)break}if(!s)throw i;return a};w.setItem=function(e,t,r,a,n){Wc($1,arguments,n)},w.getItem=function(e,t,r,a){return Wc(G1,arguments,a)},w.removeItem=function(e,t,r,a){Wc(Q1,arguments,a)},w.clearItems=function(e,t,r){Wc(W1,arguments,r)},w.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},w.format=function(e){for(var t=/%./g,r,a,n=0,s=[],i=0;r=t.exec(e);){a=e.substring(i,t.lastIndex-2),a.length>0&&s.push(a),i=t.lastIndex;var o=r[0][1];switch(o){case"s":case"o":n<arguments.length?s.push(arguments[n+++1]):s.push("<?>");break;case"%":s.push("%");break;default:s.push("<%"+o+"?>")}}return s.push(e.substring(i)),s.join("")},w.formatNumber=function(e,t,r,a){var n=e,s=isNaN(t=Math.abs(t))?2:t,i=r===void 0?",":r,o=a===void 0?".":a,c=n<0?"-":"",l=parseInt(n=Math.abs(+n||0).toFixed(s),10)+"",u=l.length>3?l.length%3:0;return c+(u?l.substr(0,u)+o:"")+l.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+o)+(s?i+Math.abs(n-l).toFixed(s).slice(2):"")},w.formatSize=function(e){return e>=1073741824?e=w.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?e=w.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?e=w.formatNumber(e/1024,0)+" KiB":e=w.formatNumber(e,0)+" bytes",e},w.bytesFromIP=function(e){return e.indexOf(".")!==-1?w.bytesFromIPv4(e):e.indexOf(":")!==-1?w.bytesFromIPv6(e):null},w.bytesFromIPv4=function(e){if(e=e.split("."),e.length!==4)return null;for(var t=w.createBuffer(),r=0;r<e.length;++r){var a=parseInt(e[r],10);if(isNaN(a))return null;t.putByte(a)}return t.getBytes()},w.bytesFromIPv6=function(e){var t=0;e=e.split(":").filter(function(i){return i.length===0&&++t,!0});for(var r=(8-e.length+t)*2,a=w.createBuffer(),n=0;n<8;++n){if(!e[n]||e[n].length===0){a.fillWithByte(0,r),r=0;continue}var s=w.hexToBytes(e[n]);s.length<2&&a.putByte(0),a.putBytes(s)}return a.getBytes()},w.bytesToIP=function(e){return e.length===4?w.bytesToIPv4(e):e.length===16?w.bytesToIPv6(e):null},w.bytesToIPv4=function(e){if(e.length!==4)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},w.bytesToIPv6=function(e){if(e.length!==16)return null;for(var t=[],r=[],a=0,n=0;n<e.length;n+=2){for(var s=w.bytesToHex(e[n]+e[n+1]);s[0]==="0"&&s!=="0";)s=s.substr(1);if(s==="0"){var i=r[r.length-1],o=t.length;!i||o!==i.end+1?r.push({start:o,end:o}):(i.end=o,i.end-i.start>r[a].end-r[a].start&&(a=r.length-1))}t.push(s)}if(r.length>0){var c=r[a];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),c.start===0&&t.unshift(""),c.end===7&&t.push(""))}return t.join(":")},w.estimateCores=function(e,t){if(typeof e=="function"&&(t=e,e={}),e=e||{},"cores"in w&&!e.update)return t(null,w.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return w.cores=navigator.hardwareConcurrency,t(null,w.cores);if(typeof Worker>"u")return w.cores=1,t(null,w.cores);if(typeof Blob>"u")return w.cores=2,t(null,w.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(i){var o=Date.now(),c=o+4;self.postMessage({st:o,et:c})})}.toString(),")()"],{type:"application/javascript"}));a([],5,16);function a(i,o,c){if(o===0){var l=Math.floor(i.reduce(function(u,p){return u+p},0)/i.length);return w.cores=Math.max(1,l),URL.revokeObjectURL(r),t(null,w.cores)}n(c,function(u,p){i.push(s(c,p)),a(i,o-1,c)})}function n(i,o){for(var c=[],l=[],u=0;u<i;++u){var p=new Worker(r);p.addEventListener("message",function(d){if(l.push(d.data),l.length===i){for(var x=0;x<i;++x)c[x].terminate();o(null,l)}}),c.push(p)}for(var u=0;u<i;++u)c[u].postMessage(u)}function s(i,o){for(var c=[],l=0;l<i;++l)for(var u=o[l],p=c[l]=[],d=0;d<i;++d)if(l!==d){var x=o[d];(u.st>x.st&&u.st<x.et||x.st>u.st&&x.st<u.et)&&p.push(d)}return c.reduce(function(m,y){return Math.max(m,y.length)},0)}};var He=re;He.cipher=He.cipher||{},He.cipher.algorithms=He.cipher.algorithms||{},He.cipher.createCipher=function(e,t){var r=e;if(typeof r=="string"&&(r=He.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+e);return new He.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},He.cipher.createDecipher=function(e,t){var r=e;if(typeof r=="string"&&(r=He.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+e);return new He.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},He.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),He.cipher.algorithms[e]=t},He.cipher.getAlgorithm=function(e){return e=e.toUpperCase(),e in He.cipher.algorithms?He.cipher.algorithms[e]:null};var Du=He.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)};Du.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=He.util.createBuffer(),this.output=e.output||He.util.createBuffer(),this.mode.start(t)},Du.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()},Du.prototype.finish=function(e){e&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return e(this.blockSize,r,!1)},this.mode.unpad=function(r){return e(this.blockSize,r,!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))};var $e=re;$e.cipher=$e.cipher||{};var ce=$e.cipher.modes=$e.cipher.modes||{};ce.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)},ce.ecb.prototype.start=function(e){},ce.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a])},ce.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a])},ce.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},ce.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),a=e.at(r-1);return a>this.blockSize<<2?!1:(e.truncate(a),!0)},ce.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)},ce.cbc.prototype.start=function(e){if(e.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in e)this._iv=Xc(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")},ce.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=this._prev[a]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]);this._prev=this._outBlock},ce.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._prev[a]^this._outBlock[a]);this._prev=this._inBlock.slice(0)},ce.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},ce.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),a=e.at(r-1);return a>this.blockSize<<2?!1:(e.truncate(a),!0)},ce.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=$e.util.createBuffer(),this._partialBytes=0},ce.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Xc(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},ce.cfb.prototype.encrypt=function(e,t,r){var a=e.length();if(a===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&a>=this.blockSize){for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32()^this._outBlock[n],t.putInt32(this._inBlock[n]);return}var s=(this.blockSize-a)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialBlock[n]=e.getInt32()^this._outBlock[n],this._partialOutput.putInt32(this._partialBlock[n]);if(s>0)e.read-=this.blockSize;else for(var n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0},ce.cfb.prototype.decrypt=function(e,t,r){var a=e.length();if(a===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&a>=this.blockSize){for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32(),t.putInt32(this._inBlock[n]^this._outBlock[n]);return}var s=(this.blockSize-a)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialBlock[n]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[n]^this._outBlock[n]);if(s>0)e.read-=this.blockSize;else for(var n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0},ce.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=$e.util.createBuffer(),this._partialBytes=0},ce.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Xc(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},ce.ofb.prototype.encrypt=function(e,t,r){var a=e.length();if(e.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&a>=this.blockSize){for(var n=0;n<this._ints;++n)t.putInt32(e.getInt32()^this._outBlock[n]),this._inBlock[n]=this._outBlock[n];return}var s=(this.blockSize-a)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(s>0)e.read-=this.blockSize;else for(var n=0;n<this._ints;++n)this._inBlock[n]=this._outBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0},ce.ofb.prototype.decrypt=ce.ofb.prototype.encrypt,ce.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=$e.util.createBuffer(),this._partialBytes=0},ce.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Xc(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},ce.ctr.prototype.encrypt=function(e,t,r){var a=e.length();if(a===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&a>=this.blockSize)for(var n=0;n<this._ints;++n)t.putInt32(e.getInt32()^this._outBlock[n]);else{var s=(this.blockSize-a)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);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(a-this._partialBytes)),this._partialBytes=0}Yc(this._inBlock)},ce.ctr.prototype.decrypt=ce.ctr.prototype.encrypt,ce.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=$e.util.createBuffer(),this._partialBytes=0,this._R=3774873600},ce.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=$e.util.createBuffer(e.iv);this._cipherLength=0;var r;if("additionalData"in e?r=$e.util.createBuffer(e.additionalData):r=$e.util.createBuffer(),"tagLength"in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=$e.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 a=t.length();if(a===12)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(Ou(a*8)))}this._inBlock=this._j0.slice(0),Yc(this._inBlock),this._partialBytes=0,r=$e.util.createBuffer(r),this._aDataLength=Ou(r.length()*8);var n=r.length()%this.blockSize;for(n&&r.fillWithByte(0,this.blockSize-n),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()])},ce.gcm.prototype.encrypt=function(e,t,r){var a=e.length();if(a===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&a>=this.blockSize){for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]^=e.getInt32());this._cipherLength+=this.blockSize}else{var s=(this.blockSize-a)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(s<=0||r){if(r){var i=a%this.blockSize;this._cipherLength+=i,this._partialOutput.truncate(this.blockSize-i)}else this._cipherLength+=this.blockSize;for(var n=0;n<this._ints;++n)this._outBlock[n]=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(a-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Yc(this._inBlock)},ce.gcm.prototype.decrypt=function(e,t,r){var a=e.length();if(a<this.blockSize&&!(r&&a>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Yc(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 n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]^this._hashBlock[n]);a<this.blockSize?this._cipherLength+=a%this.blockSize:this._cipherLength+=this.blockSize},ce.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=$e.util.createBuffer();var a=this._aDataLength.concat(Ou(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,a);var n=[];this.cipher.encrypt(this._j0,n);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^n[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},ce.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],a=t.slice(0),n=0;n<128;++n){var s=e[n/32|0]&1<<31-n%32;s&&(r[0]^=a[0],r[1]^=a[1],r[2]^=a[2],r[3]^=a[3]),this.pow(a,a)}return r},ce.gcm.prototype.pow=function(e,t){for(var r=e[3]&1,a=3;a>0;--a)t[a]=e[a]>>>1|(e[a-1]&1)<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},ce.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var a=r/8|0,n=e[a]>>>(7-r%8)*4&15,s=this._m[r][n];t[0]^=s[0],t[1]^=s[1],t[2]^=s[2],t[3]^=s[3]}return t},ce.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)},ce.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,a=4*r,n=16*r,s=new Array(n),i=0;i<n;++i){var o=[0,0,0,0],c=i/a|0,l=(a-1-i%a)*t;o[c]=1<<t-1<<l,s[i]=this.generateSubHashTable(this.multiply(o,e),t)}return s},ce.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,a=r>>>1,n=new Array(r);n[a]=e.slice(0);for(var s=a>>>1;s>0;)this.pow(n[2*s],n[s]=[]),s>>=1;for(s=2;s<a;){for(var i=1;i<s;++i){var o=n[s],c=n[i];n[s+i]=[o[0]^c[0],o[1]^c[1],o[2]^c[2],o[3]^c[3]]}s*=2}for(n[0]=[0,0,0,0],s=a+1;s<r;++s){var l=n[s^a];n[s]=[e[0]^l[0],e[1]^l[1],e[2]^l[2],e[3]^l[3]]}return n};function Xc(e,t){if(typeof e=="string"&&(e=$e.util.createBuffer(e)),$e.util.isArray(e)&&e.length>4){var r=e;e=$e.util.createBuffer();for(var a=0;a<r.length;++a)e.putByte(r[a])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!$e.util.isArray(e)){for(var n=[],s=t/4,a=0;a<s;++a)n.push(e.getInt32());e=n}return e}function Yc(e){e[e.length-1]=e[e.length-1]+1&4294967295}function Ou(e){return[e/4294967296|0,e&4294967295]}var Ie=re;Ie.aes=Ie.aes||{},Ie.aes.startEncrypting=function(e,t,r,a){var n=Jc({key:e,output:r,decrypt:!1,mode:a});return n.start(t),n},Ie.aes.createEncryptionCipher=function(e,t){return Jc({key:e,output:null,decrypt:!1,mode:t})},Ie.aes.startDecrypting=function(e,t,r,a){var n=Jc({key:e,output:r,decrypt:!0,mode:a});return n.start(t),n},Ie.aes.createDecryptionCipher=function(e,t){return Jc({key:e,output:null,decrypt:!0,mode:t})},Ie.aes.Algorithm=function(e,t){Fu||$f();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(a,n){return Vu(r._w,a,n,!1)},decrypt:function(a,n){return Vu(r._w,a,n,!0)}}}),r._init=!1},Ie.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,r;if(typeof t=="string"&&(t.length===16||t.length===24||t.length===32))t=Ie.util.createBuffer(t);else if(Ie.util.isArray(t)&&(t.length===16||t.length===24||t.length===32)){r=t,t=Ie.util.createBuffer();for(var a=0;a<r.length;++a)t.putByte(r[a])}if(!Ie.util.isArray(t)){r=t,t=[];var n=r.length();if(n===16||n===24||n===32){n=n>>>2;for(var a=0;a<n;++a)t.push(r.getInt32())}}if(!Ie.util.isArray(t)||!(t.length===4||t.length===6||t.length===8))throw new Error("Invalid key parameter.");var s=this.mode.name,i=["CFB","OFB","CTR","GCM"].indexOf(s)!==-1;this._w=Gf(t,e.decrypt&&!i),this._init=!0}},Ie.aes._expandKey=function(e,t){return Fu||$f(),Gf(e,t)},Ie.aes._updateBlock=Vu,Ka("AES-ECB",Ie.cipher.modes.ecb),Ka("AES-CBC",Ie.cipher.modes.cbc),Ka("AES-CFB",Ie.cipher.modes.cfb),Ka("AES-OFB",Ie.cipher.modes.ofb),Ka("AES-CTR",Ie.cipher.modes.ctr),Ka("AES-GCM",Ie.cipher.modes.gcm);function Ka(e,t){var r=function(){return new Ie.aes.Algorithm(e,t)};Ie.cipher.registerAlgorithm(e,r)}var Fu=!1,za=4,ut,Mu,Hf,wa,Mt;function $f(){Fu=!0,Hf=[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;ut=new Array(256),Mu=new Array(256),wa=new Array(4),Mt=new Array(4);for(var t=0;t<4;++t)wa[t]=new Array(256),Mt[t]=new Array(256);for(var r=0,a=0,n,s,i,o,c,l,u,t=0;t<256;++t){o=a^a<<1^a<<2^a<<3^a<<4,o=o>>8^o&255^99,ut[r]=o,Mu[o]=r,c=e[o],n=e[r],s=e[n],i=e[s],l=c<<24^o<<16^o<<8^(o^c),u=(n^s^i)<<24^(r^i)<<16^(r^s^i)<<8^(r^n^i);for(var p=0;p<4;++p)wa[p][r]=l,Mt[p][o]=u,l=l<<24|l>>>8,u=u<<24|u>>>8;r===0?r=a=1:(r=n^e[e[e[n^i]]],a^=e[e[a]])}}function Gf(e,t){for(var r=e.slice(0),a,n=1,s=r.length,i=s+6+1,o=za*i,c=s;c<o;++c)a=r[c-1],c%s===0?(a=ut[a>>>16&255]<<24^ut[a>>>8&255]<<16^ut[a&255]<<8^ut[a>>>24]^Hf[n]<<24,n++):s>6&&c%s===4&&(a=ut[a>>>24]<<24^ut[a>>>16&255]<<16^ut[a>>>8&255]<<8^ut[a&255]),r[c]=r[c-s]^a;if(t){var l,u=Mt[0],p=Mt[1],d=Mt[2],x=Mt[3],m=r.slice(0);o=r.length;for(var c=0,y=o-za;c<o;c+=za,y-=za)if(c===0||c===o-za)m[c]=r[y],m[c+1]=r[y+3],m[c+2]=r[y+2],m[c+3]=r[y+1];else for(var b=0;b<za;++b)l=r[y+b],m[c+(3&-b)]=u[ut[l>>>24]]^p[ut[l>>>16&255]]^d[ut[l>>>8&255]]^x[ut[l&255]];r=m}return r}function Vu(e,t,r,a){var n=e.length/4-1,s,i,o,c,l;a?(s=Mt[0],i=Mt[1],o=Mt[2],c=Mt[3],l=Mu):(s=wa[0],i=wa[1],o=wa[2],c=wa[3],l=ut);var u,p,d,x,m,y,b;u=t[0]^e[0],p=t[a?3:1]^e[1],d=t[2]^e[2],x=t[a?1:3]^e[3];for(var C=3,B=1;B<n;++B)m=s[u>>>24]^i[p>>>16&255]^o[d>>>8&255]^c[x&255]^e[++C],y=s[p>>>24]^i[d>>>16&255]^o[x>>>8&255]^c[u&255]^e[++C],b=s[d>>>24]^i[x>>>16&255]^o[u>>>8&255]^c[p&255]^e[++C],x=s[x>>>24]^i[u>>>16&255]^o[p>>>8&255]^c[d&255]^e[++C],u=m,p=y,d=b;r[0]=l[u>>>24]<<24^l[p>>>16&255]<<16^l[d>>>8&255]<<8^l[x&255]^e[++C],r[a?3:1]=l[p>>>24]<<24^l[d>>>16&255]<<16^l[x>>>8&255]<<8^l[u&255]^e[++C],r[2]=l[d>>>24]<<24^l[x>>>16&255]<<16^l[u>>>8&255]<<8^l[p&255]^e[++C],r[a?1:3]=l[x>>>24]<<24^l[u>>>16&255]<<16^l[p>>>8&255]<<8^l[d&255]^e[++C]}function Jc(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),r="AES-"+t,a;e.decrypt?a=Ie.cipher.createDecipher(r,e.key):a=Ie.cipher.createCipher(r,e.key);var n=a.start;return a.start=function(s,i){var o=null;i instanceof Ie.util.ByteBuffer&&(o=i,i={}),i=i||{},i.output=o,i.iv=s,n.call(a,i)},a}var pc=re;pc.pki=pc.pki||{};var qu=pc.pki.oids=pc.oids=pc.oids||{};function P(e,t){qu[e]=t,qu[t]=e}function Se(e,t){qu[e]=t}P("1.2.840.113549.1.1.1","rsaEncryption"),P("1.2.840.113549.1.1.4","md5WithRSAEncryption"),P("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),P("1.2.840.113549.1.1.7","RSAES-OAEP"),P("1.2.840.113549.1.1.8","mgf1"),P("1.2.840.113549.1.1.9","pSpecified"),P("1.2.840.113549.1.1.10","RSASSA-PSS"),P("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),P("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),P("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),P("1.3.101.112","EdDSA25519"),P("1.2.840.10040.4.3","dsa-with-sha1"),P("1.3.14.3.2.7","desCBC"),P("1.3.14.3.2.26","sha1"),P("1.3.14.3.2.29","sha1WithRSASignature"),P("2.16.840.1.101.3.4.2.1","sha256"),P("2.16.840.1.101.3.4.2.2","sha384"),P("2.16.840.1.101.3.4.2.3","sha512"),P("2.16.840.1.101.3.4.2.4","sha224"),P("2.16.840.1.101.3.4.2.5","sha512-224"),P("2.16.840.1.101.3.4.2.6","sha512-256"),P("1.2.840.113549.2.2","md2"),P("1.2.840.113549.2.5","md5"),P("1.2.840.113549.1.7.1","data"),P("1.2.840.113549.1.7.2","signedData"),P("1.2.840.113549.1.7.3","envelopedData"),P("1.2.840.113549.1.7.4","signedAndEnvelopedData"),P("1.2.840.113549.1.7.5","digestedData"),P("1.2.840.113549.1.7.6","encryptedData"),P("1.2.840.113549.1.9.1","emailAddress"),P("1.2.840.113549.1.9.2","unstructuredName"),P("1.2.840.113549.1.9.3","contentType"),P("1.2.840.113549.1.9.4","messageDigest"),P("1.2.840.113549.1.9.5","signingTime"),P("1.2.840.113549.1.9.6","counterSignature"),P("1.2.840.113549.1.9.7","challengePassword"),P("1.2.840.113549.1.9.8","unstructuredAddress"),P("1.2.840.113549.1.9.14","extensionRequest"),P("1.2.840.113549.1.9.20","friendlyName"),P("1.2.840.113549.1.9.21","localKeyId"),P("1.2.840.113549.1.9.22.1","x509Certificate"),P("1.2.840.113549.1.12.10.1.1","keyBag"),P("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),P("1.2.840.113549.1.12.10.1.3","certBag"),P("1.2.840.113549.1.12.10.1.4","crlBag"),P("1.2.840.113549.1.12.10.1.5","secretBag"),P("1.2.840.113549.1.12.10.1.6","safeContentsBag"),P("1.2.840.113549.1.5.13","pkcs5PBES2"),P("1.2.840.113549.1.5.12","pkcs5PBKDF2"),P("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),P("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),P("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),P("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),P("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),P("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),P("1.2.840.113549.2.7","hmacWithSHA1"),P("1.2.840.113549.2.8","hmacWithSHA224"),P("1.2.840.113549.2.9","hmacWithSHA256"),P("1.2.840.113549.2.10","hmacWithSHA384"),P("1.2.840.113549.2.11","hmacWithSHA512"),P("1.2.840.113549.3.7","des-EDE3-CBC"),P("2.16.840.1.101.3.4.1.2","aes128-CBC"),P("2.16.840.1.101.3.4.1.22","aes192-CBC"),P("2.16.840.1.101.3.4.1.42","aes256-CBC"),P("2.5.4.3","commonName"),P("2.5.4.4","surname"),P("2.5.4.5","serialNumber"),P("2.5.4.6","countryName"),P("2.5.4.7","localityName"),P("2.5.4.8","stateOrProvinceName"),P("2.5.4.9","streetAddress"),P("2.5.4.10","organizationName"),P("2.5.4.11","organizationalUnitName"),P("2.5.4.12","title"),P("2.5.4.13","description"),P("2.5.4.15","businessCategory"),P("2.5.4.17","postalCode"),P("2.5.4.42","givenName"),P("2.5.4.65","pseudonym"),P("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),P("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),P("2.16.840.1.113730.1.1","nsCertType"),P("2.16.840.1.113730.1.13","nsComment"),Se("2.5.29.1","authorityKeyIdentifier"),Se("2.5.29.2","keyAttributes"),Se("2.5.29.3","certificatePolicies"),Se("2.5.29.4","keyUsageRestriction"),Se("2.5.29.5","policyMapping"),Se("2.5.29.6","subtreesConstraint"),Se("2.5.29.7","subjectAltName"),Se("2.5.29.8","issuerAltName"),Se("2.5.29.9","subjectDirectoryAttributes"),Se("2.5.29.10","basicConstraints"),Se("2.5.29.11","nameConstraints"),Se("2.5.29.12","policyConstraints"),Se("2.5.29.13","basicConstraints"),P("2.5.29.14","subjectKeyIdentifier"),P("2.5.29.15","keyUsage"),Se("2.5.29.16","privateKeyUsagePeriod"),P("2.5.29.17","subjectAltName"),P("2.5.29.18","issuerAltName"),P("2.5.29.19","basicConstraints"),Se("2.5.29.20","cRLNumber"),Se("2.5.29.21","cRLReason"),Se("2.5.29.22","expirationDate"),Se("2.5.29.23","instructionCode"),Se("2.5.29.24","invalidityDate"),Se("2.5.29.25","cRLDistributionPoints"),Se("2.5.29.26","issuingDistributionPoint"),Se("2.5.29.27","deltaCRLIndicator"),Se("2.5.29.28","issuingDistributionPoint"),Se("2.5.29.29","certificateIssuer"),Se("2.5.29.30","nameConstraints"),P("2.5.29.31","cRLDistributionPoints"),P("2.5.29.32","certificatePolicies"),Se("2.5.29.33","policyMappings"),Se("2.5.29.34","policyConstraints"),P("2.5.29.35","authorityKeyIdentifier"),Se("2.5.29.36","policyConstraints"),P("2.5.29.37","extKeyUsage"),Se("2.5.29.46","freshestCRL"),Se("2.5.29.54","inhibitAnyPolicy"),P("1.3.6.1.4.1.11129.2.4.2","timestampList"),P("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),P("1.3.6.1.5.5.7.3.1","serverAuth"),P("1.3.6.1.5.5.7.3.2","clientAuth"),P("1.3.6.1.5.5.7.3.3","codeSigning"),P("1.3.6.1.5.5.7.3.4","emailProtection"),P("1.3.6.1.5.5.7.3.8","timeStamping");var Re=re,j=Re.asn1=Re.asn1||{};j.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},j.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},j.maxDepth=256,j.create=function(e,t,r,a,n){if(Re.util.isArray(a)){for(var s=[],i=0;i<a.length;++i)a[i]!==void 0&&s.push(a[i]);a=s}var o={tagClass:e,type:t,constructed:r,composed:r||Re.util.isArray(a),value:a};return n&&"bitStringContents"in n&&(o.bitStringContents=n.bitStringContents,o.original=j.copy(o)),o},j.copy=function(e,t){var r;if(Re.util.isArray(e)){r=[];for(var a=0;a<e.length;++a)r.push(j.copy(e[a],t));return r}return typeof e=="string"?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:j.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},j.equals=function(e,t,r){if(Re.util.isArray(e)){if(!Re.util.isArray(t)||e.length!==t.length)return!1;for(var a=0;a<e.length;++a)if(!j.equals(e[a],t[a]))return!1;return!0}if(typeof e!=typeof t)return!1;if(typeof e=="string")return e===t;var n=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&j.equals(e.value,t.value);return r&&r.includeBitStringContents&&(n=n&&e.bitStringContents===t.bitStringContents),n},j.getBerValueLength=function(e){var t=e.getByte();if(t!==128){var r,a=t&128;return a?r=e.getInt((t&127)<<3):r=t,r}};function dc(e,t,r){if(r>t){var a=new Error("Too few bytes to parse DER.");throw a.available=e.length(),a.remaining=t,a.requested=r,a}}var X1=function(e,t){var r=e.getByte();if(t--,r!==128){var a,n=r&128;if(!n)a=r;else{var s=r&127;dc(e,t,s),a=e.getInt(s<<3)}if(a<0)throw new Error("Negative length: "+a);return a}};j.fromDer=function(e,t){t===void 0&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof t=="boolean"&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"maxDepth"in t||(t.maxDepth=j.maxDepth),typeof e=="string"&&(e=Re.util.createBuffer(e));var r=e.length(),a=Zc(e,e.length(),0,t);if(t.parseAllBytes&&e.length()!==0){var n=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw n.byteCount=r,n.remaining=e.length(),n}return a};function Zc(e,t,r,a){if(r>=a.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var n;dc(e,t,2);var s=e.getByte();t--;var i=s&192,o=s&31;n=e.length();var c=X1(e,t);if(t-=n-e.length(),c!==void 0&&c>t){if(a.strict){var l=new Error("Too few bytes to read ASN.1 value.");throw l.available=e.length(),l.remaining=t,l.requested=c,l}c=t}var u,p,d=(s&32)===32;if(d)if(u=[],c===void 0)for(;;){if(dc(e,t,2),e.bytes(2)==="\0\0"){e.getBytes(2),t-=2;break}n=e.length(),u.push(Zc(e,t,r+1,a)),t-=n-e.length()}else for(;c>0;)n=e.length(),u.push(Zc(e,c,r+1,a)),t-=n-e.length(),c-=n-e.length();if(u===void 0&&i===j.Class.UNIVERSAL&&o===j.Type.BITSTRING&&(p=e.bytes(c)),u===void 0&&a.decodeBitStrings&&i===j.Class.UNIVERSAL&&o===j.Type.BITSTRING&&c>1){var x=e.read,m=t,y=0;if(o===j.Type.BITSTRING&&(dc(e,t,1),y=e.getByte(),t--),y===0)try{n=e.length();var b={strict:!0,decodeBitStrings:!0},C=Zc(e,t,r+1,b),B=n-e.length();t-=B,o==j.Type.BITSTRING&&B++;var _=C.tagClass;B===c&&(_===j.Class.UNIVERSAL||_===j.Class.CONTEXT_SPECIFIC)&&(u=[C])}catch{}u===void 0&&(e.read=x,t=m)}if(u===void 0){if(c===void 0){if(a.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=t}if(o===j.Type.BMPSTRING)for(u="";c>0;c-=2)dc(e,t,2),u+=String.fromCharCode(e.getInt16()),t-=2;else u=e.getBytes(c),t-=c}var k=p===void 0?null:{bitStringContents:p};return j.create(i,o,d,u,k)}j.toDer=function(e){var t=Re.util.createBuffer(),r=e.tagClass|e.type,a=Re.util.createBuffer(),n=!1;if("bitStringContents"in e&&(n=!0,e.original&&(n=j.equals(e,e.original))),n)a.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:a.putByte(0);for(var s=0;s<e.value.length;++s)e.value[s]!==void 0&&a.putBuffer(j.toDer(e.value[s]))}else if(e.type===j.Type.BMPSTRING)for(var s=0;s<e.value.length;++s)a.putInt16(e.value.charCodeAt(s));else e.type===j.Type.INTEGER&&e.value.length>1&&(e.value.charCodeAt(0)===0&&(e.value.charCodeAt(1)&128)===0||e.value.charCodeAt(0)===255&&(e.value.charCodeAt(1)&128)===128)?a.putBytes(e.value.substr(1)):a.putBytes(e.value);if(t.putByte(r),a.length()<=127)t.putByte(a.length()&127);else{var i=a.length(),o="";do o+=String.fromCharCode(i&255),i=i>>>8;while(i>0);t.putByte(o.length|128);for(var s=o.length-1;s>=0;--s)t.putByte(o.charCodeAt(s))}return t.putBuffer(a),t},j.oidToDer=function(e){var t=e.split("."),r=Re.util.createBuffer();r.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var a,n,s,i,o=2;o<t.length;++o){if(a=!0,n=[],s=parseInt(t[o],10),s>4294967295)throw new Error("OID value too large; max is 32-bits.");do i=s&127,s=s>>>7,a||(i|=128),n.push(i),a=!1;while(s>0);for(var c=n.length-1;c>=0;--c)r.putByte(n[c])}return r},j.derToOid=function(e){var t;typeof e=="string"&&(e=Re.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var a=0;e.length()>0;){if(a>70368744177663)throw new Error("OID value too large; max is 53-bits.");r=e.getByte(),a=a*128,r&128?a+=r&127:(t+="."+(a+r),a=0)}return t},j.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var a=parseInt(e.substr(2,2),10)-1,n=parseInt(e.substr(4,2),10),s=parseInt(e.substr(6,2),10),i=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),l=10;c!=="+"&&c!=="-"&&(o=parseInt(e.substr(10,2),10),l+=2)}if(t.setUTCFullYear(r,a,n),t.setUTCHours(s,i,o,0),l&&(c=e.charAt(l),c==="+"||c==="-")){var u=parseInt(e.substr(l+1,2),10),p=parseInt(e.substr(l+4,2),10),d=u*60+p;d*=6e4,c==="+"?t.setTime(+t-d):t.setTime(+t+d)}return t},j.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),a=parseInt(e.substr(4,2),10)-1,n=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),i=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),c=0,l=0,u=!1;e.charAt(e.length-1)==="Z"&&(u=!0);var p=e.length-5,d=e.charAt(p);if(d==="+"||d==="-"){var x=parseInt(e.substr(p+1,2),10),m=parseInt(e.substr(p+4,2),10);l=x*60+m,l*=6e4,d==="+"&&(l*=-1),u=!0}return e.charAt(14)==="."&&(c=parseFloat(e.substr(14),10)*1e3),u?(t.setUTCFullYear(r,a,n),t.setUTCHours(s,i,o,c),t.setTime(+t+l)):(t.setFullYear(r,a,n),t.setHours(s,i,o,c)),t},j.dateToUtcTime=function(e){if(typeof e=="string")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 a=0;a<r.length;++a)r[a].length<2&&(t+="0"),t+=r[a];return t+="Z",t},j.dateToGeneralizedTime=function(e){if(typeof e=="string")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 a=0;a<r.length;++a)r[a].length<2&&(t+="0"),t+=r[a];return t+="Z",t},j.integerToDer=function(e){var t=Re.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},j.derToInteger=function(e){typeof e=="string"&&(e=Re.util.createBuffer(e));var t=e.length()*8;if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},j.validate=function(e,t,r,a){var n=!1;if((e.tagClass===t.tagClass||typeof t.tagClass>"u")&&(e.type===t.type||typeof t.type>"u"))if(e.constructed===t.constructed||typeof t.constructed>"u"){if(n=!0,t.value&&Re.util.isArray(t.value))for(var s=0,i=0;n&&i<t.value.length;++i){var o=t.value[i];n=!!o.optional;var c=e.value[s];if(!c){o.optional||(n=!1,a&&a.push("["+t.name+'] Missing required element. Expected tag class "'+o.tagClass+'", type "'+o.type+'"'));continue}var l=typeof o.tagClass<"u"&&typeof o.type<"u";if(l&&(c.tagClass!==o.tagClass||c.type!==o.type))if(o.optional){n=!0;continue}else{n=!1,a&&a.push("["+t.name+"] Tag mismatch. Expected ("+o.tagClass+","+o.type+"), got ("+c.tagClass+","+c.type+")");break}var u=j.validate(c,o,r,a);if(u)++s,n=!0;else if(o.optional)n=!0;else{n=!1;break}}if(n&&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 p=e.bitStringContents.charCodeAt(0);if(p!==0)throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else a&&a.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');else a&&(e.tagClass!==t.tagClass&&a.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&a.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));return n};var Qf=/[^\\u0000-\\u00ff]/;j.prettyPrint=function(e,t,r){var a="";t=t||0,r=r||2,t>0&&(a+=`
29
- `);for(var n="",s=0;s<t*r;++s)n+=" ";switch(a+=n+"Tag: ",e.tagClass){case j.Class.UNIVERSAL:a+="Universal:";break;case j.Class.APPLICATION:a+="Application:";break;case j.Class.CONTEXT_SPECIFIC:a+="Context-Specific:";break;case j.Class.PRIVATE:a+="Private:";break}if(e.tagClass===j.Class.UNIVERSAL)switch(a+=e.type,e.type){case j.Type.NONE:a+=" (None)";break;case j.Type.BOOLEAN:a+=" (Boolean)";break;case j.Type.INTEGER:a+=" (Integer)";break;case j.Type.BITSTRING:a+=" (Bit string)";break;case j.Type.OCTETSTRING:a+=" (Octet string)";break;case j.Type.NULL:a+=" (Null)";break;case j.Type.OID:a+=" (Object Identifier)";break;case j.Type.ODESC:a+=" (Object Descriptor)";break;case j.Type.EXTERNAL:a+=" (External or Instance of)";break;case j.Type.REAL:a+=" (Real)";break;case j.Type.ENUMERATED:a+=" (Enumerated)";break;case j.Type.EMBEDDED:a+=" (Embedded PDV)";break;case j.Type.UTF8:a+=" (UTF8)";break;case j.Type.ROID:a+=" (Relative Object Identifier)";break;case j.Type.SEQUENCE:a+=" (Sequence)";break;case j.Type.SET:a+=" (Set)";break;case j.Type.PRINTABLESTRING:a+=" (Printable String)";break;case j.Type.IA5String:a+=" (IA5String (ASCII))";break;case j.Type.UTCTIME:a+=" (UTC time)";break;case j.Type.GENERALIZEDTIME:a+=" (Generalized time)";break;case j.Type.BMPSTRING:a+=" (BMP String)";break}else a+=e.type;if(a+=`
30
- `,a+=n+"Constructed: "+e.constructed+`
31
- `,e.composed){for(var i=0,o="",s=0;s<e.value.length;++s)e.value[s]!==void 0&&(i+=1,o+=j.prettyPrint(e.value[s],t+1,r),s+1<e.value.length&&(o+=","));a+=n+"Sub values: "+i+o}else{if(a+=n+"Value: ",e.type===j.Type.OID){var c=j.derToOid(e.value);a+=c,Re.pki&&Re.pki.oids&&c in Re.pki.oids&&(a+=" ("+Re.pki.oids[c]+") ")}if(e.type===j.Type.INTEGER)try{a+=j.derToInteger(e.value)}catch{a+="0x"+Re.util.bytesToHex(e.value)}else if(e.type===j.Type.BITSTRING){if(e.value.length>1?a+="0x"+Re.util.bytesToHex(e.value.slice(1)):a+="(none)",e.value.length>0){var l=e.value.charCodeAt(0);l==1?a+=" (1 unused bit shown)":l>1&&(a+=" ("+l+" unused bits shown)")}}else if(e.type===j.Type.OCTETSTRING)Qf.test(e.value)||(a+="("+e.value+") "),a+="0x"+Re.util.bytesToHex(e.value);else if(e.type===j.Type.UTF8)try{a+=Re.util.decodeUtf8(e.value)}catch(u){if(u.message==="URI malformed")a+="0x"+Re.util.bytesToHex(e.value)+" (malformed UTF8)";else throw u}else e.type===j.Type.PRINTABLESTRING||e.type===j.Type.IA5String?a+=e.value:Qf.test(e.value)?a+="0x"+Re.util.bytesToHex(e.value):e.value.length===0?a+="[null]":a+=e.value}return a};var el=re;el.md=el.md||{},el.md.algorithms=el.md.algorithms||{};var Yt=re,Y1=Yt.hmac=Yt.hmac||{};Y1.create=function(){var e=null,t=null,r=null,a=null,n={};return n.start=function(s,i){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in Yt.md.algorithms)t=Yt.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else t=s;if(i===null)i=e;else{if(typeof i=="string")i=Yt.util.createBuffer(i);else if(Yt.util.isArray(i)){var o=i;i=Yt.util.createBuffer();for(var c=0;c<o.length;++c)i.putByte(o[c])}var l=i.length();l>t.blockLength&&(t.start(),t.update(i.bytes()),i=t.digest()),r=Yt.util.createBuffer(),a=Yt.util.createBuffer(),l=i.length();for(var c=0;c<l;++c){var o=i.at(c);r.putByte(54^o),a.putByte(92^o)}if(l<t.blockLength)for(var o=t.blockLength-l,c=0;c<o;++c)r.putByte(54),a.putByte(92);e=i,r=r.bytes(),a=a.bytes()}t.start(),t.update(r)},n.update=function(s){t.update(s)},n.getMac=function(){var s=t.digest().bytes();return t.start(),t.update(a),t.update(s),t.digest()},n.digest=n.getMac,n};var jt=re,Wf=jt.md5=jt.md5||{};jt.md.md5=jt.md.algorithms.md5=Wf,Wf.create=function(){Xf||J1();var e=null,t=jt.util.createBuffer(),r=new Array(16),a={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength64=[];for(var n=a.messageLengthSize/4,s=0;s<n;++s)a.fullMessageLength.push(0);return t=jt.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},a},a.start(),a.update=function(n,s){s==="utf8"&&(n=jt.util.encodeUtf8(n));var i=n.length;a.messageLength+=i,i=[i/4294967296>>>0,i>>>0];for(var o=a.fullMessageLength.length-1;o>=0;--o)a.fullMessageLength[o]+=i[1],i[1]=i[0]+(a.fullMessageLength[o]/4294967296>>>0),a.fullMessageLength[o]=a.fullMessageLength[o]>>>0,i[0]=i[1]/4294967296>>>0;return t.putBytes(n),Yf(e,r,t),(t.read>2048||t.length()===0)&&t.compact(),a},a.digest=function(){var n=jt.util.createBuffer();n.putBytes(t.bytes());var s=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize,i=s&a.blockLength-1;n.putBytes(ju.substr(0,a.blockLength-i));for(var o,c=0,l=a.fullMessageLength.length-1;l>=0;--l)o=a.fullMessageLength[l]*8+c,c=o/4294967296>>>0,n.putInt32Le(o>>>0);var u={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};Yf(u,r,n);var p=jt.util.createBuffer();return p.putInt32Le(u.h0),p.putInt32Le(u.h1),p.putInt32Le(u.h2),p.putInt32Le(u.h3),p},a};var ju=null,tl=null,fc=null,Ha=null,Xf=!1;function J1(){ju="\x80",ju+=jt.util.fillString("\0",64),tl=[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],fc=[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],Ha=new Array(64);for(var e=0;e<64;++e)Ha[e]=Math.floor(Math.abs(Math.sin(e+1))*4294967296);Xf=!0}function Yf(e,t,r){for(var a,n,s,i,o,c,l,u,p=r.length();p>=64;){for(n=e.h0,s=e.h1,i=e.h2,o=e.h3,u=0;u<16;++u)t[u]=r.getInt32Le(),c=o^s&(i^o),a=n+c+Ha[u]+t[u],l=fc[u],n=o,o=i,i=s,s+=a<<l|a>>>32-l;for(;u<32;++u)c=i^o&(s^i),a=n+c+Ha[u]+t[tl[u]],l=fc[u],n=o,o=i,i=s,s+=a<<l|a>>>32-l;for(;u<48;++u)c=s^i^o,a=n+c+Ha[u]+t[tl[u]],l=fc[u],n=o,o=i,i=s,s+=a<<l|a>>>32-l;for(;u<64;++u)c=i^(s|~o),a=n+c+Ha[u]+t[tl[u]],l=fc[u],n=o,o=i,i=s,s+=a<<l|a>>>32-l;e.h0=e.h0+n|0,e.h1=e.h1+s|0,e.h2=e.h2+i|0,e.h3=e.h3+o|0,p-=64}}var al=re,Jf=al.pem=al.pem||{};Jf.encode=function(e,t){t=t||{};var r="-----BEGIN "+e.type+`-----\r
32
- `,a;if(e.procType&&(a={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]},r+=rl(a)),e.contentDomain&&(a={name:"Content-Domain",values:[e.contentDomain]},r+=rl(a)),e.dekInfo&&(a={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&a.values.push(e.dekInfo.parameters),r+=rl(a)),e.headers)for(var n=0;n<e.headers.length;++n)r+=rl(e.headers[n]);return e.procType&&(r+=`\r
33
- `),r+=al.util.encode64(e.body,t.maxline||64)+`\r
34
- `,r+="-----END "+e.type+`-----\r
35
- `,r},Jf.decode=function(e){for(var t=[],r=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,a=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,n=/\r?\n/,s;s=r.exec(e),!!s;){var i=s[1];i==="NEW CERTIFICATE REQUEST"&&(i="CERTIFICATE REQUEST");var o={type:i,procType:null,contentDomain:null,dekInfo:null,headers:[],body:al.util.decode64(s[3])};if(t.push(o),!!s[2]){for(var c=s[2].split(n),l=0;s&&l<c.length;){for(var u=c[l].replace(/\s+$/,""),p=l+1;p<c.length;++p){var d=c[p];if(!/\s/.test(d[0]))break;u+=d,l=p}if(s=u.match(a),s){for(var x={name:s[1],values:[]},m=s[2].split(","),y=0;y<m.length;++y)x.values.push(Z1(m[y]));if(o.procType)if(!o.contentDomain&&x.name==="Content-Domain")o.contentDomain=m[0]||"";else if(!o.dekInfo&&x.name==="DEK-Info"){if(x.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');o.dekInfo={algorithm:m[0],parameters:m[1]||null}}else o.headers.push(x);else{if(x.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(x.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');o.procType={version:m[0],type:m[1]}}}++l}if(o.procType==="ENCRYPTED"&&!o.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(t.length===0)throw new Error("Invalid PEM formatted message.");return t};function rl(e){for(var t=e.name+": ",r=[],a=function(c,l){return" "+l},n=0;n<e.values.length;++n)r.push(e.values[n].replace(/^(\S+\r\n)/,a));t+=r.join(",")+`\r
36
- `;for(var s=0,i=-1,n=0;n<t.length;++n,++s)if(s>65&&i!==-1){var o=t[i];o===","?(++i,t=t.substr(0,i)+`\r
37
- `+t.substr(i)):t=t.substr(0,i)+`\r
38
- `+o+t.substr(i+1),s=n-i-1,i=-1,++n}else(t[n]===" "||t[n]===" "||t[n]===",")&&(i=n);return t}function Z1(e){return e.replace(/^\s+/,"")}var Ue=re;Ue.des=Ue.des||{},Ue.des.startEncrypting=function(e,t,r,a){var n=nl({key:e,output:r,decrypt:!1,mode:a||(t===null?"ECB":"CBC")});return n.start(t),n},Ue.des.createEncryptionCipher=function(e,t){return nl({key:e,output:null,decrypt:!1,mode:t})},Ue.des.startDecrypting=function(e,t,r,a){var n=nl({key:e,output:r,decrypt:!0,mode:a||(t===null?"ECB":"CBC")});return n.start(t),n},Ue.des.createDecryptionCipher=function(e,t){return nl({key:e,output:null,decrypt:!0,mode:t})},Ue.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(a,n){return Zf(r._keys,a,n,!1)},decrypt:function(a,n){return Zf(r._keys,a,n,!0)}}}),r._init=!1},Ue.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=Ue.util.createBuffer(e.key);if(this.name.indexOf("3DES")===0&&t.length()!==24)throw new Error("Invalid Triple-DES key size: "+t.length()*8);this._keys=cb(t),this._init=!0}},Kt("DES-ECB",Ue.cipher.modes.ecb),Kt("DES-CBC",Ue.cipher.modes.cbc),Kt("DES-CFB",Ue.cipher.modes.cfb),Kt("DES-OFB",Ue.cipher.modes.ofb),Kt("DES-CTR",Ue.cipher.modes.ctr),Kt("3DES-ECB",Ue.cipher.modes.ecb),Kt("3DES-CBC",Ue.cipher.modes.cbc),Kt("3DES-CFB",Ue.cipher.modes.cfb),Kt("3DES-OFB",Ue.cipher.modes.ofb),Kt("3DES-CTR",Ue.cipher.modes.ctr);function Kt(e,t){var r=function(){return new Ue.des.Algorithm(e,t)};Ue.cipher.registerAlgorithm(e,r)}var eb=[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],tb=[-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],ab=[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],rb=[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],nb=[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],ib=[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],sb=[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],ob=[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 cb(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],a=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],n=[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],i=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[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],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],x=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],m=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=e.length()>8?3:1,b=[],C=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],B=0,_,k=0;k<y;k++){var N=e.getInt32(),D=e.getInt32();_=(N>>>4^D)&252645135,D^=_,N^=_<<4,_=(D>>>-16^N)&65535,N^=_,D^=_<<-16,_=(N>>>2^D)&858993459,D^=_,N^=_<<2,_=(D>>>-16^N)&65535,N^=_,D^=_<<-16,_=(N>>>1^D)&1431655765,D^=_,N^=_<<1,_=(D>>>8^N)&16711935,N^=_,D^=_<<8,_=(N>>>1^D)&1431655765,D^=_,N^=_<<1,_=N<<8|D>>>20&240,N=D<<24|D<<8&16711680|D>>>8&65280|D>>>24&240,D=_;for(var K=0;K<C.length;++K){C[K]?(N=N<<2|N>>>26,D=D<<2|D>>>26):(N=N<<1|N>>>27,D=D<<1|D>>>27),N&=-15,D&=-15;var W=t[N>>>28]|r[N>>>24&15]|a[N>>>20&15]|n[N>>>16&15]|s[N>>>12&15]|i[N>>>8&15]|o[N>>>4&15],X=c[D>>>28]|l[D>>>24&15]|u[D>>>20&15]|p[D>>>16&15]|d[D>>>12&15]|x[D>>>8&15]|m[D>>>4&15];_=(X>>>16^W)&65535,b[B++]=W^_,b[B++]=X^_<<16}}return b}function Zf(e,t,r,a){var n=e.length===32?3:9,s;n===3?s=a?[30,-2,-2]:[0,32,2]:s=a?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var i,o=t[0],c=t[1];i=(o>>>4^c)&252645135,c^=i,o^=i<<4,i=(o>>>16^c)&65535,c^=i,o^=i<<16,i=(c>>>2^o)&858993459,o^=i,c^=i<<2,i=(c>>>8^o)&16711935,o^=i,c^=i<<8,i=(o>>>1^c)&1431655765,c^=i,o^=i<<1,o=o<<1|o>>>31,c=c<<1|c>>>31;for(var l=0;l<n;l+=3){for(var u=s[l+1],p=s[l+2],d=s[l];d!=u;d+=p){var x=c^e[d],m=(c>>>4|c<<28)^e[d+1];i=o,o=c,c=i^(tb[x>>>24&63]|rb[x>>>16&63]|ib[x>>>8&63]|ob[x&63]|eb[m>>>24&63]|ab[m>>>16&63]|nb[m>>>8&63]|sb[m&63])}i=o,o=c,c=i}o=o>>>1|o<<31,c=c>>>1|c<<31,i=(o>>>1^c)&1431655765,c^=i,o^=i<<1,i=(c>>>8^o)&16711935,o^=i,c^=i<<8,i=(c>>>2^o)&858993459,o^=i,c^=i<<2,i=(o>>>16^c)&65535,c^=i,o^=i<<16,i=(o>>>4^c)&252645135,c^=i,o^=i<<4,r[0]=o,r[1]=c}function nl(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),r="DES-"+t,a;e.decrypt?a=Ue.cipher.createDecipher(r,e.key):a=Ue.cipher.createCipher(r,e.key);var n=a.start;return a.start=function(s,i){var o=null;i instanceof Ue.util.ByteBuffer&&(o=i,i={}),i=i||{},i.output=o,i.iv=s,n.call(a,i)},a}var pt=re,lb=pt.pkcs5=pt.pkcs5||{},Jt;pt.util.isNodejs&&!pt.options.usePureJavaScript&&(Jt=tr),pt.pbkdf2=lb.pbkdf2=function(e,t,r,a,n,s){if(typeof n=="function"&&(s=n,n=null),pt.util.isNodejs&&!pt.options.usePureJavaScript&&Jt.pbkdf2&&(n===null||typeof n!="object")&&(Jt.pbkdf2Sync.length>4||!n||n==="sha1"))return typeof n!="string"&&(n="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),s?Jt.pbkdf2Sync.length===4?Jt.pbkdf2(e,t,r,a,function(_,k){if(_)return s(_);s(null,k.toString("binary"))}):Jt.pbkdf2(e,t,r,a,n,function(_,k){if(_)return s(_);s(null,k.toString("binary"))}):Jt.pbkdf2Sync.length===4?Jt.pbkdf2Sync(e,t,r,a).toString("binary"):Jt.pbkdf2Sync(e,t,r,a,n).toString("binary");if((typeof n>"u"||n===null)&&(n="sha1"),typeof n=="string"){if(!(n in pt.md.algorithms))throw new Error("Unknown hash algorithm: "+n);n=pt.md[n].create()}var i=n.digestLength;if(a>4294967295*i){var o=new Error("Derived key is too long.");if(s)return s(o);throw o}var c=Math.ceil(a/i),l=a-(c-1)*i,u=pt.hmac.create();u.start(n,e);var p="",d,x,m;if(!s){for(var y=1;y<=c;++y){u.start(null,null),u.update(t),u.update(pt.util.int32ToBytes(y)),d=m=u.digest().getBytes();for(var b=2;b<=r;++b)u.start(null,null),u.update(m),x=u.digest().getBytes(),d=pt.util.xorBytes(d,x,i),m=x;p+=y<c?d:d.substr(0,l)}return p}var y=1,b;function C(){if(y>c)return s(null,p);u.start(null,null),u.update(t),u.update(pt.util.int32ToBytes(y)),d=m=u.digest().getBytes(),b=2,B()}function B(){if(b<=r)return u.start(null,null),u.update(m),x=u.digest().getBytes(),d=pt.util.xorBytes(d,x,i),m=x,++b,pt.util.setImmediate(B);p+=y<c?d:d.substr(0,l),++y,C()}C()};var zt=re,e0=zt.sha256=zt.sha256||{};zt.md.sha256=zt.md.algorithms.sha256=e0,e0.create=function(){t0||ub();var e=null,t=zt.util.createBuffer(),r=new Array(64),a={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength64=[];for(var n=a.messageLengthSize/4,s=0;s<n;++s)a.fullMessageLength.push(0);return t=zt.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},a},a.start(),a.update=function(n,s){s==="utf8"&&(n=zt.util.encodeUtf8(n));var i=n.length;a.messageLength+=i,i=[i/4294967296>>>0,i>>>0];for(var o=a.fullMessageLength.length-1;o>=0;--o)a.fullMessageLength[o]+=i[1],i[1]=i[0]+(a.fullMessageLength[o]/4294967296>>>0),a.fullMessageLength[o]=a.fullMessageLength[o]>>>0,i[0]=i[1]/4294967296>>>0;return t.putBytes(n),r0(e,r,t),(t.read>2048||t.length()===0)&&t.compact(),a},a.digest=function(){var n=zt.util.createBuffer();n.putBytes(t.bytes());var s=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize,i=s&a.blockLength-1;n.putBytes(Ku.substr(0,a.blockLength-i));for(var o,c,l=a.fullMessageLength[0]*8,u=0;u<a.fullMessageLength.length-1;++u)o=a.fullMessageLength[u+1]*8,c=o/4294967296>>>0,l+=c,n.putInt32(l>>>0),l=o>>>0;n.putInt32(l);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};r0(p,r,n);var d=zt.util.createBuffer();return d.putInt32(p.h0),d.putInt32(p.h1),d.putInt32(p.h2),d.putInt32(p.h3),d.putInt32(p.h4),d.putInt32(p.h5),d.putInt32(p.h6),d.putInt32(p.h7),d},a};var Ku=null,t0=!1,a0=null;function ub(){Ku="\x80",Ku+=zt.util.fillString("\0",64),a0=[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],t0=!0}function r0(e,t,r){for(var a,n,s,i,o,c,l,u,p,d,x,m,y,b,C,B=r.length();B>=64;){for(l=0;l<16;++l)t[l]=r.getInt32();for(;l<64;++l)a=t[l-2],a=(a>>>17|a<<15)^(a>>>19|a<<13)^a>>>10,n=t[l-15],n=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,t[l]=a+t[l-7]+n+t[l-16]|0;for(u=e.h0,p=e.h1,d=e.h2,x=e.h3,m=e.h4,y=e.h5,b=e.h6,C=e.h7,l=0;l<64;++l)i=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),o=b^m&(y^b),s=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),c=u&p|d&(u^p),a=C+i+o+a0[l]+t[l],n=s+c,C=b,b=y,y=m,m=x+a>>>0,x=d,d=p,p=u,u=a+n>>>0;e.h0=e.h0+u|0,e.h1=e.h1+p|0,e.h2=e.h2+d|0,e.h3=e.h3+x|0,e.h4=e.h4+m|0,e.h5=e.h5+y|0,e.h6=e.h6+b|0,e.h7=e.h7+C|0,B-=64}}var Ht=re,il=null;Ht.util.isNodejs&&!Ht.options.usePureJavaScript&&!process.versions["node-webkit"]&&(il=tr);var pb=Ht.prng=Ht.prng||{};pb.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,a=new Array(32),n=0;n<32;++n)a[n]=r.create();t.pools=a,t.pool=0,t.generate=function(l,u){if(!u)return t.generateSync(l);var p=t.plugin.cipher,d=t.plugin.increment,x=t.plugin.formatKey,m=t.plugin.formatSeed,y=Ht.util.createBuffer();t.key=null,b();function b(C){if(C)return u(C);if(y.length()>=l)return u(null,y.getBytes(l));if(t.generated>1048575&&(t.key=null),t.key===null)return Ht.util.nextTick(function(){s(b)});var B=p(t.key,t.seed);t.generated+=B.length,y.putBytes(B),t.key=x(p(t.key,d(t.seed))),t.seed=m(p(t.key,t.seed)),Ht.util.setImmediate(b)}},t.generateSync=function(l){var u=t.plugin.cipher,p=t.plugin.increment,d=t.plugin.formatKey,x=t.plugin.formatSeed;t.key=null;for(var m=Ht.util.createBuffer();m.length()<l;){t.generated>1048575&&(t.key=null),t.key===null&&i();var y=u(t.key,t.seed);t.generated+=y.length,m.putBytes(y),t.key=d(u(t.key,p(t.seed))),t.seed=x(u(t.key,t.seed))}return m.getBytes(l)};function s(l){if(t.pools[0].messageLength>=32)return o(),l();var u=32-t.pools[0].messageLength<<5;t.seedFile(u,function(p,d){if(p)return l(p);t.collect(d),o(),l()})}function i(){if(t.pools[0].messageLength>=32)return o();var l=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(l)),o()}function o(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var l=t.plugin.md.create();l.update(t.keyBytes);for(var u=1,p=0;p<32;++p)t.reseeds%u===0&&(l.update(t.pools[p].digest().getBytes()),t.pools[p].start()),u=u<<1;t.keyBytes=l.digest().getBytes(),l.start(),l.update(t.keyBytes);var d=l.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(d),t.generated=0}function c(l){var u=null,p=Ht.util.globalScope,d=p.crypto||p.msCrypto;d&&d.getRandomValues&&(u=function(N){return d.getRandomValues(N)});var x=Ht.util.createBuffer();if(u)for(;x.length()<l;){var m=Math.max(1,Math.min(l-x.length(),65536)/4),y=new Uint32Array(Math.floor(m));try{u(y);for(var b=0;b<y.length;++b)x.putInt32(y[b])}catch(N){if(!(typeof QuotaExceededError<"u"&&N instanceof QuotaExceededError))throw N}}if(x.length()<l)for(var C,B,_,k=Math.floor(Math.random()*65536);x.length()<l;){B=16807*(k&65535),C=16807*(k>>16),B+=(C&32767)<<16,B+=C>>15,B=(B&2147483647)+(B>>31),k=B&4294967295;for(var b=0;b<3;++b)_=k>>>(b<<3),_^=Math.floor(Math.random()*256),x.putByte(_&255)}return x.getBytes(l)}return il?(t.seedFile=function(l,u){il.randomBytes(l,function(p,d){if(p)return u(p);u(null,d.toString())})},t.seedFileSync=function(l){return il.randomBytes(l).toString()}):(t.seedFile=function(l,u){try{u(null,c(l))}catch(p){u(p)}},t.seedFileSync=c),t.collect=function(l){for(var u=l.length,p=0;p<u;++p)t.pools[t.pool].update(l.substr(p,1)),t.pool=t.pool===31?0:t.pool+1},t.collectInt=function(l,u){for(var p="",d=0;d<u;d+=8)p+=String.fromCharCode(l>>d&255);t.collect(p)},t.registerWorker=function(l){if(l===self)t.seedFile=function(p,d){function x(m){var y=m.data;y.forge&&y.forge.prng&&(self.removeEventListener("message",x),d(y.forge.prng.err,y.forge.prng.bytes))}self.addEventListener("message",x),self.postMessage({forge:{prng:{needed:p}}})};else{var u=function(p){var d=p.data;d.forge&&d.forge.prng&&t.seedFile(d.forge.prng.needed,function(x,m){l.postMessage({forge:{prng:{err:x,bytes:m}}})})};l.addEventListener("message",u)}},t};var Ge=re;(function(){if(Ge.random&&Ge.random.getBytes){Ge.random;return}(function(e){var t={},r=new Array(4),a=Ge.util.createBuffer();t.formatKey=function(p){var d=Ge.util.createBuffer(p);return p=new Array(4),p[0]=d.getInt32(),p[1]=d.getInt32(),p[2]=d.getInt32(),p[3]=d.getInt32(),Ge.aes._expandKey(p,!1)},t.formatSeed=function(p){var d=Ge.util.createBuffer(p);return p=new Array(4),p[0]=d.getInt32(),p[1]=d.getInt32(),p[2]=d.getInt32(),p[3]=d.getInt32(),p},t.cipher=function(p,d){return Ge.aes._updateBlock(p,d,r,!1),a.putInt32(r[0]),a.putInt32(r[1]),a.putInt32(r[2]),a.putInt32(r[3]),a.getBytes()},t.increment=function(p){return++p[3],p},t.md=Ge.md.sha256;function n(){var p=Ge.prng.create(t);return p.getBytes=function(d,x){return p.generate(d,x)},p.getBytesSync=function(d){return p.generate(d)},p}var s=n(),i=null,o=Ge.util.globalScope,c=o.crypto||o.msCrypto;if(c&&c.getRandomValues&&(i=function(p){return c.getRandomValues(p)}),Ge.options.usePureJavaScript||!Ge.util.isNodejs&&!i){if(s.collectInt(+new Date,32),typeof navigator<"u"){var l="";for(var u in navigator)try{typeof navigator[u]=="string"&&(l+=navigator[u])}catch{}s.collect(l),l=null}e&&(e().mousemove(function(p){s.collectInt(p.clientX,16),s.collectInt(p.clientY,16)}),e().keypress(function(p){s.collectInt(p.charCode,8)}))}if(!Ge.random)Ge.random=s;else for(var u in s)Ge.random[u]=s[u];Ge.random.createInstance=n,Ge.random})(typeof jQuery<"u"?jQuery:null)})();var wt=re,zu=[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],n0=[1,2,3,5],db=function(e,t){return e<<t&65535|(e&65535)>>16-t},fb=function(e,t){return(e&65535)>>t|e<<16-t&65535};wt.rc2=wt.rc2||{},wt.rc2.expandKey=function(e,t){typeof e=="string"&&(e=wt.util.createBuffer(e)),t=t||128;var r=e,a=e.length(),n=t,s=Math.ceil(n/8),i=255>>(n&7),o;for(o=a;o<128;o++)r.putByte(zu[r.at(o-1)+r.at(o-a)&255]);for(r.setAt(128-s,zu[r.at(128-s)&i]),o=127-s;o>=0;o--)r.setAt(o,zu[r.at(o+1)^r.at(o+s)]);return r};var i0=function(e,t,r){var a=!1,n=null,s=null,i=null,o,c,l,u,p=[];for(e=wt.rc2.expandKey(e,t),l=0;l<64;l++)p.push(e.getInt16Le());r?(o=function(m){for(l=0;l<4;l++)m[l]+=p[u]+(m[(l+3)%4]&m[(l+2)%4])+(~m[(l+3)%4]&m[(l+1)%4]),m[l]=db(m[l],n0[l]),u++},c=function(m){for(l=0;l<4;l++)m[l]+=p[m[(l+3)%4]&63]}):(o=function(m){for(l=3;l>=0;l--)m[l]=fb(m[l],n0[l]),m[l]-=p[u]+(m[(l+3)%4]&m[(l+2)%4])+(~m[(l+3)%4]&m[(l+1)%4]),u--},c=function(m){for(l=3;l>=0;l--)m[l]-=p[m[(l+3)%4]&63]});var d=function(m){var y=[];for(l=0;l<4;l++){var b=n.getInt16Le();i!==null&&(r?b^=i.getInt16Le():i.putInt16Le(b)),y.push(b&65535)}u=r?0:63;for(var C=0;C<m.length;C++)for(var B=0;B<m[C][0];B++)m[C][1](y);for(l=0;l<4;l++)i!==null&&(r?i.putInt16Le(y[l]):y[l]^=i.getInt16Le()),s.putInt16Le(y[l])},x=null;return x={start:function(m,y){m&&typeof m=="string"&&(m=wt.util.createBuffer(m)),a=!1,n=wt.util.createBuffer(),s=y||new wt.util.createBuffer,i=m,x.output=s},update:function(m){for(a||n.putBuffer(m);n.length()>=8;)d([[5,o],[1,c],[6,o],[1,c],[5,o]])},finish:function(m){var y=!0;if(r)if(m)y=m(8,n,!r);else{var b=n.length()===8?8:8-n.length();n.fillWithByte(b,b)}if(y&&(a=!0,x.update()),!r&&(y=n.length()===0,y))if(m)y=m(8,s,!r);else{var C=s.length(),B=s.at(C-1);B>C?y=!1:s.truncate(B)}return y}},x};wt.rc2.startEncrypting=function(e,t,r){var a=wt.rc2.createEncryptionCipher(e,128);return a.start(t,r),a},wt.rc2.createEncryptionCipher=function(e,t){return i0(e,t,!0)},wt.rc2.startDecrypting=function(e,t,r){var a=wt.rc2.createDecryptionCipher(e,128);return a.start(t,r),a},wt.rc2.createDecryptionCipher=function(e,t){return i0(e,t,!1)};var Hu=re;Hu.jsbn=Hu.jsbn||{};var Zt;function L(e,t,r){this.data=[],e!=null&&(typeof e=="number"?this.fromNumber(e,t,r):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}Hu.jsbn.BigInteger=L;function ve(){return new L(null)}function mb(e,t,r,a,n,s){for(;--s>=0;){var i=t*this.data[e++]+r.data[a]+n;n=Math.floor(i/67108864),r.data[a++]=i&67108863}return n}function hb(e,t,r,a,n,s){for(var i=t&32767,o=t>>15;--s>=0;){var c=this.data[e]&32767,l=this.data[e++]>>15,u=o*c+l*i;c=i*c+((u&32767)<<15)+r.data[a]+(n&1073741823),n=(c>>>30)+(u>>>15)+o*l+(n>>>30),r.data[a++]=c&1073741823}return n}function s0(e,t,r,a,n,s){for(var i=t&16383,o=t>>14;--s>=0;){var c=this.data[e]&16383,l=this.data[e++]>>14,u=o*c+l*i;c=i*c+((u&16383)<<14)+r.data[a]+n,n=(c>>28)+(u>>14)+o*l,r.data[a++]=c&268435455}return n}typeof navigator>"u"?(L.prototype.am=s0,Zt=28):navigator.appName=="Microsoft Internet Explorer"?(L.prototype.am=hb,Zt=30):navigator.appName!="Netscape"?(L.prototype.am=mb,Zt=26):(L.prototype.am=s0,Zt=28),L.prototype.DB=Zt,L.prototype.DM=(1<<Zt)-1,L.prototype.DV=1<<Zt;var $u=52;L.prototype.FV=Math.pow(2,$u),L.prototype.F1=$u-Zt,L.prototype.F2=2*Zt-$u;var vb="0123456789abcdefghijklmnopqrstuvwxyz",sl=new Array,$a,Nt;for($a=48,Nt=0;Nt<=9;++Nt)sl[$a++]=Nt;for($a=97,Nt=10;Nt<36;++Nt)sl[$a++]=Nt;for($a=65,Nt=10;Nt<36;++Nt)sl[$a++]=Nt;function o0(e){return vb.charAt(e)}function c0(e,t){var r=sl[e.charCodeAt(t)];return r??-1}function gb(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 xb(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 oa(e){var t=ve();return t.fromInt(e),t}function yb(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var a=e.length,n=!1,s=0;--a>=0;){var i=r==8?e[a]&255:c0(e,a);if(i<0){e.charAt(a)=="-"&&(n=!0);continue}n=!1,s==0?this.data[this.t++]=i:s+r>this.DB?(this.data[this.t-1]|=(i&(1<<this.DB-s)-1)<<s,this.data[this.t++]=i>>this.DB-s):this.data[this.t-1]|=i<<s,s+=r,s>=this.DB&&(s-=this.DB)}r==8&&(e[0]&128)!=0&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),n&&L.ZERO.subTo(this,this)}function bb(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function Eb(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var r=(1<<t)-1,a,n=!1,s="",i=this.t,o=this.DB-i*this.DB%t;if(i-- >0)for(o<this.DB&&(a=this.data[i]>>o)>0&&(n=!0,s=o0(a));i>=0;)o<t?(a=(this.data[i]&(1<<o)-1)<<t-o,a|=this.data[--i]>>(o+=this.DB-t)):(a=this.data[i]>>(o-=t)&r,o<=0&&(o+=this.DB,--i)),a>0&&(n=!0),n&&(s+=o0(a));return n?s:"0"}function Cb(){var e=ve();return L.ZERO.subTo(this,e),e}function Sb(){return this.s<0?this.negate():this}function Tb(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;if(t=r-e.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this.data[r]-e.data[r])!=0)return t;return 0}function ol(e){var t=1,r;return(r=e>>>16)!=0&&(e=r,t+=16),(r=e>>8)!=0&&(e=r,t+=8),(r=e>>4)!=0&&(e=r,t+=4),(r=e>>2)!=0&&(e=r,t+=2),(r=e>>1)!=0&&(e=r,t+=1),t}function wb(){return this.t<=0?0:this.DB*(this.t-1)+ol(this.data[this.t-1]^this.s&this.DM)}function Ab(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 Ib(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 Bb(e,t){var r=e%this.DB,a=this.DB-r,n=(1<<a)-1,s=Math.floor(e/this.DB),i=this.s<<r&this.DM,o;for(o=this.t-1;o>=0;--o)t.data[o+s+1]=this.data[o]>>a|i,i=(this.data[o]&n)<<r;for(o=s-1;o>=0;--o)t.data[o]=0;t.data[s]=i,t.t=this.t+s+1,t.s=this.s,t.clamp()}function _b(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var a=e%this.DB,n=this.DB-a,s=(1<<a)-1;t.data[0]=this.data[r]>>a;for(var i=r+1;i<this.t;++i)t.data[i-r-1]|=(this.data[i]&s)<<n,t.data[i-r]=this.data[i]>>a;a>0&&(t.data[this.t-r-1]|=(this.s&s)<<n),t.t=this.t-r,t.clamp()}function Rb(e,t){for(var r=0,a=0,n=Math.min(e.t,this.t);r<n;)a+=this.data[r]-e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;if(e.t<this.t){for(a-=e.s;r<this.t;)a+=this.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a+=this.s}else{for(a+=this.s;r<e.t;)a-=e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a-=e.s}t.s=a<0?-1:0,a<-1?t.data[r++]=this.DV+a:a>0&&(t.data[r++]=a),t.t=r,t.clamp()}function kb(e,t){var r=this.abs(),a=e.abs(),n=r.t;for(t.t=n+a.t;--n>=0;)t.data[n]=0;for(n=0;n<a.t;++n)t.data[n+r.t]=r.am(0,a.data[n],t,n,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&L.ZERO.subTo(t,t)}function Nb(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 a=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,a,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 Lb(e,t,r){var a=e.abs();if(!(a.t<=0)){var n=this.abs();if(n.t<a.t){t?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=ve());var s=ve(),i=this.s,o=e.s,c=this.DB-ol(a.data[a.t-1]);c>0?(a.lShiftTo(c,s),n.lShiftTo(c,r)):(a.copyTo(s),n.copyTo(r));var l=s.t,u=s.data[l-1];if(u!=0){var p=u*(1<<this.F1)+(l>1?s.data[l-2]>>this.F2:0),d=this.FV/p,x=(1<<this.F1)/p,m=1<<this.F2,y=r.t,b=y-l,C=t??ve();for(s.dlShiftTo(b,C),r.compareTo(C)>=0&&(r.data[r.t++]=1,r.subTo(C,r)),L.ONE.dlShiftTo(l,C),C.subTo(s,s);s.t<l;)s.data[s.t++]=0;for(;--b>=0;){var B=r.data[--y]==u?this.DM:Math.floor(r.data[y]*d+(r.data[y-1]+m)*x);if((r.data[y]+=s.am(0,B,r,b,0,l))<B)for(s.dlShiftTo(b,C),r.subTo(C,r);r.data[y]<--B;)r.subTo(C,r)}t!=null&&(r.drShiftTo(l,t),i!=o&&L.ZERO.subTo(t,t)),r.t=l,r.clamp(),c>0&&r.rShiftTo(c,r),i<0&&L.ZERO.subTo(r,r)}}}function Ub(e){var t=ve();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(L.ZERO)>0&&e.subTo(t,t),t}function Aa(e){this.m=e}function Pb(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function Db(e){return e}function Ob(e){e.divRemTo(this.m,null,e)}function Fb(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function Mb(e,t){e.squareTo(t),this.reduce(t)}Aa.prototype.convert=Pb,Aa.prototype.revert=Db,Aa.prototype.reduce=Ob,Aa.prototype.mulTo=Fb,Aa.prototype.sqrTo=Mb;function Vb(){if(this.t<1)return 0;var e=this.data[0];if((e&1)==0)return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Ia(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function qb(e){var t=ve();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(L.ZERO)>0&&this.m.subTo(t,t),t}function jb(e){var t=ve();return e.copyTo(t),this.reduce(t),t}function Kb(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=e.data[t]&32767,a=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,a,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 zb(e,t){e.squareTo(t),this.reduce(t)}function Hb(e,t,r){e.multiplyTo(t,r),this.reduce(r)}Ia.prototype.convert=qb,Ia.prototype.revert=jb,Ia.prototype.reduce=Kb,Ia.prototype.mulTo=Hb,Ia.prototype.sqrTo=zb;function $b(){return(this.t>0?this.data[0]&1:this.s)==0}function Gb(e,t){if(e>4294967295||e<1)return L.ONE;var r=ve(),a=ve(),n=t.convert(this),s=ol(e)-1;for(n.copyTo(r);--s>=0;)if(t.sqrTo(r,a),(e&1<<s)>0)t.mulTo(a,n,r);else{var i=r;r=a,a=i}return t.revert(r)}function Qb(e,t){var r;return e<256||t.isEven()?r=new Aa(t):r=new Ia(t),this.exp(e,r)}L.prototype.copyTo=gb,L.prototype.fromInt=xb,L.prototype.fromString=yb,L.prototype.clamp=bb,L.prototype.dlShiftTo=Ab,L.prototype.drShiftTo=Ib,L.prototype.lShiftTo=Bb,L.prototype.rShiftTo=_b,L.prototype.subTo=Rb,L.prototype.multiplyTo=kb,L.prototype.squareTo=Nb,L.prototype.divRemTo=Lb,L.prototype.invDigit=Vb,L.prototype.isEven=$b,L.prototype.exp=Gb,L.prototype.toString=Eb,L.prototype.negate=Cb,L.prototype.abs=Sb,L.prototype.compareTo=Tb,L.prototype.bitLength=wb,L.prototype.mod=Ub,L.prototype.modPowInt=Qb,L.ZERO=oa(0),L.ONE=oa(1);function Wb(){var e=ve();return this.copyTo(e),e}function Xb(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function Yb(){return this.t==0?this.s:this.data[0]<<24>>24}function Jb(){return this.t==0?this.s:this.data[0]<<16>>16}function Zb(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function eE(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function tE(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),a=oa(r),n=ve(),s=ve(),i="";for(this.divRemTo(a,n,s);n.signum()>0;)i=(r+s.intValue()).toString(e).substr(1)+i,n.divRemTo(a,n,s);return s.intValue().toString(e)+i}function aE(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),a=Math.pow(t,r),n=!1,s=0,i=0,o=0;o<e.length;++o){var c=c0(e,o);if(c<0){e.charAt(o)=="-"&&this.signum()==0&&(n=!0);continue}i=t*i+c,++s>=r&&(this.dMultiply(a),this.dAddOffset(i,0),s=0,i=0)}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(i,0)),n&&L.ZERO.subTo(this,this)}function rE(e,t,r){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(L.ONE.shiftLeft(e-1),Gu,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(L.ONE.shiftLeft(e-1),this);else{var a=new Array,n=e&7;a.length=(e>>3)+1,t.nextBytes(a),n>0?a[0]&=(1<<n)-1:a[0]=0,this.fromString(a,256)}}function nE(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,a,n=0;if(e-- >0)for(r<this.DB&&(a=this.data[e]>>r)!=(this.s&this.DM)>>r&&(t[n++]=a|this.s<<this.DB-r);e>=0;)r<8?(a=(this.data[e]&(1<<r)-1)<<8-r,a|=this.data[--e]>>(r+=this.DB-8)):(a=this.data[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),(a&128)!=0&&(a|=-256),n==0&&(this.s&128)!=(a&128)&&++n,(n>0||a!=this.s)&&(t[n++]=a);return t}function iE(e){return this.compareTo(e)==0}function sE(e){return this.compareTo(e)<0?this:e}function oE(e){return this.compareTo(e)>0?this:e}function cE(e,t,r){var a,n,s=Math.min(e.t,this.t);for(a=0;a<s;++a)r.data[a]=t(this.data[a],e.data[a]);if(e.t<this.t){for(n=e.s&this.DM,a=s;a<this.t;++a)r.data[a]=t(this.data[a],n);r.t=this.t}else{for(n=this.s&this.DM,a=s;a<e.t;++a)r.data[a]=t(n,e.data[a]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}function lE(e,t){return e&t}function uE(e){var t=ve();return this.bitwiseTo(e,lE,t),t}function Gu(e,t){return e|t}function pE(e){var t=ve();return this.bitwiseTo(e,Gu,t),t}function l0(e,t){return e^t}function dE(e){var t=ve();return this.bitwiseTo(e,l0,t),t}function u0(e,t){return e&~t}function fE(e){var t=ve();return this.bitwiseTo(e,u0,t),t}function mE(){for(var e=ve(),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 hE(e){var t=ve();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function vE(e){var t=ve();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function gE(e){if(e==0)return-1;var t=0;return(e&65535)==0&&(e>>=16,t+=16),(e&255)==0&&(e>>=8,t+=8),(e&15)==0&&(e>>=4,t+=4),(e&3)==0&&(e>>=2,t+=2),(e&1)==0&&++t,t}function xE(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+gE(this.data[e]);return this.s<0?this.t*this.DB:-1}function yE(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function bE(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=yE(this.data[r]^t);return e}function EE(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function CE(e,t){var r=L.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function SE(e){return this.changeBit(e,Gu)}function TE(e){return this.changeBit(e,u0)}function wE(e){return this.changeBit(e,l0)}function AE(e,t){for(var r=0,a=0,n=Math.min(e.t,this.t);r<n;)a+=this.data[r]+e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;if(e.t<this.t){for(a+=e.s;r<this.t;)a+=this.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a+=this.s}else{for(a+=this.s;r<e.t;)a+=e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a+=e.s}t.s=a<0?-1:0,a>0?t.data[r++]=a:a<-1&&(t.data[r++]=this.DV+a),t.t=r,t.clamp()}function IE(e){var t=ve();return this.addTo(e,t),t}function BE(e){var t=ve();return this.subTo(e,t),t}function _E(e){var t=ve();return this.multiplyTo(e,t),t}function RE(){var e=ve();return this.squareTo(e),e}function kE(e){var t=ve();return this.divRemTo(e,t,null),t}function NE(e){var t=ve();return this.divRemTo(e,null,t),t}function LE(e){var t=ve(),r=ve();return this.divRemTo(e,t,r),new Array(t,r)}function UE(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function PE(e,t){if(e!=0){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 mc(){}function p0(e){return e}function DE(e,t,r){e.multiplyTo(t,r)}function OE(e,t){e.squareTo(t)}mc.prototype.convert=p0,mc.prototype.revert=p0,mc.prototype.mulTo=DE,mc.prototype.sqrTo=OE;function FE(e){return this.exp(e,new mc)}function ME(e,t,r){var a=Math.min(this.t+e.t,t);for(r.s=0,r.t=a;a>0;)r.data[--a]=0;var n;for(n=r.t-this.t;a<n;++a)r.data[a+this.t]=this.am(0,e.data[a],r,a,0,this.t);for(n=Math.min(e.t,t);a<n;++a)this.am(0,e.data[a],r,a,0,t-a);r.clamp()}function VE(e,t,r){--t;var a=r.t=this.t+e.t-t;for(r.s=0;--a>=0;)r.data[a]=0;for(a=Math.max(t-this.t,0);a<e.t;++a)r.data[this.t+a-t]=this.am(t-a,e.data[a],r,0,0,this.t+a-t);r.clamp(),r.drShiftTo(1,r)}function Ga(e){this.r2=ve(),this.q3=ve(),L.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function qE(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=ve();return e.copyTo(t),this.reduce(t),t}function jE(e){return e}function KE(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 zE(e,t){e.squareTo(t),this.reduce(t)}function HE(e,t,r){e.multiplyTo(t,r),this.reduce(r)}Ga.prototype.convert=qE,Ga.prototype.revert=jE,Ga.prototype.reduce=KE,Ga.prototype.mulTo=HE,Ga.prototype.sqrTo=zE;function $E(e,t){var r=e.bitLength(),a,n=oa(1),s;if(r<=0)return n;r<18?a=1:r<48?a=3:r<144?a=4:r<768?a=5:a=6,r<8?s=new Aa(t):t.isEven()?s=new Ga(t):s=new Ia(t);var i=new Array,o=3,c=a-1,l=(1<<a)-1;if(i[1]=s.convert(this),a>1){var u=ve();for(s.sqrTo(i[1],u);o<=l;)i[o]=ve(),s.mulTo(u,i[o-2],i[o]),o+=2}var p=e.t-1,d,x=!0,m=ve(),y;for(r=ol(e.data[p])-1;p>=0;){for(r>=c?d=e.data[p]>>r-c&l:(d=(e.data[p]&(1<<r+1)-1)<<c-r,p>0&&(d|=e.data[p-1]>>this.DB+r-c)),o=a;(d&1)==0;)d>>=1,--o;if((r-=o)<0&&(r+=this.DB,--p),x)i[d].copyTo(n),x=!1;else{for(;o>1;)s.sqrTo(n,m),s.sqrTo(m,n),o-=2;o>0?s.sqrTo(n,m):(y=n,n=m,m=y),s.mulTo(m,i[d],n)}for(;p>=0&&(e.data[p]&1<<r)==0;)s.sqrTo(n,m),y=n,n=m,m=y,--r<0&&(r=this.DB-1,--p)}return s.revert(n)}function GE(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var a=t;t=r,r=a}var n=t.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)return t;for(n<s&&(s=n),s>0&&(t.rShiftTo(s,t),r.rShiftTo(s,r));t.signum()>0;)(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function QE(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this.data[0]%e;else for(var a=this.t-1;a>=0;--a)r=(t*r+this.data[a])%e;return r}function WE(e){if(this.signum()==0)return L.ZERO;var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return L.ZERO;for(var r=e.clone(),a=this.clone(),n=oa(1),s=oa(0),i=oa(0),o=oa(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!n.isEven()||!s.isEven())&&(n.addTo(this,n),s.subTo(e,s)),n.rShiftTo(1,n)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;a.isEven();)a.rShiftTo(1,a),t?((!i.isEven()||!o.isEven())&&(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);r.compareTo(a)>=0?(r.subTo(a,r),t&&n.subTo(i,n),s.subTo(o,s)):(a.subTo(r,a),t&&i.subTo(n,i),o.subTo(s,o))}if(a.compareTo(L.ONE)!=0)return L.ZERO;if(o.compareTo(e)>=0)return o.subtract(e);if(o.signum()<0)o.addTo(e,o);else return o;return o.signum()<0?o.add(e):o}var Vt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],XE=(1<<26)/Vt[Vt.length-1];function YE(e){var t,r=this.abs();if(r.t==1&&r.data[0]<=Vt[Vt.length-1]){for(t=0;t<Vt.length;++t)if(r.data[0]==Vt[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<Vt.length;){for(var a=Vt[t],n=t+1;n<Vt.length&&a<XE;)a*=Vt[n++];for(a=r.modInt(a);t<n;)if(a%Vt[t++]==0)return!1}return r.millerRabin(e)}function JE(e){var t=this.subtract(L.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var a=t.shiftRight(r),n=ZE(),s,i=0;i<e;++i){do s=new L(this.bitLength(),n);while(s.compareTo(L.ONE)<=0||s.compareTo(t)>=0);var o=s.modPow(a,this);if(o.compareTo(L.ONE)!=0&&o.compareTo(t)!=0){for(var c=1;c++<r&&o.compareTo(t)!=0;)if(o=o.modPowInt(2,this),o.compareTo(L.ONE)==0)return!1;if(o.compareTo(t)!=0)return!1}}return!0}function ZE(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256)}}}L.prototype.chunkSize=Zb,L.prototype.toRadix=tE,L.prototype.fromRadix=aE,L.prototype.fromNumber=rE,L.prototype.bitwiseTo=cE,L.prototype.changeBit=CE,L.prototype.addTo=AE,L.prototype.dMultiply=UE,L.prototype.dAddOffset=PE,L.prototype.multiplyLowerTo=ME,L.prototype.multiplyUpperTo=VE,L.prototype.modInt=QE,L.prototype.millerRabin=JE,L.prototype.clone=Wb,L.prototype.intValue=Xb,L.prototype.byteValue=Yb,L.prototype.shortValue=Jb,L.prototype.signum=eE,L.prototype.toByteArray=nE,L.prototype.equals=iE,L.prototype.min=sE,L.prototype.max=oE,L.prototype.and=uE,L.prototype.or=pE,L.prototype.xor=dE,L.prototype.andNot=fE,L.prototype.not=mE,L.prototype.shiftLeft=hE,L.prototype.shiftRight=vE,L.prototype.getLowestSetBit=xE,L.prototype.bitCount=bE,L.prototype.testBit=EE,L.prototype.setBit=SE,L.prototype.clearBit=TE,L.prototype.flipBit=wE,L.prototype.add=IE,L.prototype.subtract=BE,L.prototype.multiply=_E,L.prototype.divide=kE,L.prototype.remainder=NE,L.prototype.divideAndRemainder=LE,L.prototype.modPow=$E,L.prototype.modInverse=WE,L.prototype.pow=FE,L.prototype.gcd=GE,L.prototype.isProbablePrime=YE,L.prototype.square=RE;var $t=re,d0=$t.sha1=$t.sha1||{};$t.md.sha1=$t.md.algorithms.sha1=d0,d0.create=function(){f0||eC();var e=null,t=$t.util.createBuffer(),r=new Array(80),a={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength64=[];for(var n=a.messageLengthSize/4,s=0;s<n;++s)a.fullMessageLength.push(0);return t=$t.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},a},a.start(),a.update=function(n,s){s==="utf8"&&(n=$t.util.encodeUtf8(n));var i=n.length;a.messageLength+=i,i=[i/4294967296>>>0,i>>>0];for(var o=a.fullMessageLength.length-1;o>=0;--o)a.fullMessageLength[o]+=i[1],i[1]=i[0]+(a.fullMessageLength[o]/4294967296>>>0),a.fullMessageLength[o]=a.fullMessageLength[o]>>>0,i[0]=i[1]/4294967296>>>0;return t.putBytes(n),m0(e,r,t),(t.read>2048||t.length()===0)&&t.compact(),a},a.digest=function(){var n=$t.util.createBuffer();n.putBytes(t.bytes());var s=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize,i=s&a.blockLength-1;n.putBytes(Qu.substr(0,a.blockLength-i));for(var o,c,l=a.fullMessageLength[0]*8,u=0;u<a.fullMessageLength.length-1;++u)o=a.fullMessageLength[u+1]*8,c=o/4294967296>>>0,l+=c,n.putInt32(l>>>0),l=o>>>0;n.putInt32(l);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};m0(p,r,n);var d=$t.util.createBuffer();return d.putInt32(p.h0),d.putInt32(p.h1),d.putInt32(p.h2),d.putInt32(p.h3),d.putInt32(p.h4),d},a};var Qu=null,f0=!1;function eC(){Qu="\x80",Qu+=$t.util.fillString("\0",64),f0=!0}function m0(e,t,r){for(var a,n,s,i,o,c,l,u,p=r.length();p>=64;){for(n=e.h0,s=e.h1,i=e.h2,o=e.h3,c=e.h4,u=0;u<16;++u)a=r.getInt32(),t[u]=a,l=o^s&(i^o),a=(n<<5|n>>>27)+l+c+1518500249+a,c=o,o=i,i=(s<<30|s>>>2)>>>0,s=n,n=a;for(;u<20;++u)a=t[u-3]^t[u-8]^t[u-14]^t[u-16],a=a<<1|a>>>31,t[u]=a,l=o^s&(i^o),a=(n<<5|n>>>27)+l+c+1518500249+a,c=o,o=i,i=(s<<30|s>>>2)>>>0,s=n,n=a;for(;u<32;++u)a=t[u-3]^t[u-8]^t[u-14]^t[u-16],a=a<<1|a>>>31,t[u]=a,l=s^i^o,a=(n<<5|n>>>27)+l+c+1859775393+a,c=o,o=i,i=(s<<30|s>>>2)>>>0,s=n,n=a;for(;u<40;++u)a=t[u-6]^t[u-16]^t[u-28]^t[u-32],a=a<<2|a>>>30,t[u]=a,l=s^i^o,a=(n<<5|n>>>27)+l+c+1859775393+a,c=o,o=i,i=(s<<30|s>>>2)>>>0,s=n,n=a;for(;u<60;++u)a=t[u-6]^t[u-16]^t[u-28]^t[u-32],a=a<<2|a>>>30,t[u]=a,l=s&i|o&(s^i),a=(n<<5|n>>>27)+l+c+2400959708+a,c=o,o=i,i=(s<<30|s>>>2)>>>0,s=n,n=a;for(;u<80;++u)a=t[u-6]^t[u-16]^t[u-28]^t[u-32],a=a<<2|a>>>30,t[u]=a,l=s^i^o,a=(n<<5|n>>>27)+l+c+3395469782+a,c=o,o=i,i=(s<<30|s>>>2)>>>0,s=n,n=a;e.h0=e.h0+n|0,e.h1=e.h1+s|0,e.h2=e.h2+i|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,p-=64}}var Gt=re,h0=Gt.pkcs1=Gt.pkcs1||{};h0.encode_rsa_oaep=function(e,t,r){var a,n,s,i;typeof r=="string"?(a=r,n=arguments[3]||void 0,s=arguments[4]||void 0):r&&(a=r.label||void 0,n=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(i=r.mgf1.md)),s?s.start():s=Gt.md.sha1.create(),i||(i=s);var o=Math.ceil(e.n.bitLength()/8),c=o-2*s.digestLength-2;if(t.length>c){var l=new Error("RSAES-OAEP input message length is too long.");throw l.length=t.length,l.maxLength=c,l}a||(a=""),s.update(a,"raw");for(var u=s.digest(),p="",d=c-t.length,x=0;x<d;x++)p+="\0";var m=u.getBytes()+p+""+t;if(!n)n=Gt.random.getBytes(s.digestLength);else if(n.length!==s.digestLength){var l=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw l.seedLength=n.length,l.digestLength=s.digestLength,l}var y=cl(n,o-s.digestLength-1,i),b=Gt.util.xorBytes(m,y,m.length),C=cl(b,s.digestLength,i),B=Gt.util.xorBytes(n,C,n.length);return"\0"+B+b},h0.decode_rsa_oaep=function(e,t,r){var a,n,s;typeof r=="string"?(a=r,n=arguments[3]||void 0):r&&(a=r.label||void 0,n=r.md||void 0,r.mgf1&&r.mgf1.md&&(s=r.mgf1.md));var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var b=new Error("RSAES-OAEP encoded message length is invalid.");throw b.length=t.length,b.expectedLength=i,b}if(n===void 0?n=Gt.md.sha1.create():n.start(),s||(s=n),i<2*n.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");a||(a=""),n.update(a,"raw");for(var o=n.digest().getBytes(),c=t.charAt(0),l=t.substring(1,n.digestLength+1),u=t.substring(1+n.digestLength),p=cl(u,n.digestLength,s),d=Gt.util.xorBytes(l,p,l.length),x=cl(d,i-n.digestLength-1,s),m=Gt.util.xorBytes(u,x,u.length),y=m.substring(0,n.digestLength),b=c!=="\0",C=0;C<n.digestLength;++C)b|=o.charAt(C)!==y.charAt(C);for(var B=1,_=n.digestLength,k=n.digestLength;k<m.length;k++){var N=m.charCodeAt(k),D=N&1^1,K=B?65534:0;b|=N&K,B=B&D,_+=B}if(b||m.charCodeAt(_)!==1)throw new Error("Invalid RSAES-OAEP padding.");return m.substring(_+1)};function cl(e,t,r){r||(r=Gt.md.sha1.create());for(var a="",n=Math.ceil(t/r.digestLength),s=0;s<n;++s){var i=String.fromCharCode(s>>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(e+i),a+=r.digest().getBytes()}return a.substring(0,t)}var ca=re;(function(){if(ca.prime){ca.prime;return}var e=ca.prime=ca.prime||{},t=ca.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],a=new t(null);a.fromInt(30);var n=function(p,d){return p|d};e.generateProbablePrime=function(p,d,x){typeof d=="function"&&(x=d,d={}),d=d||{};var m=d.algorithm||"PRIMEINC";typeof m=="string"&&(m={name:m}),m.options=m.options||{};var y=d.prng||ca.random,b={nextBytes:function(C){for(var B=y.getBytesSync(C.length),_=0;_<C.length;++_)C[_]=B.charCodeAt(_)}};if(m.name==="PRIMEINC")return s(p,b,m.options,x);throw new Error("Invalid prime generation algorithm: "+m.name)};function s(p,d,x,m){return"workers"in x?c(p,d,x,m):i(p,d,x,m)}function i(p,d,x,m){var y=l(p,d),b=0,C=u(y.bitLength());"millerRabinTests"in x&&(C=x.millerRabinTests);var B=10;"maxBlockTime"in x&&(B=x.maxBlockTime),o(y,p,d,b,C,B,m)}function o(p,d,x,m,y,b,C){var B=+new Date;do{if(p.bitLength()>d&&(p=l(d,x)),p.isProbablePrime(y))return C(null,p);p.dAddOffset(r[m++%8],0)}while(b<0||+new Date-B<b);ca.util.setImmediate(function(){o(p,d,x,m,y,b,C)})}function c(p,d,x,m){if(typeof Worker>"u")return i(p,d,x,m);var y=l(p,d),b=x.workers,C=x.workLoad||100,B=C*30/8,_=x.workerScript||"forge/prime.worker.js";if(b===-1)return ca.util.estimateCores(function(N,D){N&&(D=2),b=D-1,k()});k();function k(){b=Math.max(1,b);for(var N=[],D=0;D<b;++D)N[D]=new Worker(_);for(var D=0;D<b;++D)N[D].addEventListener("message",W);var K=!1;function W(X){if(!K){var pe=X.data;if(pe.found){for(var me=0;me<N.length;++me)N[me].terminate();return K=!0,m(null,new t(pe.prime,16))}y.bitLength()>p&&(y=l(p,d));var xe=y.toString(16);X.target.postMessage({hex:xe,workLoad:C}),y.dAddOffset(B,0)}}}}function l(p,d){var x=new t(p,d),m=p-1;return x.testBit(m)||x.bitwiseTo(t.ONE.shiftLeft(m),n,x),x.dAddOffset(31-x.mod(a).byteValue(),0),x}function u(p){return p<=100?27:p<=150?18:p<=200?15:p<=250?12:p<=300?9:p<=350?8:p<=400?7:p<=500?6:p<=600?5:p<=800?4:p<=1250?3:2}})();var G=re;if(typeof ye>"u")var ye=G.jsbn.BigInteger;var Wu=G.util.isNodejs?tr:null,I=G.asn1,Lt=G.util;G.pki=G.pki||{},G.pki.rsa=G.rsa=G.rsa||{};var Z=G.pki,tC=[6,4,2,4,2,4,6,2],aC={name:"PrivateKeyInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},rC={name:"RSAPrivateKey",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},nC={name:"RSAPublicKey",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},iC=G.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:I.Class.UNIVERSAL,type:I.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},sC={name:"DigestInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:I.Class.UNIVERSAL,type:I.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},oC=function(e){var t;if(e.algorithm in Z.oids)t=Z.oids[e.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}var a=I.oidToDer(t).getBytes(),n=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[]),s=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[]);s.value.push(I.create(I.Class.UNIVERSAL,I.Type.OID,!1,a)),s.value.push(I.create(I.Class.UNIVERSAL,I.Type.NULL,!1,""));var i=I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,e.digest().getBytes());return n.value.push(s),n.value.push(i),I.toDer(n).getBytes()},v0=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(ye.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(ye.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var a;do a=new ye(G.util.bytesToHex(G.random.getBytes(t.n.bitLength()/8)),16);while(a.compareTo(t.n)>=0||!a.gcd(t.n).equals(ye.ONE));e=e.multiply(a.modPow(t.e,t.n)).mod(t.n);for(var n=e.mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);n.compareTo(s)<0;)n=n.add(t.p);var i=n.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return i=i.multiply(a.modInverse(t.n)).mod(t.n),i};Z.rsa.encrypt=function(e,t,r){var a=r,n,s=Math.ceil(t.n.bitLength()/8);r!==!1&&r!==!0?(a=r===2,n=g0(e,t,r)):(n=G.util.createBuffer(),n.putBytes(e));for(var i=new ye(n.toHex(),16),o=v0(i,t,a),c=o.toString(16),l=G.util.createBuffer(),u=s-Math.ceil(c.length/2);u>0;)l.putByte(0),--u;return l.putBytes(G.util.hexToBytes(c)),l.getBytes()},Z.rsa.decrypt=function(e,t,r,a){var n=Math.ceil(t.n.bitLength()/8);if(e.length!==n){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=n,s}var i=new ye(G.util.createBuffer(e).toHex(),16);if(i.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var o=v0(i,t,r),c=o.toString(16),l=G.util.createBuffer(),u=n-Math.ceil(c.length/2);u>0;)l.putByte(0),--u;return l.putBytes(G.util.hexToBytes(c)),a!==!1?ll(l.getBytes(),t,r):l.getBytes()},Z.rsa.createKeyPairGenerationState=function(e,t,r){typeof e=="string"&&(e=parseInt(e,10)),e=e||2048,r=r||{};var a=r.prng||G.random,n={nextBytes:function(o){for(var c=a.getBytesSync(o.length),l=0;l<o.length;++l)o[l]=c.charCodeAt(l)}},s=r.algorithm||"PRIMEINC",i;if(s==="PRIMEINC")i={algorithm:s,state:0,bits:e,rng:n,eInt:t||65537,e:new ye(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},i.e.fromInt(i.eInt);else throw new Error("Invalid key generation algorithm: "+s);return i},Z.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new ye(null);r.fromInt(30);for(var a=0,n=function(p,d){return p|d},s=+new Date,i,o=0;e.keys===null&&(t<=0||o<t);){if(e.state===0){var c=e.p===null?e.pBits:e.qBits,l=c-1;e.pqState===0?(e.num=new ye(c,e.rng),e.num.testBit(l)||e.num.bitwiseTo(ye.ONE.shiftLeft(l),n,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),a=0,++e.pqState):e.pqState===1?e.num.bitLength()>c?e.pqState=0:e.num.isProbablePrime(lC(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(tC[a++%8],0):e.pqState===2?e.pqState=e.num.subtract(ye.ONE).gcd(e.e).compareTo(ye.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(ye.ONE),e.q1=e.q.subtract(ye.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(ye.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var u=e.e.modInverse(e.phi);e.keys={privateKey:Z.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:Z.rsa.setPublicKey(e.n,e.e)}}i=+new Date,o+=i-s,s=i}return e.keys!==null},Z.rsa.generateKeyPair=function(e,t,r,a){if(arguments.length===1?typeof e=="object"?(r=e,e=void 0):typeof e=="function"&&(a=e,e=void 0):arguments.length===2?typeof e=="number"?typeof t=="function"?(a=t,t=void 0):typeof t!="number"&&(r=t,t=void 0):(r=e,a=t,e=void 0,t=void 0):arguments.length===3&&(typeof t=="number"?typeof r=="function"&&(a=r,r=void 0):(a=r,r=t,t=void 0)),r=r||{},e===void 0&&(e=r.bits||2048),t===void 0&&(t=r.e||65537),!G.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(a){if(x0("generateKeyPair"))return Wu.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(o,c,l){if(o)return a(o);a(null,{privateKey:Z.privateKeyFromPem(l),publicKey:Z.publicKeyFromPem(c)})});if(y0("generateKey")&&y0("exportKey"))return Lt.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:E0(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(o){return Lt.globalScope.crypto.subtle.exportKey("pkcs8",o.privateKey)}).then(void 0,function(o){a(o)}).then(function(o){if(o){var c=Z.privateKeyFromAsn1(I.fromDer(G.util.createBuffer(o)));a(null,{privateKey:c,publicKey:Z.setRsaPublicKey(c.n,c.e)})}});if(b0("generateKey")&&b0("exportKey")){var n=Lt.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:E0(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);n.oncomplete=function(o){var c=o.target.result,l=Lt.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);l.oncomplete=function(u){var p=u.target.result,d=Z.privateKeyFromAsn1(I.fromDer(G.util.createBuffer(p)));a(null,{privateKey:d,publicKey:Z.setRsaPublicKey(d.n,d.e)})},l.onerror=function(u){a(u)}},n.onerror=function(o){a(o)};return}}else if(x0("generateKeyPairSync")){var s=Wu.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Z.privateKeyFromPem(s.privateKey),publicKey:Z.publicKeyFromPem(s.publicKey)}}}var i=Z.rsa.createKeyPairGenerationState(e,t,r);if(!a)return Z.rsa.stepKeyPairGenerationState(i,0),i.keys;cC(i,r,a)},Z.setRsaPublicKey=Z.rsa.setPublicKey=function(e,t){var r={n:e,e:t};return r.encrypt=function(a,n,s){if(typeof n=="string"?n=n.toUpperCase():n===void 0&&(n="RSAES-PKCS1-V1_5"),n==="RSAES-PKCS1-V1_5")n={encode:function(o,c,l){return g0(o,c,2).getBytes()}};else if(n==="RSA-OAEP"||n==="RSAES-OAEP")n={encode:function(o,c){return G.pkcs1.encode_rsa_oaep(c,o,s)}};else if(["RAW","NONE","NULL",null].indexOf(n)!==-1)n={encode:function(o){return o}};else if(typeof n=="string")throw new Error('Unsupported encryption scheme: "'+n+'".');var i=n.encode(a,r,!0);return Z.rsa.encrypt(i,r,!0)},r.verify=function(a,n,s,i){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),i===void 0&&(i={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in i||(i._parseAllDigestBytes=!0),"_skipPaddingChecks"in i||(i._skipPaddingChecks=!1),s==="RSASSA-PKCS1-V1_5"?s={verify:function(c,l){l=ll(l,r,!0,void 0,i);var u=I.fromDer(l,{parseAllBytes:i._parseAllDigestBytes}),p={},d=[];if(!I.validate(u,sC,p,d)||u.value.length!==2){var x=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw x.errors=d,x}var m=I.derToOid(p.algorithmIdentifier);if(!(m===G.oids.md2||m===G.oids.md5||m===G.oids.sha1||m===G.oids.sha224||m===G.oids.sha256||m===G.oids.sha384||m===G.oids.sha512||m===G.oids["sha512-224"]||m===G.oids["sha512-256"])){var x=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw x.oid=m,x}if((m===G.oids.md2||m===G.oids.md5)&&!("parameters"in p))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return c===p.digest}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(c,l){return l=ll(l,r,!0,void 0,i),c===l}});var o=Z.rsa.decrypt(n,r,!0,!1);return s.verify(a,o,r.n.bitLength())},r},Z.setRsaPrivateKey=Z.rsa.setPrivateKey=function(e,t,r,a,n,s,i,o){var c={n:e,e:t,d:r,p:a,q:n,dP:s,dQ:i,qInv:o};return c.decrypt=function(l,u,p){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var d=Z.rsa.decrypt(l,c,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:ll};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(x,m){return G.pkcs1.decode_rsa_oaep(m,x,p)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(x){return x}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(d,c,!1)},c.sign=function(l,u){var p=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:oC},p=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return l}},p=1);var d=u.encode(l,c.n.bitLength());return Z.rsa.encrypt(d,c,p)},c},Z.wrapRsaPrivateKey=function(e){return I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,I.integerToDer(0).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(Z.oids.rsaEncryption).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.NULL,!1,"")]),I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,I.toDer(e).getBytes())])},Z.privateKeyFromAsn1=function(e){var t={},r=[];if(I.validate(e,aC,t,r)&&(e=I.fromDer(G.util.createBuffer(t.privateKey))),t={},r=[],!I.validate(e,rC,t,r)){var a=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw a.errors=r,a}var n,s,i,o,c,l,u,p;return n=G.util.createBuffer(t.privateKeyModulus).toHex(),s=G.util.createBuffer(t.privateKeyPublicExponent).toHex(),i=G.util.createBuffer(t.privateKeyPrivateExponent).toHex(),o=G.util.createBuffer(t.privateKeyPrime1).toHex(),c=G.util.createBuffer(t.privateKeyPrime2).toHex(),l=G.util.createBuffer(t.privateKeyExponent1).toHex(),u=G.util.createBuffer(t.privateKeyExponent2).toHex(),p=G.util.createBuffer(t.privateKeyCoefficient).toHex(),Z.setRsaPrivateKey(new ye(n,16),new ye(s,16),new ye(i,16),new ye(o,16),new ye(c,16),new ye(l,16),new ye(u,16),new ye(p,16))},Z.privateKeyToAsn1=Z.privateKeyToRSAPrivateKey=function(e){return I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,I.integerToDer(0).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Qt(e.n)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Qt(e.e)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Qt(e.d)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Qt(e.p)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Qt(e.q)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Qt(e.dP)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Qt(e.dQ)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Qt(e.qInv))])},Z.publicKeyFromAsn1=function(e){var t={},r=[];if(I.validate(e,iC,t,r)){var a=I.derToOid(t.publicKeyOid);if(a!==Z.oids.rsaEncryption){var n=new Error("Cannot read public key. Unknown OID.");throw n.oid=a,n}e=t.rsaPublicKey}if(r=[],!I.validate(e,nC,t,r)){var n=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw n.errors=r,n}var s=G.util.createBuffer(t.publicKeyModulus).toHex(),i=G.util.createBuffer(t.publicKeyExponent).toHex();return Z.setRsaPublicKey(new ye(s,16),new ye(i,16))},Z.publicKeyToAsn1=Z.publicKeyToSubjectPublicKeyInfo=function(e){return I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(Z.oids.rsaEncryption).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.NULL,!1,"")]),I.create(I.Class.UNIVERSAL,I.Type.BITSTRING,!1,[Z.publicKeyToRSAPublicKey(e)])])},Z.publicKeyToRSAPublicKey=function(e){return I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Qt(e.n)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Qt(e.e))])};function g0(e,t,r){var a=G.util.createBuffer(),n=Math.ceil(t.n.bitLength()/8);if(e.length>n-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=e.length,s.max=n-11,s}a.putByte(0),a.putByte(r);var i=n-3-e.length,o;if(r===0||r===1){o=r===0?0:255;for(var c=0;c<i;++c)a.putByte(o)}else for(;i>0;){for(var l=0,u=G.random.getBytes(i),c=0;c<i;++c)o=u.charCodeAt(c),o===0?++l:a.putByte(o);i=l}return a.putByte(0),a.putBytes(e),a}function ll(e,t,r,a,n){var s=Math.ceil(t.n.bitLength()/8),i=G.util.createBuffer(e),o=i.getByte(),c=i.getByte();if(o!==0||r&&c!==0&&c!==1||!r&&c!==2||r&&c===0&&typeof a>"u")throw new Error("Encryption block is invalid.");var l=0;if(c===0){l=s-3-a;for(var u=0;u<l;++u)if(i.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(c===1){for(l=0;i.length()>1;){if(i.getByte()!==255){--i.read;break}++l}if(l<8&&!(n&&n._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(c===2){for(l=0;i.length()>1;){if(i.getByte()===0){--i.read;break}++l}if(l<8&&!(n&&n._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var p=i.getByte();if(p!==0||l!==s-3-i.length())throw new Error("Encryption block is invalid.");return i.getBytes()}function cC(e,t,r){typeof t=="function"&&(r=t,t={}),t=t||{};var a={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(a.prng=t.prng),n();function n(){s(e.pBits,function(o,c){if(o)return r(o);if(e.p=c,e.q!==null)return i(o,e.q);s(e.qBits,i)})}function s(o,c){G.prime.generateProbablePrime(o,a,c)}function i(o,c){if(o)return r(o);if(e.q=c,e.p.compareTo(e.q)<0){var l=e.p;e.p=e.q,e.q=l}if(e.p.subtract(ye.ONE).gcd(e.e).compareTo(ye.ONE)!==0){e.p=null,n();return}if(e.q.subtract(ye.ONE).gcd(e.e).compareTo(ye.ONE)!==0){e.q=null,s(e.qBits,i);return}if(e.p1=e.p.subtract(ye.ONE),e.q1=e.q.subtract(ye.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(ye.ONE)!==0){e.p=e.q=null,n();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,s(e.qBits,i);return}var u=e.e.modInverse(e.phi);e.keys={privateKey:Z.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:Z.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}}function Qt(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=G.util.hexToBytes(t);return r.length>1&&(r.charCodeAt(0)===0&&(r.charCodeAt(1)&128)===0||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function lC(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 x0(e){return G.util.isNodejs&&typeof Wu[e]=="function"}function y0(e){return typeof Lt.globalScope<"u"&&typeof Lt.globalScope.crypto=="object"&&typeof Lt.globalScope.crypto.subtle=="object"&&typeof Lt.globalScope.crypto.subtle[e]=="function"}function b0(e){return typeof Lt.globalScope<"u"&&typeof Lt.globalScope.msCrypto=="object"&&typeof Lt.globalScope.msCrypto.subtle=="object"&&typeof Lt.globalScope.msCrypto.subtle[e]=="function"}function E0(e){for(var t=G.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),a=0;a<t.length;++a)r[a]=t.charCodeAt(a);return r}var H=re;if(typeof uC>"u")var uC=H.jsbn.BigInteger;var R=H.asn1,ae=H.pki=H.pki||{};ae.pbe=H.pbe=H.pbe||{};var Ba=ae.oids,pC={name:"EncryptedPrivateKeyInfo",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:R.Class.UNIVERSAL,type:R.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:R.Class.UNIVERSAL,type:R.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},dC={name:"PBES2Algorithms",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:R.Class.UNIVERSAL,type:R.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:R.Class.UNIVERSAL,type:R.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:R.Class.UNIVERSAL,type:R.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:R.Class.UNIVERSAL,type:R.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:R.Class.UNIVERSAL,type:R.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:R.Class.UNIVERSAL,type:R.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:R.Class.UNIVERSAL,type:R.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},fC={name:"pkcs-12PbeParams",tagClass:R.Class.UNIVERSAL,type:R.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:R.Class.UNIVERSAL,type:R.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:R.Class.UNIVERSAL,type:R.Type.INTEGER,constructed:!1,capture:"iterations"}]};ae.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 a=H.random.getBytesSync(r.saltSize),n=r.count,s=R.integerToDer(n),i,o,c;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var l,u,p;switch(r.algorithm){case"aes128":i=16,l=16,u=Ba["aes128-CBC"],p=H.aes.createEncryptionCipher;break;case"aes192":i=24,l=16,u=Ba["aes192-CBC"],p=H.aes.createEncryptionCipher;break;case"aes256":i=32,l=16,u=Ba["aes256-CBC"],p=H.aes.createEncryptionCipher;break;case"des":i=8,l=8,u=Ba.desCBC,p=H.des.createEncryptionCipher;break;default:var d=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw d.algorithm=r.algorithm,d}var x="hmacWith"+r.prfAlgorithm.toUpperCase(),m=T0(x),y=H.pkcs5.pbkdf2(t,a,n,i,m),b=H.random.getBytesSync(l),C=p(y);C.start(b),C.update(R.toDer(e)),C.finish(),c=C.output.getBytes();var B=mC(a,s,i,x);o=R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.OID,!1,R.oidToDer(Ba.pkcs5PBES2).getBytes()),R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.OID,!1,R.oidToDer(Ba.pkcs5PBKDF2).getBytes()),B]),R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.OID,!1,R.oidToDer(u).getBytes()),R.create(R.Class.UNIVERSAL,R.Type.OCTETSTRING,!1,b)])])])}else if(r.algorithm==="3des"){i=24;var _=new H.util.ByteBuffer(a),y=ae.pbe.generatePkcs12Key(t,_,1,n,i),b=ae.pbe.generatePkcs12Key(t,_,2,n,i),C=H.des.createEncryptionCipher(y);C.start(b),C.update(R.toDer(e)),C.finish(),c=C.output.getBytes(),o=R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.OID,!1,R.oidToDer(Ba["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.OCTETSTRING,!1,a),R.create(R.Class.UNIVERSAL,R.Type.INTEGER,!1,s.getBytes())])])}else{var d=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw d.algorithm=r.algorithm,d}var k=R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[o,R.create(R.Class.UNIVERSAL,R.Type.OCTETSTRING,!1,c)]);return k},ae.decryptPrivateKeyInfo=function(e,t){var r=null,a={},n=[];if(!R.validate(e,pC,a,n)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=n,s}var i=R.derToOid(a.encryptionOid),o=ae.pbe.getCipher(i,a.encryptionParams,t),c=H.util.createBuffer(a.encryptedData);return o.update(c),o.finish()&&(r=R.fromDer(o.output)),r},ae.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:R.toDer(e).getBytes()};return H.pem.encode(r,{maxline:t})},ae.encryptedPrivateKeyFromPem=function(e){var t=H.pem.decode(e)[0];if(t.type!=="ENCRYPTED PRIVATE KEY"){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&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return R.fromDer(t.body)},ae.encryptRsaPrivateKey=function(e,t,r){if(r=r||{},!r.legacy){var a=ae.wrapRsaPrivateKey(ae.privateKeyToAsn1(e));return a=ae.encryptPrivateKeyInfo(a,t,r),ae.encryptedPrivateKeyToPem(a)}var n,s,i,o;switch(r.algorithm){case"aes128":n="AES-128-CBC",i=16,s=H.random.getBytesSync(16),o=H.aes.createEncryptionCipher;break;case"aes192":n="AES-192-CBC",i=24,s=H.random.getBytesSync(16),o=H.aes.createEncryptionCipher;break;case"aes256":n="AES-256-CBC",i=32,s=H.random.getBytesSync(16),o=H.aes.createEncryptionCipher;break;case"3des":n="DES-EDE3-CBC",i=24,s=H.random.getBytesSync(8),o=H.des.createEncryptionCipher;break;case"des":n="DES-CBC",i=8,s=H.random.getBytesSync(8),o=H.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var l=H.pbe.opensslDeriveBytes(t,s.substr(0,8),i),u=o(l);u.start(s),u.update(R.toDer(ae.privateKeyToAsn1(e))),u.finish();var p={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:n,parameters:H.util.bytesToHex(s).toUpperCase()},body:u.output.getBytes()};return H.pem.encode(p)},ae.decryptRsaPrivateKey=function(e,t){var r=null,a=H.pem.decode(e)[0];if(a.type!=="ENCRYPTED PRIVATE KEY"&&a.type!=="PRIVATE KEY"&&a.type!=="RSA PRIVATE KEY"){var n=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw n.headerType=n,n}if(a.procType&&a.procType.type==="ENCRYPTED"){var s,i;switch(a.dekInfo.algorithm){case"DES-CBC":s=8,i=H.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,i=H.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,i=H.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,i=H.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,i=H.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,i=function(p){return H.rc2.createDecryptionCipher(p,40)};break;case"RC2-64-CBC":s=8,i=function(p){return H.rc2.createDecryptionCipher(p,64)};break;case"RC2-128-CBC":s=16,i=function(p){return H.rc2.createDecryptionCipher(p,128)};break;default:var n=new Error('Could not decrypt private key; unsupported encryption algorithm "'+a.dekInfo.algorithm+'".');throw n.algorithm=a.dekInfo.algorithm,n}var o=H.util.hexToBytes(a.dekInfo.parameters),c=H.pbe.opensslDeriveBytes(t,o.substr(0,8),s),l=i(c);if(l.start(o),l.update(H.util.createBuffer(a.body)),l.finish())r=l.output.getBytes();else return r}else r=a.body;return a.type==="ENCRYPTED PRIVATE KEY"?r=ae.decryptPrivateKeyInfo(R.fromDer(r),t):r=R.fromDer(r),r!==null&&(r=ae.privateKeyFromAsn1(r)),r},ae.pbe.generatePkcs12Key=function(e,t,r,a,n,s){var i,o;if(typeof s>"u"||s===null){if(!("sha1"in H.md))throw new Error('"sha1" hash algorithm unavailable.');s=H.md.sha1.create()}var c=s.digestLength,l=s.blockLength,u=new H.util.ByteBuffer,p=new H.util.ByteBuffer;if(e!=null){for(o=0;o<e.length;o++)p.putInt16(e.charCodeAt(o));p.putInt16(0)}var d=p.length(),x=t.length(),m=new H.util.ByteBuffer;m.fillWithByte(r,l);var y=l*Math.ceil(x/l),b=new H.util.ByteBuffer;for(o=0;o<y;o++)b.putByte(t.at(o%x));var C=l*Math.ceil(d/l),B=new H.util.ByteBuffer;for(o=0;o<C;o++)B.putByte(p.at(o%d));var _=b;_.putBuffer(B);for(var k=Math.ceil(n/c),N=1;N<=k;N++){var D=new H.util.ByteBuffer;D.putBytes(m.bytes()),D.putBytes(_.bytes());for(var K=0;K<a;K++)s.start(),s.update(D.getBytes()),D=s.digest();var W=new H.util.ByteBuffer;for(o=0;o<l;o++)W.putByte(D.at(o%c));var X=Math.ceil(x/l)+Math.ceil(d/l),pe=new H.util.ByteBuffer;for(i=0;i<X;i++){var me=new H.util.ByteBuffer(_.getBytes(l)),xe=511;for(o=W.length()-1;o>=0;o--)xe=xe>>8,xe+=W.at(o)+me.at(o),me.setAt(o,xe&255);pe.putBuffer(me)}_=pe,u.putBuffer(D)}return u.truncate(u.length()-n),u},ae.pbe.getCipher=function(e,t,r){switch(e){case ae.oids.pkcs5PBES2:return ae.pbe.getCipherForPBES2(e,t,r);case ae.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case ae.oids["pbewithSHAAnd40BitRC2-CBC"]:return ae.pbe.getCipherForPKCS12PBE(e,t,r);default:var a=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw a.oid=e,a.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],a}},ae.pbe.getCipherForPBES2=function(e,t,r){var a={},n=[];if(!R.validate(t,dC,a,n)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=n,s}if(e=R.derToOid(a.kdfOid),e!==ae.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=R.derToOid(a.encOid),e!==ae.oids["aes128-CBC"]&&e!==ae.oids["aes192-CBC"]&&e!==ae.oids["aes256-CBC"]&&e!==ae.oids["des-EDE3-CBC"]&&e!==ae.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 i=a.kdfSalt,o=H.util.createBuffer(a.kdfIterationCount);o=o.getInt(o.length()<<3);var c,l;switch(ae.oids[e]){case"aes128-CBC":c=16,l=H.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,l=H.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,l=H.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,l=H.des.createDecryptionCipher;break;case"desCBC":c=8,l=H.des.createDecryptionCipher;break}var u=S0(a.prfOid),p=H.pkcs5.pbkdf2(r,i,o,c,u),d=a.encIv,x=l(p);return x.start(d),x},ae.pbe.getCipherForPKCS12PBE=function(e,t,r){var a={},n=[];if(!R.validate(t,fC,a,n)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=n,s}var i=H.util.createBuffer(a.salt),o=H.util.createBuffer(a.iterations);o=o.getInt(o.length()<<3);var c,l,u;switch(e){case ae.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,l=8,u=H.des.startDecrypting;break;case ae.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,l=8,u=function(y,b){var C=H.rc2.createDecryptionCipher(y,40);return C.start(b,null),C};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=e,s}var p=S0(a.prfOid),d=ae.pbe.generatePkcs12Key(r,i,1,o,c,p);p.start();var x=ae.pbe.generatePkcs12Key(r,i,2,o,l,p);return u(d,x)},ae.pbe.opensslDeriveBytes=function(e,t,r,a){if(typeof a>"u"||a===null){if(!("md5"in H.md))throw new Error('"md5" hash algorithm unavailable.');a=H.md.md5.create()}t===null&&(t="");for(var n=[C0(a,e+t)],s=16,i=1;s<r;++i,s+=16)n.push(C0(a,n[i-1]+e+t));return n.join("").substr(0,r)};function C0(e,t){return e.start().update(t).digest().getBytes()}function S0(e){var t;if(!e)t="hmacWithSHA1";else if(t=ae.oids[R.derToOid(e)],!t){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}return T0(t)}function T0(e){var t=H.md;switch(e){case"hmacWithSHA224":t=H.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 mC(e,t,r,a){var n=R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.OCTETSTRING,!1,e),R.create(R.Class.UNIVERSAL,R.Type.INTEGER,!1,t.getBytes())]);return a!=="hmacWithSHA1"&&n.value.push(R.create(R.Class.UNIVERSAL,R.Type.INTEGER,!1,H.util.hexToBytes(r.toString(16))),R.create(R.Class.UNIVERSAL,R.Type.SEQUENCE,!0,[R.create(R.Class.UNIVERSAL,R.Type.OID,!1,R.oidToDer(ae.oids[a]).getBytes()),R.create(R.Class.UNIVERSAL,R.Type.NULL,!1,"")])),n}var Qa=re,z=Qa.asn1,Wa=Qa.pkcs7asn1=Qa.pkcs7asn1||{};Qa.pkcs7=Qa.pkcs7||{},Qa.pkcs7.asn1=Wa;var w0={name:"ContentInfo",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:z.Class.UNIVERSAL,type:z.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:z.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Wa.contentInfoValidator=w0;var A0={name:"EncryptedContentInfo",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:z.Class.UNIVERSAL,type:z.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:z.Class.UNIVERSAL,type:z.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:z.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:z.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Wa.envelopedDataValidator={name:"EnvelopedData",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:z.Class.UNIVERSAL,type:z.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:z.Class.UNIVERSAL,type:z.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(A0)},Wa.encryptedDataValidator={name:"EncryptedData",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:z.Class.UNIVERSAL,type:z.Type.INTEGER,constructed:!1,capture:"version"}].concat(A0)};var hC={name:"SignerInfo",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:z.Class.UNIVERSAL,type:z.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:z.Class.UNIVERSAL,type:z.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:z.Class.UNIVERSAL,type:z.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:z.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:z.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:z.Class.UNIVERSAL,type:z.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:z.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Wa.signedDataValidator={name:"SignedData",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:z.Class.UNIVERSAL,type:z.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:z.Class.UNIVERSAL,type:z.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},w0,{name:"SignedData.Certificates",tagClass:z.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:z.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:z.Class.UNIVERSAL,type:z.Type.SET,capture:"signerInfos",optional:!0,value:[hC]}]},Wa.recipientInfoValidator={name:"RecipientInfo",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:z.Class.UNIVERSAL,type:z.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:z.Class.UNIVERSAL,type:z.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:z.Class.UNIVERSAL,type:z.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:z.Class.UNIVERSAL,type:z.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:z.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:z.Class.UNIVERSAL,type:z.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]};var _a=re;_a.mgf=_a.mgf||{};var vC=_a.mgf.mgf1=_a.mgf1=_a.mgf1||{};vC.create=function(e){var t={generate:function(r,a){for(var n=new _a.util.ByteBuffer,s=Math.ceil(a/e.digestLength),i=0;i<s;i++){var o=new _a.util.ByteBuffer;o.putInt32(i),e.start(),e.update(r+o.getBytes()),n.putBuffer(e.digest())}return n.truncate(n.length()-a),n.getBytes()}};return t};var ul=re;ul.mgf=ul.mgf||{},ul.mgf.mgf1=ul.mgf1;var Ra=re,gC=Ra.pss=Ra.pss||{};gC.create=function(e){arguments.length===3&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,r=e.mgf,a=t.digestLength,n=e.salt||null;typeof n=="string"&&(n=Ra.util.createBuffer(n));var s;if("saltLength"in e)s=e.saltLength;else if(n!==null)s=n.length();else throw new Error("Salt length not specified or specific salt not given.");if(n!==null&&n.length()!==s)throw new Error("Given salt length does not match length of given salt.");var i=e.prng||Ra.random,o={};return o.encode=function(c,l){var u,p=l-1,d=Math.ceil(p/8),x=c.digest().getBytes();if(d<a+s+2)throw new Error("Message is too long to encrypt.");var m;n===null?m=i.getBytesSync(s):m=n.bytes();var y=new Ra.util.ByteBuffer;y.fillWithByte(0,8),y.putBytes(x),y.putBytes(m),t.start(),t.update(y.getBytes());var b=t.digest().getBytes(),C=new Ra.util.ByteBuffer;C.fillWithByte(0,d-s-a-2),C.putByte(1),C.putBytes(m);var B=C.getBytes(),_=d-a-1,k=r.generate(b,_),N="";for(u=0;u<_;u++)N+=String.fromCharCode(B.charCodeAt(u)^k.charCodeAt(u));var D=65280>>8*d-p&255;return N=String.fromCharCode(N.charCodeAt(0)&~D)+N.substr(1),N+b+"\xBC"},o.verify=function(c,l,u){var p,d=u-1,x=Math.ceil(d/8);if(l=l.substr(-x),x<a+s+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(l.charCodeAt(x-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var m=x-a-1,y=l.substr(0,m),b=l.substr(m,a),C=65280>>8*x-d&255;if((y.charCodeAt(0)&C)!==0)throw new Error("Bits beyond keysize not zero as expected.");var B=r.generate(b,m),_="";for(p=0;p<m;p++)_+=String.fromCharCode(y.charCodeAt(p)^B.charCodeAt(p));_=String.fromCharCode(_.charCodeAt(0)&~C)+_.substr(1);var k=x-a-s-2;for(p=0;p<k;p++)if(_.charCodeAt(p)!==0)throw new Error("Leftmost octets not zero as expected");if(_.charCodeAt(k)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var N=_.substr(-s),D=new Ra.util.ByteBuffer;D.fillWithByte(0,8),D.putBytes(c),D.putBytes(N),t.start(),t.update(D.getBytes());var K=t.digest().getBytes();return b===K},o};var Q=re,h=Q.asn1,F=Q.pki=Q.pki||{},ge=F.oids,Me={};Me.CN=ge.commonName,Me.commonName="CN",Me.C=ge.countryName,Me.countryName="C",Me.L=ge.localityName,Me.localityName="L",Me.ST=ge.stateOrProvinceName,Me.stateOrProvinceName="ST",Me.O=ge.organizationName,Me.organizationName="O",Me.OU=ge.organizationalUnitName,Me.organizationalUnitName="OU",Me.E=ge.emailAddress,Me.emailAddress="E";var I0=Q.pki.rsa.publicKeyValidator,xC={name:"Certificate",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:h.Class.UNIVERSAL,type:h.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:h.Class.UNIVERSAL,type:h.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:h.Class.UNIVERSAL,type:h.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:h.Class.UNIVERSAL,type:h.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},I0,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:h.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:h.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:h.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},yC={name:"rsapss",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:h.Class.UNIVERSAL,type:h.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:h.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:h.Class.UNIVERSAL,type:h.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:h.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:h.Class.UNIVERSAL,type:h.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:h.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:h.Class.UNIVERSAL,type:h.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},bC={name:"CertificationRequestInfo",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},I0,{name:"CertificationRequestInfo.attributes",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:h.Class.UNIVERSAL,type:h.Type.SET,constructed:!0}]}]}]},EC={name:"CertificationRequest",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[bC,{name:"CertificationRequest.signatureAlgorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};F.RDNAttributesAsArray=function(e,t){for(var r=[],a,n,s,i=0;i<e.value.length;++i){a=e.value[i];for(var o=0;o<a.value.length;++o)s={},n=a.value[o],s.type=h.derToOid(n.value[0].value),s.value=n.value[1].value,s.valueTagClass=n.value[1].type,s.type in ge&&(s.name=ge[s.type],s.name in Me&&(s.shortName=Me[s.name])),t&&(t.update(s.type),t.update(s.value)),r.push(s)}return r},F.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var a=e[r],n=h.derToOid(a.value[0].value),s=a.value[1].value,i=0;i<s.length;++i){var o={};if(o.type=n,o.value=s[i].value,o.valueTagClass=s[i].type,o.type in ge&&(o.name=ge[o.type],o.name in Me&&(o.shortName=Me[o.name])),o.type===ge.extensionRequest){o.extensions=[];for(var c=0;c<o.value.length;++c)o.extensions.push(F.certificateExtensionFromAsn1(o.value[c]))}t.push(o)}return t};function la(e,t){typeof t=="string"&&(t={shortName:t});for(var r=null,a,n=0;r===null&&n<e.attributes.length;++n)a=e.attributes[n],(t.type&&t.type===a.type||t.name&&t.name===a.name||t.shortName&&t.shortName===a.shortName)&&(r=a);return r}var pl=function(e,t,r){var a={};if(e!==ge["RSASSA-PSS"])return a;r&&(a={hash:{algorithmOid:ge.sha1},mgf:{algorithmOid:ge.mgf1,hash:{algorithmOid:ge.sha1}},saltLength:20});var n={},s=[];if(!h.validate(t,yC,n,s)){var i=new Error("Cannot read RSASSA-PSS parameter block.");throw i.errors=s,i}return n.hashOid!==void 0&&(a.hash=a.hash||{},a.hash.algorithmOid=h.derToOid(n.hashOid)),n.maskGenOid!==void 0&&(a.mgf=a.mgf||{},a.mgf.algorithmOid=h.derToOid(n.maskGenOid),a.mgf.hash=a.mgf.hash||{},a.mgf.hash.algorithmOid=h.derToOid(n.maskGenHashOid)),n.saltLength!==void 0&&(a.saltLength=n.saltLength.charCodeAt(0)),a},dl=function(e){switch(ge[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return Q.md.sha1.create();case"md5WithRSAEncryption":return Q.md.md5.create();case"sha256WithRSAEncryption":return Q.md.sha256.create();case"sha384WithRSAEncryption":return Q.md.sha384.create();case"sha512WithRSAEncryption":return Q.md.sha512.create();case"RSASSA-PSS":return Q.md.sha256.create();default:var t=new Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},B0=function(e){var t=e.certificate,r;switch(t.signatureOid){case ge.sha1WithRSAEncryption:case ge.sha1WithRSASignature:break;case ge["RSASSA-PSS"]:var a,n;if(a=ge[t.signatureParameters.mgf.hash.algorithmOid],a===void 0||Q.md[a]===void 0){var s=new Error("Unsupported MGF hash function.");throw s.oid=t.signatureParameters.mgf.hash.algorithmOid,s.name=a,s}if(n=ge[t.signatureParameters.mgf.algorithmOid],n===void 0||Q.mgf[n]===void 0){var s=new Error("Unsupported MGF function.");throw s.oid=t.signatureParameters.mgf.algorithmOid,s.name=n,s}if(n=Q.mgf[n].create(Q.md[a].create()),a=ge[t.signatureParameters.hash.algorithmOid],a===void 0||Q.md[a]===void 0){var s=new Error("Unsupported RSASSA-PSS hash function.");throw s.oid=t.signatureParameters.hash.algorithmOid,s.name=a,s}r=Q.pss.create(Q.md[a].create(),n,t.signatureParameters.saltLength);break}return t.publicKey.verify(e.md.digest().getBytes(),e.signature,r)};F.certificateFromPem=function(e,t,r){var a=Q.pem.decode(e)[0];if(a.type!=="CERTIFICATE"&&a.type!=="X509 CERTIFICATE"&&a.type!=="TRUSTED CERTIFICATE"){var n=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw n.headerType=a.type,n}if(a.procType&&a.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var s=h.fromDer(a.body,r);return F.certificateFromAsn1(s,t)},F.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:h.toDer(F.certificateToAsn1(e)).getBytes()};return Q.pem.encode(r,{maxline:t})},F.publicKeyFromPem=function(e){var t=Q.pem.decode(e)[0];if(t.type!=="PUBLIC KEY"&&t.type!=="RSA PUBLIC KEY"){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&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var a=h.fromDer(t.body);return F.publicKeyFromAsn1(a)},F.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:h.toDer(F.publicKeyToAsn1(e)).getBytes()};return Q.pem.encode(r,{maxline:t})},F.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:h.toDer(F.publicKeyToRSAPublicKey(e)).getBytes()};return Q.pem.encode(r,{maxline:t})},F.getPublicKeyFingerprint=function(e,t){t=t||{};var r=t.md||Q.md.sha1.create(),a=t.type||"RSAPublicKey",n;switch(a){case"RSAPublicKey":n=h.toDer(F.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":n=h.toDer(F.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}r.start(),r.update(n);var s=r.digest();if(t.encoding==="hex"){var i=s.toHex();return t.delimiter?i.match(/.{2}/g).join(t.delimiter):i}else{if(t.encoding==="binary")return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return s},F.certificationRequestFromPem=function(e,t,r){var a=Q.pem.decode(e)[0];if(a.type!=="CERTIFICATE REQUEST"){var n=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw n.headerType=a.type,n}if(a.procType&&a.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var s=h.fromDer(a.body,r);return F.certificationRequestFromAsn1(s,t)},F.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:h.toDer(F.certificationRequestToAsn1(e)).getBytes()};return Q.pem.encode(r,{maxline:t})},F.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 la(e.issuer,t)},e.issuer.addField=function(t){Ut([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return la(e.subject,t)},e.subject.addField=function(t){Ut([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){Ut(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){Ut(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)_0(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){typeof t=="string"&&(t={name:t});for(var r=null,a,n=0;r===null&&n<e.extensions.length;++n)a=e.extensions[n],(t.id&&a.id===t.id||t.name&&a.name===t.name)&&(r=a);return r},e.sign=function(t,r){e.md=r||Q.md.sha1.create();var a=ge[e.md.algorithm+"WithRSAEncryption"];if(!a){var n=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw n.algorithm=e.md.algorithm,n}e.signatureOid=e.siginfo.algorithmOid=a,e.tbsCertificate=F.getTBSCertificate(e);var s=h.toDer(e.tbsCertificate);e.md.update(s.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var a=t.issuer,n=e.subject,s=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 s.expectedIssuer=n.attributes,s.actualIssuer=a.attributes,s}var i=t.md;if(i===null){i=dl({signatureOid:t.signatureOid,type:"certificate"});var o=t.tbsCertificate||F.getTBSCertificate(t),c=h.toDer(o);i.update(c.getBytes())}return i!==null&&(r=B0({certificate:e,md:i,signature:t.signature})),r},e.isIssuer=function(t){var r=!1,a=e.issuer,n=t.subject;if(a.hash&&n.hash)r=a.hash===n.hash;else if(a.attributes.length===n.attributes.length){r=!0;for(var s,i,o=0;r&&o<a.attributes.length;++o)s=a.attributes[o],i=n.attributes[o],(s.type!==i.type||s.value!==i.value)&&(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return F.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=ge.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var a=e.extensions[r];if(a.id===t){var n=e.generateSubjectKeyIdentifier().getBytes();return Q.util.hexToBytes(a.subjectKeyIdentifier)===n}}return!1},e},F.certificateFromAsn1=function(e,t){var r={},a=[];if(!h.validate(e,xC,r,a)){var n=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw n.errors=a,n}var s=h.derToOid(r.publicKeyOid);if(s!==F.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var i=F.createCertificate();i.version=r.certVersion?r.certVersion.charCodeAt(0):0;var o=Q.util.createBuffer(r.certSerialNumber);i.serialNumber=o.toHex(),i.signatureOid=Q.asn1.derToOid(r.certSignatureOid),i.signatureParameters=pl(i.signatureOid,r.certSignatureParams,!0),i.siginfo.algorithmOid=Q.asn1.derToOid(r.certinfoSignatureOid),i.siginfo.parameters=pl(i.siginfo.algorithmOid,r.certinfoSignatureParams,!1),i.signature=r.certSignature;var c=[];if(r.certValidity1UTCTime!==void 0&&c.push(h.utcTimeToDate(r.certValidity1UTCTime)),r.certValidity2GeneralizedTime!==void 0&&c.push(h.generalizedTimeToDate(r.certValidity2GeneralizedTime)),r.certValidity3UTCTime!==void 0&&c.push(h.utcTimeToDate(r.certValidity3UTCTime)),r.certValidity4GeneralizedTime!==void 0&&c.push(h.generalizedTimeToDate(r.certValidity4GeneralizedTime)),c.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(c.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(i.validity.notBefore=c[0],i.validity.notAfter=c[1],i.tbsCertificate=r.tbsCertificate,t){i.md=dl({signatureOid:i.signatureOid,type:"certificate"});var l=h.toDer(i.tbsCertificate);i.md.update(l.getBytes())}var u=Q.md.sha1.create(),p=h.toDer(r.certIssuer);u.update(p.getBytes()),i.issuer.getField=function(m){return la(i.issuer,m)},i.issuer.addField=function(m){Ut([m]),i.issuer.attributes.push(m)},i.issuer.attributes=F.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(i.issuer.uniqueId=r.certIssuerUniqueId),i.issuer.hash=u.digest().toHex();var d=Q.md.sha1.create(),x=h.toDer(r.certSubject);return d.update(x.getBytes()),i.subject.getField=function(m){return la(i.subject,m)},i.subject.addField=function(m){Ut([m]),i.subject.attributes.push(m)},i.subject.attributes=F.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(i.subject.uniqueId=r.certSubjectUniqueId),i.subject.hash=d.digest().toHex(),r.certExtensions?i.extensions=F.certificateExtensionsFromAsn1(r.certExtensions):i.extensions=[],i.publicKey=F.publicKeyFromAsn1(r.subjectPublicKeyInfo),i},F.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r<e.value.length;++r)for(var a=e.value[r],n=0;n<a.value.length;++n)t.push(F.certificateExtensionFromAsn1(a.value[n]));return t},F.certificateExtensionFromAsn1=function(e){var t={};if(t.id=h.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===h.Type.BOOLEAN?(t.critical=e.value[1].value.charCodeAt(0)!==0,t.value=e.value[2].value):t.value=e.value[1].value,t.id in ge){if(t.name=ge[t.id],t.name==="keyUsage"){var r=h.fromDer(t.value),a=0,n=0;r.value.length>1&&(a=r.value.charCodeAt(1),n=r.value.length>2?r.value.charCodeAt(2):0),t.digitalSignature=(a&128)===128,t.nonRepudiation=(a&64)===64,t.keyEncipherment=(a&32)===32,t.dataEncipherment=(a&16)===16,t.keyAgreement=(a&8)===8,t.keyCertSign=(a&4)===4,t.cRLSign=(a&2)===2,t.encipherOnly=(a&1)===1,t.decipherOnly=(n&128)===128}else if(t.name==="basicConstraints"){var r=h.fromDer(t.value);r.value.length>0&&r.value[0].type===h.Type.BOOLEAN?t.cA=r.value[0].value.charCodeAt(0)!==0:t.cA=!1;var s=null;r.value.length>0&&r.value[0].type===h.Type.INTEGER?s=r.value[0].value:r.value.length>1&&(s=r.value[1].value),s!==null&&(t.pathLenConstraint=h.derToInteger(s))}else if(t.name==="extKeyUsage")for(var r=h.fromDer(t.value),i=0;i<r.value.length;++i){var o=h.derToOid(r.value[i].value);o in ge?t[ge[o]]=!0:t[o]=!0}else if(t.name==="nsCertType"){var r=h.fromDer(t.value),a=0;r.value.length>1&&(a=r.value.charCodeAt(1)),t.client=(a&128)===128,t.server=(a&64)===64,t.email=(a&32)===32,t.objsign=(a&16)===16,t.reserved=(a&8)===8,t.sslCA=(a&4)===4,t.emailCA=(a&2)===2,t.objCA=(a&1)===1}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.altNames=[];for(var c,r=h.fromDer(t.value),l=0;l<r.value.length;++l){c=r.value[l];var u={type:c.type,value:c.value};switch(t.altNames.push(u),c.type){case 1:case 2:case 6:break;case 7:u.ip=Q.util.bytesToIP(c.value);break;case 8:u.oid=h.derToOid(c.value);break}}}else if(t.name==="subjectKeyIdentifier"){var r=h.fromDer(t.value);t.subjectKeyIdentifier=Q.util.bytesToHex(r.value)}}return t},F.certificationRequestFromAsn1=function(e,t){var r={},a=[];if(!h.validate(e,EC,r,a)){var n=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw n.errors=a,n}var s=h.derToOid(r.publicKeyOid);if(s!==F.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var i=F.createCertificationRequest();if(i.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,i.signatureOid=Q.asn1.derToOid(r.csrSignatureOid),i.signatureParameters=pl(i.signatureOid,r.csrSignatureParams,!0),i.siginfo.algorithmOid=Q.asn1.derToOid(r.csrSignatureOid),i.siginfo.parameters=pl(i.siginfo.algorithmOid,r.csrSignatureParams,!1),i.signature=r.csrSignature,i.certificationRequestInfo=r.certificationRequestInfo,t){i.md=dl({signatureOid:i.signatureOid,type:"certification request"});var o=h.toDer(i.certificationRequestInfo);i.md.update(o.getBytes())}var c=Q.md.sha1.create();return i.subject.getField=function(l){return la(i.subject,l)},i.subject.addField=function(l){Ut([l]),i.subject.attributes.push(l)},i.subject.attributes=F.RDNAttributesAsArray(r.certificationRequestInfoSubject,c),i.subject.hash=c.digest().toHex(),i.publicKey=F.publicKeyFromAsn1(r.subjectPublicKeyInfo),i.getAttribute=function(l){return la(i,l)},i.addAttribute=function(l){Ut([l]),i.attributes.push(l)},i.attributes=F.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),i},F.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 la(e.subject,t)},e.subject.addField=function(t){Ut([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return la(e,t)},e.addAttribute=function(t){Ut([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){Ut(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){Ut(t),e.attributes=t},e.sign=function(t,r){e.md=r||Q.md.sha1.create();var a=ge[e.md.algorithm+"WithRSAEncryption"];if(!a){var n=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw n.algorithm=e.md.algorithm,n}e.signatureOid=e.siginfo.algorithmOid=a,e.certificationRequestInfo=F.getCertificationRequestInfo(e);var s=h.toDer(e.certificationRequestInfo);e.md.update(s.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(r===null){r=dl({signatureOid:e.signatureOid,type:"certification request"});var a=e.certificationRequestInfo||F.getCertificationRequestInfo(e),n=h.toDer(a);r.update(n.getBytes())}return r!==null&&(t=B0({certificate:e,md:r,signature:e.signature})),t},e};function Xa(e){for(var t=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),r,a,n=e.attributes,s=0;s<n.length;++s){r=n[s];var i=r.value,o=h.Type.PRINTABLESTRING;"valueTagClass"in r&&(o=r.valueTagClass,o===h.Type.UTF8&&(i=Q.util.encodeUtf8(i))),a=h.create(h.Class.UNIVERSAL,h.Type.SET,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(r.type).getBytes()),h.create(h.Class.UNIVERSAL,o,!1,i)])]),t.value.push(a)}return t}function Ut(e){for(var t,r=0;r<e.length;++r){if(t=e[r],typeof t.name>"u"&&(t.type&&t.type in F.oids?t.name=F.oids[t.type]:t.shortName&&t.shortName in Me&&(t.name=F.oids[Me[t.shortName]])),typeof t.type>"u")if(t.name&&t.name in F.oids)t.type=F.oids[t.name];else{var a=new Error("Attribute type not specified.");throw a.attribute=t,a}if(typeof t.shortName>"u"&&t.name&&t.name in Me&&(t.shortName=Me[t.name]),t.type===ge.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=h.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var n=0;n<t.extensions.length;++n)t.value.push(F.certificateExtensionToAsn1(_0(t.extensions[n])))}if(typeof t.value>"u"){var a=new Error("Attribute value not specified.");throw a.attribute=t,a}}}function _0(e,t){if(t=t||{},typeof e.name>"u"&&e.id&&e.id in F.oids&&(e.name=F.oids[e.id]),typeof e.id>"u")if(e.name&&e.name in F.oids)e.id=F.oids[e.name];else{var r=new Error("Extension ID not specified.");throw r.extension=e,r}if(typeof e.value<"u")return e;if(e.name==="keyUsage"){var a=0,n=0,s=0;e.digitalSignature&&(n|=128,a=7),e.nonRepudiation&&(n|=64,a=6),e.keyEncipherment&&(n|=32,a=5),e.dataEncipherment&&(n|=16,a=4),e.keyAgreement&&(n|=8,a=3),e.keyCertSign&&(n|=4,a=2),e.cRLSign&&(n|=2,a=1),e.encipherOnly&&(n|=1,a=0),e.decipherOnly&&(s|=128,a=7);var i=String.fromCharCode(a);s!==0?i+=String.fromCharCode(n)+String.fromCharCode(s):n!==0&&(i+=String.fromCharCode(n)),e.value=h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,i)}else if(e.name==="basicConstraints")e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(h.create(h.Class.UNIVERSAL,h.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in e&&e.value.value.push(h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.pathLenConstraint).getBytes()));else if(e.name==="extKeyUsage"){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);var o=e.value.value;for(var c in e)e[c]===!0&&(c in ge?o.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(ge[c]).getBytes())):c.indexOf(".")!==-1&&o.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(c).getBytes())))}else if(e.name==="nsCertType"){var a=0,n=0;e.client&&(n|=128,a=7),e.server&&(n|=64,a=6),e.email&&(n|=32,a=5),e.objsign&&(n|=16,a=4),e.reserved&&(n|=8,a=3),e.sslCA&&(n|=4,a=2),e.emailCA&&(n|=2,a=1),e.objCA&&(n|=1,a=0);var i=String.fromCharCode(a);n!==0&&(i+=String.fromCharCode(n)),e.value=h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,i)}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);for(var l,u=0;u<e.altNames.length;++u){l=e.altNames[u];var i=l.value;if(l.type===7&&l.ip){if(i=Q.util.bytesFromIP(l.ip),i===null){var r=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw r.extension=e,r}}else l.type===8&&(l.oid?i=h.oidToDer(h.oidToDer(l.oid)):i=h.oidToDer(i));e.value.value.push(h.create(h.Class.CONTEXT_SPECIFIC,l.type,!1,i))}}else if(e.name==="nsComment"&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=h.create(h.Class.UNIVERSAL,h.Type.IA5STRING,!1,e.comment)}else if(e.name==="subjectKeyIdentifier"&&t.cert){var p=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=p.toHex(),e.value=h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,p.getBytes())}else if(e.name==="authorityKeyIdentifier"&&t.cert){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);var o=e.value.value;if(e.keyIdentifier){var d=e.keyIdentifier===!0?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;o.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var x=[h.create(h.Class.CONTEXT_SPECIFIC,4,!0,[Xa(e.authorityCertIssuer===!0?t.cert.issuer:e.authorityCertIssuer)])];o.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,x))}if(e.serialNumber){var m=Q.util.hexToBytes(e.serialNumber===!0?t.cert.serialNumber:e.serialNumber);o.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!1,m))}}else if(e.name==="cRLDistributionPoints"){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);for(var o=e.value.value,y=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),b=h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[]),l,u=0;u<e.altNames.length;++u){l=e.altNames[u];var i=l.value;if(l.type===7&&l.ip){if(i=Q.util.bytesFromIP(l.ip),i===null){var r=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw r.extension=e,r}}else l.type===8&&(l.oid?i=h.oidToDer(h.oidToDer(l.oid)):i=h.oidToDer(i));b.value.push(h.create(h.Class.CONTEXT_SPECIFIC,l.type,!1,i))}y.value.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[b])),o.push(y)}if(typeof e.value>"u"){var r=new Error("Extension value not specified.");throw r.extension=e,r}return e}function Xu(e,t){switch(e){case ge["RSASSA-PSS"]:var r=[];return t.hash.algorithmOid!==void 0&&r.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.hash.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")])])),t.mgf.algorithmOid!==void 0&&r.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.mgf.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.mgf.hash.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")])])])),t.saltLength!==void 0&&r.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(t.saltLength).getBytes())])),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,r);default:return h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")}}function CC(e){var t=h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[]);if(e.attributes.length===0)return t;for(var r=e.attributes,a=0;a<r.length;++a){var n=r[a],s=n.value,i=h.Type.UTF8;"valueTagClass"in n&&(i=n.valueTagClass),i===h.Type.UTF8&&(s=Q.util.encodeUtf8(s));var o=!1;"valueConstructed"in n&&(o=n.valueConstructed);var c=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(n.type).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SET,!0,[h.create(h.Class.UNIVERSAL,i,o,s)])]);t.value.push(c)}return t}var SC=new Date("1950-01-01T00:00:00Z"),TC=new Date("2050-01-01T00:00:00Z");function R0(e){return e>=SC&&e<TC?h.create(h.Class.UNIVERSAL,h.Type.UTCTIME,!1,h.dateToUtcTime(e)):h.create(h.Class.UNIVERSAL,h.Type.GENERALIZEDTIME,!1,h.dateToGeneralizedTime(e))}F.getTBSCertificate=function(e){var t=R0(e.validity.notBefore),r=R0(e.validity.notAfter),a=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.version).getBytes())]),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,Q.util.hexToBytes(e.serialNumber)),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.siginfo.algorithmOid).getBytes()),Xu(e.siginfo.algorithmOid,e.siginfo.parameters)]),Xa(e.issuer),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[t,r]),Xa(e.subject),F.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&a.value.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,[h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.issuer.uniqueId)])),e.subject.uniqueId&&a.value.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!0,[h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.subject.uniqueId)])),e.extensions.length>0&&a.value.push(F.certificateExtensionsToAsn1(e.extensions)),a},F.getCertificationRequestInfo=function(e){var t=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.version).getBytes()),Xa(e.subject),F.publicKeyToAsn1(e.publicKey),CC(e)]);return t},F.distinguishedNameToAsn1=function(e){return Xa(e)},F.certificateToAsn1=function(e){var t=e.tbsCertificate||F.getTBSCertificate(e);return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[t,h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.signatureOid).getBytes()),Xu(e.signatureOid,e.signatureParameters)]),h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.signature)])},F.certificateExtensionsToAsn1=function(e){var t=h.create(h.Class.CONTEXT_SPECIFIC,3,!0,[]),r=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);t.value.push(r);for(var a=0;a<e.length;++a)r.value.push(F.certificateExtensionToAsn1(e[a]));return t},F.certificateExtensionToAsn1=function(e){var t=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);t.value.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.id).getBytes())),e.critical&&t.value.push(h.create(h.Class.UNIVERSAL,h.Type.BOOLEAN,!1,"\xFF"));var r=e.value;return typeof e.value!="string"&&(r=h.toDer(r).getBytes()),t.value.push(h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,r)),t},F.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||F.getCertificationRequestInfo(e);return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[t,h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.signatureOid).getBytes()),Xu(e.signatureOid,e.signatureParameters)]),h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.signature)])},F.createCaStore=function(e){var t={certs:{}};t.getIssuer=function(i){var o=r(i.issuer);return o},t.addCertificate=function(i){if(typeof i=="string"&&(i=Q.pki.certificateFromPem(i)),a(i.subject),!t.hasCertificate(i))if(i.subject.hash in t.certs){var o=t.certs[i.subject.hash];Q.util.isArray(o)||(o=[o]),o.push(i),t.certs[i.subject.hash]=o}else t.certs[i.subject.hash]=i},t.hasCertificate=function(i){typeof i=="string"&&(i=Q.pki.certificateFromPem(i));var o=r(i.subject);if(!o)return!1;Q.util.isArray(o)||(o=[o]);for(var c=h.toDer(F.certificateToAsn1(i)).getBytes(),l=0;l<o.length;++l){var u=h.toDer(F.certificateToAsn1(o[l])).getBytes();if(c===u)return!0}return!1},t.listAllCertificates=function(){var i=[];for(var o in t.certs)if(t.certs.hasOwnProperty(o)){var c=t.certs[o];if(!Q.util.isArray(c))i.push(c);else for(var l=0;l<c.length;++l)i.push(c[l])}return i},t.removeCertificate=function(i){var o;if(typeof i=="string"&&(i=Q.pki.certificateFromPem(i)),a(i.subject),!t.hasCertificate(i))return null;var c=r(i.subject);if(!Q.util.isArray(c))return o=t.certs[i.subject.hash],delete t.certs[i.subject.hash],o;for(var l=h.toDer(F.certificateToAsn1(i)).getBytes(),u=0;u<c.length;++u){var p=h.toDer(F.certificateToAsn1(c[u])).getBytes();l===p&&(o=c[u],c.splice(u,1))}return c.length===0&&delete t.certs[i.subject.hash],o};function r(i){return a(i),t.certs[i.hash]||null}function a(i){if(!i.hash){var o=Q.md.sha1.create();i.attributes=F.RDNAttributesAsArray(Xa(i),o),i.hash=o.digest().toHex()}}if(e)for(var n=0;n<e.length;++n){var s=e[n];t.addCertificate(s)}return t},F.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"},F.verifyCertificateChain=function(e,t,r){typeof r=="function"&&(r={verify:r}),r=r||{},t=t.slice(0);var a=t.slice(0),n=r.validityCheckDate;typeof n>"u"&&(n=new Date);var s=!0,i=null,o=0;do{var c=t.shift(),l=null,u=!1;if(n&&(n<c.validity.notBefore||n>c.validity.notAfter)&&(i={message:"Certificate is not valid yet or has expired.",error:F.certificateError.certificate_expired,notBefore:c.validity.notBefore,notAfter:c.validity.notAfter,now:n}),i===null){if(l=t[0]||e.getIssuer(c),l===null&&c.isIssuer(c)&&(u=!0,l=c),l){var p=l;Q.util.isArray(p)||(p=[p]);for(var d=!1;!d&&p.length>0;){l=p.shift();try{d=l.verify(c)}catch{}}d||(i={message:"Certificate signature is invalid.",error:F.certificateError.bad_certificate})}i===null&&(!l||u)&&!e.hasCertificate(c)&&(i={message:"Certificate is not trusted.",error:F.certificateError.unknown_ca})}if(i===null&&l&&!c.isIssuer(l)&&(i={message:"Certificate issuer is invalid.",error:F.certificateError.bad_certificate}),i===null)for(var x={keyUsage:!0,basicConstraints:!0},m=0;i===null&&m<c.extensions.length;++m){var y=c.extensions[m];y.critical&&!(y.name in x)&&(i={message:"Certificate has an unsupported critical extension.",error:F.certificateError.unsupported_certificate})}if(i===null&&(!s||t.length===0&&(!l||u))){var b=c.getExtension("basicConstraints"),C=c.getExtension("keyUsage");if(C!==null&&(!C.keyCertSign||b===null)&&(i={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:F.certificateError.bad_certificate}),i===null&&b===null&&(i={message:"Certificate is missing basicConstraints extension and cannot be used as a CA.",error:F.certificateError.bad_certificate}),i===null&&b!==null&&!b.cA&&(i={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:F.certificateError.bad_certificate}),i===null&&C!==null&&"pathLenConstraint"in b){var B=o-1;B>b.pathLenConstraint&&(i={message:"Certificate basicConstraints pathLenConstraint violated.",error:F.certificateError.bad_certificate})}}var _=i===null?!0:i.error,k=r.verify?r.verify(_,o,a):_;if(k===!0)i=null;else throw _===!0&&(i={message:"The application rejected the certificate.",error:F.certificateError.bad_certificate}),(k||k===0)&&(typeof k=="object"&&!Q.util.isArray(k)?(k.message&&(i.message=k.message),k.error&&(i.error=k.error)):typeof k=="string"&&(i.error=k)),i;s=!1,++o}while(t.length>0);return!0};var Be=re,S=Be.asn1,le=Be.pki,hc=Be.pkcs12=Be.pkcs12||{},k0={name:"ContentInfo",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:S.Class.UNIVERSAL,type:S.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:S.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},wC={name:"PFX",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:S.Class.UNIVERSAL,type:S.Type.INTEGER,constructed:!1,capture:"version"},k0,{name:"PFX.macData",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:S.Class.UNIVERSAL,type:S.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:S.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:S.Class.UNIVERSAL,type:S.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:S.Class.UNIVERSAL,type:S.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:S.Class.UNIVERSAL,type:S.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},AC={name:"SafeBag",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:S.Class.UNIVERSAL,type:S.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:S.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:S.Class.UNIVERSAL,type:S.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},IC={name:"Attribute",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:S.Class.UNIVERSAL,type:S.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:S.Class.UNIVERSAL,type:S.Type.SET,constructed:!0,capture:"values"}]},BC={name:"CertBag",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:S.Class.UNIVERSAL,type:S.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:S.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:S.Class.UNIVERSAL,type:S.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function vc(e,t,r,a){for(var n=[],s=0;s<e.length;s++)for(var i=0;i<e[s].safeBags.length;i++){var o=e[s].safeBags[i];if(!(a!==void 0&&o.type!==a)){if(t===null){n.push(o);continue}o.attributes[t]!==void 0&&o.attributes[t].indexOf(r)>=0&&n.push(o)}}return n}hc.pkcs12FromAsn1=function(e,t,r){typeof t=="string"?(r=t,t=!0):t===void 0&&(t=!0);var a={},n=[];if(!S.validate(e,wC,a,n)){var s=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw s.errors=s,s}var i={version:a.version.charCodeAt(0),safeContents:[],getBags:function(b){var C={},B;return"localKeyId"in b?B=b.localKeyId:"localKeyIdHex"in b&&(B=Be.util.hexToBytes(b.localKeyIdHex)),B===void 0&&!("friendlyName"in b)&&"bagType"in b&&(C[b.bagType]=vc(i.safeContents,null,null,b.bagType)),B!==void 0&&(C.localKeyId=vc(i.safeContents,"localKeyId",B,b.bagType)),"friendlyName"in b&&(C.friendlyName=vc(i.safeContents,"friendlyName",b.friendlyName,b.bagType)),C},getBagsByFriendlyName:function(b,C){return vc(i.safeContents,"friendlyName",b,C)},getBagsByLocalKeyId:function(b,C){return vc(i.safeContents,"localKeyId",b,C)}};if(a.version.charCodeAt(0)!==3){var s=new Error("PKCS#12 PFX of version other than 3 not supported.");throw s.version=a.version.charCodeAt(0),s}if(S.derToOid(a.contentType)!==le.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=S.derToOid(a.contentType),s}var o=a.content.value[0];if(o.tagClass!==S.Class.UNIVERSAL||o.type!==S.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(o=Yu(o),a.mac){var c=null,l=0,u=S.derToOid(a.macAlgorithm);switch(u){case le.oids.sha1:c=Be.md.sha1.create(),l=20;break;case le.oids.sha256:c=Be.md.sha256.create(),l=32;break;case le.oids.sha384:c=Be.md.sha384.create(),l=48;break;case le.oids.sha512:c=Be.md.sha512.create(),l=64;break;case le.oids.md5:c=Be.md.md5.create(),l=16;break}if(c===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+u);var p=new Be.util.ByteBuffer(a.macSalt),d="macIterations"in a?parseInt(Be.util.bytesToHex(a.macIterations),16):1,x=hc.generateKey(r,p,3,d,l,c),m=Be.hmac.create();m.start(c,x),m.update(o.value);var y=m.getMac();if(y.getBytes()!==a.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(e.value)&&e.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");return _C(i,o.value,t,r),i};function Yu(e){if(e.composed||e.constructed){for(var t=Be.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 _C(e,t,r,a){if(t=S.fromDer(t,r),t.tagClass!==S.Class.UNIVERSAL||t.type!==S.Type.SEQUENCE||t.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var n=0;n<t.value.length;n++){var s=t.value[n],i={},o=[];if(!S.validate(s,k0,i,o)){var c=new Error("Cannot read ContentInfo.");throw c.errors=o,c}var l={encrypted:!1},u=null,p=i.content.value[0];switch(S.derToOid(i.contentType)){case le.oids.data:if(p.tagClass!==S.Class.UNIVERSAL||p.type!==S.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");u=Yu(p).value;break;case le.oids.encryptedData:u=RC(p,a),l.encrypted=!0;break;default:var c=new Error("Unsupported PKCS#12 contentType.");throw c.contentType=S.derToOid(i.contentType),c}l.safeBags=kC(u,r,a),e.safeContents.push(l)}}function RC(e,t){var r={},a=[];if(!S.validate(e,Be.pkcs7.asn1.encryptedDataValidator,r,a)){var n=new Error("Cannot read EncryptedContentInfo.");throw n.errors=a,n}var s=S.derToOid(r.contentType);if(s!==le.oids.data){var n=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw n.oid=s,n}s=S.derToOid(r.encAlgorithm);var i=le.pbe.getCipher(s,r.encParameter,t),o=Yu(r.encryptedContentAsn1),c=Be.util.createBuffer(o.value);if(i.update(c),!i.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return i.output.getBytes()}function kC(e,t,r){if(!t&&e.length===0)return[];if(e=S.fromDer(e,t),e.tagClass!==S.Class.UNIVERSAL||e.type!==S.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var a=[],n=0;n<e.value.length;n++){var s=e.value[n],i={},o=[];if(!S.validate(s,AC,i,o)){var c=new Error("Cannot read SafeBag.");throw c.errors=o,c}var l={type:S.derToOid(i.bagId),attributes:NC(i.bagAttributes)};a.push(l);var u,p,d=i.bagValue.value[0];switch(l.type){case le.oids.pkcs8ShroudedKeyBag:if(d=le.decryptPrivateKeyInfo(d,r),d===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case le.oids.keyBag:try{l.key=le.privateKeyFromAsn1(d)}catch{l.key=null,l.asn1=d}continue;case le.oids.certBag:u=BC,p=function(){if(S.derToOid(i.certId)!==le.oids.x509Certificate){var m=new Error("Unsupported certificate type, only X.509 supported.");throw m.oid=S.derToOid(i.certId),m}var y=S.fromDer(i.cert,t);try{l.cert=le.certificateFromAsn1(y,!0)}catch{l.cert=null,l.asn1=y}};break;default:var c=new Error("Unsupported PKCS#12 SafeBag type.");throw c.oid=l.type,c}if(u!==void 0&&!S.validate(d,u,i,o)){var c=new Error("Cannot read PKCS#12 "+u.name);throw c.errors=o,c}p()}return a}function NC(e){var t={};if(e!==void 0)for(var r=0;r<e.length;++r){var a={},n=[];if(!S.validate(e[r],IC,a,n)){var s=new Error("Cannot read PKCS#12 BagAttribute.");throw s.errors=n,s}var i=S.derToOid(a.oid);if(le.oids[i]!==void 0){t[le.oids[i]]=[];for(var o=0;o<a.values.length;++o)t[le.oids[i]].push(a.values[o].value)}}return t}hc.toPkcs12Asn1=function(e,t,r,a){a=a||{},a.saltSize=a.saltSize||8,a.count=a.count||2048,a.algorithm=a.algorithm||a.encAlgorithm||"aes128","useMac"in a||(a.useMac=!0),"localKeyId"in a||(a.localKeyId=null),"generateLocalKeyId"in a||(a.generateLocalKeyId=!0);var n=a.localKeyId,s;if(n!==null)n=Be.util.hexToBytes(n);else if(a.generateLocalKeyId)if(t){var i=Be.util.isArray(t)?t[0]:t;typeof i=="string"&&(i=le.certificateFromPem(i));var o=Be.md.sha1.create();o.update(S.toDer(le.certificateToAsn1(i)).getBytes()),n=o.digest().getBytes()}else n=Be.random.getBytes(20);var c=[];n!==null&&c.push(S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(le.oids.localKeyId).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SET,!0,[S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,n)])])),"friendlyName"in a&&c.push(S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(le.oids.friendlyName).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SET,!0,[S.create(S.Class.UNIVERSAL,S.Type.BMPSTRING,!1,a.friendlyName)])])),c.length>0&&(s=S.create(S.Class.UNIVERSAL,S.Type.SET,!0,c));var l=[],u=[];t!==null&&(Be.util.isArray(t)?u=t:u=[t]);for(var p=[],d=0;d<u.length;++d){t=u[d],typeof t=="string"&&(t=le.certificateFromPem(t));var x=d===0?s:void 0,m=le.certificateToAsn1(t),y=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(le.oids.certBag).getBytes()),S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(le.oids.x509Certificate).getBytes()),S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,S.toDer(m).getBytes())])])]),x]);p.push(y)}if(p.length>0){var b=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,p),C=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(le.oids.data).getBytes()),S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,S.toDer(b).getBytes())])]);l.push(C)}var B=null;if(e!==null){var _=le.wrapRsaPrivateKey(le.privateKeyToAsn1(e));r===null?B=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(le.oids.keyBag).getBytes()),S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[_]),s]):B=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(le.oids.pkcs8ShroudedKeyBag).getBytes()),S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[le.encryptPrivateKeyInfo(_,r,a)]),s]);var k=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[B]),N=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(le.oids.data).getBytes()),S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,S.toDer(k).getBytes())])]);l.push(N)}var D=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,l),K;if(a.useMac){var o=Be.md.sha1.create(),W=new Be.util.ByteBuffer(Be.random.getBytes(a.saltSize)),X=a.count,e=hc.generateKey(r,W,3,X,20),pe=Be.hmac.create();pe.start(o,e),pe.update(S.toDer(D).getBytes());var me=pe.getMac();K=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(le.oids.sha1).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.NULL,!1,"")]),S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,me.getBytes())]),S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,W.getBytes()),S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,S.integerToDer(X).getBytes())])}return S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,S.integerToDer(3).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(le.oids.data).getBytes()),S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,S.toDer(D).getBytes())])]),K])},hc.generateKey=Be.pbe.generatePkcs12Key;var ua=re,Ju=ua.asn1,Ya=ua.pki=ua.pki||{};Ya.pemToDer=function(e){var t=ua.pem.decode(e)[0];if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return ua.util.createBuffer(t.body)},Ya.privateKeyFromPem=function(e){var t=ua.pem.decode(e)[0];if(t.type!=="PRIVATE KEY"&&t.type!=="RSA PRIVATE KEY"){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&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var a=Ju.fromDer(t.body);return Ya.privateKeyFromAsn1(a)},Ya.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:Ju.toDer(Ya.privateKeyToAsn1(e)).getBytes()};return ua.pem.encode(r,{maxline:t})},Ya.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:Ju.toDer(e).getBytes()};return ua.pem.encode(r,{maxline:t})};var U=re,fl=function(e,t,r,a){var n=U.util.createBuffer(),s=e.length>>1,i=s+(e.length&1),o=e.substr(0,i),c=e.substr(s,i),l=U.util.createBuffer(),u=U.hmac.create();r=t+r;var p=Math.ceil(a/16),d=Math.ceil(a/20);u.start("MD5",o);var x=U.util.createBuffer();l.putBytes(r);for(var m=0;m<p;++m)u.start(null,null),u.update(l.getBytes()),l.putBuffer(u.digest()),u.start(null,null),u.update(l.bytes()+r),x.putBuffer(u.digest());u.start("SHA1",c);var y=U.util.createBuffer();l.clear(),l.putBytes(r);for(var m=0;m<d;++m)u.start(null,null),u.update(l.getBytes()),l.putBuffer(u.digest()),u.start(null,null),u.update(l.bytes()+r),y.putBuffer(u.digest());return n.putBytes(U.util.xorBytes(x.getBytes(),y.getBytes(),a)),n},LC=function(e,t,r){var a=U.hmac.create();a.start("SHA1",e);var n=U.util.createBuffer();return n.putInt32(t[0]),n.putInt32(t[1]),n.putByte(r.type),n.putByte(r.version.major),n.putByte(r.version.minor),n.putInt16(r.length),n.putBytes(r.fragment.bytes()),a.update(n.getBytes()),a.digest().getBytes()},UC=function(e,t,r){var a=!1;try{var n=e.deflate(t.fragment.getBytes());t.fragment=U.util.createBuffer(n),t.length=n.length,a=!0}catch{}return a},PC=function(e,t,r){var a=!1;try{var n=e.inflate(t.fragment.getBytes());t.fragment=U.util.createBuffer(n),t.length=n.length,a=!0}catch{}return a},Bt=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();break}return U.util.createBuffer(e.getBytes(r))},Pt=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},g={};g.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}},g.SupportedVersions=[g.Versions.TLS_1_1,g.Versions.TLS_1_0],g.Version=g.SupportedVersions[0],g.MaxFragment=15360,g.ConnectionEnd={server:0,client:1},g.PRFAlgorithm={tls_prf_sha256:0},g.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},g.CipherType={stream:0,block:1,aead:2},g.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},g.CompressionMethod={none:0,deflate:1},g.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},g.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},g.Alert={},g.Alert.Level={warning:1,fatal:2},g.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},g.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},g.CipherSuites={},g.getCipherSuite=function(e){var t=null;for(var r in g.CipherSuites){var a=g.CipherSuites[r];if(a.id[0]===e.charCodeAt(0)&&a.id[1]===e.charCodeAt(1)){t=a;break}}return t},g.handleUnexpected=function(e,t){var r=!e.open&&e.entity===g.ConnectionEnd.client;r||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unexpected_message}})},g.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(g.queue(e,g.createAlert(e,{level:g.Alert.Level.warning,description:g.Alert.Description.no_renegotiation})),g.flush(e)),e.process()},g.parseHelloMessage=function(e,t,r){var a=null,n=e.entity===g.ConnectionEnd.client;if(r<38)e.error(e,{message:n?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});else{var s=t.fragment,i=s.length();if(a={version:{major:s.getByte(),minor:s.getByte()},random:U.util.createBuffer(s.getBytes(32)),session_id:Bt(s,1),extensions:[]},n?(a.cipher_suite=s.getBytes(2),a.compression_method=s.getByte()):(a.cipher_suites=Bt(s,2),a.compression_methods=Bt(s,1)),i=r-(i-s.length()),i>0){for(var o=Bt(s,2);o.length()>0;)a.extensions.push({type:[o.getByte(),o.getByte()],data:Bt(o,2)});if(!n)for(var c=0;c<a.extensions.length;++c){var l=a.extensions[c];if(l.type[0]===0&&l.type[1]===0)for(var u=Bt(l.data,2);u.length()>0;){var p=u.getByte();if(p!==0)break;e.session.extensions.server_name.serverNameList.push(Bt(u,2).getBytes())}}}if(e.session.version&&(a.version.major!==e.session.version.major||a.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}});if(n)e.session.cipherSuite=g.getCipherSuite(a.cipher_suite);else for(var d=U.util.createBuffer(a.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=g.getCipherSuite(d.getBytes(2)),e.session.cipherSuite===null););if(e.session.cipherSuite===null)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.handshake_failure},cipherSuite:U.util.bytesToHex(a.cipher_suite)});n?e.session.compressionMethod=a.compression_method:e.session.compressionMethod=g.CompressionMethod.none}return a},g.createSecurityParameters=function(e,t){var r=e.entity===g.ConnectionEnd.client,a=t.random.bytes(),n=r?e.session.sp.client_random:a,s=r?a:g.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:g.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:n,server_random:s}},g.handleServerHello=function(e,t,r){var a=g.parseHelloMessage(e,t,r);if(!e.fail){if(a.version.minor<=e.version.minor)e.version.minor=a.version.minor;else return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}});e.session.version=e.version;var n=a.session_id.bytes();n.length>0&&n===e.session.id?(e.expect=L0,e.session.resuming=!0,e.session.sp.server_random=a.random.bytes()):(e.expect=OC,e.session.resuming=!1,g.createSecurityParameters(e,a)),e.session.id=n,e.process()}},g.handleClientHello=function(e,t,r){var a=g.parseHelloMessage(e,t,r);if(!e.fail){var n=a.session_id.bytes(),s=null;if(e.sessionCache&&(s=e.sessionCache.getSession(n),s===null?n="":(s.version.major!==a.version.major||s.version.minor>a.version.minor)&&(s=null,n="")),n.length===0&&(n=U.random.getBytes(32)),e.session.id=n,e.session.clientHelloVersion=a.version,e.session.sp={},s)e.version=e.session.version=s.version,e.session.sp=s.sp;else{for(var i,o=1;o<g.SupportedVersions.length&&(i=g.SupportedVersions[o],!(i.minor<=a.version.minor));++o);e.version={major:i.major,minor:i.minor},e.session.version=e.version}s!==null?(e.expect=ep,e.session.resuming=!0,e.session.sp.client_random=a.random.bytes()):(e.expect=e.verifyClient!==!1?zC:Zu,e.session.resuming=!1,g.createSecurityParameters(e,a)),e.open=!0,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerHello(e)})),e.session.resuming?(g.queue(e,g.createRecord(e,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),e.state.pending=g.createConnectionState(e),e.state.current.write=e.state.pending.write,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createFinished(e)}))):(g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificate(e)})),e.fail||(g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerKeyExchange(e)})),e.verifyClient!==!1&&g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificateRequest(e)})),g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerHelloDone(e)})))),g.flush(e),e.process()}},g.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var a=t.fragment,n={certificate_list:Bt(a,3)},s,i,o=[];try{for(;n.certificate_list.length()>0;)s=Bt(n.certificate_list,3),i=U.asn1.fromDer(s),s=U.pki.certificateFromAsn1(i,!0),o.push(s)}catch(l){return e.error(e,{message:"Could not parse certificate list.",cause:l,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate}})}var c=e.entity===g.ConnectionEnd.client;(c||e.verifyClient===!0)&&o.length===0?e.error(e,{message:c?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}}):o.length===0?e.expect=c?N0:Zu:(c?e.session.serverCertificate=o[0]:e.session.clientCertificate=o[0],g.verifyCertificateChain(e,o)&&(e.expect=c?N0:Zu)),e.process()},g.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unsupported_certificate}});e.expect=FC,e.process()},g.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unsupported_certificate}});var a=t.fragment,n={enc_pre_master_secret:Bt(a,2).getBytes()},s=null;if(e.getPrivateKey)try{s=e.getPrivateKey(e,e.session.serverCertificate),s=U.pki.privateKeyFromPem(s)}catch(c){e.error(e,{message:"Could not get private key.",cause:c,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}})}if(s===null)return e.error(e,{message:"No private key set.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}});try{var i=e.session.sp;i.pre_master_secret=s.decrypt(n.enc_pre_master_secret);var o=e.session.clientHelloVersion;if(o.major!==i.pre_master_secret.charCodeAt(0)||o.minor!==i.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{i.pre_master_secret=U.random.getBytes(48)}e.expect=ep,e.session.clientCertificate!==null&&(e.expect=HC),e.process()},g.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var a=t.fragment,n={certificate_types:Bt(a,1),certificate_authorities:Bt(a,2)};e.session.certificateRequest=n,e.expect=MC,e.process()},g.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var a=t.fragment;a.read-=4;var n=a.bytes();a.read+=4;var s={signature:Bt(a,2).getBytes()},i=U.util.createBuffer();i.putBuffer(e.session.md5.digest()),i.putBuffer(e.session.sha1.digest()),i=i.getBytes();try{var o=e.session.clientCertificate;if(!o.publicKey.verify(i,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(n),e.session.sha1.update(n)}catch{return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.handshake_failure}})}e.expect=ep,e.process()},g.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.record_overflow}});if(e.serverCertificate===null){var a={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.insufficient_security}},n=0,s=e.verify(e,a.alert.description,n,[]);if(s!==!0)return(s||s===0)&&(typeof s=="object"&&!U.util.isArray(s)?(s.message&&(a.message=s.message),s.alert&&(a.alert.description=s.alert)):typeof s=="number"&&(a.alert.description=s)),e.error(e,a)}e.session.certificateRequest!==null&&(t=g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificate(e)}),g.queue(e,t)),t=g.createRecord(e,{type:g.ContentType.handshake,data:g.createClientKeyExchange(e)}),g.queue(e,t),e.expect=jC;var i=function(o,c){o.session.certificateRequest!==null&&o.session.clientCertificate!==null&&g.queue(o,g.createRecord(o,{type:g.ContentType.handshake,data:g.createCertificateVerify(o,c)})),g.queue(o,g.createRecord(o,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),o.state.pending=g.createConnectionState(o),o.state.current.write=o.state.pending.write,g.queue(o,g.createRecord(o,{type:g.ContentType.handshake,data:g.createFinished(o)})),o.expect=L0,g.flush(o),o.process()};if(e.session.certificateRequest===null||e.session.clientCertificate===null)return i(e,null);g.getClientSignature(e,i)},g.handleChangeCipherSpec=function(e,t){if(t.fragment.getByte()!==1)return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=e.entity===g.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=g.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?VC:$C,e.process()},g.handleFinished=function(e,t,r){var a=t.fragment;a.read-=4;var n=a.bytes();a.read+=4;var s=t.fragment.getBytes();a=U.util.createBuffer(),a.putBuffer(e.session.md5.digest()),a.putBuffer(e.session.sha1.digest());var i=e.entity===g.ConnectionEnd.client,o=i?"server finished":"client finished",c=e.session.sp,l=12,u=fl;if(a=u(c.master_secret,o,a.getBytes(),l),a.getBytes()!==s)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.decrypt_error}});e.session.md5.update(n),e.session.sha1.update(n),(e.session.resuming&&i||!e.session.resuming&&!i)&&(g.queue(e,g.createRecord(e,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createFinished(e)}))),e.expect=i?qC:GC,e.handshaking=!1,++e.handshakes,e.peerCertificate=i?e.session.serverCertificate:e.session.clientCertificate,g.flush(e),e.isConnected=!0,e.connected(e),e.process()},g.handleAlert=function(e,t){var r=t.fragment,a={level:r.getByte(),description:r.getByte()},n;switch(a.description){case g.Alert.Description.close_notify:n="Connection closed.";break;case g.Alert.Description.unexpected_message:n="Unexpected message.";break;case g.Alert.Description.bad_record_mac:n="Bad record MAC.";break;case g.Alert.Description.decryption_failed:n="Decryption failed.";break;case g.Alert.Description.record_overflow:n="Record overflow.";break;case g.Alert.Description.decompression_failure:n="Decompression failed.";break;case g.Alert.Description.handshake_failure:n="Handshake failure.";break;case g.Alert.Description.bad_certificate:n="Bad certificate.";break;case g.Alert.Description.unsupported_certificate:n="Unsupported certificate.";break;case g.Alert.Description.certificate_revoked:n="Certificate revoked.";break;case g.Alert.Description.certificate_expired:n="Certificate expired.";break;case g.Alert.Description.certificate_unknown:n="Certificate unknown.";break;case g.Alert.Description.illegal_parameter:n="Illegal parameter.";break;case g.Alert.Description.unknown_ca:n="Unknown certificate authority.";break;case g.Alert.Description.access_denied:n="Access denied.";break;case g.Alert.Description.decode_error:n="Decode error.";break;case g.Alert.Description.decrypt_error:n="Decrypt error.";break;case g.Alert.Description.export_restriction:n="Export restriction.";break;case g.Alert.Description.protocol_version:n="Unsupported protocol version.";break;case g.Alert.Description.insufficient_security:n="Insufficient security.";break;case g.Alert.Description.internal_error:n="Internal error.";break;case g.Alert.Description.user_canceled:n="User canceled.";break;case g.Alert.Description.no_renegotiation:n="Renegotiation not supported.";break;default:n="Unknown error.";break}if(a.description===g.Alert.Description.close_notify)return e.close();e.error(e,{message:n,send:!1,origin:e.entity===g.ConnectionEnd.client?"server":"client",alert:a}),e.process()},g.handleHandshake=function(e,t){var r=t.fragment,a=r.getByte(),n=r.getInt24();if(n>r.length())return e.fragmented=t,t.fragment=U.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var s=r.bytes(n+4);r.read+=4,a in hl[e.entity][e.expect]?(e.entity===g.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:U.md.md5.create(),sha1:U.md.sha1.create()}),a!==g.HandshakeType.hello_request&&a!==g.HandshakeType.certificate_verify&&a!==g.HandshakeType.finished&&(e.session.md5.update(s),e.session.sha1.update(s)),hl[e.entity][e.expect][a](e,t,n)):g.handleUnexpected(e,t)},g.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},g.handleHeartbeat=function(e,t){var r=t.fragment,a=r.getByte(),n=r.getInt16(),s=r.getBytes(n);if(a===g.HeartbeatMessageType.heartbeat_request){if(e.handshaking||n>s.length)return e.process();g.queue(e,g.createRecord(e,{type:g.ContentType.heartbeat,data:g.createHeartbeat(g.HeartbeatMessageType.heartbeat_response,s)})),g.flush(e)}else if(a===g.HeartbeatMessageType.heartbeat_response){if(s!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,U.util.createBuffer(s))}e.process()};var DC=0,OC=1,N0=2,FC=3,MC=4,L0=5,VC=6,qC=7,jC=8,KC=0,zC=1,Zu=2,HC=3,ep=4,$C=5,GC=6,v=g.handleUnexpected,U0=g.handleChangeCipherSpec,Ye=g.handleAlert,dt=g.handleHandshake,P0=g.handleApplicationData,Je=g.handleHeartbeat,tp=[];tp[g.ConnectionEnd.client]=[[v,Ye,dt,v,Je],[v,Ye,dt,v,Je],[v,Ye,dt,v,Je],[v,Ye,dt,v,Je],[v,Ye,dt,v,Je],[U0,Ye,v,v,Je],[v,Ye,dt,v,Je],[v,Ye,dt,P0,Je],[v,Ye,dt,v,Je]],tp[g.ConnectionEnd.server]=[[v,Ye,dt,v,Je],[v,Ye,dt,v,Je],[v,Ye,dt,v,Je],[v,Ye,dt,v,Je],[U0,Ye,v,v,Je],[v,Ye,dt,v,Je],[v,Ye,dt,P0,Je],[v,Ye,dt,v,Je]];var pa=g.handleHelloRequest,QC=g.handleServerHello,D0=g.handleCertificate,O0=g.handleServerKeyExchange,ap=g.handleCertificateRequest,ml=g.handleServerHelloDone,F0=g.handleFinished,hl=[];hl[g.ConnectionEnd.client]=[[v,v,QC,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v],[pa,v,v,v,v,v,v,v,v,v,v,D0,O0,ap,ml,v,v,v,v,v,v],[pa,v,v,v,v,v,v,v,v,v,v,v,O0,ap,ml,v,v,v,v,v,v],[pa,v,v,v,v,v,v,v,v,v,v,v,v,ap,ml,v,v,v,v,v,v],[pa,v,v,v,v,v,v,v,v,v,v,v,v,v,ml,v,v,v,v,v,v],[pa,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v],[pa,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,F0],[pa,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v],[pa,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v]];var WC=g.handleClientHello,XC=g.handleClientKeyExchange,YC=g.handleCertificateVerify;hl[g.ConnectionEnd.server]=[[v,WC,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v],[v,v,v,v,v,v,v,v,v,v,v,D0,v,v,v,v,v,v,v,v,v],[v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,XC,v,v,v,v],[v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,YC,v,v,v,v,v],[v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v],[v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,F0],[v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v],[v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v]],g.generateKeys=function(e,t){var r=fl,a=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",a,48).bytes(),t.pre_master_secret=null),a=t.server_random+t.client_random;var n=2*t.mac_key_length+2*t.enc_key_length,s=e.version.major===g.Versions.TLS_1_0.major&&e.version.minor===g.Versions.TLS_1_0.minor;s&&(n+=2*t.fixed_iv_length);var i=r(t.master_secret,"key expansion",a,n),o={client_write_MAC_key:i.getBytes(t.mac_key_length),server_write_MAC_key:i.getBytes(t.mac_key_length),client_write_key:i.getBytes(t.enc_key_length),server_write_key:i.getBytes(t.enc_key_length)};return s&&(o.client_write_IV=i.getBytes(t.fixed_iv_length),o.server_write_IV=i.getBytes(t.fixed_iv_length)),o},g.createConnectionState=function(e){var t=e.entity===g.ConnectionEnd.client,r=function(){var s={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(i){return!0},compressionState:null,compressFunction:function(i){return!0},updateSequenceNumber:function(){s.sequenceNumber[1]===4294967295?(s.sequenceNumber[1]=0,++s.sequenceNumber[0]):++s.sequenceNumber[1]}};return s},a={read:r(),write:r()};if(a.read.update=function(s,i){return a.read.cipherFunction(i,a.read)?a.read.compressFunction(s,i,a.read)||s.error(s,{message:"Could not decompress record.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_record_mac}}),!s.fail},a.write.update=function(s,i){return a.write.compressFunction(s,i,a.write)?a.write.cipherFunction(i,a.write)||s.error(s,{message:"Could not encrypt record.",send:!1,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}),!s.fail},e.session){var n=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(n),n.keys=g.generateKeys(e,n),a.read.macKey=t?n.keys.server_write_MAC_key:n.keys.client_write_MAC_key,a.write.macKey=t?n.keys.client_write_MAC_key:n.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(a,e,n),n.compression_algorithm){case g.CompressionMethod.none:break;case g.CompressionMethod.deflate:a.read.compressFunction=PC,a.write.compressFunction=UC;break;default:throw new Error("Unsupported compression algorithm.")}}return a},g.createRandom=function(){var e=new Date,t=+e+e.getTimezoneOffset()*6e4,r=U.util.createBuffer();return r.putInt32(t),r.putBytes(U.random.getBytes(28)),r},g.createRecord=function(e,t){if(!t.data)return null;var r={type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data};return r},g.createAlert=function(e,t){var r=U.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),g.createRecord(e,{type:g.ContentType.alert,data:r})},g.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=U.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var a=e.cipherSuites[r];t.putByte(a.id[0]),t.putByte(a.id[1])}var n=t.length(),s=U.util.createBuffer();s.putByte(g.CompressionMethod.none);var i=s.length(),o=U.util.createBuffer();if(e.virtualHost){var c=U.util.createBuffer();c.putByte(0),c.putByte(0);var l=U.util.createBuffer();l.putByte(0),Pt(l,2,U.util.createBuffer(e.virtualHost));var u=U.util.createBuffer();Pt(u,2,l),Pt(c,2,u),o.putBuffer(c)}var p=o.length();p>0&&(p+=2);var d=e.session.id,x=d.length+1+2+4+28+2+n+1+i+p,m=U.util.createBuffer();return m.putByte(g.HandshakeType.client_hello),m.putInt24(x),m.putByte(e.version.major),m.putByte(e.version.minor),m.putBytes(e.session.sp.client_random),Pt(m,1,U.util.createBuffer(d)),Pt(m,2,t),Pt(m,1,s),p>0&&Pt(m,2,o),m},g.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,a=U.util.createBuffer();return a.putByte(g.HandshakeType.server_hello),a.putInt24(r),a.putByte(e.version.major),a.putByte(e.version.minor),a.putBytes(e.session.sp.server_random),Pt(a,1,U.util.createBuffer(t)),a.putByte(e.session.cipherSuite.id[0]),a.putByte(e.session.cipherSuite.id[1]),a.putByte(e.session.compressionMethod),a},g.createCertificate=function(e){var t=e.entity===g.ConnectionEnd.client,r=null;if(e.getCertificate){var a;t?a=e.session.certificateRequest:a=e.session.extensions.server_name.serverNameList,r=e.getCertificate(e,a)}var n=U.util.createBuffer();if(r!==null)try{U.util.isArray(r)||(r=[r]);for(var s=null,i=0;i<r.length;++i){var o=U.pem.decode(r[i])[0];if(o.type!=="CERTIFICATE"&&o.type!=="X509 CERTIFICATE"&&o.type!=="TRUSTED CERTIFICATE"){var c=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw c.headerType=o.type,c}if(o.procType&&o.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var l=U.util.createBuffer(o.body);s===null&&(s=U.asn1.fromDer(l.bytes(),!1));var u=U.util.createBuffer();Pt(u,3,l),n.putBuffer(u)}r=U.pki.certificateFromAsn1(s),t?e.session.clientCertificate=r:e.session.serverCertificate=r}catch(x){return e.error(e,{message:"Could not send certificate list.",cause:x,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate}})}var p=3+n.length(),d=U.util.createBuffer();return d.putByte(g.HandshakeType.certificate),d.putInt24(p),Pt(d,3,n),d},g.createClientKeyExchange=function(e){var t=U.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(U.random.getBytes(46));var r=e.session.sp;r.pre_master_secret=t.getBytes();var a=e.session.serverCertificate.publicKey;t=a.encrypt(r.pre_master_secret);var n=t.length+2,s=U.util.createBuffer();return s.putByte(g.HandshakeType.client_key_exchange),s.putInt24(n),s.putInt16(t.length),s.putBytes(t),s},g.createServerKeyExchange=function(e){var t=U.util.createBuffer();return t},g.getClientSignature=function(e,t){var r=U.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(a,n,s){var i=null;if(a.getPrivateKey)try{i=a.getPrivateKey(a,a.session.clientCertificate),i=U.pki.privateKeyFromPem(i)}catch(o){a.error(a,{message:"Could not get private key.",cause:o,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}})}i===null?a.error(a,{message:"No private key set.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}):n=i.sign(n,null),s(a,n)},e.getSignature(e,r,t)},g.createCertificateVerify=function(e,t){var r=t.length+2,a=U.util.createBuffer();return a.putByte(g.HandshakeType.certificate_verify),a.putInt24(r),a.putInt16(t.length),a.putBytes(t),a},g.createCertificateRequest=function(e){var t=U.util.createBuffer();t.putByte(1);var r=U.util.createBuffer();for(var a in e.caStore.certs){var n=e.caStore.certs[a],s=U.pki.distinguishedNameToAsn1(n.subject),i=U.asn1.toDer(s);r.putInt16(i.length()),r.putBuffer(i)}var o=1+t.length()+2+r.length(),c=U.util.createBuffer();return c.putByte(g.HandshakeType.certificate_request),c.putInt24(o),Pt(c,1,t),Pt(c,2,r),c},g.createServerHelloDone=function(e){var t=U.util.createBuffer();return t.putByte(g.HandshakeType.server_hello_done),t.putInt24(0),t},g.createChangeCipherSpec=function(){var e=U.util.createBuffer();return e.putByte(1),e},g.createFinished=function(e){var t=U.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===g.ConnectionEnd.client,a=e.session.sp,n=12,s=fl,i=r?"client finished":"server finished";t=s(a.master_secret,i,t.getBytes(),n);var o=U.util.createBuffer();return o.putByte(g.HandshakeType.finished),o.putInt24(t.length()),o.putBuffer(t),o},g.createHeartbeat=function(e,t,r){typeof r>"u"&&(r=t.length);var a=U.util.createBuffer();a.putByte(e),a.putInt16(r),a.putBytes(t);var n=a.length(),s=Math.max(16,n-r-3);return a.putBytes(U.random.getBytes(s)),a},g.queue=function(e,t){if(t&&!(t.fragment.length()===0&&(t.type===g.ContentType.handshake||t.type===g.ContentType.alert||t.type===g.ContentType.change_cipher_spec))){if(t.type===g.ContentType.handshake){var r=t.fragment.bytes();e.session.md5.update(r),e.session.sha1.update(r),r=null}var a;if(t.fragment.length()<=g.MaxFragment)a=[t];else{a=[];for(var n=t.fragment.bytes();n.length>g.MaxFragment;)a.push(g.createRecord(e,{type:t.type,data:U.util.createBuffer(n.slice(0,g.MaxFragment))})),n=n.slice(g.MaxFragment);n.length>0&&a.push(g.createRecord(e,{type:t.type,data:U.util.createBuffer(n)}))}for(var s=0;s<a.length&&!e.fail;++s){var i=a[s],o=e.state.current.write;o.update(e,i)&&e.records.push(i)}}},g.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 rp=function(e){switch(e){case!0:return!0;case U.pki.certificateError.bad_certificate:return g.Alert.Description.bad_certificate;case U.pki.certificateError.unsupported_certificate:return g.Alert.Description.unsupported_certificate;case U.pki.certificateError.certificate_revoked:return g.Alert.Description.certificate_revoked;case U.pki.certificateError.certificate_expired:return g.Alert.Description.certificate_expired;case U.pki.certificateError.certificate_unknown:return g.Alert.Description.certificate_unknown;case U.pki.certificateError.unknown_ca:return g.Alert.Description.unknown_ca;default:return g.Alert.Description.bad_certificate}},JC=function(e){switch(e){case!0:return!0;case g.Alert.Description.bad_certificate:return U.pki.certificateError.bad_certificate;case g.Alert.Description.unsupported_certificate:return U.pki.certificateError.unsupported_certificate;case g.Alert.Description.certificate_revoked:return U.pki.certificateError.certificate_revoked;case g.Alert.Description.certificate_expired:return U.pki.certificateError.certificate_expired;case g.Alert.Description.certificate_unknown:return U.pki.certificateError.certificate_unknown;case g.Alert.Description.unknown_ca:return U.pki.certificateError.unknown_ca;default:return U.pki.certificateError.bad_certificate}};g.verifyCertificateChain=function(e,t){try{var r={};for(var a in e.verifyOptions)r[a]=e.verifyOptions[a];r.verify=function(s,i,o){var c=rp(s),l=e.verify(e,s,i,o);if(l!==!0){if(typeof l=="object"&&!U.util.isArray(l)){var u=new Error("The application rejected the certificate.");throw u.send=!0,u.alert={level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate},l.message&&(u.message=l.message),l.alert&&(u.alert.description=l.alert),u}l!==s&&(l=JC(l))}return l},U.pki.verifyCertificateChain(e.caStore,t,r)}catch(s){var n=s;(typeof n!="object"||U.util.isArray(n))&&(n={send:!0,alert:{level:g.Alert.Level.fatal,description:rp(s)}}),"send"in n||(n.send=!0),"alert"in n||(n.alert={level:g.Alert.Level.fatal,description:rp(n.error)}),e.error(e,n)}return!e.fail},g.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 a in e)r.order.length<=t?r.order.push(a):delete e[a];r.getSession=function(n){var s=null,i=null;if(n?i=U.util.bytesToHex(n):r.order.length>0&&(i=r.order[0]),i!==null&&i in r.cache){s=r.cache[i],delete r.cache[i];for(var o in r.order)if(r.order[o]===i){r.order.splice(o,1);break}}return s},r.setSession=function(n,s){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}var i=U.util.bytesToHex(n);r.order.push(i),r.cache[i]=s}}return r},g.createConnection=function(e){var t=null;e.caStore?U.util.isArray(e.caStore)?t=U.pki.createCaStore(e.caStore):t=e.caStore:t=U.pki.createCaStore();var r=e.cipherSuites||null;if(r===null){r=[];for(var a in g.CipherSuites)r.push(g.CipherSuites[a])}var n=e.server?g.ConnectionEnd.server:g.ConnectionEnd.client,s=e.sessionCache?g.createSessionCache(e.sessionCache):null,i={version:{major:g.Version.major,minor:g.Version.minor},entity:n,sessionId:e.sessionId,caStore:t,sessionCache:s,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(u,p,d,x){return p},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:U.util.createBuffer(),tlsData:U.util.createBuffer(),data:U.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(u,p){p.origin=p.origin||(u.entity===g.ConnectionEnd.client?"client":"server"),p.send&&(g.queue(u,g.createAlert(u,p.alert)),g.flush(u));var d=p.fatal!==!1;d&&(u.fail=!0),e.error(u,p),d&&u.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};i.reset=function(u){i.version={major:g.Version.major,minor:g.Version.minor},i.record=null,i.session=null,i.peerCertificate=null,i.state={pending:null,current:null},i.expect=i.entity===g.ConnectionEnd.client?DC:KC,i.fragmented=null,i.records=[],i.open=!1,i.handshakes=0,i.handshaking=!1,i.isConnected=!1,i.fail=!(u||typeof u>"u"),i.input.clear(),i.tlsData.clear(),i.data.clear(),i.state.current=g.createConnectionState(i)},i.reset();var o=function(u,p){var d=p.type-g.ContentType.change_cipher_spec,x=tp[u.entity][u.expect];d in x?x[d](u,p):g.handleUnexpected(u,p)},c=function(u){var p=0,d=u.input,x=d.length();if(x<5)p=5-x;else{u.record={type:d.getByte(),version:{major:d.getByte(),minor:d.getByte()},length:d.getInt16(),fragment:U.util.createBuffer(),ready:!1};var m=u.record.version.major===u.version.major;m&&u.session&&u.session.version&&(m=u.record.version.minor===u.version.minor),m||u.error(u,{message:"Incompatible TLS version.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}})}return p},l=function(u){var p=0,d=u.input,x=d.length();if(x<u.record.length)p=u.record.length-x;else{u.record.fragment.putBytes(d.getBytes(u.record.length)),d.compact();var m=u.state.current.read;m.update(u,u.record)&&(u.fragmented!==null&&(u.fragmented.type===u.record.type?(u.fragmented.fragment.putBuffer(u.record.fragment),u.record=u.fragmented):u.error(u,{message:"Invalid fragmented record.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unexpected_message}})),u.record.ready=!0)}return p};return i.handshake=function(u){if(i.entity!==g.ConnectionEnd.client)i.error(i,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(i.handshaking)i.error(i,{message:"Handshake already in progress.",fatal:!1});else{i.fail&&!i.open&&i.handshakes===0&&(i.fail=!1),i.handshaking=!0,u=u||"";var p=null;u.length>0&&(i.sessionCache&&(p=i.sessionCache.getSession(u)),p===null&&(u="")),u.length===0&&i.sessionCache&&(p=i.sessionCache.getSession(),p!==null&&(u=p.id)),i.session={id:u,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:U.md.md5.create(),sha1:U.md.sha1.create()},p&&(i.version=p.version,i.session.sp=p.sp),i.session.sp.client_random=g.createRandom().getBytes(),i.open=!0,g.queue(i,g.createRecord(i,{type:g.ContentType.handshake,data:g.createClientHello(i)})),g.flush(i)}},i.process=function(u){var p=0;return u&&i.input.putBytes(u),i.fail||(i.record!==null&&i.record.ready&&i.record.fragment.isEmpty()&&(i.record=null),i.record===null&&(p=c(i)),!i.fail&&i.record!==null&&!i.record.ready&&(p=l(i)),!i.fail&&i.record!==null&&i.record.ready&&o(i,i.record)),p},i.prepare=function(u){return g.queue(i,g.createRecord(i,{type:g.ContentType.application_data,data:U.util.createBuffer(u)})),g.flush(i)},i.prepareHeartbeatRequest=function(u,p){return u instanceof U.util.ByteBuffer&&(u=u.bytes()),typeof p>"u"&&(p=u.length),i.expectedHeartbeatPayload=u,g.queue(i,g.createRecord(i,{type:g.ContentType.heartbeat,data:g.createHeartbeat(g.HeartbeatMessageType.heartbeat_request,u,p)})),g.flush(i)},i.close=function(u){if(!i.fail&&i.sessionCache&&i.session){var p={id:i.session.id,version:i.session.version,sp:i.session.sp};p.sp.keys=null,i.sessionCache.setSession(p.id,p)}i.open&&(i.open=!1,i.input.clear(),(i.isConnected||i.handshaking)&&(i.isConnected=i.handshaking=!1,g.queue(i,g.createAlert(i,{level:g.Alert.Level.warning,description:g.Alert.Description.close_notify})),g.flush(i)),i.closed(i)),i.reset(u)},i},U.tls=U.tls||{};for(var np in g)typeof g[np]!="function"&&(U.tls[np]=g[np]);U.tls.prf_tls1=fl,U.tls.hmac_sha1=LC,U.tls.createSessionCache=g.createSessionCache,U.tls.createConnection=g.createConnection;var da=re,Dt=da.tls;Dt.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=Dt.BulkCipherAlgorithm.aes,e.cipher_type=Dt.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=Dt.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:M0},Dt.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=Dt.BulkCipherAlgorithm.aes,e.cipher_type=Dt.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=Dt.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:M0};function M0(e,t,r){var a=t.entity===da.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:da.cipher.createDecipher("AES-CBC",a?r.keys.server_write_key:r.keys.client_write_key),iv:a?r.keys.server_write_IV:r.keys.client_write_IV},e.write.cipherState={init:!1,cipher:da.cipher.createCipher("AES-CBC",a?r.keys.client_write_key:r.keys.server_write_key),iv:a?r.keys.client_write_IV:r.keys.server_write_IV},e.read.cipherFunction=a2,e.write.cipherFunction=ZC,e.read.macLength=e.write.macLength=r.mac_length,e.read.macFunction=e.write.macFunction=Dt.hmac_sha1}function ZC(e,t){var r=!1,a=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(a),t.updateSequenceNumber();var n;e.version.minor===Dt.Versions.TLS_1_0.minor?n=t.cipherState.init?null:t.cipherState.iv:n=da.random.getBytesSync(16),t.cipherState.init=!0;var s=t.cipherState.cipher;return s.start({iv:n}),e.version.minor>=Dt.Versions.TLS_1_1.minor&&s.output.putBytes(n),s.update(e.fragment),s.finish(e2)&&(e.fragment=s.output,e.length=e.fragment.length(),r=!0),r}function e2(e,t,r){if(!r){var a=e-t.length()%e;t.fillWithByte(a-1,a)}return!0}function t2(e,t,r){var a=!0;if(r){for(var n=t.length(),s=t.last(),i=n-1-s;i<n-1;++i)a=a&&t.at(i)==s;a&&t.truncate(s+1)}return a}function a2(e,t){var r=!1,a;e.version.minor===Dt.Versions.TLS_1_0.minor?a=t.cipherState.init?null:t.cipherState.iv:a=e.fragment.getBytes(16),t.cipherState.init=!0;var n=t.cipherState.cipher;n.start({iv:a}),n.update(e.fragment),r=n.finish(t2);var s=t.macLength,i=da.random.getBytesSync(s),o=n.output.length();o>=s?(e.fragment=n.output.getBytes(o-s),i=n.output.getBytes(s)):e.fragment=n.output.getBytes(),e.fragment=da.util.createBuffer(e.fragment),e.length=e.fragment.length();var c=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),r=r2(t.macKey,i,c)&&r,r}function r2(e,t,r){var a=da.hmac.create();return a.start("SHA1",e),a.update(t),t=a.digest().getBytes(),a.start(null,null),a.update(r),r=a.digest().getBytes(),t===r}var ke=re,gc=ke.sha512=ke.sha512||{};ke.md.sha512=ke.md.algorithms.sha512=gc;var V0=ke.sha384=ke.sha512.sha384=ke.sha512.sha384||{};V0.create=function(){return gc.create("SHA-384")},ke.md.sha384=ke.md.algorithms.sha384=V0,ke.sha512.sha256=ke.sha512.sha256||{create:function(){return gc.create("SHA-512/256")}},ke.md["sha512/256"]=ke.md.algorithms["sha512/256"]=ke.sha512.sha256,ke.sha512.sha224=ke.sha512.sha224||{create:function(){return gc.create("SHA-512/224")}},ke.md["sha512/224"]=ke.md.algorithms["sha512/224"]=ke.sha512.sha224,gc.create=function(e){if(q0||n2(),typeof e>"u"&&(e="SHA-512"),!(e in ka))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=ka[e],r=null,a=ke.util.createBuffer(),n=new Array(80),s=0;s<80;++s)n[s]=new Array(2);var i=64;switch(e){case"SHA-384":i=48;break;case"SHA-512/256":i=32;break;case"SHA-512/224":i=28;break}var o={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:i,messageLength:0,fullMessageLength:null,messageLengthSize:16};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength128=[];for(var c=o.messageLengthSize/4,l=0;l<c;++l)o.fullMessageLength.push(0);a=ke.util.createBuffer(),r=new Array(t.length);for(var l=0;l<t.length;++l)r[l]=t[l].slice(0);return o},o.start(),o.update=function(c,l){l==="utf8"&&(c=ke.util.encodeUtf8(c));var u=c.length;o.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var p=o.fullMessageLength.length-1;p>=0;--p)o.fullMessageLength[p]+=u[1],u[1]=u[0]+(o.fullMessageLength[p]/4294967296>>>0),o.fullMessageLength[p]=o.fullMessageLength[p]>>>0,u[0]=u[1]/4294967296>>>0;return a.putBytes(c),j0(r,n,a),(a.read>2048||a.length()===0)&&a.compact(),o},o.digest=function(){var c=ke.util.createBuffer();c.putBytes(a.bytes());var l=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,u=l&o.blockLength-1;c.putBytes(ip.substr(0,o.blockLength-u));for(var p,d,x=o.fullMessageLength[0]*8,m=0;m<o.fullMessageLength.length-1;++m)p=o.fullMessageLength[m+1]*8,d=p/4294967296>>>0,x+=d,c.putInt32(x>>>0),x=p>>>0;c.putInt32(x);for(var y=new Array(r.length),m=0;m<r.length;++m)y[m]=r[m].slice(0);j0(y,n,c);var b=ke.util.createBuffer(),C;e==="SHA-512"?C=y.length:e==="SHA-384"?C=y.length-2:C=y.length-4;for(var m=0;m<C;++m)b.putInt32(y[m][0]),(m!==C-1||e!=="SHA-512/224")&&b.putInt32(y[m][1]);return b},o};var ip=null,q0=!1,sp=null,ka=null;function n2(){ip="\x80",ip+=ke.util.fillString("\0",128),sp=[[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]],ka={},ka["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],ka["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],ka["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],ka["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],q0=!0}function j0(e,t,r){for(var a,n,s,i,o,c,l,u,p,d,x,m,y,b,C,B,_,k,N,D,K,W,X,pe,me,xe,Ne,_e,be,te,$,je,Le,Te,ie,q=r.length();q>=128;){for(be=0;be<16;++be)t[be][0]=r.getInt32()>>>0,t[be][1]=r.getInt32()>>>0;for(;be<80;++be)je=t[be-2],te=je[0],$=je[1],a=((te>>>19|$<<13)^($>>>29|te<<3)^te>>>6)>>>0,n=((te<<13|$>>>19)^($<<3|te>>>29)^(te<<26|$>>>6))>>>0,Te=t[be-15],te=Te[0],$=Te[1],s=((te>>>1|$<<31)^(te>>>8|$<<24)^te>>>7)>>>0,i=((te<<31|$>>>1)^(te<<24|$>>>8)^(te<<25|$>>>7))>>>0,Le=t[be-7],ie=t[be-16],$=n+Le[1]+i+ie[1],t[be][0]=a+Le[0]+s+ie[0]+($/4294967296>>>0)>>>0,t[be][1]=$>>>0;for(y=e[0][0],b=e[0][1],C=e[1][0],B=e[1][1],_=e[2][0],k=e[2][1],N=e[3][0],D=e[3][1],K=e[4][0],W=e[4][1],X=e[5][0],pe=e[5][1],me=e[6][0],xe=e[6][1],Ne=e[7][0],_e=e[7][1],be=0;be<80;++be)l=((K>>>14|W<<18)^(K>>>18|W<<14)^(W>>>9|K<<23))>>>0,u=((K<<18|W>>>14)^(K<<14|W>>>18)^(W<<23|K>>>9))>>>0,p=(me^K&(X^me))>>>0,d=(xe^W&(pe^xe))>>>0,o=((y>>>28|b<<4)^(b>>>2|y<<30)^(b>>>7|y<<25))>>>0,c=((y<<4|b>>>28)^(b<<30|y>>>2)^(b<<25|y>>>7))>>>0,x=(y&C|_&(y^C))>>>0,m=(b&B|k&(b^B))>>>0,$=_e+u+d+sp[be][1]+t[be][1],a=Ne+l+p+sp[be][0]+t[be][0]+($/4294967296>>>0)>>>0,n=$>>>0,$=c+m,s=o+x+($/4294967296>>>0)>>>0,i=$>>>0,Ne=me,_e=xe,me=X,xe=pe,X=K,pe=W,$=D+n,K=N+a+($/4294967296>>>0)>>>0,W=$>>>0,N=_,D=k,_=C,k=B,C=y,B=b,$=n+i,y=a+s+($/4294967296>>>0)>>>0,b=$>>>0;$=e[0][1]+b,e[0][0]=e[0][0]+y+($/4294967296>>>0)>>>0,e[0][1]=$>>>0,$=e[1][1]+B,e[1][0]=e[1][0]+C+($/4294967296>>>0)>>>0,e[1][1]=$>>>0,$=e[2][1]+k,e[2][0]=e[2][0]+_+($/4294967296>>>0)>>>0,e[2][1]=$>>>0,$=e[3][1]+D,e[3][0]=e[3][0]+N+($/4294967296>>>0)>>>0,e[3][1]=$>>>0,$=e[4][1]+W,e[4][0]=e[4][0]+K+($/4294967296>>>0)>>>0,e[4][1]=$>>>0,$=e[5][1]+pe,e[5][0]=e[5][0]+X+($/4294967296>>>0)>>>0,e[5][1]=$>>>0,$=e[6][1]+xe,e[6][0]=e[6][0]+me+($/4294967296>>>0)>>>0,e[6][1]=$>>>0,$=e[7][1]+_e,e[7][0]=e[7][0]+Ne+($/4294967296>>>0)>>>0,e[7][1]=$>>>0,q-=128}}var op={},i2=re,Qe=i2.asn1;op.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},op.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]};var Ze=re,K0=op,s2=K0.publicKeyValidator,o2=K0.privateKeyValidator;if(typeof c2>"u")var c2=Ze.jsbn.BigInteger;var cp=Ze.util.ByteBuffer,At=typeof Buffer>"u"?Uint8Array:Buffer;Ze.pki=Ze.pki||{},Ze.pki.ed25519=Ze.ed25519=Ze.ed25519||{};var ue=Ze.ed25519;ue.constants={},ue.constants.PUBLIC_KEY_BYTE_LENGTH=32,ue.constants.PRIVATE_KEY_BYTE_LENGTH=64,ue.constants.SEED_BYTE_LENGTH=32,ue.constants.SIGN_BYTE_LENGTH=64,ue.constants.HASH_BYTE_LENGTH=64,ue.generateKeyPair=function(e){e=e||{};var t=e.seed;if(t===void 0)t=Ze.random.getBytesSync(ue.constants.SEED_BYTE_LENGTH);else if(typeof t=="string"){if(t.length!==ue.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+ue.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=ea({message:t,encoding:"binary"});for(var r=new At(ue.constants.PUBLIC_KEY_BYTE_LENGTH),a=new At(ue.constants.PRIVATE_KEY_BYTE_LENGTH),n=0;n<32;++n)a[n]=t[n];return d2(r,a),{publicKey:r,privateKey:a}},ue.privateKeyFromAsn1=function(e){var t={},r=[],a=Ze.asn1.validate(e,o2,t,r);if(!a){var n=new Error("Invalid Key.");throw n.errors=r,n}var s=Ze.asn1.derToOid(t.privateKeyOid),i=Ze.oids.EdDSA25519;if(s!==i)throw new Error('Invalid OID "'+s+'"; OID must be "'+i+'".');var o=t.privateKey,c=ea({message:Ze.asn1.fromDer(o).value,encoding:"binary"});return{privateKeyBytes:c}},ue.publicKeyFromAsn1=function(e){var t={},r=[],a=Ze.asn1.validate(e,s2,t,r);if(!a){var n=new Error("Invalid Key.");throw n.errors=r,n}var s=Ze.asn1.derToOid(t.publicKeyOid),i=Ze.oids.EdDSA25519;if(s!==i)throw new Error('Invalid OID "'+s+'"; OID must be "'+i+'".');var o=t.ed25519PublicKey;if(o.length!==ue.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return ea({message:o,encoding:"binary"})},ue.publicKeyFromPrivateKey=function(e){e=e||{};var t=ea({message:e.privateKey,encoding:"binary"});if(t.length!==ue.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+ue.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new At(ue.constants.PUBLIC_KEY_BYTE_LENGTH),a=0;a<r.length;++a)r[a]=t[32+a];return r},ue.sign=function(e){e=e||{};var t=ea(e),r=ea({message:e.privateKey,encoding:"binary"});if(r.length===ue.constants.SEED_BYTE_LENGTH){var a=ue.generateKeyPair({seed:r});r=a.privateKey}else if(r.length!==ue.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+ue.constants.SEED_BYTE_LENGTH+" or "+ue.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new At(ue.constants.SIGN_BYTE_LENGTH+t.length);f2(n,t,t.length,r);for(var s=new At(ue.constants.SIGN_BYTE_LENGTH),i=0;i<s.length;++i)s[i]=n[i];return s},ue.verify=function(e){e=e||{};var t=ea(e);if(e.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var r=ea({message:e.signature,encoding:"binary"});if(r.length!==ue.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+ue.constants.SIGN_BYTE_LENGTH);var a=ea({message:e.publicKey,encoding:"binary"});if(a.length!==ue.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+ue.constants.PUBLIC_KEY_BYTE_LENGTH);var n=new At(ue.constants.SIGN_BYTE_LENGTH+t.length),s=new At(ue.constants.SIGN_BYTE_LENGTH+t.length),i;for(i=0;i<ue.constants.SIGN_BYTE_LENGTH;++i)n[i]=r[i];for(i=0;i<t.length;++i)n[i+ue.constants.SIGN_BYTE_LENGTH]=t[i];return m2(s,n,n.length,a)>=0};function ea(e){var t=e.message;if(t instanceof Uint8Array||t instanceof At)return t;var r=e.encoding;if(t===void 0)if(e.md)t=e.md.digest().getBytes(),r="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof t=="string"&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof t=="string"){if(typeof Buffer<"u")return Buffer.from(t,r);t=new cp(t,r)}else if(!(t instanceof cp))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var a=new At(t.length()),n=0;n<a.length;++n)a[n]=t.at(n);return a}var lp=Y(),vl=Y([1]),l2=Y([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u2=Y([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),z0=Y([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),H0=Y([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),xc=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),p2=Y([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function yc(e,t){var r=Ze.md.sha512.create(),a=new cp(e);r.update(a.getBytes(t),"binary");var n=r.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(n,"binary");for(var s=new At(ue.constants.HASH_BYTE_LENGTH),i=0;i<64;++i)s[i]=n.charCodeAt(i);return s}function d2(e,t){var r=[Y(),Y(),Y(),Y()],a,n=yc(t,32);for(n[0]&=248,n[31]&=127,n[31]|=64,fp(r,n),dp(e,r),a=0;a<32;++a)t[a+32]=e[a];return 0}function f2(e,t,r,a){var n,s,i=new Float64Array(64),o=[Y(),Y(),Y(),Y()],c=yc(a,32);c[0]&=248,c[31]&=127,c[31]|=64;var l=r+64;for(n=0;n<r;++n)e[64+n]=t[n];for(n=0;n<32;++n)e[32+n]=c[32+n];var u=yc(e.subarray(32),r+32);for(up(u),fp(o,u),dp(e,o),n=32;n<64;++n)e[n]=a[n];var p=yc(e,r+64);for(up(p),n=32;n<64;++n)i[n]=0;for(n=0;n<32;++n)i[n]=u[n];for(n=0;n<32;++n)for(s=0;s<32;s++)i[n+s]+=p[n]*c[s];return $0(e.subarray(32),i),l}function m2(e,t,r,a){var n,s,i=new At(32),o=[Y(),Y(),Y(),Y()],c=[Y(),Y(),Y(),Y()];if(s=-1,r<64||v2(c,a)||!h2(t,32))return-1;for(n=0;n<r;++n)e[n]=t[n];for(n=0;n<32;++n)e[n+32]=a[n];var l=yc(e,r);if(up(l),Y0(o,c,l),fp(c,t.subarray(32)),pp(o,c),dp(i,o),r-=64,W0(t,0,i,0)){for(n=0;n<r;++n)e[n]=0;return-1}for(n=0;n<r;++n)e[n]=t[n+64];return s=r,s}function h2(e,t){var r;for(r=31;r>=0;--r){if(e[t+r]<xc[r])return!0;if(e[t+r]>xc[r])return!1}return!1}function $0(e,t){var r,a,n,s;for(a=63;a>=32;--a){for(r=0,n=a-32,s=a-12;n<s;++n)t[n]+=r-16*t[a]*xc[n-(a-32)],r=t[n]+128>>8,t[n]-=r*256;t[n]+=r,t[a]=0}for(r=0,n=0;n<32;++n)t[n]+=r-(t[31]>>4)*xc[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;++n)t[n]-=r*xc[n];for(a=0;a<32;++a)t[a+1]+=t[a]>>8,e[a]=t[a]&255}function up(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;$0(e,t)}function pp(e,t){var r=Y(),a=Y(),n=Y(),s=Y(),i=Y(),o=Y(),c=Y(),l=Y(),u=Y();Za(r,e[1],e[0]),Za(u,t[1],t[0]),we(r,r,u),Ja(a,e[0],e[1]),Ja(u,t[0],t[1]),we(a,a,u),we(n,e[3],t[3]),we(n,n,u2),we(s,e[2],t[2]),Ja(s,s,s),Za(i,a,r),Za(o,s,n),Ja(c,s,n),Ja(l,a,r),we(e[0],i,o),we(e[1],l,c),we(e[2],c,o),we(e[3],i,l)}function G0(e,t,r){for(var a=0;a<4;++a)J0(e[a],t[a],r)}function dp(e,t){var r=Y(),a=Y(),n=Y();b2(n,t[2]),we(r,t[0],n),we(a,t[1],n),gl(e,a),e[31]^=X0(r)<<7}function gl(e,t){var r,a,n,s=Y(),i=Y();for(r=0;r<16;++r)i[r]=t[r];for(mp(i),mp(i),mp(i),a=0;a<2;++a){for(s[0]=i[0]-65517,r=1;r<15;++r)s[r]=i[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=i[15]-32767-(s[14]>>16&1),n=s[15]>>16&1,s[14]&=65535,J0(i,s,1-n)}for(r=0;r<16;r++)e[2*r]=i[r]&255,e[2*r+1]=i[r]>>8}function v2(e,t){var r=Y(),a=Y(),n=Y(),s=Y(),i=Y(),o=Y(),c=Y();return fa(e[2],vl),g2(e[1],t),Na(n,e[1]),we(s,n,l2),Za(n,n,e[2]),Ja(s,e[2],s),Na(i,s),Na(o,i),we(c,o,i),we(r,c,n),we(r,r,s),x2(r,r),we(r,r,n),we(r,r,s),we(r,r,s),we(e[0],r,s),Na(a,e[0]),we(a,a,s),Q0(a,n)&&we(e[0],e[0],p2),Na(a,e[0]),we(a,a,s),Q0(a,n)?-1:(X0(e[0])===t[31]>>7&&Za(e[0],lp,e[0]),we(e[3],e[0],e[1]),0)}function g2(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function x2(e,t){var r=Y(),a;for(a=0;a<16;++a)r[a]=t[a];for(a=250;a>=0;--a)Na(r,r),a!==1&&we(r,r,t);for(a=0;a<16;++a)e[a]=r[a]}function Q0(e,t){var r=new At(32),a=new At(32);return gl(r,e),gl(a,t),W0(r,0,a,0)}function W0(e,t,r,a){return y2(e,t,r,a,32)}function y2(e,t,r,a,n){var s,i=0;for(s=0;s<n;++s)i|=e[t+s]^r[a+s];return(1&i-1>>>8)-1}function X0(e){var t=new At(32);return gl(t,e),t[0]&1}function Y0(e,t,r){var a,n;for(fa(e[0],lp),fa(e[1],vl),fa(e[2],vl),fa(e[3],lp),n=255;n>=0;--n)a=r[n/8|0]>>(n&7)&1,G0(e,t,a),pp(t,e),pp(e,e),G0(e,t,a)}function fp(e,t){var r=[Y(),Y(),Y(),Y()];fa(r[0],z0),fa(r[1],H0),fa(r[2],vl),we(r[3],z0,H0),Y0(e,r,t)}function fa(e,t){var r;for(r=0;r<16;r++)e[r]=t[r]|0}function b2(e,t){var r=Y(),a;for(a=0;a<16;++a)r[a]=t[a];for(a=253;a>=0;--a)Na(r,r),a!==2&&a!==4&&we(r,r,t);for(a=0;a<16;++a)e[a]=r[a]}function mp(e){var t,r,a=1;for(t=0;t<16;++t)r=e[t]+a+65535,a=Math.floor(r/65536),e[t]=r-a*65536;e[0]+=a-1+37*(a-1)}function J0(e,t,r){for(var a,n=~(r-1),s=0;s<16;++s)a=n&(e[s]^t[s]),e[s]^=a,t[s]^=a}function Y(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function Ja(e,t,r){for(var a=0;a<16;++a)e[a]=t[a]+r[a]}function Za(e,t,r){for(var a=0;a<16;++a)e[a]=t[a]-r[a]}function Na(e,t){we(e,t,t)}function we(e,t,r){var a,n,s=0,i=0,o=0,c=0,l=0,u=0,p=0,d=0,x=0,m=0,y=0,b=0,C=0,B=0,_=0,k=0,N=0,D=0,K=0,W=0,X=0,pe=0,me=0,xe=0,Ne=0,_e=0,be=0,te=0,$=0,je=0,Le=0,Te=r[0],ie=r[1],q=r[2],M=r[3],J=r[4],ne=r[5],ee=r[6],Ee=r[7],Ae=r[8],se=r[9],Pe=r[10],De=r[11],fe=r[12],Ke=r[13],et=r[14],tt=r[15];a=t[0],s+=a*Te,i+=a*ie,o+=a*q,c+=a*M,l+=a*J,u+=a*ne,p+=a*ee,d+=a*Ee,x+=a*Ae,m+=a*se,y+=a*Pe,b+=a*De,C+=a*fe,B+=a*Ke,_+=a*et,k+=a*tt,a=t[1],i+=a*Te,o+=a*ie,c+=a*q,l+=a*M,u+=a*J,p+=a*ne,d+=a*ee,x+=a*Ee,m+=a*Ae,y+=a*se,b+=a*Pe,C+=a*De,B+=a*fe,_+=a*Ke,k+=a*et,N+=a*tt,a=t[2],o+=a*Te,c+=a*ie,l+=a*q,u+=a*M,p+=a*J,d+=a*ne,x+=a*ee,m+=a*Ee,y+=a*Ae,b+=a*se,C+=a*Pe,B+=a*De,_+=a*fe,k+=a*Ke,N+=a*et,D+=a*tt,a=t[3],c+=a*Te,l+=a*ie,u+=a*q,p+=a*M,d+=a*J,x+=a*ne,m+=a*ee,y+=a*Ee,b+=a*Ae,C+=a*se,B+=a*Pe,_+=a*De,k+=a*fe,N+=a*Ke,D+=a*et,K+=a*tt,a=t[4],l+=a*Te,u+=a*ie,p+=a*q,d+=a*M,x+=a*J,m+=a*ne,y+=a*ee,b+=a*Ee,C+=a*Ae,B+=a*se,_+=a*Pe,k+=a*De,N+=a*fe,D+=a*Ke,K+=a*et,W+=a*tt,a=t[5],u+=a*Te,p+=a*ie,d+=a*q,x+=a*M,m+=a*J,y+=a*ne,b+=a*ee,C+=a*Ee,B+=a*Ae,_+=a*se,k+=a*Pe,N+=a*De,D+=a*fe,K+=a*Ke,W+=a*et,X+=a*tt,a=t[6],p+=a*Te,d+=a*ie,x+=a*q,m+=a*M,y+=a*J,b+=a*ne,C+=a*ee,B+=a*Ee,_+=a*Ae,k+=a*se,N+=a*Pe,D+=a*De,K+=a*fe,W+=a*Ke,X+=a*et,pe+=a*tt,a=t[7],d+=a*Te,x+=a*ie,m+=a*q,y+=a*M,b+=a*J,C+=a*ne,B+=a*ee,_+=a*Ee,k+=a*Ae,N+=a*se,D+=a*Pe,K+=a*De,W+=a*fe,X+=a*Ke,pe+=a*et,me+=a*tt,a=t[8],x+=a*Te,m+=a*ie,y+=a*q,b+=a*M,C+=a*J,B+=a*ne,_+=a*ee,k+=a*Ee,N+=a*Ae,D+=a*se,K+=a*Pe,W+=a*De,X+=a*fe,pe+=a*Ke,me+=a*et,xe+=a*tt,a=t[9],m+=a*Te,y+=a*ie,b+=a*q,C+=a*M,B+=a*J,_+=a*ne,k+=a*ee,N+=a*Ee,D+=a*Ae,K+=a*se,W+=a*Pe,X+=a*De,pe+=a*fe,me+=a*Ke,xe+=a*et,Ne+=a*tt,a=t[10],y+=a*Te,b+=a*ie,C+=a*q,B+=a*M,_+=a*J,k+=a*ne,N+=a*ee,D+=a*Ee,K+=a*Ae,W+=a*se,X+=a*Pe,pe+=a*De,me+=a*fe,xe+=a*Ke,Ne+=a*et,_e+=a*tt,a=t[11],b+=a*Te,C+=a*ie,B+=a*q,_+=a*M,k+=a*J,N+=a*ne,D+=a*ee,K+=a*Ee,W+=a*Ae,X+=a*se,pe+=a*Pe,me+=a*De,xe+=a*fe,Ne+=a*Ke,_e+=a*et,be+=a*tt,a=t[12],C+=a*Te,B+=a*ie,_+=a*q,k+=a*M,N+=a*J,D+=a*ne,K+=a*ee,W+=a*Ee,X+=a*Ae,pe+=a*se,me+=a*Pe,xe+=a*De,Ne+=a*fe,_e+=a*Ke,be+=a*et,te+=a*tt,a=t[13],B+=a*Te,_+=a*ie,k+=a*q,N+=a*M,D+=a*J,K+=a*ne,W+=a*ee,X+=a*Ee,pe+=a*Ae,me+=a*se,xe+=a*Pe,Ne+=a*De,_e+=a*fe,be+=a*Ke,te+=a*et,$+=a*tt,a=t[14],_+=a*Te,k+=a*ie,N+=a*q,D+=a*M,K+=a*J,W+=a*ne,X+=a*ee,pe+=a*Ee,me+=a*Ae,xe+=a*se,Ne+=a*Pe,_e+=a*De,be+=a*fe,te+=a*Ke,$+=a*et,je+=a*tt,a=t[15],k+=a*Te,N+=a*ie,D+=a*q,K+=a*M,W+=a*J,X+=a*ne,pe+=a*ee,me+=a*Ee,xe+=a*Ae,Ne+=a*se,_e+=a*Pe,be+=a*De,te+=a*fe,$+=a*Ke,je+=a*et,Le+=a*tt,s+=38*N,i+=38*D,o+=38*K,c+=38*W,l+=38*X,u+=38*pe,p+=38*me,d+=38*xe,x+=38*Ne,m+=38*_e,y+=38*be,b+=38*te,C+=38*$,B+=38*je,_+=38*Le,n=1,a=s+n+65535,n=Math.floor(a/65536),s=a-n*65536,a=i+n+65535,n=Math.floor(a/65536),i=a-n*65536,a=o+n+65535,n=Math.floor(a/65536),o=a-n*65536,a=c+n+65535,n=Math.floor(a/65536),c=a-n*65536,a=l+n+65535,n=Math.floor(a/65536),l=a-n*65536,a=u+n+65535,n=Math.floor(a/65536),u=a-n*65536,a=p+n+65535,n=Math.floor(a/65536),p=a-n*65536,a=d+n+65535,n=Math.floor(a/65536),d=a-n*65536,a=x+n+65535,n=Math.floor(a/65536),x=a-n*65536,a=m+n+65535,n=Math.floor(a/65536),m=a-n*65536,a=y+n+65535,n=Math.floor(a/65536),y=a-n*65536,a=b+n+65535,n=Math.floor(a/65536),b=a-n*65536,a=C+n+65535,n=Math.floor(a/65536),C=a-n*65536,a=B+n+65535,n=Math.floor(a/65536),B=a-n*65536,a=_+n+65535,n=Math.floor(a/65536),_=a-n*65536,a=k+n+65535,n=Math.floor(a/65536),k=a-n*65536,s+=n-1+37*(n-1),n=1,a=s+n+65535,n=Math.floor(a/65536),s=a-n*65536,a=i+n+65535,n=Math.floor(a/65536),i=a-n*65536,a=o+n+65535,n=Math.floor(a/65536),o=a-n*65536,a=c+n+65535,n=Math.floor(a/65536),c=a-n*65536,a=l+n+65535,n=Math.floor(a/65536),l=a-n*65536,a=u+n+65535,n=Math.floor(a/65536),u=a-n*65536,a=p+n+65535,n=Math.floor(a/65536),p=a-n*65536,a=d+n+65535,n=Math.floor(a/65536),d=a-n*65536,a=x+n+65535,n=Math.floor(a/65536),x=a-n*65536,a=m+n+65535,n=Math.floor(a/65536),m=a-n*65536,a=y+n+65535,n=Math.floor(a/65536),y=a-n*65536,a=b+n+65535,n=Math.floor(a/65536),b=a-n*65536,a=C+n+65535,n=Math.floor(a/65536),C=a-n*65536,a=B+n+65535,n=Math.floor(a/65536),B=a-n*65536,a=_+n+65535,n=Math.floor(a/65536),_=a-n*65536,a=k+n+65535,n=Math.floor(a/65536),k=a-n*65536,s+=n-1+37*(n-1),e[0]=s,e[1]=i,e[2]=o,e[3]=c,e[4]=l,e[5]=u,e[6]=p,e[7]=d,e[8]=x,e[9]=m,e[10]=y,e[11]=b,e[12]=C,e[13]=B,e[14]=_,e[15]=k}var _t=re;_t.kem=_t.kem||{};var Z0=_t.jsbn.BigInteger;_t.kem.rsa={},_t.kem.rsa.create=function(e,t){t=t||{};var r=t.prng||_t.random,a={};return a.encrypt=function(n,s){var i=Math.ceil(n.n.bitLength()/8),o;do o=new Z0(_t.util.bytesToHex(r.getBytesSync(i)),16).mod(n.n);while(o.compareTo(Z0.ONE)<=0);o=_t.util.hexToBytes(o.toString(16));var c=i-o.length;c>0&&(o=_t.util.fillString("\0",c)+o);var l=n.encrypt(o,"NONE"),u=e.generate(o,s);return{encapsulation:l,key:u}},a.decrypt=function(n,s,i){var o=n.decrypt(s,"NONE");return e.generate(o,i)},a},_t.kem.kdf1=function(e,t){em(this,e,0,t||e.digestLength)},_t.kem.kdf2=function(e,t){em(this,e,1,t||e.digestLength)};function em(e,t,r,a){e.generate=function(n,s){for(var i=new _t.util.ByteBuffer,o=Math.ceil(s/a)+r,c=new _t.util.ByteBuffer,l=r;l<o;++l){c.putInt32(l),t.start(),t.update(n+c.getBytes());var u=t.digest();i.putBytes(u.getBytes(a))}return i.truncate(i.length()-s),i.getBytes()}}var de=re;de.log=de.log||{},de.log.levels=["none","error","warning","info","debug","verbose","max"];var xl={},hp=[],bc=null;de.log.LEVEL_LOCKED=2,de.log.NO_LEVEL_CHECK=4,de.log.INTERPOLATE=8;for(var ma=0;ma<de.log.levels.length;++ma){var tm=de.log.levels[ma];xl[tm]={index:ma,name:tm.toUpperCase()}}de.log.logMessage=function(e){for(var t=xl[e.level].index,r=0;r<hp.length;++r){var a=hp[r];if(a.flags&de.log.NO_LEVEL_CHECK)a.f(e);else{var n=xl[a.level].index;t<=n&&a.f(a,e)}}},de.log.prepareStandard=function(e){"standard"in e||(e.standard=xl[e.level].name+" ["+e.category+"] "+e.message)},de.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]),e.full=de.util.format.apply(this,t)}},de.log.prepareStandardFull=function(e){"standardFull"in e||(de.log.prepareStandard(e),e.standardFull=e.standard)};for(var am=["error","warning","info","debug","verbose"],ma=0;ma<am.length;++ma)(function(t){de.log[t]=function(r,a){var n=Array.prototype.slice.call(arguments).slice(2),s={timestamp:new Date,level:t,category:r,message:a,arguments:n};de.log.logMessage(s)}})(am[ma]);if(de.log.makeLogger=function(e){var t={flags:0,f:e};return de.log.setLevel(t,"none"),t},de.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&de.log.LEVEL_LOCKED))for(var a=0;a<de.log.levels.length;++a){var n=de.log.levels[a];if(t==n){e.level=t,r=!0;break}}return r},de.log.lock=function(e,t){typeof t>"u"||t?e.flags|=de.log.LEVEL_LOCKED:e.flags&=~de.log.LEVEL_LOCKED},de.log.addLogger=function(e){hp.push(e)},typeof console<"u"&&"log"in console){var Ec;if(console.error&&console.warn&&console.info&&console.debug){var E2={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},yp=function(e,t){de.log.prepareStandard(t);var r=E2[t.level],a=[t.standard];a=a.concat(t.arguments.slice()),r.apply(console,a)};Ec=de.log.makeLogger(yp)}else{var yp=function(t,r){de.log.prepareStandardFull(r),console.log(r.standardFull)};Ec=de.log.makeLogger(yp)}de.log.setLevel(Ec,"debug"),de.log.addLogger(Ec),bc=Ec}else console={log:function(){}};if(bc!==null&&typeof window<"u"&&window.location){var yl=new URL(window.location.href).searchParams;if(yl.has("console.level")&&de.log.setLevel(bc,yl.get("console.level").slice(-1)[0]),yl.has("console.lock")){var C2=yl.get("console.lock").slice(-1)[0];C2=="true"&&de.log.lock(bc)}}de.log.consoleLogger=bc;var V=re,T=V.asn1,ft=V.pkcs7=V.pkcs7||{};ft.messageFromPem=function(e){var t=V.pem.decode(e)[0];if(t.type!=="PKCS7"){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&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var a=T.fromDer(t.body);return ft.messageFromAsn1(a)},ft.messageToPem=function(e,t){var r={type:"PKCS7",body:T.toDer(e.toAsn1()).getBytes()};return V.pem.encode(r,{maxline:t})},ft.messageFromAsn1=function(e){var t={},r=[];if(!T.validate(e,ft.asn1.contentInfoValidator,t,r)){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw a.errors=r,a}var n=T.derToOid(t.contentType),s;switch(n){case V.pki.oids.envelopedData:s=ft.createEnvelopedData();break;case V.pki.oids.encryptedData:s=ft.createEncryptedData();break;case V.pki.oids.signedData:s=ft.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+n+" is not (yet) supported.")}return s.fromAsn1(t.content.value[0]),s},ft.createSignedData=function(){var e=null;return e={type:V.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(a){if(gp(e,a,ft.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var n=e.rawCapture.certificates.value,s=0;s<n.length;++s)e.certificates.push(V.pki.certificateFromAsn1(n[s]))},toAsn1:function(){e.contentInfo||e.sign();for(var a=[],n=0;n<e.certificates.length;++n)a.push(V.pki.certificateToAsn1(e.certificates[n]));var s=[],i=T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(e.version).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return a.length>0&&i.value[0].value.push(T.create(T.Class.CONTEXT_SPECIFIC,0,!0,a)),s.length>0&&i.value[0].value.push(T.create(T.Class.CONTEXT_SPECIFIC,1,!0,s)),i.value[0].value.push(T.create(T.Class.UNIVERSAL,T.Type.SET,!0,e.signerInfos)),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.type).getBytes()),i])},addSigner:function(a){var n=a.issuer,s=a.serialNumber;if(a.certificate){var i=a.certificate;typeof i=="string"&&(i=V.pki.certificateFromPem(i)),n=i.issuer.attributes,s=i.serialNumber}var o=a.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof o=="string"&&(o=V.pki.privateKeyFromPem(o));var c=a.digestAlgorithm||V.pki.oids.sha1;switch(c){case V.pki.oids.sha1:case V.pki.oids.sha256:case V.pki.oids.sha384:case V.pki.oids.sha512:case V.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+c)}var l=a.authenticatedAttributes||[];if(l.length>0){for(var u=!1,p=!1,d=0;d<l.length;++d){var x=l[d];if(!u&&x.type===V.pki.oids.contentType){if(u=!0,p)break;continue}if(!p&&x.type===V.pki.oids.messageDigest){if(p=!0,u)break;continue}}if(!u||!p)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:o,version:1,issuer:n,serialNumber:s,digestAlgorithm:c,signatureAlgorithm:V.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:l,unauthenticatedAttributes:[]})},sign:function(a){if(a=a||{},(typeof e.content!="object"||e.contentInfo===null)&&(e.contentInfo=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(V.pki.oids.data).getBytes())]),"content"in e)){var n;e.content instanceof V.util.ByteBuffer?n=e.content.bytes():typeof e.content=="string"&&(n=V.util.encodeUtf8(e.content)),a.detached?e.detachedContent=T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,n):e.contentInfo.value.push(T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,n)]))}if(e.signers.length!==0){var s=t();r(s)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(a){typeof a=="string"&&(a=V.pki.certificateFromPem(a)),e.certificates.push(a)},addCertificateRevokationList:function(a){throw new Error("PKCS#7 CRL support not yet implemented.")}},e;function t(){for(var a={},n=0;n<e.signers.length;++n){var s=e.signers[n],i=s.digestAlgorithm;i in a||(a[i]=V.md[V.pki.oids[i]].create()),s.authenticatedAttributes.length===0?s.md=a[i]:s.md=V.md[V.pki.oids[i]].create()}e.digestAlgorithmIdentifiers=[];for(var i in a)e.digestAlgorithmIdentifiers.push(T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(i).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.NULL,!1,"")]));return a}function r(a){var n;if(e.detachedContent?n=e.detachedContent:(n=e.contentInfo.value[1],n=n.value[0]),!n)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var s=T.derToOid(e.contentInfo.value[0].value),i=T.toDer(n);i.getByte(),T.getBerValueLength(i),i=i.getBytes();for(var o in a)a[o].start().update(i);for(var c=new Date,l=0;l<e.signers.length;++l){var u=e.signers[l];if(u.authenticatedAttributes.length===0){if(s!==V.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{u.authenticatedAttributesAsn1=T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var p=T.create(T.Class.UNIVERSAL,T.Type.SET,!0,[]),d=0;d<u.authenticatedAttributes.length;++d){var x=u.authenticatedAttributes[d];x.type===V.pki.oids.messageDigest?x.value=a[u.digestAlgorithm].digest():x.type===V.pki.oids.signingTime&&(x.value||(x.value=c)),p.value.push(vp(x)),u.authenticatedAttributesAsn1.value.push(vp(x))}i=T.toDer(p).getBytes(),u.md.start().update(i)}u.signature=u.key.sign(u.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=B2(e.signers)}},ft.createEncryptedData=function(){var e=null;return e={type:V.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:V.pki.oids["aes256-CBC"]},fromAsn1:function(t){gp(e,t,ft.asn1.encryptedDataValidator)},decrypt:function(t){t!==void 0&&(e.encryptedContent.key=t),rm(e)}},e},ft.createEnvelopedData=function(){var e=null;return e={type:V.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:V.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=gp(e,t,ft.asn1.envelopedDataValidator);e.recipients=w2(r.recipientInfos.value)},toAsn1:function(){return T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.type).getBytes()),T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(e.version).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SET,!0,A2(e.recipients)),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,_2(e.encryptedContent))])])])},findRecipient:function(t){for(var r=t.issuer.attributes,a=0;a<e.recipients.length;++a){var n=e.recipients[a],s=n.issuer;if(n.serialNumber===t.serialNumber&&s.length===r.length){for(var i=!0,o=0;o<r.length;++o)if(s[o].type!==r[o].type||s[o].value!==r[o].value){i=!1;break}if(i)return n}}return null},decrypt:function(t,r){if(e.encryptedContent.key===void 0&&t!==void 0&&r!==void 0)switch(t.encryptedContent.algorithm){case V.pki.oids.rsaEncryption:case V.pki.oids.desCBC:var a=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=V.util.createBuffer(a);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}rm(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:V.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(e.encryptedContent.content===void 0){r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key;var a,n,s;switch(r){case V.pki.oids["aes128-CBC"]:a=16,n=16,s=V.aes.createEncryptionCipher;break;case V.pki.oids["aes192-CBC"]:a=24,n=16,s=V.aes.createEncryptionCipher;break;case V.pki.oids["aes256-CBC"]:a=32,n=16,s=V.aes.createEncryptionCipher;break;case V.pki.oids["des-EDE3-CBC"]:a=24,n=8,s=V.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(t===void 0)t=V.util.createBuffer(V.random.getBytes(a));else if(t.length()!=a)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+a+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=V.util.createBuffer(V.random.getBytes(n));var i=s(t);if(i.start(e.encryptedContent.parameter.copy()),i.update(e.content),!i.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=i.output}for(var o=0;o<e.recipients.length;++o){var c=e.recipients[o];if(c.encryptedContent.content===void 0)switch(c.encryptedContent.algorithm){case V.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)}}}},e};function S2(e){var t={},r=[];if(!T.validate(e,ft.asn1.recipientInfoValidator,t,r)){var a=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw a.errors=r,a}return{version:t.version.charCodeAt(0),issuer:V.pki.RDNAttributesAsArray(t.issuer),serialNumber:V.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:T.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function T2(e){return T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(e.version).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[V.pki.distinguishedNameToAsn1({attributes:e.issuer}),T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,V.util.hexToBytes(e.serialNumber))]),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.encryptedContent.algorithm).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.NULL,!1,"")]),T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function w2(e){for(var t=[],r=0;r<e.length;++r)t.push(S2(e[r]));return t}function A2(e){for(var t=[],r=0;r<e.length;++r)t.push(T2(e[r]));return t}function I2(e){var t=T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,T.integerToDer(e.version).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[V.pki.distinguishedNameToAsn1({attributes:e.issuer}),T.create(T.Class.UNIVERSAL,T.Type.INTEGER,!1,V.util.hexToBytes(e.serialNumber))]),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.digestAlgorithm).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.signatureAlgorithm).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.NULL,!1,"")])),t.value.push(T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=T.create(T.Class.CONTEXT_SPECIFIC,1,!0,[]),a=0;a<e.unauthenticatedAttributes.length;++a){var n=e.unauthenticatedAttributes[a];r.values.push(vp(n))}t.value.push(r)}return t}function B2(e){for(var t=[],r=0;r<e.length;++r)t.push(I2(e[r]));return t}function vp(e){var t;if(e.type===V.pki.oids.contentType)t=T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.value).getBytes());else if(e.type===V.pki.oids.messageDigest)t=T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===V.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),a=new Date("2050-01-01T00:00:00Z"),n=e.value;if(typeof n=="string"){var s=Date.parse(n);isNaN(s)?n.length===13?n=T.utcTimeToDate(n):n=T.generalizedTimeToDate(n):n=new Date(s)}n>=r&&n<a?t=T.create(T.Class.UNIVERSAL,T.Type.UTCTIME,!1,T.dateToUtcTime(n)):t=T.create(T.Class.UNIVERSAL,T.Type.GENERALIZEDTIME,!1,T.dateToGeneralizedTime(n))}return T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.type).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SET,!0,[t])])}function _2(e){return[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(V.pki.oids.data).getBytes()),T.create(T.Class.UNIVERSAL,T.Type.SEQUENCE,!0,[T.create(T.Class.UNIVERSAL,T.Type.OID,!1,T.oidToDer(e.algorithm).getBytes()),e.parameter?T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,e.parameter.getBytes()):void 0]),T.create(T.Class.CONTEXT_SPECIFIC,0,!0,[T.create(T.Class.UNIVERSAL,T.Type.OCTETSTRING,!1,e.content.getBytes())])]}function gp(e,t,r){var a={},n=[];if(!T.validate(t,r,a,n)){var s=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw s.errors=s,s}var i=T.derToOid(a.contentType);if(i!==V.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(a.encryptedContent){var o="";if(V.util.isArray(a.encryptedContent))for(var c=0;c<a.encryptedContent.length;++c){if(a.encryptedContent[c].type!==T.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=a.encryptedContent[c].value}else o=a.encryptedContent;e.encryptedContent={algorithm:T.derToOid(a.encAlgorithm),parameter:V.util.createBuffer(a.encParameter.value),content:V.util.createBuffer(o)}}if(a.content){var o="";if(V.util.isArray(a.content))for(var c=0;c<a.content.length;++c){if(a.content[c].type!==T.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=a.content[c].value}else o=a.content;e.content=V.util.createBuffer(o)}return e.version=a.version.charCodeAt(0),e.rawCapture=a,a}function rm(e){if(e.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(e.content===void 0){var t;switch(e.encryptedContent.algorithm){case V.pki.oids["aes128-CBC"]:case V.pki.oids["aes192-CBC"]:case V.pki.oids["aes256-CBC"]:t=V.aes.createDecryptionCipher(e.encryptedContent.key);break;case V.pki.oids.desCBC:case V.pki.oids["des-EDE3-CBC"]:t=V.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 qe=re,bl=qe.ssh=qe.ssh||{};bl.privateKeyToPutty=function(e,t,r){r=r||"",t=t||"";var a="ssh-rsa",n=t===""?"none":"aes256-cbc",s="PuTTY-User-Key-File-2: "+a+`\r
39
- `;s+="Encryption: "+n+`\r
40
- `,s+="Comment: "+r+`\r
41
- `;var i=qe.util.createBuffer();er(i,a),Wt(i,e.e),Wt(i,e.n);var o=qe.util.encode64(i.bytes(),64),c=Math.floor(o.length/66)+1;s+="Public-Lines: "+c+`\r
42
- `,s+=o;var l=qe.util.createBuffer();Wt(l,e.d),Wt(l,e.p),Wt(l,e.q),Wt(l,e.qInv);var u;if(!t)u=qe.util.encode64(l.bytes(),64);else{var p=l.length()+16-1;p-=p%16;var d=El(l.bytes());d.truncate(d.length()-p+l.length()),l.putBuffer(d);var x=qe.util.createBuffer();x.putBuffer(El("\0\0\0\0",t)),x.putBuffer(El("\0\0\0",t));var m=qe.aes.createEncryptionCipher(x.truncate(8),"CBC");m.start(qe.util.createBuffer().fillWithByte(0,16)),m.update(l.copy()),m.finish();var y=m.output;y.truncate(16),u=qe.util.encode64(y.bytes(),64)}c=Math.floor(u.length/66)+1,s+=`\r
1
+ import se,{isAxiosError as qe}from"axios";import"fs";import"path";import ac,{randomUUID as ql}from"crypto";const He="https://api.circle.com".replace(/\/+$/,"");let Hl=class extends Error{constructor(t,a){super(a),this.field=t,this.name="RequiredError"}};const Ge={},ze="https://example.com",bt=function(e,t,a){if(a==null)throw new Hl(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},et=async function(e,t){if(t&&t.accessToken){const a=typeof t.accessToken=="function"?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+a}};function nc(e,t,a=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>nc(e,r,a)):Object.keys(t).forEach(r=>nc(e,t[r],`${a}${a!==""?".":""}${r}`)):e.has(a)?e.append(a,t):e.set(a,t))}const $e=function(e,...t){const a=new URLSearchParams(e.search);nc(a,t),e.search=a.toString()},Yt=function(e,t,a){const r=typeof e!="string";return(r&&a&&a.isJsonMime?a.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},Qe=function(e){return e.pathname+e.search+e.hash},je=function(e,t,a,r){return(n=t,i=a)=>{const s={...e.options,url:(r?.basePath||n.defaults.baseURL||i)+e.url};return n.request(s)}},Gl=function(e){return{getEntityConfig:async(t={})=>{const a="/v1/w3s/config/entity",r=new URL(a,ze);let n;e&&(n=e.baseOptions);const i={method:"GET",...n,...t},s={},o={};await et(s,e),$e(r,o);let c=n&&n.headers?n.headers:{};return i.headers={...s,...c,...t.headers},{url:Qe(r),options:i}},getPublicKey:async(t={})=>{const a="/v1/w3s/config/entity/publicKey",r=new URL(a,ze);let n;e&&(n=e.baseOptions);const i={method:"GET",...n,...t},s={},o={};await et(s,e),$e(r,o);let c=n&&n.headers?n.headers:{};return i.headers={...s,...c,...t.headers},{url:Qe(r),options:i}}}},zl=function(e){const t=Gl(e);return{async getEntityConfig(a){const r=await t.getEntityConfig(a),n=e?.serverIndex??0,i=Ge["DeveloperAccountApi.getEntityConfig"]?.[n]?.url;return(s,o)=>je(r,se,He,e)(s,i||o)},async getPublicKey(a){const r=await t.getPublicKey(a),n=e?.serverIndex??0,i=Ge["DeveloperAccountApi.getPublicKey"]?.[n]?.url;return(s,o)=>je(r,se,He,e)(s,i||o)}}},$l=function(e,t,a){const r=zl(e);return{getEntityConfig(n){return r.getEntityConfig(n).then(i=>i(a,t))},getPublicKey(n){return r.getPublicKey(n).then(i=>i(a,t))}}},Ql=function(e){return{requestTestnetTokens:async(t,a,r={})=>{const n="/v1/faucet/drips",i=new URL(n,ze);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await et(c,e),t!=null&&(c["X-Request-Id"]=String(t)),c["Content-Type"]="application/json",$e(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=Yt(a,o,e),{url:Qe(i),options:o}}}},jl=function(e){const t=Ql(e);return{async requestTestnetTokens(a,r,n){const i=await t.requestTestnetTokens(a,r,n),s=e?.serverIndex??0,o=Ge["FaucetApi.requestTestnetTokens"]?.[s]?.url;return(c,l)=>je(i,se,He,e)(c,o||l)}}},Xl=function(e,t,a){const r=jl(e);return{requestTestnetTokens(n,i,s){return r.requestTestnetTokens(n,i,s).then(o=>o(a,t))}}},Yl=function(e){return{ping:async(t={})=>{const a="/ping",r=new URL(a,ze);let n;e&&(n=e.baseOptions);const i={method:"GET",...n,...t},s={};$e(r,{});let o=n&&n.headers?n.headers:{};return i.headers={...s,...o,...t.headers},{url:Qe(r),options:i}}}},Wl=function(e){const t=Yl(e);return{async ping(a){const r=await t.ping(a),n=e?.serverIndex??0,i=Ge["HealthApi.ping"]?.[n]?.url;return(s,o)=>je(r,se,He,e)(s,i||o)}}},Zl=function(e,t,a){const r=Wl(e);return{ping(n){return r.ping(n).then(i=>i(a,t))}}},Jl=function(e){return{createMonitoredTokens:async(t,a={})=>{bt("createMonitoredTokens","createMonitoredTokensRequest",t);const r="/v1/w3s/config/entity/monitoredTokens",n=new URL(r,ze);let i;e&&(i=e.baseOptions);const s={method:"POST",...i,...a},o={},c={};await et(o,e),o["Content-Type"]="application/json",$e(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=Yt(t,s,e),{url:Qe(n),options:s}},deleteMonitoredTokens:async(t,a={})=>{bt("deleteMonitoredTokens","deleteMonitoredTokensRequest",t);const r="/v1/w3s/config/entity/monitoredTokens/delete",n=new URL(r,ze);let i;e&&(i=e.baseOptions);const s={method:"POST",...i,...a},o={},c={};await et(o,e),o["Content-Type"]="application/json",$e(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=Yt(t,s,e),{url:Qe(n),options:s}},listMonitoredTokens:async(t,a,r,n,i,s,o,c,l={})=>{const u="/v1/w3s/config/entity/monitoredTokens",d=new URL(u,ze);let v;e&&(v=e.baseOptions);const E={method:"GET",...v,...l},y={},x={};await et(y,e),t!==void 0&&(x.blockchain=t),a!==void 0&&(x.tokenAddress=a),r!==void 0&&(x.symbol=r),n!==void 0&&(x.from=n instanceof Date?n.toISOString():n),i!==void 0&&(x.to=i instanceof Date?i.toISOString():i),s!==void 0&&(x.pageBefore=s),o!==void 0&&(x.pageAfter=o),c!==void 0&&(x.pageSize=c),$e(d,x);let b=v&&v.headers?v.headers:{};return E.headers={...y,...b,...l.headers},{url:Qe(d),options:E}},updateMonitoredTokens:async(t,a={})=>{bt("updateMonitoredTokens","updateMonitoredTokensRequest",t);const r="/v1/w3s/config/entity/monitoredTokens",n=new URL(r,ze);let i;e&&(i=e.baseOptions);const s={method:"PUT",...i,...a},o={},c={};await et(o,e),o["Content-Type"]="application/json",$e(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=Yt(t,s,e),{url:Qe(n),options:s}},updateMonitoredTokensScope:async(t,a={})=>{bt("updateMonitoredTokensScope","updateMonitoredTokensScopeRequest",t);const r="/v1/w3s/config/entity/monitoredTokens/scope",n=new URL(r,ze);let i;e&&(i=e.baseOptions);const s={method:"PUT",...i,...a},o={},c={};await et(o,e),o["Content-Type"]="application/json",$e(n,c);let l=i&&i.headers?i.headers:{};return s.headers={...o,...l,...a.headers},s.data=Yt(t,s,e),{url:Qe(n),options:s}}}},eu=function(e){const t=Jl(e);return{async createMonitoredTokens(a,r){const n=await t.createMonitoredTokens(a,r),i=e?.serverIndex??0,s=Ge["MonitorTokensApi.createMonitoredTokens"]?.[i]?.url;return(o,c)=>je(n,se,He,e)(o,s||c)},async deleteMonitoredTokens(a,r){const n=await t.deleteMonitoredTokens(a,r),i=e?.serverIndex??0,s=Ge["MonitorTokensApi.deleteMonitoredTokens"]?.[i]?.url;return(o,c)=>je(n,se,He,e)(o,s||c)},async listMonitoredTokens(a,r,n,i,s,o,c,l,u){const d=await t.listMonitoredTokens(a,r,n,i,s,o,c,l,u),v=e?.serverIndex??0,E=Ge["MonitorTokensApi.listMonitoredTokens"]?.[v]?.url;return(y,x)=>je(d,se,He,e)(y,E||x)},async updateMonitoredTokens(a,r){const n=await t.updateMonitoredTokens(a,r),i=e?.serverIndex??0,s=Ge["MonitorTokensApi.updateMonitoredTokens"]?.[i]?.url;return(o,c)=>je(n,se,He,e)(o,s||c)},async updateMonitoredTokensScope(a,r){const n=await t.updateMonitoredTokensScope(a,r),i=e?.serverIndex??0,s=Ge["MonitorTokensApi.updateMonitoredTokensScope"]?.[i]?.url;return(o,c)=>je(n,se,He,e)(o,s||c)}}},tu=function(e,t,a){const r=eu(e);return{createMonitoredTokens(n,i){return r.createMonitoredTokens(n,i).then(s=>s(a,t))},deleteMonitoredTokens(n,i){return r.deleteMonitoredTokens(n,i).then(s=>s(a,t))},listMonitoredTokens(n,i,s,o,c,l,u,d,v){return r.listMonitoredTokens(n,i,s,o,c,l,u,d,v).then(E=>E(a,t))},updateMonitoredTokens(n,i){return r.updateMonitoredTokens(n,i).then(s=>s(a,t))},updateMonitoredTokensScope(n,i){return r.updateMonitoredTokensScope(n,i).then(s=>s(a,t))}}},ru=function(e){return{createSubscription:async(t,a,r={})=>{bt("createSubscription","createSubscriptionRequest",t);const n="/v2/notifications/subscriptions",i=new URL(n,ze);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await et(c,e),a!=null&&(c["X-Request-Id"]=String(a)),c["Content-Type"]="application/json",$e(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=Yt(t,o,e),{url:Qe(i),options:o}},deleteSubscription:async(t,a,r={})=>{bt("deleteSubscription","id",t);const n="/v2/notifications/subscriptions/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(n,ze);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...r},c={},l={};await et(c,e),a!=null&&(c["X-Request-Id"]=String(a)),$e(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},{url:Qe(i),options:o}},getNotificationSignature:async(t,a,r={})=>{bt("getNotificationSignature","id",t);const n="/v2/notifications/publicKey/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(n,ze);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},c={},l={};await et(c,e),a!=null&&(c["X-Request-Id"]=String(a)),$e(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},{url:Qe(i),options:o}},getSubscription:async(t,a,r={})=>{bt("getSubscription","id",t);const n="/v2/notifications/subscriptions/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(n,ze);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},c={},l={};await et(c,e),a!=null&&(c["X-Request-Id"]=String(a)),$e(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},{url:Qe(i),options:o}},getSubscriptions:async(t={})=>{const a="/v2/notifications/subscriptions",r=new URL(a,ze);let n;e&&(n=e.baseOptions);const i={method:"GET",...n,...t},s={},o={};await et(s,e),$e(r,o);let c=n&&n.headers?n.headers:{};return i.headers={...s,...c,...t.headers},{url:Qe(r),options:i}},updateSubscription:async(t,a,r,n={})=>{bt("updateSubscription","id",t),bt("updateSubscription","updateSubscriptionRequest",a);const i="/v2/notifications/subscriptions/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,ze);let o;e&&(o=e.baseOptions);const c={method:"PATCH",...o,...n},l={},u={};await et(l,e),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",$e(s,u);let d=o&&o.headers?o.headers:{};return c.headers={...l,...d,...n.headers},c.data=Yt(a,c,e),{url:Qe(s),options:c}}}},au=function(e){const t=ru(e);return{async createSubscription(a,r,n){const i=await t.createSubscription(a,r,n),s=e?.serverIndex??0,o=Ge["WebhookSubscriptionsApi.createSubscription"]?.[s]?.url;return(c,l)=>je(i,se,He,e)(c,o||l)},async deleteSubscription(a,r,n){const i=await t.deleteSubscription(a,r,n),s=e?.serverIndex??0,o=Ge["WebhookSubscriptionsApi.deleteSubscription"]?.[s]?.url;return(c,l)=>je(i,se,He,e)(c,o||l)},async getNotificationSignature(a,r,n){const i=await t.getNotificationSignature(a,r,n),s=e?.serverIndex??0,o=Ge["WebhookSubscriptionsApi.getNotificationSignature"]?.[s]?.url;return(c,l)=>je(i,se,He,e)(c,o||l)},async getSubscription(a,r,n){const i=await t.getSubscription(a,r,n),s=e?.serverIndex??0,o=Ge["WebhookSubscriptionsApi.getSubscription"]?.[s]?.url;return(c,l)=>je(i,se,He,e)(c,o||l)},async getSubscriptions(a){const r=await t.getSubscriptions(a),n=e?.serverIndex??0,i=Ge["WebhookSubscriptionsApi.getSubscriptions"]?.[n]?.url;return(s,o)=>je(r,se,He,e)(s,i||o)},async updateSubscription(a,r,n,i){const s=await t.updateSubscription(a,r,n,i),o=e?.serverIndex??0,c=Ge["WebhookSubscriptionsApi.updateSubscription"]?.[o]?.url;return(l,u)=>je(s,se,He,e)(l,c||u)}}},nu=function(e,t,a){const r=au(e);return{createSubscription(n,i,s){return r.createSubscription(n,i,s).then(o=>o(a,t))},deleteSubscription(n,i,s){return r.deleteSubscription(n,i,s).then(o=>o(a,t))},getNotificationSignature(n,i,s){return r.getNotificationSignature(n,i,s).then(o=>o(a,t))},getSubscription(n,i,s){return r.getSubscription(n,i,s).then(o=>o(a,t))},getSubscriptions(n){return r.getSubscriptions(n).then(i=>i(a,t))},updateSubscription(n,i,s,o){return r.updateSubscription(n,i,s,o).then(c=>c(a,t))}}};var su=Object.defineProperty,iu=(e,t,a)=>t in e?su(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Vt=(e,t,a)=>iu(e,typeof t!="symbol"?t+"":t,a);let ou=class{constructor(t={}){Vt(this,"apiKey"),Vt(this,"username"),Vt(this,"password"),Vt(this,"accessToken"),Vt(this,"basePath"),Vt(this,"serverIndex"),Vt(this,"baseOptions"),Vt(this,"formDataCtor"),this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions=t.baseOptions,this.formDataCtor=t.formDataCtor}isJsonMime(t){const a=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(a.test(t)||t.toLowerCase()==="application/json-patch+json")}};var cu=Object.defineProperty,lu=(e,t,a)=>t in e?cu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Cr=(e,t,a)=>lu(e,typeof t!="symbol"?t+"":t,a);class uu{constructor(t,a,r={}){Cr(this,"DeveloperAccount"),Cr(this,"Faucet"),Cr(this,"Health"),Cr(this,"MonitorTokens"),Cr(this,"WebhookSubscriptions");const n=new ou({basePath:t,baseOptions:{headers:{...r,Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json","User-Agent":`${a.userAgent?a.userAgent+" / ":""}CircleNodeJS / Configurations / ${a.version}`}}});this.DeveloperAccount=$l(n),this.Faucet=Xl(n),this.Health=Zl(n),this.MonitorTokens=tu(n),this.WebhookSubscriptions=nu(n)}}const tt="https://api.circle.com".replace(/\/+$/,"");class fu extends Error{constructor(t,a){super(a),this.field=t,this.name="RequiredError"}}const rt={},at="https://example.com",dt=function(e,t,a){if(a==null)throw new fu(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},nt=async function(e,t){if(t&&t.accessToken){const a=typeof t.accessToken=="function"?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+a}};function sc(e,t,a=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>sc(e,r,a)):Object.keys(t).forEach(r=>sc(e,t[r],`${a}${a!==""?".":""}${r}`)):e.has(a)?e.append(a,t):e.set(a,t))}const st=function(e,...t){const a=new URLSearchParams(e.search);sc(a,t),e.search=a.toString()},Lt=function(e,t,a){const r=typeof e!="string";return(r&&a&&a.isJsonMime?a.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},it=function(e){return e.pathname+e.search+e.hash},ot=function(e,t,a,r){return(n=t,i=a)=>{const s={...e.options,url:(r?.basePath||n.defaults.baseURL||i)+e.url};return n.request(s)}},du=function(e){return{deployContract:async(t,a,r={})=>{dt("deployContract","contractDeploymentRequest",t);const n="/v1/w3s/contracts/deploy",i=new URL(n,at);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await nt(c,e),a!=null&&(c["X-Request-Id"]=String(a)),c["Content-Type"]="application/json",st(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=Lt(t,o,e),{url:it(i),options:o}},estimateContractDeploy:async(t,a,r={})=>{dt("estimateContractDeploy","contractDeploymentEstimateFeeRequest",t);const n="/v1/w3s/contracts/deploy/estimateFee",i=new URL(n,at);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await nt(c,e),a!=null&&(c["X-Request-Id"]=String(a)),c["Content-Type"]="application/json",st(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=Lt(t,o,e),{url:it(i),options:o}},importContract:async(t,a,r={})=>{dt("importContract","importContractRequest",t);const n="/v1/w3s/contracts/import",i=new URL(n,at);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await nt(c,e),a!=null&&(c["X-Request-Id"]=String(a)),c["Content-Type"]="application/json",st(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=Lt(t,o,e),{url:it(i),options:o}}}},pu=function(e){const t=du(e);return{async deployContract(a,r,n){const i=await t.deployContract(a,r,n),s=e?.serverIndex??0,o=rt["DeployImportApi.deployContract"]?.[s]?.url;return(c,l)=>ot(i,se,tt,e)(c,o||l)},async estimateContractDeploy(a,r,n){const i=await t.estimateContractDeploy(a,r,n),s=e?.serverIndex??0,o=rt["DeployImportApi.estimateContractDeploy"]?.[s]?.url;return(c,l)=>ot(i,se,tt,e)(c,o||l)},async importContract(a,r,n){const i=await t.importContract(a,r,n),s=e?.serverIndex??0,o=rt["DeployImportApi.importContract"]?.[s]?.url;return(c,l)=>ot(i,se,tt,e)(c,o||l)}}},hu=function(e,t,a){const r=pu(e);return{deployContract(n,i,s){return r.deployContract(n,i,s).then(o=>o(a,t))},estimateContractDeploy(n,i,s){return r.estimateContractDeploy(n,i,s).then(o=>o(a,t))},importContract(n,i,s){return r.importContract(n,i,s).then(o=>o(a,t))}}},gu=function(e){return{createEventMonitor:async(t,a,r={})=>{const n="/v1/w3s/contracts/monitors",i=new URL(n,at);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await nt(c,e),t!=null&&(c["X-Request-Id"]=String(t)),c["Content-Type"]="application/json",st(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=Lt(a,o,e),{url:it(i),options:o}},deleteEventMonitor:async(t,a,r={})=>{dt("deleteEventMonitor","id",t);const n="/v1/w3s/contracts/monitors/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(n,at);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...r},c={},l={};await nt(c,e),a!=null&&(c["X-Request-Id"]=String(a)),st(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},{url:it(i),options:o}},getEventMonitors:async(t,a,r,n,i,s,o,c,l,u={})=>{const d="/v1/w3s/contracts/monitors",v=new URL(d,at);let E;e&&(E=e.baseOptions);const y={method:"GET",...E,...u},x={},b={};await nt(x,e),t!==void 0&&(b.contractAddress=t),a!==void 0&&(b.blockchain=a),r!==void 0&&(b.eventSignature=r),n!==void 0&&(b.from=n instanceof Date?n.toISOString():n),i!==void 0&&(b.to=i instanceof Date?i.toISOString():i),s!==void 0&&(b.pageBefore=s),o!==void 0&&(b.pageAfter=o),c!==void 0&&(b.pageSize=c),l!=null&&(x["X-Request-Id"]=String(l)),st(v,b);let A=E&&E.headers?E.headers:{};return y.headers={...x,...A,...u.headers},{url:it(v),options:y}},listEventLogs:async(t,a,r,n,i,s,o,c,l={})=>{const u="/v1/w3s/contracts/events",d=new URL(u,at);let v;e&&(v=e.baseOptions);const E={method:"GET",...v,...l},y={},x={};await nt(y,e),t!==void 0&&(x.contractAddress=t),a!==void 0&&(x.blockchain=a),r!==void 0&&(x.from=r instanceof Date?r.toISOString():r),n!==void 0&&(x.to=n instanceof Date?n.toISOString():n),i!==void 0&&(x.pageBefore=i),s!==void 0&&(x.pageAfter=s),o!==void 0&&(x.pageSize=o),c!=null&&(y["X-Request-Id"]=String(c)),st(d,x);let b=v&&v.headers?v.headers:{};return E.headers={...y,...b,...l.headers},{url:it(d),options:E}},updateEventMonitor:async(t,a,r,n={})=>{dt("updateEventMonitor","id",t);const i="/v1/w3s/contracts/monitors/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,at);let o;e&&(o=e.baseOptions);const c={method:"PUT",...o,...n},l={},u={};await nt(l,e),a!=null&&(l["X-Request-Id"]=String(a)),l["Content-Type"]="application/json",st(s,u);let d=o&&o.headers?o.headers:{};return c.headers={...l,...d,...n.headers},c.data=Lt(r,c,e),{url:it(s),options:c}}}},vu=function(e){const t=gu(e);return{async createEventMonitor(a,r,n){const i=await t.createEventMonitor(a,r,n),s=e?.serverIndex??0,o=rt["EventMonitorsApi.createEventMonitor"]?.[s]?.url;return(c,l)=>ot(i,se,tt,e)(c,o||l)},async deleteEventMonitor(a,r,n){const i=await t.deleteEventMonitor(a,r,n),s=e?.serverIndex??0,o=rt["EventMonitorsApi.deleteEventMonitor"]?.[s]?.url;return(c,l)=>ot(i,se,tt,e)(c,o||l)},async getEventMonitors(a,r,n,i,s,o,c,l,u,d){const v=await t.getEventMonitors(a,r,n,i,s,o,c,l,u,d),E=e?.serverIndex??0,y=rt["EventMonitorsApi.getEventMonitors"]?.[E]?.url;return(x,b)=>ot(v,se,tt,e)(x,y||b)},async listEventLogs(a,r,n,i,s,o,c,l,u){const d=await t.listEventLogs(a,r,n,i,s,o,c,l,u),v=e?.serverIndex??0,E=rt["EventMonitorsApi.listEventLogs"]?.[v]?.url;return(y,x)=>ot(d,se,tt,e)(y,E||x)},async updateEventMonitor(a,r,n,i){const s=await t.updateEventMonitor(a,r,n,i),o=e?.serverIndex??0,c=rt["EventMonitorsApi.updateEventMonitor"]?.[o]?.url;return(l,u)=>ot(s,se,tt,e)(l,c||u)}}},yu=function(e,t,a){const r=vu(e);return{createEventMonitor(n,i,s){return r.createEventMonitor(n,i,s).then(o=>o(a,t))},deleteEventMonitor(n,i,s){return r.deleteEventMonitor(n,i,s).then(o=>o(a,t))},getEventMonitors(n,i,s,o,c,l,u,d,v,E){return r.getEventMonitors(n,i,s,o,c,l,u,d,v,E).then(y=>y(a,t))},listEventLogs(n,i,s,o,c,l,u,d,v){return r.listEventLogs(n,i,s,o,c,l,u,d,v).then(E=>E(a,t))},updateEventMonitor(n,i,s,o){return r.updateEventMonitor(n,i,s,o).then(c=>c(a,t))}}},mu=function(e){return{queryContract:async(t,a,r={})=>{dt("queryContract","readContractStateRequest",t);const n="/v1/w3s/contracts/query",i=new URL(n,at);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...r},c={},l={};await nt(c,e),a!=null&&(c["X-Request-Id"]=String(a)),c["Content-Type"]="application/json",st(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},o.data=Lt(t,o,e),{url:it(i),options:o}}}},Eu=function(e){const t=mu(e);return{async queryContract(a,r,n){const i=await t.queryContract(a,r,n),s=e?.serverIndex??0,o=rt["InteractApi.queryContract"]?.[s]?.url;return(c,l)=>ot(i,se,tt,e)(c,o||l)}}},Cu=function(e,t,a){const r=Eu(e);return{queryContract(n,i,s){return r.queryContract(n,i,s).then(o=>o(a,t))}}},xu=function(e){return{deployContractTemplate:async(t,a,r,n={})=>{dt("deployContractTemplate","id",t),dt("deployContractTemplate","templateContractDeploymentRequest",a);const i="/v1/w3s/templates/{id}/deploy".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,at);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await nt(l,e),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",st(s,u);let d=o&&o.headers?o.headers:{};return c.headers={...l,...d,...n.headers},c.data=Lt(a,c,e),{url:it(s),options:c}},estimateContractTemplateDeploy:async(t,a,r,n={})=>{dt("estimateContractTemplateDeploy","id",t),dt("estimateContractTemplateDeploy","contractDeploymentEstimateRequest",a);const i="/v1/w3s/templates/{id}/deploy/estimateFee".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,at);let o;e&&(o=e.baseOptions);const c={method:"POST",...o,...n},l={},u={};await nt(l,e),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",st(s,u);let d=o&&o.headers?o.headers:{};return c.headers={...l,...d,...n.headers},c.data=Lt(a,c,e),{url:it(s),options:c}}}},Su=function(e){const t=xu(e);return{async deployContractTemplate(a,r,n,i){const s=await t.deployContractTemplate(a,r,n,i),o=e?.serverIndex??0,c=rt["TemplatesApi.deployContractTemplate"]?.[o]?.url;return(l,u)=>ot(s,se,tt,e)(l,c||u)},async estimateContractTemplateDeploy(a,r,n,i){const s=await t.estimateContractTemplateDeploy(a,r,n,i),o=e?.serverIndex??0,c=rt["TemplatesApi.estimateContractTemplateDeploy"]?.[o]?.url;return(l,u)=>ot(s,se,tt,e)(l,c||u)}}},Tu=function(e,t,a){const r=Su(e);return{deployContractTemplate(n,i,s,o){return r.deployContractTemplate(n,i,s,o).then(c=>c(a,t))},estimateContractTemplateDeploy(n,i,s,o){return r.estimateContractTemplateDeploy(n,i,s,o).then(c=>c(a,t))}}},bu=function(e){return{getContract:async(t,a,r={})=>{dt("getContract","id",t);const n="/v1/w3s/contracts/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(n,at);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},c={},l={};await nt(c,e),a!=null&&(c["X-Request-Id"]=String(a)),st(i,l);let u=s&&s.headers?s.headers:{};return o.headers={...c,...u,...r.headers},{url:it(i),options:o}},listContracts:async(t,a,r,n,i,s,o,c,l,u,d,v={})=>{const E="/v1/w3s/contracts",y=new URL(E,at);let x;e&&(x=e.baseOptions);const b={method:"GET",...x,...v},A={},w={};await nt(A,e),t!==void 0&&(w.blockchain=t),a!==void 0&&(w.contractInputType=a),r!==void 0&&(w.deployerAddress=r),n!==void 0&&(w.name=n),i!==void 0&&(w.status=i),s!==void 0&&(w.from=s instanceof Date?s.toISOString():s),o!==void 0&&(w.to=o instanceof Date?o.toISOString():o),c!==void 0&&(w.pageBefore=c),l!==void 0&&(w.pageAfter=l),u!==void 0&&(w.pageSize=u),d!=null&&(A["X-Request-Id"]=String(d)),st(y,w);let N=x&&x.headers?x.headers:{};return b.headers={...A,...N,...v.headers},{url:it(y),options:b}},updateContract:async(t,a,r,n={})=>{dt("updateContract","id",t),dt("updateContract","patchContractRequest",a);const i="/v1/w3s/contracts/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,at);let o;e&&(o=e.baseOptions);const c={method:"PATCH",...o,...n},l={},u={};await nt(l,e),r!=null&&(l["X-Request-Id"]=String(r)),l["Content-Type"]="application/json",st(s,u);let d=o&&o.headers?o.headers:{};return c.headers={...l,...d,...n.headers},c.data=Lt(a,c,e),{url:it(s),options:c}}}},Iu=function(e){const t=bu(e);return{async getContract(a,r,n){const i=await t.getContract(a,r,n),s=e?.serverIndex??0,o=rt["ViewUpdateApi.getContract"]?.[s]?.url;return(c,l)=>ot(i,se,tt,e)(c,o||l)},async listContracts(a,r,n,i,s,o,c,l,u,d,v,E){const y=await t.listContracts(a,r,n,i,s,o,c,l,u,d,v,E),x=e?.serverIndex??0,b=rt["ViewUpdateApi.listContracts"]?.[x]?.url;return(A,w)=>ot(y,se,tt,e)(A,b||w)},async updateContract(a,r,n,i){const s=await t.updateContract(a,r,n,i),o=e?.serverIndex??0,c=rt["ViewUpdateApi.updateContract"]?.[o]?.url;return(l,u)=>ot(s,se,tt,e)(l,c||u)}}},Au=function(e,t,a){const r=Iu(e);return{getContract(n,i,s){return r.getContract(n,i,s).then(o=>o(a,t))},listContracts(n,i,s,o,c,l,u,d,v,E,y,x){return r.listContracts(n,i,s,o,c,l,u,d,v,E,y,x).then(b=>b(a,t))},updateContract(n,i,s,o){return r.updateContract(n,i,s,o).then(c=>c(a,t))}}};var Bu=Object.defineProperty,wu=(e,t,a)=>t in e?Bu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Mt=(e,t,a)=>wu(e,typeof t!="symbol"?t+"":t,a);class Nu{constructor(t={}){Mt(this,"apiKey"),Mt(this,"username"),Mt(this,"password"),Mt(this,"accessToken"),Mt(this,"basePath"),Mt(this,"serverIndex"),Mt(this,"baseOptions"),Mt(this,"formDataCtor"),this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions=t.baseOptions,this.formDataCtor=t.formDataCtor}isJsonMime(t){const a=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(a.test(t)||t.toLowerCase()==="application/json-patch+json")}}const _u={Eth:"ETH",EthSepolia:"ETH-SEPOLIA",Matic:"MATIC",MaticAmoy:"MATIC-AMOY",Arb:"ARB",ArbSepolia:"ARB-SEPOLIA",Uni:"UNI",UniSepolia:"UNI-SEPOLIA",Base:"BASE",BaseSepolia:"BASE-SEPOLIA",Op:"OP",OpSepolia:"OP-SEPOLIA",Avax:"AVAX",AvaxFuji:"AVAX-FUJI",ArcTestnet:"ARC-TESTNET",Monad:"MONAD",MonadTestnet:"MONAD-TESTNET"};var Ru=Object.defineProperty,ku=(e,t,a)=>t in e?Ru(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,xr=(e,t,a)=>ku(e,typeof t!="symbol"?t+"":t,a);class Lu{constructor(t,a,r={}){xr(this,"DeployImport"),xr(this,"EventMonitors"),xr(this,"Interact"),xr(this,"Templates"),xr(this,"ViewUpdate");const n=new Nu({basePath:t,baseOptions:{headers:{...r,Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json","User-Agent":`${a.userAgent?a.userAgent+" / ":""}CircleNodeJS / SmartContractPlatform / ${a.version}`}}});this.DeployImport=hu(n),this.EventMonitors=yu(n),this.Interact=Cu(n),this.Templates=Tu(n),this.ViewUpdate=Au(n)}}var Du=Object.defineProperty,Jc=e=>{throw TypeError(e)},Uu=(e,t,a)=>t in e?Du(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,or=(e,t,a)=>Uu(e,typeof t!="symbol"?t+"":t,a),e0=(e,t,a)=>t.has(e)||Jc("Cannot "+a),Pu=(e,t,a)=>(e0(e,t,"read from private field"),a?a.call(e):t.get(e)),Ou=(e,t,a)=>t.has(e)?Jc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a),Vu=(e,t,a,r)=>(e0(e,t,"write to private field"),r?r.call(e,a):t.set(e,a),a),wo;class Sr extends Error{constructor({message:t,code:a,url:r,method:n,error:i}){super(t),or(this,"code"),or(this,"message"),or(this,"url"),or(this,"method"),Ou(this,wo),this.message=t??new.target.message,this.code=a??new.target.code,this.url=r,this.method=n,Vu(this,wo,i)}get error(){return Pu(this,wo)}}wo=new WeakMap,or(Sr,"code","UNKNOWN"),or(Sr,"message","HTTP Error");var Mu=Object.defineProperty,Fu=(e,t,a)=>t in e?Mu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,ic=(e,t,a)=>Fu(e,typeof t!="symbol"?t+"":t,a);class m extends Sr{constructor({message:t,code:a,url:r,method:n,status:i,error:s}){super({message:t,code:a,url:r,method:n,error:s}),ic(this,"status"),this.status=i}}ic(m,"code",-1),ic(m,"message","HTTP Response Error");var Ku=Object.defineProperty,qu=(e,t,a)=>t in e?Ku(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,t0=(e,t,a)=>qu(e,typeof t!="symbol"?t+"":t,a);class vt extends Sr{}t0(vt,"code","UNKNOWN"),t0(vt,"message","Unknown HTTP request error");var Hu=Object.defineProperty,Gu=(e,t,a)=>t in e?Hu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,r0=(e,t,a)=>Gu(e,typeof t!="symbol"?t+"":t,a);class Tr extends m{}r0(Tr,"code",400),r0(Tr,"message","Bad Request");var zu=Object.defineProperty,$u=(e,t,a)=>t in e?zu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,a0=(e,t,a)=>$u(e,typeof t!="symbol"?t+"":t,a);class br extends m{}a0(br,"code",401),a0(br,"message","Unauthorized");var Qu=Object.defineProperty,ju=(e,t,a)=>t in e?Qu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,n0=(e,t,a)=>ju(e,typeof t!="symbol"?t+"":t,a);class Ir extends m{}n0(Ir,"code",403),n0(Ir,"message","Forbidden");var Xu=Object.defineProperty,Yu=(e,t,a)=>t in e?Xu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,s0=(e,t,a)=>Yu(e,typeof t!="symbol"?t+"":t,a);class Ar extends m{}s0(Ar,"code",404),s0(Ar,"message","Not Found");var Wu=Object.defineProperty,Zu=(e,t,a)=>t in e?Wu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,i0=(e,t,a)=>Zu(e,typeof t!="symbol"?t+"":t,a);class Br extends m{}i0(Br,"code",429),i0(Br,"message","Too Many Requests");var Ju=Object.defineProperty,ef=(e,t,a)=>t in e?Ju(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,o0=(e,t,a)=>ef(e,typeof t!="symbol"?t+"":t,a);class wr extends m{}o0(wr,"code",500),o0(wr,"message","Internal Server Error");var tf=Object.defineProperty,rf=(e,t,a)=>t in e?tf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,c0=(e,t,a)=>rf(e,typeof t!="symbol"?t+"":t,a);class Nr extends m{}c0(Nr,"code",501),c0(Nr,"message","Not Implemented");var af=Object.defineProperty,nf=(e,t,a)=>t in e?af(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,l0=(e,t,a)=>nf(e,typeof t!="symbol"?t+"":t,a);class _r extends m{}l0(_r,"code",502),l0(_r,"message","Bad Gateway");var sf=Object.defineProperty,of=(e,t,a)=>t in e?sf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,u0=(e,t,a)=>of(e,typeof t!="symbol"?t+"":t,a);class Rr extends m{}u0(Rr,"code",503),u0(Rr,"message","Service Unavailable");var cf=Object.defineProperty,lf=(e,t,a)=>t in e?cf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,f0=(e,t,a)=>lf(e,typeof t!="symbol"?t+"":t,a);class kr extends m{}f0(kr,"code",504),f0(kr,"message","Gateway Timeout");var uf=Object.defineProperty,ff=(e,t,a)=>t in e?uf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,d0=(e,t,a)=>ff(e,typeof t!="symbol"?t+"":t,a);class Lr extends vt{}d0(Lr,"code","ECONNREFUSED"),d0(Lr,"message","Connection refused");var df=Object.defineProperty,pf=(e,t,a)=>t in e?df(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,p0=(e,t,a)=>pf(e,typeof t!="symbol"?t+"":t,a);class Dr extends vt{}p0(Dr,"code","ETIMEDOUT"),p0(Dr,"message","Connection timeout");var hf=Object.defineProperty,gf=(e,t,a)=>t in e?hf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,h0=(e,t,a)=>gf(e,typeof t!="symbol"?t+"":t,a);class Ur extends vt{}h0(Ur,"code","ECONNABORTED"),h0(Ur,"message","Request timeout");var vf=Object.defineProperty,yf=(e,t,a)=>t in e?vf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,g0=(e,t,a)=>yf(e,typeof t!="symbol"?t+"":t,a);class Pr extends vt{}g0(Pr,"code","ENOTFOUND"),g0(Pr,"message","DNS lookup failed - host not found");var mf=Object.defineProperty,Ef=(e,t,a)=>t in e?mf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,v0=(e,t,a)=>Ef(e,typeof t!="symbol"?t+"":t,a);class Or extends vt{}v0(Or,"code","EAI_AGAIN"),v0(Or,"message","DNS lookup failed - timeout");var Cf=Object.defineProperty,xf=(e,t,a)=>t in e?Cf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,y0=(e,t,a)=>xf(e,typeof t!="symbol"?t+"":t,a);class Vr extends vt{}y0(Vr,"code","ENETUNREACH"),y0(Vr,"message","Network unreachable");var Sf=Object.defineProperty,Tf=(e,t,a)=>t in e?Sf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,m0=(e,t,a)=>Tf(e,typeof t!="symbol"?t+"":t,a);class Mr extends vt{}m0(Mr,"code","ECONNRESET"),m0(Mr,"message","Connection reset");var bf=Object.defineProperty,If=(e,t,a)=>t in e?bf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,E0=(e,t,a)=>If(e,typeof t!="symbol"?t+"":t,a);class Fr extends vt{}E0(Fr,"code","EHOSTUNREACH"),E0(Fr,"message","Host unreachable");const C0={undefined:vt,[Lr.code]:Lr,[Dr.code]:Dr,[Ur.code]:Ur,[Mr.code]:Mr,[Pr.code]:Pr,[Or.code]:Or,[Vr.code]:Vr,[Fr.code]:Fr};function Af(e){return C0[e]??C0.undefined}function Bf(e){return wf({code:e.code,message:e.message,url:e.config.url,method:e.config.method.toUpperCase(),error:e})}function wf({code:e,message:t,url:a,method:r,error:n}){const i=Af(e);return new i({message:t,code:e,url:a,method:r,error:n})}var Nf=Object.defineProperty,_f=(e,t,a)=>t in e?Nf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,f=(e,t,a)=>_f(e,typeof t!="symbol"?t+"":t,a);class oc extends m{}f(oc,"code",110700),f(oc,"message","The input amount is outside trade limit.");class cc extends m{}f(cc,"code",110701),f(cc,"message","No quote is available with given input.");class lc extends m{}f(lc,"code",110702),f(lc,"message","No supported configurations with given input.");class uc extends m{}f(uc,"code",110703),f(uc,"message","refId already exists, should be unique.");class Kr extends m{}f(Kr,"code",155101),f(Kr,"message","Existing user already created with the provided userId.");class qr extends m{}f(qr,"code",155102),f(qr,"message","Cannot find the user id in the system.");class Hr extends m{}f(Hr,"code",155103),f(Hr,"message","Cannot find the user token in the system.");class Gr extends m{}f(Gr,"code",155104),f(Gr,"message","The userToken had expired.");class zr extends m{}f(zr,"code",155105),f(zr,"message","The userToken is invalid.");class $r extends m{}f($r,"code",155106),f($r,"message","The user had already been initialized.");class Qr extends m{}f(Qr,"code",155107),f(Qr,"message","User has previously set a PIN. Use PUT /user/pin to reset the PIN.");class jr extends m{}f(jr,"code",155108),f(jr,"message","User has previously set up their security questions, and they can't be reset.");class Xr extends m{}f(Xr,"code",155109),f(Xr,"message","The specified user has been disabled.");class Yr extends m{}f(Yr,"code",155110),f(Yr,"message","User has not set up a PIN yet.");class Wr extends m{}f(Wr,"code",155111),f(Wr,"message","User hasn't set the security questions for PIN backup yet.");class Zr extends m{}f(Zr,"code",155112),f(Zr,"message","The user has inputted the incorrect pin.");class Jr extends m{}f(Jr,"code",155113),f(Jr,"message","Provided device ID is not found in the system.");class ea extends m{}f(ea,"code",155114),f(ea,"message","Provided app ID is not recognized in the system.");class ta extends m{}f(ta,"code",155115),f(ta,"message","The user has inputted the incorrect security answers");class ra extends m{}f(ra,"code",155116),f(ra,"message","The challenge ID doesn't exist in the system.");class aa extends m{}f(aa,"code",155117),f(aa,"message","The content provided for approval is not correct.");class na extends m{}f(na,"code",155118),f(na,"message","Encryption key does not match with the user's token. Call POST /users/token to get the correct token encryption key pair.");class sa extends m{}f(sa,"code",155119),f(sa,"message","The user's PIN input is locked. It will be unlocked after the cooldown period.");class ia extends m{}f(ia,"code",155120),f(ia,"message","The user's security questions input is locked. It will be unlocked after the cooldown period.");class oa extends m{}f(oa,"code",155121),f(oa,"message","The provided challengeId has expired.");class ca extends m{}f(ca,"code",155122),f(ca,"message","The provided challengeId is invalid");class la extends m{}f(la,"code",155123),f(la,"message","No extra information provided when adding PIN-related requests.");class ua extends m{}f(ua,"code",155124),f(ua,"message","The extra information provided for PIN-related requests is invalid.");class fa extends m{}f(fa,"code",155130),f(fa,"message","User OTP token is expired.");class da extends m{}f(da,"code",155131),f(da,"message","User OTP token is invalid.");class pa extends m{}f(pa,"code",155132),f(pa,"message","User OTP value is not found.");class ha extends m{}f(ha,"code",155133),f(ha,"message","User OTP value is invalid.");class ga extends m{}f(ga,"code",155134),f(ga,"message","User OTP value is not matched.");class va extends m{}f(va,"code",155135),f(va,"message","User's email is invalid.");class ya extends m{}f(ya,"code",155136),f(ya,"message","User's email is not matched.");class ma extends m{}f(ma,"code",155137),f(ma,"message","User's device ID is invalid.");class Ea extends m{}f(Ea,"code",155138),f(Ea,"message","Failed to send the email.");class Ca extends m{}f(Ca,"code",155139),f(Ca,"message","The idToken / accessToken of SSO is expired.");class xa extends m{}f(xa,"code",155140),f(xa,"message","Failed to validate the idToken/ accessToken.");class Sa extends m{}f(Sa,"code",155141),f(Sa,"message","The user has exceeded the max limit (5) of entering OTP at the moment.");class Ta extends m{}f(Ta,"code",155142),f(Ta,"message","The max limit (5) of sending OTP has been exceeded at the moment.");class ba extends m{}f(ba,"code",155143),f(ba,"message","The device token is expired.");class Ia extends m{}f(Ia,"code",155144),f(Ia,"message","The device token is invalid.");class Aa extends m{}f(Aa,"code",155145),f(Aa,"message","The device token is not found.");class Ba extends m{}f(Ba,"code",155146),f(Ba,"message","The one-time password token is invalid as the user has entered it incorrectly three times.");class wa extends m{}f(wa,"code",155150),f(wa,"message","The SMTP server configuration is not found.");class Na extends m{}f(Na,"code",155151),f(Na,"message","The SMTP server configuration is invalid.");class _a extends m{}f(_a,"code",155152),f(_a,"message","The SSO provider configuration is not found.");class Ra extends m{}f(Ra,"code",155154),f(Ra,"message","The OTP email template is invalid.");class ka extends m{}f(ka,"code",155155),f(ka,"message","The OTP email template is not found.");class La extends m{}f(La,"code",155156),f(La,"message","Failed to update the email template.");class Da extends m{}f(Da,"code",155157),f(Da,"message","Failed to update the SMTP server configuration.");class Ua extends m{}f(Ua,"code",155158),f(Ua,"message","Failed to dial to the SMTP server.");class Pa extends m{}f(Pa,"code",155159),f(Pa,"message","Failed to auth to the SMTP server.");class Oa extends m{}f(Oa,"code",155160),f(Oa,"message","Failed to send to the SMTP server.");class Va extends m{}f(Va,"code",155201),f(Va,"message","Not enough funds to fulfill the withdraw request.");class Ma extends m{}f(Ma,"code",155202),f(Ma,"message","Transaction nonce is inconsistent with sender's latest nonce.");class Fa extends m{}f(Fa,"code",155203),f(Fa,"message","User op nonce can not be larger than 0 when the smart contract wallet hasn't been deployed.");class Ka extends m{}f(Ka,"code",155204),f(Ka,"message","The total cost of executing transaction is higher than the balance of the user's account when estimating fee.");class qa extends m{}f(qa,"code",155205),f(qa,"message","Failed to execute this request on EVM due to insufficient tokens when the estimating gas fee.");class Ha extends m{}f(Ha,"code",155206),f(Ha,"message","The sender address is not the token owner or the sender wasn't approved to commit this transaction.");class Ga extends m{}f(Ga,"code",155207),f(Ga,"message","Gas required exceeds the maximum allowance for the account. This is based on the gas fee estimate amount.");class za extends m{}f(za,"code",155208),f(za,"message","Estimate fee execution reverted.");class $a extends m{}f($a,"code",155209),f($a,"message","ABI function signature can't pack ABI parameter.");class Qa extends m{}f(Qa,"code",155210),f(Qa,"message","Fails to perform transaction estimation.");class ja extends m{}f(ja,"code",155211),f(ja,"message","MaxFee * GasLimit exceeded the maximum permitted transaction gas fee.");class Xa extends m{}f(Xa,"code",155215),f(Xa,"message","Unsupported operation for transaction.");class Ya extends m{}f(Ya,"code",155218),f(Ya,"message","Invalid number of nft in transaction request.");class Wa extends m{}f(Wa,"code",155219),f(Wa,"message","Invalid destination address.");class Za extends m{}f(Za,"code",155220),f(Za,"message","Wallet and token's blockchain mismatch.");class Ja extends m{}f(Ja,"code",155221),f(Ja,"message","Invalid amounts in transfer request.");class en extends m{}f(en,"code",155222),f(en,"message","NFT metadata can not be found.");class tn extends m{}f(tn,"code",155223),f(tn,"message","Unsupported userId for get transactions.");class rn extends m{}f(rn,"code",155224),f(rn,"message","Failed to parse the provided amounts in request to decimals.");class an extends m{}f(an,"code",155225),f(an,"message","Wallet and request's blockchain mismatch.");class nn extends m{}f(nn,"code",155226),f(nn,"message","Invalid source address.");class sn extends m{}f(sn,"code",155227),f(sn,"message","Invalid transaction type.");class on extends m{}f(on,"code",155228),f(on,"message","Missing token ID.");class cn extends m{}f(cn,"code",155229),f(cn,"message","Transaction is not eligible for operation.");class ln extends m{}f(ln,"code",155230),f(ln,"message","No abi signature provided.");class un extends m{}f(un,"code",155231),f(un,"message","Transaction needs feeLevel or gasLimit provided.");class fn extends m{}f(fn,"code",155232),f(fn,"message","SCA transaction needs feeLevel provided.");class dn extends m{}f(dn,"code",155233),f(dn,"message","Provided gasLimit is too low to complete the requested transaction.");class pn extends m{}f(pn,"code",155234),f(pn,"message","Transaction can't have both feeLevel and fee parameters provided.");class hn extends m{}f(hn,"code",155235),f(hn,"message","EIP1559 chains need maxFee/priorityFee provided.");class gn extends m{}f(gn,"code",155236),f(gn,"message","The provided fee in request is invalid.");class vn extends m{}f(vn,"code",155237),f(vn,"message","PriorityFee cannot be larger than maxFee in creating transaction request.");class yn extends m{}f(yn,"code",155238),f(yn,"message","Non-EIP1559 chains need gasPrice provided.");class mn extends m{}f(mn,"code",155239),f(mn,"message","Invalid token address for transfer.");class En extends m{}f(En,"code",155240),f(En,"message","Invalid token standard for transfer.");class Cn extends m{}f(Cn,"code",155241),f(Cn,"message","Invalid token decimal for transfer.");class xn extends m{}f(xn,"code",155242),f(xn,"message","The lengths of amounts and nft tokens don't match.");class Sn extends m{}f(Sn,"code",155243),f(Sn,"message","Missing bytecode for contract deployment.");class Tn extends m{}f(Tn,"code",155244),f(Tn,"message","Cannot provide both WalletID and SourceAddress/Blockchain.");class bn extends m{}f(bn,"code",155245),f(bn,"message","Invalid amount in contract execution request.");class In extends m{}f(In,"code",155247),f(In,"message","Cannot provide both CallData and AbiFunctionSignature/AbiParameters.");class An extends m{}f(An,"code",155254),f(An,"message","Non-EIP1559 chains don't support maxFee/priorityFee.");class Bn extends m{}f(Bn,"code",155257),f(Bn,"message","the transfer amount is insufficient to make the destination account rent exempted or the balance of the source account is insufficient to remain rent exempted. The source address's remaining balance after transfer must be either zero or above the rent exemption threshold.");class wn extends m{}f(wn,"code",155258),f(wn,"message","The asset amount owned by the wallet is insufficient for the transaction.");class Nn extends m{}f(Nn,"code",155262),f(Nn,"message","Account is not found, could be caused by transacting from a Solana account with zero balance.");class _n extends m{}f(_n,"code",155264),f(_n,"message","Wait for pending transactions to be included on the blockchain before submitting new requests. EVM chains restrict the number of queued transactions per sender address.");class Rn extends m{}f(Rn,"code",155501),f(Rn,"message","Frozen wallets can not be updated or interact with, only query.");class kn extends m{}f(kn,"code",155502),f(kn,"message","Max amount of wallets (tentative 1M) reached under 1 wallet set.");class Ln extends m{}f(Ln,"code",155503),f(Ln,"message","Metadata array length needs to match wallet count in create developer wallets request.");class Dn extends m{}f(Dn,"code",155504),f(Dn,"message","Metadata array length needs to match number of blockchains in create user wallets request.");class Un extends m{}f(Un,"code",155505),f(Un,"message","SCA wallet needs to wait for first-time transaction to be queued before processing more transactions.");class Pn extends m{}f(Pn,"code",155506),f(Pn,"message","SCA wallet config is invalid.");class On extends m{}f(On,"code",155507),f(On,"message","SCA account is not supported on the given blockchain.");class Vn extends m{}f(Vn,"code",155508),f(Vn,"message","Can't create multiple user-controlled SCA wallets across multiple blockchains at a time.");class Mn extends m{}f(Mn,"code",155509),f(Mn,"message","Entity needs to setup paymaster policy in developer console before sending transaction on mainnet");class Fn extends m{}f(Fn,"code",155510),f(Fn,"message","The operation is not supported on the blockchain you specify.");class Kn extends m{}f(Kn,"code",155511),f(Kn,"message","Blockchain is not supported for wallet creation.");class qn extends m{}f(qn,"code",155512),f(qn,"message","The owner of the SCA wallet can not be found.");class Hn extends m{}f(Hn,"code",155514),f(Hn,"message","circle_4337_v1 SCA wallet must be deployed before being upgraded.");class Gn extends m{}f(Gn,"code",155515),f(Gn,"message","The provided wallet account type is not supported by this API.");class zn extends m{}f(zn,"code",155516),f(zn,"message","The source wallet was originally created on an SCA version that does not support wallet derivation.");class $n extends m{}f($n,"code",155517),f($n,"message","The SCA wallet is not deployed onchain.");class Qn extends m{}f(Qn,"code",155601),f(Qn,"message","Failed to retrieve wallet set which already exists.");class jn extends m{}f(jn,"code",155701),f(jn,"message","User canceled");class Xn extends m{}f(Xn,"code",155702),f(Xn,"message","<Launch UI failed reason>");class Yn extends m{}f(Yn,"code",155703),f(Yn,"message","The code you entered is not the same as the first one.");class Wn extends m{}f(Wn,"code",155704),f(Wn,"message","Your PIN can't have repeating or consecutive numbers.");class Zn extends m{}f(Zn,"code",155705),f(Zn,"message","Your hint can't be the same as the answer.");class Jn extends m{}f(Jn,"code",155706),f(Jn,"message","Network error");class es extends m{}f(es,"code",155707),f(es,"message","Failed to encrypt data");class ts extends m{}f(ts,"code",155708),f(ts,"message",'"Biometrics instead of PIN" is disabled');class rs extends m{}f(rs,"code",155709),f(rs,"message","The device system doesn't support biometrics");class as extends m{}f(as,"code",155710),f(as,"message","Failed to decrypt biometrics key");class ns extends m{}f(ns,"code",155711),f(ns,"message","The user has not enabled biometrics yet");class ss extends m{}f(ss,"code",155712),f(ss,"message","The user refused to enable biometrics");class is extends m{}f(is,"code",155713),f(is,"message","Too many requests. Try again later");class os extends m{}f(os,"code",155714),f(os,"message","Too many requests. The biometrics sensor on the device is locked.");class cs extends m{}f(cs,"code",155715),f(cs,"message","The user didn't enable biometrics");class ls extends m{}f(ls,"code",155716),f(ls,"message","Unexpected error for biometrics");class us extends m{}f(us,"code",155717),f(us,"message","User secret is missing.");class fs extends m{}f(fs,"code",155718),f(fs,"message","User secret is invalid.");class ds extends m{}f(ds,"code",155719),f(ds,"message","User token and SDK API execute function does not match.");class ps extends m{}f(ps,"code",155720),f(ps,"message","Social login failed.");class hs extends m{}f(hs,"code",155721),f(hs,"message","Login info is missing.");class gs extends m{}f(gs,"code",155801),f(gs,"message","Transaction or rawTransaction is invalid.");class vs extends m{}f(vs,"code",155802),f(vs,"message","Account not found.");class ys extends m{}f(ys,"code",155803),f(ys,"message","Not signer account.");class ms extends m{}f(ms,"code",155804),f(ms,"message","Transaction already signed.");class Es extends m{}f(Es,"code",155805),f(Es,"message","Transaction failed to deserialize.");class Cs extends m{}f(Cs,"code",155806),f(Cs,"message","The transaction size exceeds blockchain limit.");class xs extends m{}f(xs,"code",155807),f(xs,"message","The chain ID is not supported for signing.");class Ss extends m{}f(Ss,"code",155808),f(Ss,"message","The chain ID is missing in sign request.");class Ts extends m{}f(Ts,"code",156001),f(Ts,"message","Cannot find target wallet in the system. Either the specified wallet doesn't exist or it's not accessible to the caller.");class bs extends m{}f(bs,"code",156002),f(bs,"message","Cannot find target token in the system. Either the specified token doesn't exist or it's not accessible to the caller.");class Is extends m{}f(Is,"code",156003),f(Is,"message","Cannot find target transaction in the system. Either the specified transaction doesn't exist or it's not accessible to the caller.");class As extends m{}f(As,"code",156004),f(As,"message","Reusing an entity secret ciphertext is not allowed. Please re-encrypt the entity secret to generate new ciphertext.");class Bs extends m{}f(Bs,"code",156005),f(Bs,"message","Cannot find target wallet set in the system. Either no such wallet set, or it's not accessible to the caller.");class ws extends m{}f(ws,"code",156006),f(ws,"message","TEST_API key cannot be used with blockchain mainnets, or LIVE_API key cannot be used with blockchain testnets.");class Ns extends m{}f(Ns,"code",156007),f(Ns,"message","TEST_API key or LIVE_API key is not found for the request.");class _s extends m{}f(_s,"code",156008),f(_s,"message","Cannot find target entity config in the system. Either no such entity config, or it's not accessible to the caller.");class Rs extends m{}f(Rs,"code",156009),f(Rs,"message","Fail to parse id as UUID in url.");class ks extends m{}f(ks,"code",156010),f(ks,"message","Cannot find the corresponding entity in the system.");class Ls extends m{}f(Ls,"code",156011),f(Ls,"message","Cannot find target nftTokenId in the system.");class Ds extends m{}f(Ds,"code",156012),f(Ds,"message","Cannot find corresponding pagination cursor in the system.");class Us extends m{}f(Us,"code",156013),f(Us,"message","The provided entity secret is invalid.");class Ps extends m{}f(Ps,"code",156014),f(Ps,"message","Pagination params are invalid. Only UUID format is supported for pageBefore and pageAfter.");class Os extends m{}f(Os,"code",156015),f(Os,"message","The secret for this entity has already been set.");class Vs extends m{}f(Vs,"code",156016),f(Vs,"message","The entity secret has not been set yet. Please provide encrypted ciphertext in the console.");class Ms extends m{}f(Ms,"code",156017),f(Ms,"message","The specified blockchain parameters are incorrect.");class Fs extends m{}f(Fs,"code",156018),f(Fs,"message","The uploaded recovery file is invalid.");class Ks extends m{}f(Ks,"code",156019),f(Ks,"message","Current entity secret is invalid. Please rotate the entity secret first.");class qs extends m{}f(qs,"code",156020),f(qs,"message","Please use a new idempotency key.");class Hs extends m{}f(Hs,"code",156021),f(Hs,"message","A new wallet set ID is required.");class Gs extends m{}f(Gs,"code",156023),f(Gs,"message","EncodedByHex is true in sign request, but the message is not hex encoded.");class zs extends m{}f(zs,"code",156024),f(zs,"message","Data is not a valid JSON string in sign request.");class $s extends m{}f($s,"code",156025),f($s,"message","Invalid message in request.");class Qs extends m{}f(Qs,"code",156026),f(Qs,"message","Invalid typed data in request.");class js extends m{}f(js,"code",156027),f(js,"message","The specified blockchain is either not supported or deprecated.");class Xs extends m{}f(Xs,"code",156030),f(Xs,"message","Invalid unsigned delegate action in request.");class Ys extends m{}f(Ys,"code",156031),f(Ys,"message","The specified token address is not supported.");class Ws extends m{}f(Ws,"code",156032),f(Ws,"message","The provided amount is invalid.");class Zs extends m{}f(Zs,"code",175001),f(Zs,"message","contract not found");class Js extends m{}f(Js,"code",175002),f(Js,"message","no ABI JSON for the target contract");class ei extends m{}f(ei,"code",175003),f(ei,"message","constructor parameters length must match constructor signature");class ti extends m{}f(ti,"code",175004),f(ti,"message","contract already exists");class ri extends m{}f(ri,"code",175005),f(ri,"message","address is not a contract address");class ai extends m{}f(ai,"code",175006),f(ai,"message","contract is archived");class ni extends m{}f(ni,"code",175007),f(ni,"message","invalid ABI JSON");class si extends m{}f(si,"code",175008),f(si,"message","multi-layered proxies are not supported");class ii extends m{}f(ii,"code",175009),f(ii,"message","contract deployment pending");class oi extends m{}f(oi,"code",175010),f(oi,"message","ABI function not found");class ci extends m{}f(ci,"code",175011),f(ci,"message","empty update on a contract");class li extends m{}f(li,"code",175012),f(li,"message","unable to query contract");class ui extends m{}f(ui,"code",175013),f(ui,"message","ABI function is not supported");class fi extends m{}f(fi,"code",175201),f(fi,"message","template not found");class di extends m{}f(di,"code",175202),f(di,"message","deploying this template is temporarily disabled");class pi extends m{}f(pi,"code",175203),f(pi,"message","invalid template deployment parameter");class hi extends m{}f(hi,"code",175204),f(hi,"message","missing required template deployment parameter");class gi extends m{}f(gi,"code",175205),f(gi,"message","estimation is not supported");class vi extends m{}f(vi,"code",175301),f(vi,"message","event subscription not found");class yi extends m{}f(yi,"code",175302),f(yi,"message","event subscription already exists");class mi extends m{}f(mi,"code",175303),f(mi,"message","the specified event signature does not exist");class Ei extends m{}f(Ei,"code",175401),f(Ei,"message","failed to parse id as UUID in url");class Ci extends m{}f(Ci,"code",175402),f(Ci,"message","the specified blockchain is either not supported or deprecated");class xi extends m{}f(xi,"code",175403),f(xi,"message","please use a new idempotency key");class Si extends m{}f(Si,"code",175404),f(Si,"message","TEST_API key cannot be used with blockchain mainnets, or LIVE_API key cannot be used with blockchain testnets");class Ti extends m{}f(Ti,"code",175405),f(Ti,"message","TEST_API key or LIVE_API key is not found for the request");class bi extends m{}f(bi,"code",175406),f(bi,"message","this feature is temporarily disabled");class Ii extends m{}f(Ii,"code",175407),f(Ii,"message","the specified blockchain is currently unavailable");class Ai extends m{}f(Ai,"code",175408),f(Ai,"message","can not find corresponding pagination cursor in the system");class Bi extends m{}f(Bi,"code",175409),f(Bi,"message","restricted entity cannot perform this operation");class wi extends m{}f(wi,"code",175410),f(wi,"message","invalid address format");class Ni extends m{}f(Ni,"code",177001),f(Ni,"message","transaction nonce is inconsistent with sender's latest nonce");class _i extends m{}f(_i,"code",177002),f(_i,"message","user op nonce can not be larger than 0 when smart contract wallet hasn't been deployed");class Ri extends m{}f(Ri,"code",177003),f(Ri,"message","failed to execute this request on EVM due to insufficient token when estimating fee");class ki extends m{}f(ki,"code",177004),f(ki,"message","the total cost of executing transaction is higher than the balance of the user's account when estimating fee");class Li extends m{}f(Li,"code",177005),f(Li,"message","the sender address is not token owner or approved when estimating token transfer");class Di extends m{}f(Di,"code",177006),f(Di,"message","gas required exceeds allowance when estimating fee");class Ui extends m{}f(Ui,"code",177007),f(Ui,"message","estimate fee execution reverted");class Pi extends m{}f(Pi,"code",177008),f(Pi,"message","ABI function signature can't pack ABI parameter");class Oi extends m{}f(Oi,"code",177009),f(Oi,"message","fails to perform transaction estimation");class Vi extends m{}f(Vi,"code",177010),f(Vi,"message","MaxFee * GasLimit exceeds configurable max transaction fee (default is 1 native token)");class Mi extends m{}f(Mi,"code",177011),f(Mi,"message","transaction needs feeLevel or gasLimit provided");class Fi extends m{}f(Fi,"code",177012),f(Fi,"message","SCA transaction needs feeLevel provided");class Ki extends m{}f(Ki,"code",177013),f(Ki,"message","EIP1559 chains need maxFee/priorityFee provided");class qi extends m{}f(qi,"code",177014),f(qi,"message","priorityFee cannot be larger than maxFee in creating transaction request");class Hi extends m{}f(Hi,"code",177015),f(Hi,"message","missing bytecode for contract deployment");class Gi extends m{}f(Gi,"code",177016),f(Gi,"message","cannot provide both WalletID and SourceAddress/Blockchain");class zi extends m{}f(zi,"code",177017),f(zi,"message","invalid amount in contract execution request");class $i extends m{}f($i,"code",177018),f($i,"message","policy is not activated and cannot be used");class Qi extends m{}f(Qi,"code",177019),f(Qi,"message","exceeded max daily transaction of the policy");class ji extends m{}f(ji,"code",177020),f(ji,"message","exceeded max spend USD per transaction of the policy");class Xi extends m{}f(Xi,"code",177021),f(Xi,"message","exceeded max spend USD daily of the policy");class Yi extends m{}f(Yi,"code",177022),f(Yi,"message","exceeded max native token daily of the policy");class Wi extends m{}f(Wi,"code",177023),f(Wi,"message","sender is in policy blocklist");class Zi extends m{}f(Zi,"code",177024),f(Zi,"message","Wallet and request's blockchain mismatch.");class Ji extends m{}f(Ji,"code",177025),f(Ji,"message","the asset amount owned by the wallet is insufficient for the transaction");class eo extends m{}f(eo,"code",177026),f(eo,"message","Wait for pending transactions to be included on the blockchain before submitting new requests. EVM chains restrict the number of queued transactions per sender address.");class to extends m{}f(to,"code",177301),f(to,"message","wallet is Frozen");class ro extends m{}f(ro,"code",177302),f(ro,"message","invalid sca wallet config");class ao extends m{}f(ao,"code",177303),f(ao,"message","SCA wallet first-time transaction is still in progress");class no extends m{}f(no,"code",177304),f(no,"message","SCA account is not supported on the given blockchain");class so extends m{}f(so,"code",177305),f(so,"message","entity is not eligible for SCA account creation. Please check paymaster policy setup");class io extends m{}f(io,"code",177601),f(io,"message","cannot find target wallet in the system. Either the specified wallet doesn't exist or it's not accessible to the caller");class oo extends m{}f(oo,"code",177602),f(oo,"message","reusing an entity secret ciphertext is not allowed. Please re-encrypt the entity secret to generate new ciphertext");class co extends m{}f(co,"code",177603),f(co,"message","cannot find the corresponding entity in the system");class lo extends m{}f(lo,"code",177604),f(lo,"message","the provided entity secret is invalid");class uo extends m{}f(uo,"code",177605),f(uo,"message","the entity secret has not been set yet. Please provide encrypted ciphertext in the console");class fo extends m{}f(fo,"code",177606),f(fo,"message","current entity secret is invalid. Please rotate the entity secret first");class po extends m{}f(po,"code",177607),f(po,"message","please use a new idempotency key");class ho extends m{}f(ho,"code",177901),f(ho,"message","smart contract query failed");const x0={undefined:m,[Tr.code]:Tr,[br.code]:br,[Ir.code]:Ir,[Ar.code]:Ar,[Br.code]:Br,[wr.code]:wr,[Nr.code]:Nr,[_r.code]:_r,[Rr.code]:Rr,[kr.code]:kr,[Kr.code]:Kr,[qr.code]:qr,[Hr.code]:Hr,[Gr.code]:Gr,[zr.code]:zr,[$r.code]:$r,[Qr.code]:Qr,[jr.code]:jr,[Xr.code]:Xr,[Yr.code]:Yr,[Wr.code]:Wr,[Zr.code]:Zr,[Jr.code]:Jr,[ea.code]:ea,[ta.code]:ta,[ra.code]:ra,[aa.code]:aa,[na.code]:na,[sa.code]:sa,[ia.code]:ia,[oa.code]:oa,[ca.code]:ca,[la.code]:la,[ua.code]:ua,[fa.code]:fa,[da.code]:da,[pa.code]:pa,[ha.code]:ha,[ga.code]:ga,[va.code]:va,[ya.code]:ya,[ma.code]:ma,[Ea.code]:Ea,[Ca.code]:Ca,[xa.code]:xa,[Sa.code]:Sa,[Ta.code]:Ta,[ba.code]:ba,[Ia.code]:Ia,[Aa.code]:Aa,[Ba.code]:Ba,[wa.code]:wa,[Na.code]:Na,[_a.code]:_a,[Ra.code]:Ra,[ka.code]:ka,[La.code]:La,[Da.code]:Da,[Ua.code]:Ua,[Pa.code]:Pa,[Oa.code]:Oa,[Va.code]:Va,[Ma.code]:Ma,[Fa.code]:Fa,[Ka.code]:Ka,[qa.code]:qa,[Ha.code]:Ha,[Ga.code]:Ga,[za.code]:za,[$a.code]:$a,[Qa.code]:Qa,[ja.code]:ja,[Xa.code]:Xa,[Ya.code]:Ya,[Wa.code]:Wa,[Za.code]:Za,[Ja.code]:Ja,[en.code]:en,[tn.code]:tn,[rn.code]:rn,[an.code]:an,[nn.code]:nn,[sn.code]:sn,[on.code]:on,[cn.code]:cn,[ln.code]:ln,[un.code]:un,[fn.code]:fn,[dn.code]:dn,[pn.code]:pn,[hn.code]:hn,[gn.code]:gn,[vn.code]:vn,[yn.code]:yn,[mn.code]:mn,[En.code]:En,[Cn.code]:Cn,[xn.code]:xn,[Sn.code]:Sn,[Tn.code]:Tn,[bn.code]:bn,[In.code]:In,[An.code]:An,[Bn.code]:Bn,[wn.code]:wn,[Nn.code]:Nn,[_n.code]:_n,[Rn.code]:Rn,[kn.code]:kn,[Ln.code]:Ln,[Dn.code]:Dn,[Un.code]:Un,[Pn.code]:Pn,[On.code]:On,[Vn.code]:Vn,[Mn.code]:Mn,[Fn.code]:Fn,[Kn.code]:Kn,[qn.code]:qn,[Hn.code]:Hn,[Gn.code]:Gn,[zn.code]:zn,[$n.code]:$n,[Qn.code]:Qn,[jn.code]:jn,[Xn.code]:Xn,[Yn.code]:Yn,[Wn.code]:Wn,[Zn.code]:Zn,[Jn.code]:Jn,[es.code]:es,[ts.code]:ts,[rs.code]:rs,[as.code]:as,[ns.code]:ns,[ss.code]:ss,[is.code]:is,[os.code]:os,[cs.code]:cs,[ls.code]:ls,[us.code]:us,[fs.code]:fs,[ds.code]:ds,[ps.code]:ps,[hs.code]:hs,[gs.code]:gs,[vs.code]:vs,[ys.code]:ys,[ms.code]:ms,[Es.code]:Es,[Cs.code]:Cs,[xs.code]:xs,[Ss.code]:Ss,[Ts.code]:Ts,[bs.code]:bs,[Is.code]:Is,[As.code]:As,[Bs.code]:Bs,[ws.code]:ws,[Ns.code]:Ns,[_s.code]:_s,[Rs.code]:Rs,[ks.code]:ks,[Ls.code]:Ls,[Ds.code]:Ds,[Us.code]:Us,[Ps.code]:Ps,[Os.code]:Os,[Vs.code]:Vs,[Ms.code]:Ms,[Fs.code]:Fs,[Ks.code]:Ks,[qs.code]:qs,[Hs.code]:Hs,[Gs.code]:Gs,[zs.code]:zs,[$s.code]:$s,[Qs.code]:Qs,[js.code]:js,[Xs.code]:Xs,[Ys.code]:Ys,[Ws.code]:Ws,[Zs.code]:Zs,[Js.code]:Js,[ei.code]:ei,[ti.code]:ti,[ri.code]:ri,[ai.code]:ai,[ni.code]:ni,[si.code]:si,[ii.code]:ii,[oi.code]:oi,[ci.code]:ci,[li.code]:li,[ui.code]:ui,[fi.code]:fi,[di.code]:di,[pi.code]:pi,[hi.code]:hi,[gi.code]:gi,[vi.code]:vi,[yi.code]:yi,[mi.code]:mi,[Ei.code]:Ei,[Ci.code]:Ci,[xi.code]:xi,[Si.code]:Si,[Ti.code]:Ti,[bi.code]:bi,[Ii.code]:Ii,[Ai.code]:Ai,[Bi.code]:Bi,[wi.code]:wi,[Ni.code]:Ni,[_i.code]:_i,[Ri.code]:Ri,[ki.code]:ki,[Li.code]:Li,[Di.code]:Di,[Ui.code]:Ui,[Pi.code]:Pi,[Oi.code]:Oi,[Vi.code]:Vi,[Mi.code]:Mi,[Fi.code]:Fi,[Ki.code]:Ki,[qi.code]:qi,[Hi.code]:Hi,[Gi.code]:Gi,[zi.code]:zi,[$i.code]:$i,[Qi.code]:Qi,[ji.code]:ji,[Xi.code]:Xi,[Yi.code]:Yi,[Wi.code]:Wi,[Zi.code]:Zi,[Ji.code]:Ji,[eo.code]:eo,[to.code]:to,[ro.code]:ro,[ao.code]:ao,[no.code]:no,[so.code]:so,[io.code]:io,[oo.code]:oo,[co.code]:co,[lo.code]:lo,[uo.code]:uo,[fo.code]:fo,[po.code]:po,[ho.code]:ho};function Rf(e){return x0[e]??x0.undefined}function kf(e){const t=e.response.data,a=e.response.status;return Lf({code:t?.code??a,status:a,message:t?.message,url:e.config.url,method:e.config.method.toUpperCase(),error:e})}function Lf({code:e,status:t,message:a,url:r,method:n,error:i}){const s=Rf(e);return new s({message:a,code:e,url:r,method:n,status:t,error:i})}function Ke(e){return e.response?kf(e):Bf(e)}const ct=e=>{const{data:t,headers:a,...r}=e;return{...r,data:t.data,headers:a}},Df=({configurationsClient:e})=>async()=>{try{return ct(await e.DeveloperAccount.getPublicKey())}catch(t){throw qe(t)?Ke(t):t}};var Uf=Object.defineProperty,Pf=(e,t,a)=>t in e?Uf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Of=(e,t,a)=>Pf(e,typeof t!="symbol"?t+"":t,a);class Vf{constructor(){Of(this,"data",{})}get(t){return Promise.resolve(this.data[t]??void 0)}set(t,a){return a===void 0?delete this.data[t]:this.data[t]=a,Promise.resolve()}}var Mf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},j={options:{usePureJavaScript:!1}},fc={},Ff=fc,S0={};fc.encode=function(e,t,a){if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(a!==void 0&&typeof a!="number")throw new TypeError('"maxline" must be a number.');var r="";if(!(e instanceof Uint8Array))r=Kf(e,t);else{var n=0,i=t.length,s=t.charAt(0),o=[0];for(n=0;n<e.length;++n){for(var c=0,l=e[n];c<o.length;++c)l+=o[c]<<8,o[c]=l%i,l=l/i|0;for(;l>0;)o.push(l%i),l=l/i|0}for(n=0;e[n]===0&&n<e.length-1;++n)r+=s;for(n=o.length-1;n>=0;--n)r+=t[o[n]]}if(a){var u=new RegExp(".{1,"+a+"}","g");r=r.match(u).join(`\r
2
+ `)}return r},fc.decode=function(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');var a=S0[t];if(!a){a=S0[t]=[];for(var r=0;r<t.length;++r)a[t.charCodeAt(r)]=r}e=e.replace(/\s/g,"");for(var n=t.length,i=t.charAt(0),s=[0],r=0;r<e.length;r++){var o=a[e.charCodeAt(r)];if(o===void 0)return;for(var c=0,l=o;c<s.length;++c)l+=s[c]*n,s[c]=l&255,l>>=8;for(;l>0;)s.push(l&255),l>>=8}for(var u=0;e[u]===i&&u<e.length-1;++u)s.push(0);return typeof Buffer<"u"?Buffer.from(s.reverse()):new Uint8Array(s.reverse())};function Kf(e,t){var a=0,r=t.length,n=t.charAt(0),i=[0];for(a=0;a<e.length();++a){for(var s=0,o=e.at(a);s<i.length;++s)o+=i[s]<<8,i[s]=o%r,o=o/r|0;for(;o>0;)i.push(o%r),o=o/r|0}var c="";for(a=0;e.at(a)===0&&a<e.length()-1;++a)c+=n;for(a=i.length-1;a>=0;--a)c+=t[i[a]];return c}var T0=j,b0=Ff,T=T0.util=T0.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){T.nextTick=process.nextTick,typeof setImmediate=="function"?T.setImmediate=setImmediate:T.setImmediate=T.nextTick;return}if(typeof setImmediate=="function"){T.setImmediate=function(){return setImmediate.apply(void 0,arguments)},T.nextTick=function(s){return setImmediate(s)};return}if(T.setImmediate=function(s){setTimeout(s,0)},typeof window<"u"&&typeof window.postMessage=="function"){let s=function(o){if(o.source===window&&o.data===e){o.stopPropagation();var c=t.slice();t.length=0,c.forEach(function(l){l()})}};var e="forge.setImmediate",t=[];T.setImmediate=function(o){t.push(o),t.length===1&&window.postMessage(e,"*")},window.addEventListener("message",s,!0)}if(typeof MutationObserver<"u"){var a=Date.now(),r=!0,n=document.createElement("div"),t=[];new MutationObserver(function(){var o=t.slice();t.length=0,o.forEach(function(c){c()})}).observe(n,{attributes:!0});var i=T.setImmediate;T.setImmediate=function(o){Date.now()-a>15?(a=Date.now(),i(o)):(t.push(o),t.length===1&&n.setAttribute("a",r=!r))}}T.nextTick=T.setImmediate})(),T.isNodejs=typeof process<"u"&&process.versions&&process.versions.node,T.globalScope=(function(){return T.isNodejs?Mf:typeof self>"u"?window:self})(),T.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},T.isArrayBuffer=function(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer},T.isArrayBufferView=function(e){return e&&T.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function go(e){if(!(e===8||e===16||e===24||e===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}T.ByteBuffer=dc;function dc(e){if(this.data="",this.read=0,typeof e=="string")this.data=e;else if(T.isArrayBuffer(e)||T.isArrayBufferView(e))if(typeof Buffer<"u"&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch{for(var a=0;a<t.length;++a)this.putByte(t[a])}}else(e instanceof dc||typeof e=="object"&&typeof e.data=="string"&&typeof e.read=="number")&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}T.ByteStringBuffer=dc;var qf=4096;T.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>qf&&(this.data.substr(0,1),this._constructedStringLength=0)},T.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},T.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},T.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},T.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var a=this.data;t>0;)t&1&&(a+=e),t>>>=1,t>0&&(e+=e);return this.data=a,this._optimizeConstructedString(t),this},T.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},T.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(T.encodeUtf8(e))},T.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},T.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},T.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(e&255))},T.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))},T.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},T.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},T.ByteStringBuffer.prototype.putInt=function(e,t){go(t);var a="";do t-=8,a+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(a)},T.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},T.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},T.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},T.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},T.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},T.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},T.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},T.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},T.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},T.ByteStringBuffer.prototype.getInt=function(e){go(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0);return t},T.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),a=2<<e-2;return t>=a&&(t-=a<<1),t},T.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):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t},T.ByteStringBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},T.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},T.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},T.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},T.ByteStringBuffer.prototype.copy=function(){var e=T.createBuffer(this.data);return e.read=this.read,e},T.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},T.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},T.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},T.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var a=this.data.charCodeAt(t);a<16&&(e+="0"),e+=a.toString(16)}return e},T.ByteStringBuffer.prototype.toString=function(){return T.decodeUtf8(this.bytes())};function Hf(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var a=T.isArrayBuffer(e),r=T.isArrayBufferView(e);if(a||r){a?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,e!=null&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}T.DataBuffer=Hf,T.DataBuffer.prototype.length=function(){return this.write-this.read},T.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},T.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var a=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+t);return r.set(a),this.data=new DataView(r.buffer),this},T.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},T.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var a=0;a<t;++a)this.data.setUint8(e);return this},T.DataBuffer.prototype.putBytes=function(e,t){if(T.isArrayBufferView(e)){var a=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=a.byteLength-a.byteOffset;this.accommodate(r);var n=new Uint8Array(this.data.buffer,this.write);return n.set(a),this.write+=r,this}if(T.isArrayBuffer(e)){var a=new Uint8Array(e);this.accommodate(a.byteLength);var n=new Uint8Array(this.data.buffer);return n.set(a,this.write),this.write+=a.byteLength,this}if(e instanceof T.DataBuffer||typeof e=="object"&&typeof e.read=="number"&&typeof e.write=="number"&&T.isArrayBufferView(e.data)){var a=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(a.byteLength);var n=new Uint8Array(e.data.byteLength,this.write);return n.set(a),this.write+=a.byteLength,this}if(e instanceof T.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary",typeof e=="string"){var i;if(t==="hex")return this.accommodate(Math.ceil(e.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=T.binary.hex.decode(e,i,this.write),this;if(t==="base64")return this.accommodate(Math.ceil(e.length/4)*3),i=new Uint8Array(this.data.buffer,this.write),this.write+=T.binary.base64.decode(e,i,this.write),this;if(t==="utf8"&&(e=T.encodeUtf8(e),t="binary"),t==="binary"||t==="raw")return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=T.binary.raw.decode(i),this;if(t==="utf16")return this.accommodate(e.length*2),i=new Uint16Array(this.data.buffer,this.write),this.write+=T.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},T.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},T.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},T.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},T.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},T.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},T.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},T.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},T.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},T.DataBuffer.prototype.putInt=function(e,t){go(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this},T.DataBuffer.prototype.putSignedInt=function(e,t){return go(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},T.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},T.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},T.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},T.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},T.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},T.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},T.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},T.DataBuffer.prototype.getInt=function(e){go(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0);return t},T.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),a=2<<e-2;return t>=a&&(t-=a<<1),t},T.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):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t},T.DataBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},T.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},T.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},T.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},T.DataBuffer.prototype.copy=function(){return new T.DataBuffer(this)},T.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},T.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},T.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},T.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var a=this.data.getUint8(t);a<16&&(e+="0"),e+=a.toString(16)}return e},T.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(e=e||"utf8",e==="binary"||e==="raw")return T.binary.raw.encode(t);if(e==="hex")return T.binary.hex.encode(t);if(e==="base64")return T.binary.base64.encode(t);if(e==="utf8")return T.text.utf8.decode(t);if(e==="utf16")return T.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},T.createBuffer=function(e,t){return t=t||"raw",e!==void 0&&t==="utf8"&&(e=T.encodeUtf8(e)),new T.ByteBuffer(e)},T.fillString=function(e,t){for(var a="";t>0;)t&1&&(a+=e),t>>>=1,t>0&&(e+=e);return a},T.xorBytes=function(e,t,a){for(var r="",n="",i="",s=0,o=0;a>0;--a,++s)n=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(r+=i,i="",o=0),i+=String.fromCharCode(n),++o;return r+=i,r},T.hexToBytes=function(e){var t="",a=0;for(e.length&!0&&(a=1,t+=String.fromCharCode(parseInt(e[0],16)));a<e.length;a+=2)t+=String.fromCharCode(parseInt(e.substr(a,2),16));return t},T.bytesToHex=function(e){return T.createBuffer(e).toHex()},T.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var Ft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Kt=[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],I0="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";T.encode64=function(e,t){for(var a="",r="",n,i,s,o=0;o<e.length;)n=e.charCodeAt(o++),i=e.charCodeAt(o++),s=e.charCodeAt(o++),a+=Ft.charAt(n>>2),a+=Ft.charAt((n&3)<<4|i>>4),isNaN(i)?a+="==":(a+=Ft.charAt((i&15)<<2|s>>6),a+=isNaN(s)?"=":Ft.charAt(s&63)),t&&a.length>t&&(r+=a.substr(0,t)+`\r
3
+ `,a=a.substr(t));return r+=a,r},T.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t="",a,r,n,i,s=0;s<e.length;)a=Kt[e.charCodeAt(s++)-43],r=Kt[e.charCodeAt(s++)-43],n=Kt[e.charCodeAt(s++)-43],i=Kt[e.charCodeAt(s++)-43],t+=String.fromCharCode(a<<2|r>>4),n!==64&&(t+=String.fromCharCode((r&15)<<4|n>>2),i!==64&&(t+=String.fromCharCode((n&3)<<6|i)));return t},T.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},T.decodeUtf8=function(e){return decodeURIComponent(escape(e))},T.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:b0.encode,decode:b0.decode}},T.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},T.binary.raw.decode=function(e,t,a){var r=t;r||(r=new Uint8Array(e.length)),a=a||0;for(var n=a,i=0;i<e.length;++i)r[n++]=e.charCodeAt(i);return t?n-a:r},T.binary.hex.encode=T.bytesToHex,T.binary.hex.decode=function(e,t,a){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/2))),a=a||0;var n=0,i=a;for(e.length&1&&(n=1,r[i++]=parseInt(e[0],16));n<e.length;n+=2)r[i++]=parseInt(e.substr(n,2),16);return t?i-a:r},T.binary.base64.encode=function(e,t){for(var a="",r="",n,i,s,o=0;o<e.byteLength;)n=e[o++],i=e[o++],s=e[o++],a+=Ft.charAt(n>>2),a+=Ft.charAt((n&3)<<4|i>>4),isNaN(i)?a+="==":(a+=Ft.charAt((i&15)<<2|s>>6),a+=isNaN(s)?"=":Ft.charAt(s&63)),t&&a.length>t&&(r+=a.substr(0,t)+`\r
4
+ `,a=a.substr(t));return r+=a,r},T.binary.base64.decode=function(e,t,a){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/4)*3)),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),a=a||0;for(var n,i,s,o,c=0,l=a;c<e.length;)n=Kt[e.charCodeAt(c++)-43],i=Kt[e.charCodeAt(c++)-43],s=Kt[e.charCodeAt(c++)-43],o=Kt[e.charCodeAt(c++)-43],r[l++]=n<<2|i>>4,s!==64&&(r[l++]=(i&15)<<4|s>>2,o!==64&&(r[l++]=(s&3)<<6|o));return t?l-a:r.subarray(0,l)},T.binary.base58.encode=function(e,t){return T.binary.baseN.encode(e,I0,t)},T.binary.base58.decode=function(e,t){return T.binary.baseN.decode(e,I0,t)},T.text={utf8:{},utf16:{}},T.text.utf8.encode=function(e,t,a){e=T.encodeUtf8(e);var r=t;r||(r=new Uint8Array(e.length)),a=a||0;for(var n=a,i=0;i<e.length;++i)r[n++]=e.charCodeAt(i);return t?n-a:r},T.text.utf8.decode=function(e){return T.decodeUtf8(String.fromCharCode.apply(null,e))},T.text.utf16.encode=function(e,t,a){var r=t;r||(r=new Uint8Array(e.length*2));var n=new Uint16Array(r.buffer);a=a||0;for(var i=a,s=a,o=0;o<e.length;++o)n[s++]=e.charCodeAt(o),i+=2;return t?i-a:r},T.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},T.deflate=function(e,t,a){if(t=T.decode64(e.deflate(T.encode64(t)).rval),a){var r=2,n=t.charCodeAt(1);n&32&&(r=6),t=t.substring(r,t.length-4)}return t},T.inflate=function(e,t,a){var r=e.inflate(T.encode64(t)).rval;return r===null?null:T.decode64(r)};var pc=function(e,t,a){if(!e)throw new Error("WebStorage not available.");var r;if(a===null?r=e.removeItem(t):(a=T.encode64(JSON.stringify(a)),r=e.setItem(t,a)),typeof r<"u"&&r.rval!==!0){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}},hc=function(e,t){if(!e)throw new Error("WebStorage not available.");var a=e.getItem(t);if(e.init)if(a.rval===null){if(a.error){var r=new Error(a.error.message);throw r.id=a.error.id,r.name=a.error.name,r}a=null}else a=a.rval;return a!==null&&(a=JSON.parse(T.decode64(a))),a},Gf=function(e,t,a,r){var n=hc(e,t);n===null&&(n={}),n[a]=r,pc(e,t,n)},zf=function(e,t,a){var r=hc(e,t);return r!==null&&(r=a in r?r[a]:null),r},$f=function(e,t,a){var r=hc(e,t);if(r!==null&&a in r){delete r[a];var n=!0;for(var i in r){n=!1;break}n&&(r=null),pc(e,t,r)}},Qf=function(e,t){pc(e,t,null)},No=function(e,t,a){var r=null;typeof a>"u"&&(a=["web","flash"]);var n,i=!1,s=null;for(var o in a){n=a[o];try{if(n==="flash"||n==="both"){if(t[0]===null)throw new Error("Flash local storage not available.");r=e.apply(this,t),i=n==="flash"}(n==="web"||n==="both")&&(t[0]=localStorage,r=e.apply(this,t),i=!0)}catch(c){s=c}if(i)break}if(!i)throw s;return r};T.setItem=function(e,t,a,r,n){No(Gf,arguments,n)},T.getItem=function(e,t,a,r){return No(zf,arguments,r)},T.removeItem=function(e,t,a,r){No($f,arguments,r)},T.clearItems=function(e,t,a){No(Qf,arguments,a)},T.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},T.format=function(e){for(var t=/%./g,a,r,n=0,i=[],s=0;a=t.exec(e);){r=e.substring(s,t.lastIndex-2),r.length>0&&i.push(r),s=t.lastIndex;var o=a[0][1];switch(o){case"s":case"o":n<arguments.length?i.push(arguments[n+++1]):i.push("<?>");break;case"%":i.push("%");break;default:i.push("<%"+o+"?>")}}return i.push(e.substring(s)),i.join("")},T.formatNumber=function(e,t,a,r){var n=e,i=isNaN(t=Math.abs(t))?2:t,s=a===void 0?",":a,o=r===void 0?".":r,c=n<0?"-":"",l=parseInt(n=Math.abs(+n||0).toFixed(i),10)+"",u=l.length>3?l.length%3:0;return c+(u?l.substr(0,u)+o:"")+l.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+o)+(i?s+Math.abs(n-l).toFixed(i).slice(2):"")},T.formatSize=function(e){return e>=1073741824?e=T.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?e=T.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?e=T.formatNumber(e/1024,0)+" KiB":e=T.formatNumber(e,0)+" bytes",e},T.bytesFromIP=function(e){return e.indexOf(".")!==-1?T.bytesFromIPv4(e):e.indexOf(":")!==-1?T.bytesFromIPv6(e):null},T.bytesFromIPv4=function(e){if(e=e.split("."),e.length!==4)return null;for(var t=T.createBuffer(),a=0;a<e.length;++a){var r=parseInt(e[a],10);if(isNaN(r))return null;t.putByte(r)}return t.getBytes()},T.bytesFromIPv6=function(e){var t=0;e=e.split(":").filter(function(s){return s.length===0&&++t,!0});for(var a=(8-e.length+t)*2,r=T.createBuffer(),n=0;n<8;++n){if(!e[n]||e[n].length===0){r.fillWithByte(0,a),a=0;continue}var i=T.hexToBytes(e[n]);i.length<2&&r.putByte(0),r.putBytes(i)}return r.getBytes()},T.bytesToIP=function(e){return e.length===4?T.bytesToIPv4(e):e.length===16?T.bytesToIPv6(e):null},T.bytesToIPv4=function(e){if(e.length!==4)return null;for(var t=[],a=0;a<e.length;++a)t.push(e.charCodeAt(a));return t.join(".")},T.bytesToIPv6=function(e){if(e.length!==16)return null;for(var t=[],a=[],r=0,n=0;n<e.length;n+=2){for(var i=T.bytesToHex(e[n]+e[n+1]);i[0]==="0"&&i!=="0";)i=i.substr(1);if(i==="0"){var s=a[a.length-1],o=t.length;!s||o!==s.end+1?a.push({start:o,end:o}):(s.end=o,s.end-s.start>a[r].end-a[r].start&&(r=a.length-1))}t.push(i)}if(a.length>0){var c=a[r];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),c.start===0&&t.unshift(""),c.end===7&&t.push(""))}return t.join(":")},T.estimateCores=function(e,t){if(typeof e=="function"&&(t=e,e={}),e=e||{},"cores"in T&&!e.update)return t(null,T.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return T.cores=navigator.hardwareConcurrency,t(null,T.cores);if(typeof Worker>"u")return T.cores=1,t(null,T.cores);if(typeof Blob>"u")return T.cores=2,t(null,T.cores);var a=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(s){var o=Date.now(),c=o+4;self.postMessage({st:o,et:c})})}.toString(),")()"],{type:"application/javascript"}));r([],5,16);function r(s,o,c){if(o===0){var l=Math.floor(s.reduce(function(u,d){return u+d},0)/s.length);return T.cores=Math.max(1,l),URL.revokeObjectURL(a),t(null,T.cores)}n(c,function(u,d){s.push(i(c,d)),r(s,o-1,c)})}function n(s,o){for(var c=[],l=[],u=0;u<s;++u){var d=new Worker(a);d.addEventListener("message",function(v){if(l.push(v.data),l.length===s){for(var E=0;E<s;++E)c[E].terminate();o(null,l)}}),c.push(d)}for(var u=0;u<s;++u)c[u].postMessage(u)}function i(s,o){for(var c=[],l=0;l<s;++l)for(var u=o[l],d=c[l]=[],v=0;v<s;++v)if(l!==v){var E=o[v];(u.st>E.st&&u.st<E.et||E.st>u.st&&E.st<u.et)&&d.push(v)}return c.reduce(function(y,x){return Math.max(y,x.length)},0)}};var Se=j;Se.cipher=Se.cipher||{},Se.cipher.algorithms=Se.cipher.algorithms||{},Se.cipher.createCipher=function(e,t){var a=e;if(typeof a=="string"&&(a=Se.cipher.getAlgorithm(a),a&&(a=a())),!a)throw new Error("Unsupported algorithm: "+e);return new Se.cipher.BlockCipher({algorithm:a,key:t,decrypt:!1})},Se.cipher.createDecipher=function(e,t){var a=e;if(typeof a=="string"&&(a=Se.cipher.getAlgorithm(a),a&&(a=a())),!a)throw new Error("Unsupported algorithm: "+e);return new Se.cipher.BlockCipher({algorithm:a,key:t,decrypt:!0})},Se.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),Se.cipher.algorithms[e]=t},Se.cipher.getAlgorithm=function(e){return e=e.toUpperCase(),e in Se.cipher.algorithms?Se.cipher.algorithms[e]:null};var gc=Se.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)};gc.prototype.start=function(e){e=e||{};var t={};for(var a in e)t[a]=e[a];t.decrypt=this._decrypt,this._finish=!1,this._input=Se.util.createBuffer(),this.output=e.output||Se.util.createBuffer(),this.mode.start(t)},gc.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()},gc.prototype.finish=function(e){e&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(a){return e(this.blockSize,a,!1)},this.mode.unpad=function(a){return e(this.blockSize,a,!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))};var Te=j;Te.cipher=Te.cipher||{};var Y=Te.cipher.modes=Te.cipher.modes||{};Y.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)},Y.ecb.prototype.start=function(e){},Y.ecb.prototype.encrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])},Y.ecb.prototype.decrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])},Y.ecb.prototype.pad=function(e,t){var a=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(a,a),!0},Y.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var a=e.length(),r=e.at(a-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)},Y.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)},Y.cbc.prototype.start=function(e){if(e.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in e)this._iv=_o(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")},Y.cbc.prototype.encrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=this._prev[r]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r]);this._prev=this._outBlock},Y.cbc.prototype.decrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._prev[r]^this._outBlock[r]);this._prev=this._inBlock.slice(0)},Y.cbc.prototype.pad=function(e,t){var a=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(a,a),!0},Y.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var a=e.length(),r=e.at(a-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)},Y.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=Te.util.createBuffer(),this._partialBytes=0},Y.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=_o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},Y.cfb.prototype.encrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32()^this._outBlock[n],t.putInt32(this._inBlock[n]);return}var i=(this.blockSize-r)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialBlock[n]=e.getInt32()^this._outBlock[n],this._partialOutput.putInt32(this._partialBlock[n]);if(i>0)e.read-=this.blockSize;else for(var n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!a)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0},Y.cfb.prototype.decrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32(),t.putInt32(this._inBlock[n]^this._outBlock[n]);return}var i=(this.blockSize-r)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialBlock[n]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[n]^this._outBlock[n]);if(i>0)e.read-=this.blockSize;else for(var n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!a)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0},Y.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=Te.util.createBuffer(),this._partialBytes=0},Y.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=_o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},Y.ofb.prototype.encrypt=function(e,t,a){var r=e.length();if(e.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)t.putInt32(e.getInt32()^this._outBlock[n]),this._inBlock[n]=this._outBlock[n];return}var i=(this.blockSize-r)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(i>0)e.read-=this.blockSize;else for(var n=0;n<this._ints;++n)this._inBlock[n]=this._outBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!a)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0},Y.ofb.prototype.decrypt=Y.ofb.prototype.encrypt,Y.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=Te.util.createBuffer(),this._partialBytes=0},Y.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=_o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},Y.ctr.prototype.encrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize)for(var n=0;n<this._ints;++n)t.putInt32(e.getInt32()^this._outBlock[n]);else{var i=(this.blockSize-r)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(i>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!a)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}Ro(this._inBlock)},Y.ctr.prototype.decrypt=Y.ctr.prototype.encrypt,Y.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=Te.util.createBuffer(),this._partialBytes=0,this._R=3774873600},Y.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=Te.util.createBuffer(e.iv);this._cipherLength=0;var a;if("additionalData"in e?a=Te.util.createBuffer(e.additionalData):a=Te.util.createBuffer(),"tagLength"in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=Te.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 r=t.length();if(r===12)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(vc(r*8)))}this._inBlock=this._j0.slice(0),Ro(this._inBlock),this._partialBytes=0,a=Te.util.createBuffer(a),this._aDataLength=vc(a.length()*8);var n=a.length()%this.blockSize;for(n&&a.fillWithByte(0,this.blockSize-n),this._s=[0,0,0,0];a.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[a.getInt32(),a.getInt32(),a.getInt32(),a.getInt32()])},Y.gcm.prototype.encrypt=function(e,t,a){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]^=e.getInt32());this._cipherLength+=this.blockSize}else{var i=(this.blockSize-r)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(i<=0||a){if(a){var s=r%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(var n=0;n<this._ints;++n)this._outBlock[n]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!a)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Ro(this._inBlock)},Y.gcm.prototype.decrypt=function(e,t,a){var r=e.length();if(r<this.blockSize&&!(a&&r>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Ro(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 n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]^this._hashBlock[n]);r<this.blockSize?this._cipherLength+=r%this.blockSize:this._cipherLength+=this.blockSize},Y.gcm.prototype.afterFinish=function(e,t){var a=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=Te.util.createBuffer();var r=this._aDataLength.concat(vc(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,r);var n=[];this.cipher.encrypt(this._j0,n);for(var i=0;i<this._ints;++i)this.tag.putInt32(this._s[i]^n[i]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(a=!1),a},Y.gcm.prototype.multiply=function(e,t){for(var a=[0,0,0,0],r=t.slice(0),n=0;n<128;++n){var i=e[n/32|0]&1<<31-n%32;i&&(a[0]^=r[0],a[1]^=r[1],a[2]^=r[2],a[3]^=r[3]),this.pow(r,r)}return a},Y.gcm.prototype.pow=function(e,t){for(var a=e[3]&1,r=3;r>0;--r)t[r]=e[r]>>>1|(e[r-1]&1)<<31;t[0]=e[0]>>>1,a&&(t[0]^=this._R)},Y.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],a=0;a<32;++a){var r=a/8|0,n=e[r]>>>(7-a%8)*4&15,i=this._m[a][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},Y.gcm.prototype.ghash=function(e,t,a){return t[0]^=a[0],t[1]^=a[1],t[2]^=a[2],t[3]^=a[3],this.tableMultiply(t)},Y.gcm.prototype.generateHashTable=function(e,t){for(var a=8/t,r=4*a,n=16*a,i=new Array(n),s=0;s<n;++s){var o=[0,0,0,0],c=s/r|0,l=(r-1-s%r)*t;o[c]=1<<t-1<<l,i[s]=this.generateSubHashTable(this.multiply(o,e),t)}return i},Y.gcm.prototype.generateSubHashTable=function(e,t){var a=1<<t,r=a>>>1,n=new Array(a);n[r]=e.slice(0);for(var i=r>>>1;i>0;)this.pow(n[2*i],n[i]=[]),i>>=1;for(i=2;i<r;){for(var s=1;s<i;++s){var o=n[i],c=n[s];n[i+s]=[o[0]^c[0],o[1]^c[1],o[2]^c[2],o[3]^c[3]]}i*=2}for(n[0]=[0,0,0,0],i=r+1;i<a;++i){var l=n[i^r];n[i]=[e[0]^l[0],e[1]^l[1],e[2]^l[2],e[3]^l[3]]}return n};function _o(e,t){if(typeof e=="string"&&(e=Te.util.createBuffer(e)),Te.util.isArray(e)&&e.length>4){var a=e;e=Te.util.createBuffer();for(var r=0;r<a.length;++r)e.putByte(a[r])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!Te.util.isArray(e)){for(var n=[],i=t/4,r=0;r<i;++r)n.push(e.getInt32());e=n}return e}function Ro(e){e[e.length-1]=e[e.length-1]+1&4294967295}function vc(e){return[e/4294967296|0,e&4294967295]}var ue=j;ue.aes=ue.aes||{},ue.aes.startEncrypting=function(e,t,a,r){var n=ko({key:e,output:a,decrypt:!1,mode:r});return n.start(t),n},ue.aes.createEncryptionCipher=function(e,t){return ko({key:e,output:null,decrypt:!1,mode:t})},ue.aes.startDecrypting=function(e,t,a,r){var n=ko({key:e,output:a,decrypt:!0,mode:r});return n.start(t),n},ue.aes.createDecryptionCipher=function(e,t){return ko({key:e,output:null,decrypt:!0,mode:t})},ue.aes.Algorithm=function(e,t){yc||B0();var a=this;a.name=e,a.mode=new t({blockSize:16,cipher:{encrypt:function(r,n){return Ec(a._w,r,n,!1)},decrypt:function(r,n){return Ec(a._w,r,n,!0)}}}),a._init=!1},ue.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,a;if(typeof t=="string"&&(t.length===16||t.length===24||t.length===32))t=ue.util.createBuffer(t);else if(ue.util.isArray(t)&&(t.length===16||t.length===24||t.length===32)){a=t,t=ue.util.createBuffer();for(var r=0;r<a.length;++r)t.putByte(a[r])}if(!ue.util.isArray(t)){a=t,t=[];var n=a.length();if(n===16||n===24||n===32){n=n>>>2;for(var r=0;r<n;++r)t.push(a.getInt32())}}if(!ue.util.isArray(t)||!(t.length===4||t.length===6||t.length===8))throw new Error("Invalid key parameter.");var i=this.mode.name,s=["CFB","OFB","CTR","GCM"].indexOf(i)!==-1;this._w=w0(t,e.decrypt&&!s),this._init=!0}},ue.aes._expandKey=function(e,t){return yc||B0(),w0(e,t)},ue.aes._updateBlock=Ec,cr("AES-ECB",ue.cipher.modes.ecb),cr("AES-CBC",ue.cipher.modes.cbc),cr("AES-CFB",ue.cipher.modes.cfb),cr("AES-OFB",ue.cipher.modes.ofb),cr("AES-CTR",ue.cipher.modes.ctr),cr("AES-GCM",ue.cipher.modes.gcm);function cr(e,t){var a=function(){return new ue.aes.Algorithm(e,t)};ue.cipher.registerAlgorithm(e,a)}var yc=!1,lr=4,Xe,mc,A0,Wt,St;function B0(){yc=!0,A0=[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;Xe=new Array(256),mc=new Array(256),Wt=new Array(4),St=new Array(4);for(var t=0;t<4;++t)Wt[t]=new Array(256),St[t]=new Array(256);for(var a=0,r=0,n,i,s,o,c,l,u,t=0;t<256;++t){o=r^r<<1^r<<2^r<<3^r<<4,o=o>>8^o&255^99,Xe[a]=o,mc[o]=a,c=e[o],n=e[a],i=e[n],s=e[i],l=c<<24^o<<16^o<<8^(o^c),u=(n^i^s)<<24^(a^s)<<16^(a^i^s)<<8^(a^n^s);for(var d=0;d<4;++d)Wt[d][a]=l,St[d][o]=u,l=l<<24|l>>>8,u=u<<24|u>>>8;a===0?a=r=1:(a=n^e[e[e[n^s]]],r^=e[e[r]])}}function w0(e,t){for(var a=e.slice(0),r,n=1,i=a.length,s=i+6+1,o=lr*s,c=i;c<o;++c)r=a[c-1],c%i===0?(r=Xe[r>>>16&255]<<24^Xe[r>>>8&255]<<16^Xe[r&255]<<8^Xe[r>>>24]^A0[n]<<24,n++):i>6&&c%i===4&&(r=Xe[r>>>24]<<24^Xe[r>>>16&255]<<16^Xe[r>>>8&255]<<8^Xe[r&255]),a[c]=a[c-i]^r;if(t){var l,u=St[0],d=St[1],v=St[2],E=St[3],y=a.slice(0);o=a.length;for(var c=0,x=o-lr;c<o;c+=lr,x-=lr)if(c===0||c===o-lr)y[c]=a[x],y[c+1]=a[x+3],y[c+2]=a[x+2],y[c+3]=a[x+1];else for(var b=0;b<lr;++b)l=a[x+b],y[c+(3&-b)]=u[Xe[l>>>24]]^d[Xe[l>>>16&255]]^v[Xe[l>>>8&255]]^E[Xe[l&255]];a=y}return a}function Ec(e,t,a,r){var n=e.length/4-1,i,s,o,c,l;r?(i=St[0],s=St[1],o=St[2],c=St[3],l=mc):(i=Wt[0],s=Wt[1],o=Wt[2],c=Wt[3],l=Xe);var u,d,v,E,y,x,b;u=t[0]^e[0],d=t[r?3:1]^e[1],v=t[2]^e[2],E=t[r?1:3]^e[3];for(var A=3,w=1;w<n;++w)y=i[u>>>24]^s[d>>>16&255]^o[v>>>8&255]^c[E&255]^e[++A],x=i[d>>>24]^s[v>>>16&255]^o[E>>>8&255]^c[u&255]^e[++A],b=i[v>>>24]^s[E>>>16&255]^o[u>>>8&255]^c[d&255]^e[++A],E=i[E>>>24]^s[u>>>16&255]^o[d>>>8&255]^c[v&255]^e[++A],u=y,d=x,v=b;a[0]=l[u>>>24]<<24^l[d>>>16&255]<<16^l[v>>>8&255]<<8^l[E&255]^e[++A],a[r?3:1]=l[d>>>24]<<24^l[v>>>16&255]<<16^l[E>>>8&255]<<8^l[u&255]^e[++A],a[2]=l[v>>>24]<<24^l[E>>>16&255]<<16^l[u>>>8&255]<<8^l[d&255]^e[++A],a[r?1:3]=l[E>>>24]<<24^l[u>>>16&255]<<16^l[d>>>8&255]<<8^l[v&255]^e[++A]}function ko(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),a="AES-"+t,r;e.decrypt?r=ue.cipher.createDecipher(a,e.key):r=ue.cipher.createCipher(a,e.key);var n=r.start;return r.start=function(i,s){var o=null;s instanceof ue.util.ByteBuffer&&(o=s,s={}),s=s||{},s.output=o,s.iv=i,n.call(r,s)},r}var vo=j;vo.pki=vo.pki||{};var Cc=vo.pki.oids=vo.oids=vo.oids||{};function k(e,t){Cc[e]=t,Cc[t]=e}function ae(e,t){Cc[e]=t}k("1.2.840.113549.1.1.1","rsaEncryption"),k("1.2.840.113549.1.1.4","md5WithRSAEncryption"),k("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),k("1.2.840.113549.1.1.7","RSAES-OAEP"),k("1.2.840.113549.1.1.8","mgf1"),k("1.2.840.113549.1.1.9","pSpecified"),k("1.2.840.113549.1.1.10","RSASSA-PSS"),k("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),k("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),k("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),k("1.3.101.112","EdDSA25519"),k("1.2.840.10040.4.3","dsa-with-sha1"),k("1.3.14.3.2.7","desCBC"),k("1.3.14.3.2.26","sha1"),k("1.3.14.3.2.29","sha1WithRSASignature"),k("2.16.840.1.101.3.4.2.1","sha256"),k("2.16.840.1.101.3.4.2.2","sha384"),k("2.16.840.1.101.3.4.2.3","sha512"),k("2.16.840.1.101.3.4.2.4","sha224"),k("2.16.840.1.101.3.4.2.5","sha512-224"),k("2.16.840.1.101.3.4.2.6","sha512-256"),k("1.2.840.113549.2.2","md2"),k("1.2.840.113549.2.5","md5"),k("1.2.840.113549.1.7.1","data"),k("1.2.840.113549.1.7.2","signedData"),k("1.2.840.113549.1.7.3","envelopedData"),k("1.2.840.113549.1.7.4","signedAndEnvelopedData"),k("1.2.840.113549.1.7.5","digestedData"),k("1.2.840.113549.1.7.6","encryptedData"),k("1.2.840.113549.1.9.1","emailAddress"),k("1.2.840.113549.1.9.2","unstructuredName"),k("1.2.840.113549.1.9.3","contentType"),k("1.2.840.113549.1.9.4","messageDigest"),k("1.2.840.113549.1.9.5","signingTime"),k("1.2.840.113549.1.9.6","counterSignature"),k("1.2.840.113549.1.9.7","challengePassword"),k("1.2.840.113549.1.9.8","unstructuredAddress"),k("1.2.840.113549.1.9.14","extensionRequest"),k("1.2.840.113549.1.9.20","friendlyName"),k("1.2.840.113549.1.9.21","localKeyId"),k("1.2.840.113549.1.9.22.1","x509Certificate"),k("1.2.840.113549.1.12.10.1.1","keyBag"),k("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),k("1.2.840.113549.1.12.10.1.3","certBag"),k("1.2.840.113549.1.12.10.1.4","crlBag"),k("1.2.840.113549.1.12.10.1.5","secretBag"),k("1.2.840.113549.1.12.10.1.6","safeContentsBag"),k("1.2.840.113549.1.5.13","pkcs5PBES2"),k("1.2.840.113549.1.5.12","pkcs5PBKDF2"),k("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),k("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),k("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),k("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),k("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),k("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),k("1.2.840.113549.2.7","hmacWithSHA1"),k("1.2.840.113549.2.8","hmacWithSHA224"),k("1.2.840.113549.2.9","hmacWithSHA256"),k("1.2.840.113549.2.10","hmacWithSHA384"),k("1.2.840.113549.2.11","hmacWithSHA512"),k("1.2.840.113549.3.7","des-EDE3-CBC"),k("2.16.840.1.101.3.4.1.2","aes128-CBC"),k("2.16.840.1.101.3.4.1.22","aes192-CBC"),k("2.16.840.1.101.3.4.1.42","aes256-CBC"),k("2.5.4.3","commonName"),k("2.5.4.4","surname"),k("2.5.4.5","serialNumber"),k("2.5.4.6","countryName"),k("2.5.4.7","localityName"),k("2.5.4.8","stateOrProvinceName"),k("2.5.4.9","streetAddress"),k("2.5.4.10","organizationName"),k("2.5.4.11","organizationalUnitName"),k("2.5.4.12","title"),k("2.5.4.13","description"),k("2.5.4.15","businessCategory"),k("2.5.4.17","postalCode"),k("2.5.4.42","givenName"),k("2.5.4.65","pseudonym"),k("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),k("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),k("2.16.840.1.113730.1.1","nsCertType"),k("2.16.840.1.113730.1.13","nsComment"),ae("2.5.29.1","authorityKeyIdentifier"),ae("2.5.29.2","keyAttributes"),ae("2.5.29.3","certificatePolicies"),ae("2.5.29.4","keyUsageRestriction"),ae("2.5.29.5","policyMapping"),ae("2.5.29.6","subtreesConstraint"),ae("2.5.29.7","subjectAltName"),ae("2.5.29.8","issuerAltName"),ae("2.5.29.9","subjectDirectoryAttributes"),ae("2.5.29.10","basicConstraints"),ae("2.5.29.11","nameConstraints"),ae("2.5.29.12","policyConstraints"),ae("2.5.29.13","basicConstraints"),k("2.5.29.14","subjectKeyIdentifier"),k("2.5.29.15","keyUsage"),ae("2.5.29.16","privateKeyUsagePeriod"),k("2.5.29.17","subjectAltName"),k("2.5.29.18","issuerAltName"),k("2.5.29.19","basicConstraints"),ae("2.5.29.20","cRLNumber"),ae("2.5.29.21","cRLReason"),ae("2.5.29.22","expirationDate"),ae("2.5.29.23","instructionCode"),ae("2.5.29.24","invalidityDate"),ae("2.5.29.25","cRLDistributionPoints"),ae("2.5.29.26","issuingDistributionPoint"),ae("2.5.29.27","deltaCRLIndicator"),ae("2.5.29.28","issuingDistributionPoint"),ae("2.5.29.29","certificateIssuer"),ae("2.5.29.30","nameConstraints"),k("2.5.29.31","cRLDistributionPoints"),k("2.5.29.32","certificatePolicies"),ae("2.5.29.33","policyMappings"),ae("2.5.29.34","policyConstraints"),k("2.5.29.35","authorityKeyIdentifier"),ae("2.5.29.36","policyConstraints"),k("2.5.29.37","extKeyUsage"),ae("2.5.29.46","freshestCRL"),ae("2.5.29.54","inhibitAnyPolicy"),k("1.3.6.1.4.1.11129.2.4.2","timestampList"),k("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),k("1.3.6.1.5.5.7.3.1","serverAuth"),k("1.3.6.1.5.5.7.3.2","clientAuth"),k("1.3.6.1.5.5.7.3.3","codeSigning"),k("1.3.6.1.5.5.7.3.4","emailProtection"),k("1.3.6.1.5.5.7.3.8","timeStamping");var de=j,O=de.asn1=de.asn1||{};O.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},O.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},O.maxDepth=256,O.create=function(e,t,a,r,n){if(de.util.isArray(r)){for(var i=[],s=0;s<r.length;++s)r[s]!==void 0&&i.push(r[s]);r=i}var o={tagClass:e,type:t,constructed:a,composed:a||de.util.isArray(r),value:r};return n&&"bitStringContents"in n&&(o.bitStringContents=n.bitStringContents,o.original=O.copy(o)),o},O.copy=function(e,t){var a;if(de.util.isArray(e)){a=[];for(var r=0;r<e.length;++r)a.push(O.copy(e[r],t));return a}return typeof e=="string"?e:(a={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:O.copy(e.value,t)},t&&!t.excludeBitStringContents&&(a.bitStringContents=e.bitStringContents),a)},O.equals=function(e,t,a){if(de.util.isArray(e)){if(!de.util.isArray(t)||e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!O.equals(e[r],t[r]))return!1;return!0}if(typeof e!=typeof t)return!1;if(typeof e=="string")return e===t;var n=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&O.equals(e.value,t.value);return a&&a.includeBitStringContents&&(n=n&&e.bitStringContents===t.bitStringContents),n},O.getBerValueLength=function(e){var t=e.getByte();if(t!==128){var a,r=t&128;return r?a=e.getInt((t&127)<<3):a=t,a}};function yo(e,t,a){if(a>t){var r=new Error("Too few bytes to parse DER.");throw r.available=e.length(),r.remaining=t,r.requested=a,r}}var jf=function(e,t){var a=e.getByte();if(t--,a!==128){var r,n=a&128;if(!n)r=a;else{var i=a&127;yo(e,t,i),r=e.getInt(i<<3)}if(r<0)throw new Error("Negative length: "+r);return r}};O.fromDer=function(e,t){t===void 0&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof t=="boolean"&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"maxDepth"in t||(t.maxDepth=O.maxDepth),typeof e=="string"&&(e=de.util.createBuffer(e));var a=e.length(),r=Lo(e,e.length(),0,t);if(t.parseAllBytes&&e.length()!==0){var n=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw n.byteCount=a,n.remaining=e.length(),n}return r};function Lo(e,t,a,r){if(a>=r.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var n;yo(e,t,2);var i=e.getByte();t--;var s=i&192,o=i&31;n=e.length();var c=jf(e,t);if(t-=n-e.length(),c!==void 0&&c>t){if(r.strict){var l=new Error("Too few bytes to read ASN.1 value.");throw l.available=e.length(),l.remaining=t,l.requested=c,l}c=t}var u,d,v=(i&32)===32;if(v)if(u=[],c===void 0)for(;;){if(yo(e,t,2),e.bytes(2)==="\0\0"){e.getBytes(2),t-=2;break}n=e.length(),u.push(Lo(e,t,a+1,r)),t-=n-e.length()}else for(;c>0;)n=e.length(),u.push(Lo(e,c,a+1,r)),t-=n-e.length(),c-=n-e.length();if(u===void 0&&s===O.Class.UNIVERSAL&&o===O.Type.BITSTRING&&(d=e.bytes(c)),u===void 0&&r.decodeBitStrings&&s===O.Class.UNIVERSAL&&o===O.Type.BITSTRING&&c>1){var E=e.read,y=t,x=0;if(o===O.Type.BITSTRING&&(yo(e,t,1),x=e.getByte(),t--),x===0)try{n=e.length();var b={strict:!0,decodeBitStrings:!0},A=Lo(e,t,a+1,b),w=n-e.length();t-=w,o==O.Type.BITSTRING&&w++;var N=A.tagClass;w===c&&(N===O.Class.UNIVERSAL||N===O.Class.CONTEXT_SPECIFIC)&&(u=[A])}catch{}u===void 0&&(e.read=E,t=y)}if(u===void 0){if(c===void 0){if(r.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=t}if(o===O.Type.BMPSTRING)for(u="";c>0;c-=2)yo(e,t,2),u+=String.fromCharCode(e.getInt16()),t-=2;else u=e.getBytes(c),t-=c}var M=d===void 0?null:{bitStringContents:d};return O.create(s,o,v,u,M)}O.toDer=function(e){var t=de.util.createBuffer(),a=e.tagClass|e.type,r=de.util.createBuffer(),n=!1;if("bitStringContents"in e&&(n=!0,e.original&&(n=O.equals(e,e.original))),n)r.putBytes(e.bitStringContents);else if(e.composed){e.constructed?a|=32:r.putByte(0);for(var i=0;i<e.value.length;++i)e.value[i]!==void 0&&r.putBuffer(O.toDer(e.value[i]))}else if(e.type===O.Type.BMPSTRING)for(var i=0;i<e.value.length;++i)r.putInt16(e.value.charCodeAt(i));else e.type===O.Type.INTEGER&&e.value.length>1&&(e.value.charCodeAt(0)===0&&(e.value.charCodeAt(1)&128)===0||e.value.charCodeAt(0)===255&&(e.value.charCodeAt(1)&128)===128)?r.putBytes(e.value.substr(1)):r.putBytes(e.value);if(t.putByte(a),r.length()<=127)t.putByte(r.length()&127);else{var s=r.length(),o="";do o+=String.fromCharCode(s&255),s=s>>>8;while(s>0);t.putByte(o.length|128);for(var i=o.length-1;i>=0;--i)t.putByte(o.charCodeAt(i))}return t.putBuffer(r),t},O.oidToDer=function(e){var t=e.split("."),a=de.util.createBuffer();a.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var r,n,i,s,o=2;o<t.length;++o){if(r=!0,n=[],i=parseInt(t[o],10),i>4294967295)throw new Error("OID value too large; max is 32-bits.");do s=i&127,i=i>>>7,r||(s|=128),n.push(s),r=!1;while(i>0);for(var c=n.length-1;c>=0;--c)a.putByte(n[c])}return a},O.derToOid=function(e){var t;typeof e=="string"&&(e=de.util.createBuffer(e));var a=e.getByte();t=Math.floor(a/40)+"."+a%40;for(var r=0;e.length()>0;){if(r>70368744177663)throw new Error("OID value too large; max is 53-bits.");a=e.getByte(),r=r*128,a&128?r+=a&127:(t+="."+(r+a),r=0)}return t},O.utcTimeToDate=function(e){var t=new Date,a=parseInt(e.substr(0,2),10);a=a>=50?1900+a:2e3+a;var r=parseInt(e.substr(2,2),10)-1,n=parseInt(e.substr(4,2),10),i=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),l=10;c!=="+"&&c!=="-"&&(o=parseInt(e.substr(10,2),10),l+=2)}if(t.setUTCFullYear(a,r,n),t.setUTCHours(i,s,o,0),l&&(c=e.charAt(l),c==="+"||c==="-")){var u=parseInt(e.substr(l+1,2),10),d=parseInt(e.substr(l+4,2),10),v=u*60+d;v*=6e4,c==="+"?t.setTime(+t-v):t.setTime(+t+v)}return t},O.generalizedTimeToDate=function(e){var t=new Date,a=parseInt(e.substr(0,4),10),r=parseInt(e.substr(4,2),10)-1,n=parseInt(e.substr(6,2),10),i=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),c=0,l=0,u=!1;e.charAt(e.length-1)==="Z"&&(u=!0);var d=e.length-5,v=e.charAt(d);if(v==="+"||v==="-"){var E=parseInt(e.substr(d+1,2),10),y=parseInt(e.substr(d+4,2),10);l=E*60+y,l*=6e4,v==="+"&&(l*=-1),u=!0}return e.charAt(14)==="."&&(c=parseFloat(e.substr(14),10)*1e3),u?(t.setUTCFullYear(a,r,n),t.setUTCHours(i,s,o,c),t.setTime(+t+l)):(t.setFullYear(a,r,n),t.setHours(i,s,o,c)),t},O.dateToUtcTime=function(e){if(typeof e=="string")return e;var t="",a=[];a.push((""+e.getUTCFullYear()).substr(2)),a.push(""+(e.getUTCMonth()+1)),a.push(""+e.getUTCDate()),a.push(""+e.getUTCHours()),a.push(""+e.getUTCMinutes()),a.push(""+e.getUTCSeconds());for(var r=0;r<a.length;++r)a[r].length<2&&(t+="0"),t+=a[r];return t+="Z",t},O.dateToGeneralizedTime=function(e){if(typeof e=="string")return e;var t="",a=[];a.push(""+e.getUTCFullYear()),a.push(""+(e.getUTCMonth()+1)),a.push(""+e.getUTCDate()),a.push(""+e.getUTCHours()),a.push(""+e.getUTCMinutes()),a.push(""+e.getUTCSeconds());for(var r=0;r<a.length;++r)a[r].length<2&&(t+="0"),t+=a[r];return t+="Z",t},O.integerToDer=function(e){var t=de.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 a=new Error("Integer too large; max is 32-bits.");throw a.integer=e,a},O.derToInteger=function(e){typeof e=="string"&&(e=de.util.createBuffer(e));var t=e.length()*8;if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},O.validate=function(e,t,a,r){var n=!1;if((e.tagClass===t.tagClass||typeof t.tagClass>"u")&&(e.type===t.type||typeof t.type>"u"))if(e.constructed===t.constructed||typeof t.constructed>"u"){if(n=!0,t.value&&de.util.isArray(t.value))for(var i=0,s=0;n&&s<t.value.length;++s){var o=t.value[s];n=!!o.optional;var c=e.value[i];if(!c){o.optional||(n=!1,r&&r.push("["+t.name+'] Missing required element. Expected tag class "'+o.tagClass+'", type "'+o.type+'"'));continue}var l=typeof o.tagClass<"u"&&typeof o.type<"u";if(l&&(c.tagClass!==o.tagClass||c.type!==o.type))if(o.optional){n=!0;continue}else{n=!1,r&&r.push("["+t.name+"] Tag mismatch. Expected ("+o.tagClass+","+o.type+"), got ("+c.tagClass+","+c.type+")");break}var u=O.validate(c,o,a,r);if(u)++i,n=!0;else if(o.optional)n=!0;else{n=!1;break}}if(n&&a&&(t.capture&&(a[t.capture]=e.value),t.captureAsn1&&(a[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(a[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e))if(e.bitStringContents.length<2)a[t.captureBitStringValue]="";else{var d=e.bitStringContents.charCodeAt(0);if(d!==0)throw new Error("captureBitStringValue only supported for zero unused bits");a[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else r&&r.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');else r&&(e.tagClass!==t.tagClass&&r.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&r.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));return n};var N0=/[^\\u0000-\\u00ff]/;O.prettyPrint=function(e,t,a){var r="";t=t||0,a=a||2,t>0&&(r+=`
5
+ `);for(var n="",i=0;i<t*a;++i)n+=" ";switch(r+=n+"Tag: ",e.tagClass){case O.Class.UNIVERSAL:r+="Universal:";break;case O.Class.APPLICATION:r+="Application:";break;case O.Class.CONTEXT_SPECIFIC:r+="Context-Specific:";break;case O.Class.PRIVATE:r+="Private:";break}if(e.tagClass===O.Class.UNIVERSAL)switch(r+=e.type,e.type){case O.Type.NONE:r+=" (None)";break;case O.Type.BOOLEAN:r+=" (Boolean)";break;case O.Type.INTEGER:r+=" (Integer)";break;case O.Type.BITSTRING:r+=" (Bit string)";break;case O.Type.OCTETSTRING:r+=" (Octet string)";break;case O.Type.NULL:r+=" (Null)";break;case O.Type.OID:r+=" (Object Identifier)";break;case O.Type.ODESC:r+=" (Object Descriptor)";break;case O.Type.EXTERNAL:r+=" (External or Instance of)";break;case O.Type.REAL:r+=" (Real)";break;case O.Type.ENUMERATED:r+=" (Enumerated)";break;case O.Type.EMBEDDED:r+=" (Embedded PDV)";break;case O.Type.UTF8:r+=" (UTF8)";break;case O.Type.ROID:r+=" (Relative Object Identifier)";break;case O.Type.SEQUENCE:r+=" (Sequence)";break;case O.Type.SET:r+=" (Set)";break;case O.Type.PRINTABLESTRING:r+=" (Printable String)";break;case O.Type.IA5String:r+=" (IA5String (ASCII))";break;case O.Type.UTCTIME:r+=" (UTC time)";break;case O.Type.GENERALIZEDTIME:r+=" (Generalized time)";break;case O.Type.BMPSTRING:r+=" (BMP String)";break}else r+=e.type;if(r+=`
6
+ `,r+=n+"Constructed: "+e.constructed+`
7
+ `,e.composed){for(var s=0,o="",i=0;i<e.value.length;++i)e.value[i]!==void 0&&(s+=1,o+=O.prettyPrint(e.value[i],t+1,a),i+1<e.value.length&&(o+=","));r+=n+"Sub values: "+s+o}else{if(r+=n+"Value: ",e.type===O.Type.OID){var c=O.derToOid(e.value);r+=c,de.pki&&de.pki.oids&&c in de.pki.oids&&(r+=" ("+de.pki.oids[c]+") ")}if(e.type===O.Type.INTEGER)try{r+=O.derToInteger(e.value)}catch{r+="0x"+de.util.bytesToHex(e.value)}else if(e.type===O.Type.BITSTRING){if(e.value.length>1?r+="0x"+de.util.bytesToHex(e.value.slice(1)):r+="(none)",e.value.length>0){var l=e.value.charCodeAt(0);l==1?r+=" (1 unused bit shown)":l>1&&(r+=" ("+l+" unused bits shown)")}}else if(e.type===O.Type.OCTETSTRING)N0.test(e.value)||(r+="("+e.value+") "),r+="0x"+de.util.bytesToHex(e.value);else if(e.type===O.Type.UTF8)try{r+=de.util.decodeUtf8(e.value)}catch(u){if(u.message==="URI malformed")r+="0x"+de.util.bytesToHex(e.value)+" (malformed UTF8)";else throw u}else e.type===O.Type.PRINTABLESTRING||e.type===O.Type.IA5String?r+=e.value:N0.test(e.value)?r+="0x"+de.util.bytesToHex(e.value):e.value.length===0?r+="[null]":r+=e.value}return r};var Do=j;Do.md=Do.md||{},Do.md.algorithms=Do.md.algorithms||{};var Dt=j,Xf=Dt.hmac=Dt.hmac||{};Xf.create=function(){var e=null,t=null,a=null,r=null,n={};return n.start=function(i,s){if(i!==null)if(typeof i=="string")if(i=i.toLowerCase(),i in Dt.md.algorithms)t=Dt.md.algorithms[i].create();else throw new Error('Unknown hash algorithm "'+i+'"');else t=i;if(s===null)s=e;else{if(typeof s=="string")s=Dt.util.createBuffer(s);else if(Dt.util.isArray(s)){var o=s;s=Dt.util.createBuffer();for(var c=0;c<o.length;++c)s.putByte(o[c])}var l=s.length();l>t.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),a=Dt.util.createBuffer(),r=Dt.util.createBuffer(),l=s.length();for(var c=0;c<l;++c){var o=s.at(c);a.putByte(54^o),r.putByte(92^o)}if(l<t.blockLength)for(var o=t.blockLength-l,c=0;c<o;++c)a.putByte(54),r.putByte(92);e=s,a=a.bytes(),r=r.bytes()}t.start(),t.update(a)},n.update=function(i){t.update(i)},n.getMac=function(){var i=t.digest().bytes();return t.start(),t.update(r),t.update(i),t.digest()},n.digest=n.getMac,n};var It=j,_0=It.md5=It.md5||{};It.md.md5=It.md.algorithms.md5=_0,_0.create=function(){R0||Yf();var e=null,t=It.util.createBuffer(),a=new Array(16),r={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var n=r.messageLengthSize/4,i=0;i<n;++i)r.fullMessageLength.push(0);return t=It.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},r},r.start(),r.update=function(n,i){i==="utf8"&&(n=It.util.encodeUtf8(n));var s=n.length;r.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=s[1],s[1]=s[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(n),k0(e,a,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var n=It.util.createBuffer();n.putBytes(t.bytes());var i=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,s=i&r.blockLength-1;n.putBytes(xc.substr(0,r.blockLength-s));for(var o,c=0,l=r.fullMessageLength.length-1;l>=0;--l)o=r.fullMessageLength[l]*8+c,c=o/4294967296>>>0,n.putInt32Le(o>>>0);var u={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};k0(u,a,n);var d=It.util.createBuffer();return d.putInt32Le(u.h0),d.putInt32Le(u.h1),d.putInt32Le(u.h2),d.putInt32Le(u.h3),d},r};var xc=null,Uo=null,mo=null,ur=null,R0=!1;function Yf(){xc="\x80",xc+=It.util.fillString("\0",64),Uo=[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],mo=[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],ur=new Array(64);for(var e=0;e<64;++e)ur[e]=Math.floor(Math.abs(Math.sin(e+1))*4294967296);R0=!0}function k0(e,t,a){for(var r,n,i,s,o,c,l,u,d=a.length();d>=64;){for(n=e.h0,i=e.h1,s=e.h2,o=e.h3,u=0;u<16;++u)t[u]=a.getInt32Le(),c=o^i&(s^o),r=n+c+ur[u]+t[u],l=mo[u],n=o,o=s,s=i,i+=r<<l|r>>>32-l;for(;u<32;++u)c=s^o&(i^s),r=n+c+ur[u]+t[Uo[u]],l=mo[u],n=o,o=s,s=i,i+=r<<l|r>>>32-l;for(;u<48;++u)c=i^s^o,r=n+c+ur[u]+t[Uo[u]],l=mo[u],n=o,o=s,s=i,i+=r<<l|r>>>32-l;for(;u<64;++u)c=s^(i|~o),r=n+c+ur[u]+t[Uo[u]],l=mo[u],n=o,o=s,s=i,i+=r<<l|r>>>32-l;e.h0=e.h0+n|0,e.h1=e.h1+i|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,d-=64}}var Po=j,L0=Po.pem=Po.pem||{};L0.encode=function(e,t){t=t||{};var a="-----BEGIN "+e.type+`-----\r
8
+ `,r;if(e.procType&&(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]},a+=Oo(r)),e.contentDomain&&(r={name:"Content-Domain",values:[e.contentDomain]},a+=Oo(r)),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),a+=Oo(r)),e.headers)for(var n=0;n<e.headers.length;++n)a+=Oo(e.headers[n]);return e.procType&&(a+=`\r
9
+ `),a+=Po.util.encode64(e.body,t.maxline||64)+`\r
10
+ `,a+="-----END "+e.type+`-----\r
11
+ `,a},L0.decode=function(e){for(var t=[],a=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,r=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,n=/\r?\n/,i;i=a.exec(e),!!i;){var s=i[1];s==="NEW CERTIFICATE REQUEST"&&(s="CERTIFICATE REQUEST");var o={type:s,procType:null,contentDomain:null,dekInfo:null,headers:[],body:Po.util.decode64(i[3])};if(t.push(o),!!i[2]){for(var c=i[2].split(n),l=0;i&&l<c.length;){for(var u=c[l].replace(/\s+$/,""),d=l+1;d<c.length;++d){var v=c[d];if(!/\s/.test(v[0]))break;u+=v,l=d}if(i=u.match(r),i){for(var E={name:i[1],values:[]},y=i[2].split(","),x=0;x<y.length;++x)E.values.push(Wf(y[x]));if(o.procType)if(!o.contentDomain&&E.name==="Content-Domain")o.contentDomain=y[0]||"";else if(!o.dekInfo&&E.name==="DEK-Info"){if(E.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');o.dekInfo={algorithm:y[0],parameters:y[1]||null}}else o.headers.push(E);else{if(E.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(E.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');o.procType={version:y[0],type:y[1]}}}++l}if(o.procType==="ENCRYPTED"&&!o.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(t.length===0)throw new Error("Invalid PEM formatted message.");return t};function Oo(e){for(var t=e.name+": ",a=[],r=function(c,l){return" "+l},n=0;n<e.values.length;++n)a.push(e.values[n].replace(/^(\S+\r\n)/,r));t+=a.join(",")+`\r
12
+ `;for(var i=0,s=-1,n=0;n<t.length;++n,++i)if(i>65&&s!==-1){var o=t[s];o===","?(++s,t=t.substr(0,s)+`\r
13
+ `+t.substr(s)):t=t.substr(0,s)+`\r
14
+ `+o+t.substr(s+1),i=n-s-1,s=-1,++n}else(t[n]===" "||t[n]===" "||t[n]===",")&&(s=n);return t}function Wf(e){return e.replace(/^\s+/,"")}var he=j;he.des=he.des||{},he.des.startEncrypting=function(e,t,a,r){var n=Vo({key:e,output:a,decrypt:!1,mode:r||(t===null?"ECB":"CBC")});return n.start(t),n},he.des.createEncryptionCipher=function(e,t){return Vo({key:e,output:null,decrypt:!1,mode:t})},he.des.startDecrypting=function(e,t,a,r){var n=Vo({key:e,output:a,decrypt:!0,mode:r||(t===null?"ECB":"CBC")});return n.start(t),n},he.des.createDecryptionCipher=function(e,t){return Vo({key:e,output:null,decrypt:!0,mode:t})},he.des.Algorithm=function(e,t){var a=this;a.name=e,a.mode=new t({blockSize:8,cipher:{encrypt:function(r,n){return D0(a._keys,r,n,!1)},decrypt:function(r,n){return D0(a._keys,r,n,!0)}}}),a._init=!1},he.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=he.util.createBuffer(e.key);if(this.name.indexOf("3DES")===0&&t.length()!==24)throw new Error("Invalid Triple-DES key size: "+t.length()*8);this._keys=id(t),this._init=!0}},At("DES-ECB",he.cipher.modes.ecb),At("DES-CBC",he.cipher.modes.cbc),At("DES-CFB",he.cipher.modes.cfb),At("DES-OFB",he.cipher.modes.ofb),At("DES-CTR",he.cipher.modes.ctr),At("3DES-ECB",he.cipher.modes.ecb),At("3DES-CBC",he.cipher.modes.cbc),At("3DES-CFB",he.cipher.modes.cfb),At("3DES-OFB",he.cipher.modes.ofb),At("3DES-CTR",he.cipher.modes.ctr);function At(e,t){var a=function(){return new he.des.Algorithm(e,t)};he.cipher.registerAlgorithm(e,a)}var Zf=[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],Jf=[-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],ed=[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],td=[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],rd=[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],ad=[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],nd=[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],sd=[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 id(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],a=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],r=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],n=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],i=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[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],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],d=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],v=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],E=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],x=e.length()>8?3:1,b=[],A=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],w=0,N,M=0;M<x;M++){var U=e.getInt32(),L=e.getInt32();N=(U>>>4^L)&252645135,L^=N,U^=N<<4,N=(L>>>-16^U)&65535,U^=N,L^=N<<-16,N=(U>>>2^L)&858993459,L^=N,U^=N<<2,N=(L>>>-16^U)&65535,U^=N,L^=N<<-16,N=(U>>>1^L)&1431655765,L^=N,U^=N<<1,N=(L>>>8^U)&16711935,U^=N,L^=N<<8,N=(U>>>1^L)&1431655765,L^=N,U^=N<<1,N=U<<8|L>>>20&240,U=L<<24|L<<8&16711680|L>>>8&65280|L>>>24&240,L=N;for(var z=0;z<A.length;++z){A[z]?(U=U<<2|U>>>26,L=L<<2|L>>>26):(U=U<<1|U>>>27,L=L<<1|L>>>27),U&=-15,L&=-15;var X=t[U>>>28]|a[U>>>24&15]|r[U>>>20&15]|n[U>>>16&15]|i[U>>>12&15]|s[U>>>8&15]|o[U>>>4&15],ne=c[L>>>28]|l[L>>>24&15]|u[L>>>20&15]|d[L>>>16&15]|v[L>>>12&15]|E[L>>>8&15]|y[L>>>4&15];N=(ne>>>16^X)&65535,b[w++]=X^N,b[w++]=ne^N<<16}}return b}function D0(e,t,a,r){var n=e.length===32?3:9,i;n===3?i=r?[30,-2,-2]:[0,32,2]:i=r?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var s,o=t[0],c=t[1];s=(o>>>4^c)&252645135,c^=s,o^=s<<4,s=(o>>>16^c)&65535,c^=s,o^=s<<16,s=(c>>>2^o)&858993459,o^=s,c^=s<<2,s=(c>>>8^o)&16711935,o^=s,c^=s<<8,s=(o>>>1^c)&1431655765,c^=s,o^=s<<1,o=o<<1|o>>>31,c=c<<1|c>>>31;for(var l=0;l<n;l+=3){for(var u=i[l+1],d=i[l+2],v=i[l];v!=u;v+=d){var E=c^e[v],y=(c>>>4|c<<28)^e[v+1];s=o,o=c,c=s^(Jf[E>>>24&63]|td[E>>>16&63]|ad[E>>>8&63]|sd[E&63]|Zf[y>>>24&63]|ed[y>>>16&63]|rd[y>>>8&63]|nd[y&63])}s=o,o=c,c=s}o=o>>>1|o<<31,c=c>>>1|c<<31,s=(o>>>1^c)&1431655765,c^=s,o^=s<<1,s=(c>>>8^o)&16711935,o^=s,c^=s<<8,s=(c>>>2^o)&858993459,o^=s,c^=s<<2,s=(o>>>16^c)&65535,c^=s,o^=s<<16,s=(o>>>4^c)&252645135,c^=s,o^=s<<4,a[0]=o,a[1]=c}function Vo(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),a="DES-"+t,r;e.decrypt?r=he.cipher.createDecipher(a,e.key):r=he.cipher.createCipher(a,e.key);var n=r.start;return r.start=function(i,s){var o=null;s instanceof he.util.ByteBuffer&&(o=s,s={}),s=s||{},s.output=o,s.iv=i,n.call(r,s)},r}var Ye=j,od=Ye.pkcs5=Ye.pkcs5||{},Ut;Ye.util.isNodejs&&!Ye.options.usePureJavaScript&&(Ut=ac),Ye.pbkdf2=od.pbkdf2=function(e,t,a,r,n,i){if(typeof n=="function"&&(i=n,n=null),Ye.util.isNodejs&&!Ye.options.usePureJavaScript&&Ut.pbkdf2&&(n===null||typeof n!="object")&&(Ut.pbkdf2Sync.length>4||!n||n==="sha1"))return typeof n!="string"&&(n="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),i?Ut.pbkdf2Sync.length===4?Ut.pbkdf2(e,t,a,r,function(N,M){if(N)return i(N);i(null,M.toString("binary"))}):Ut.pbkdf2(e,t,a,r,n,function(N,M){if(N)return i(N);i(null,M.toString("binary"))}):Ut.pbkdf2Sync.length===4?Ut.pbkdf2Sync(e,t,a,r).toString("binary"):Ut.pbkdf2Sync(e,t,a,r,n).toString("binary");if((typeof n>"u"||n===null)&&(n="sha1"),typeof n=="string"){if(!(n in Ye.md.algorithms))throw new Error("Unknown hash algorithm: "+n);n=Ye.md[n].create()}var s=n.digestLength;if(r>4294967295*s){var o=new Error("Derived key is too long.");if(i)return i(o);throw o}var c=Math.ceil(r/s),l=r-(c-1)*s,u=Ye.hmac.create();u.start(n,e);var d="",v,E,y;if(!i){for(var x=1;x<=c;++x){u.start(null,null),u.update(t),u.update(Ye.util.int32ToBytes(x)),v=y=u.digest().getBytes();for(var b=2;b<=a;++b)u.start(null,null),u.update(y),E=u.digest().getBytes(),v=Ye.util.xorBytes(v,E,s),y=E;d+=x<c?v:v.substr(0,l)}return d}var x=1,b;function A(){if(x>c)return i(null,d);u.start(null,null),u.update(t),u.update(Ye.util.int32ToBytes(x)),v=y=u.digest().getBytes(),b=2,w()}function w(){if(b<=a)return u.start(null,null),u.update(y),E=u.digest().getBytes(),v=Ye.util.xorBytes(v,E,s),y=E,++b,Ye.util.setImmediate(w);d+=x<c?v:v.substr(0,l),++x,A()}A()};var Bt=j,U0=Bt.sha256=Bt.sha256||{};Bt.md.sha256=Bt.md.algorithms.sha256=U0,U0.create=function(){P0||cd();var e=null,t=Bt.util.createBuffer(),a=new Array(64),r={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var n=r.messageLengthSize/4,i=0;i<n;++i)r.fullMessageLength.push(0);return t=Bt.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},r},r.start(),r.update=function(n,i){i==="utf8"&&(n=Bt.util.encodeUtf8(n));var s=n.length;r.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=s[1],s[1]=s[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(n),V0(e,a,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var n=Bt.util.createBuffer();n.putBytes(t.bytes());var i=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,s=i&r.blockLength-1;n.putBytes(Sc.substr(0,r.blockLength-s));for(var o,c,l=r.fullMessageLength[0]*8,u=0;u<r.fullMessageLength.length-1;++u)o=r.fullMessageLength[u+1]*8,c=o/4294967296>>>0,l+=c,n.putInt32(l>>>0),l=o>>>0;n.putInt32(l);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};V0(d,a,n);var v=Bt.util.createBuffer();return v.putInt32(d.h0),v.putInt32(d.h1),v.putInt32(d.h2),v.putInt32(d.h3),v.putInt32(d.h4),v.putInt32(d.h5),v.putInt32(d.h6),v.putInt32(d.h7),v},r};var Sc=null,P0=!1,O0=null;function cd(){Sc="\x80",Sc+=Bt.util.fillString("\0",64),O0=[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],P0=!0}function V0(e,t,a){for(var r,n,i,s,o,c,l,u,d,v,E,y,x,b,A,w=a.length();w>=64;){for(l=0;l<16;++l)t[l]=a.getInt32();for(;l<64;++l)r=t[l-2],r=(r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,n=t[l-15],n=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,t[l]=r+t[l-7]+n+t[l-16]|0;for(u=e.h0,d=e.h1,v=e.h2,E=e.h3,y=e.h4,x=e.h5,b=e.h6,A=e.h7,l=0;l<64;++l)s=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),o=b^y&(x^b),i=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),c=u&d|v&(u^d),r=A+s+o+O0[l]+t[l],n=i+c,A=b,b=x,x=y,y=E+r>>>0,E=v,v=d,d=u,u=r+n>>>0;e.h0=e.h0+u|0,e.h1=e.h1+d|0,e.h2=e.h2+v|0,e.h3=e.h3+E|0,e.h4=e.h4+y|0,e.h5=e.h5+x|0,e.h6=e.h6+b|0,e.h7=e.h7+A|0,w-=64}}var wt=j,Mo=null;wt.util.isNodejs&&!wt.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Mo=ac);var ld=wt.prng=wt.prng||{};ld.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},a=e.md,r=new Array(32),n=0;n<32;++n)r[n]=a.create();t.pools=r,t.pool=0,t.generate=function(l,u){if(!u)return t.generateSync(l);var d=t.plugin.cipher,v=t.plugin.increment,E=t.plugin.formatKey,y=t.plugin.formatSeed,x=wt.util.createBuffer();t.key=null,b();function b(A){if(A)return u(A);if(x.length()>=l)return u(null,x.getBytes(l));if(t.generated>1048575&&(t.key=null),t.key===null)return wt.util.nextTick(function(){i(b)});var w=d(t.key,t.seed);t.generated+=w.length,x.putBytes(w),t.key=E(d(t.key,v(t.seed))),t.seed=y(d(t.key,t.seed)),wt.util.setImmediate(b)}},t.generateSync=function(l){var u=t.plugin.cipher,d=t.plugin.increment,v=t.plugin.formatKey,E=t.plugin.formatSeed;t.key=null;for(var y=wt.util.createBuffer();y.length()<l;){t.generated>1048575&&(t.key=null),t.key===null&&s();var x=u(t.key,t.seed);t.generated+=x.length,y.putBytes(x),t.key=v(u(t.key,d(t.seed))),t.seed=E(u(t.key,t.seed))}return y.getBytes(l)};function i(l){if(t.pools[0].messageLength>=32)return o(),l();var u=32-t.pools[0].messageLength<<5;t.seedFile(u,function(d,v){if(d)return l(d);t.collect(v),o(),l()})}function s(){if(t.pools[0].messageLength>=32)return o();var l=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(l)),o()}function o(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var l=t.plugin.md.create();l.update(t.keyBytes);for(var u=1,d=0;d<32;++d)t.reseeds%u===0&&(l.update(t.pools[d].digest().getBytes()),t.pools[d].start()),u=u<<1;t.keyBytes=l.digest().getBytes(),l.start(),l.update(t.keyBytes);var v=l.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(v),t.generated=0}function c(l){var u=null,d=wt.util.globalScope,v=d.crypto||d.msCrypto;v&&v.getRandomValues&&(u=function(U){return v.getRandomValues(U)});var E=wt.util.createBuffer();if(u)for(;E.length()<l;){var y=Math.max(1,Math.min(l-E.length(),65536)/4),x=new Uint32Array(Math.floor(y));try{u(x);for(var b=0;b<x.length;++b)E.putInt32(x[b])}catch(U){if(!(typeof QuotaExceededError<"u"&&U instanceof QuotaExceededError))throw U}}if(E.length()<l)for(var A,w,N,M=Math.floor(Math.random()*65536);E.length()<l;){w=16807*(M&65535),A=16807*(M>>16),w+=(A&32767)<<16,w+=A>>15,w=(w&2147483647)+(w>>31),M=w&4294967295;for(var b=0;b<3;++b)N=M>>>(b<<3),N^=Math.floor(Math.random()*256),E.putByte(N&255)}return E.getBytes(l)}return Mo?(t.seedFile=function(l,u){Mo.randomBytes(l,function(d,v){if(d)return u(d);u(null,v.toString())})},t.seedFileSync=function(l){return Mo.randomBytes(l).toString()}):(t.seedFile=function(l,u){try{u(null,c(l))}catch(d){u(d)}},t.seedFileSync=c),t.collect=function(l){for(var u=l.length,d=0;d<u;++d)t.pools[t.pool].update(l.substr(d,1)),t.pool=t.pool===31?0:t.pool+1},t.collectInt=function(l,u){for(var d="",v=0;v<u;v+=8)d+=String.fromCharCode(l>>v&255);t.collect(d)},t.registerWorker=function(l){if(l===self)t.seedFile=function(d,v){function E(y){var x=y.data;x.forge&&x.forge.prng&&(self.removeEventListener("message",E),v(x.forge.prng.err,x.forge.prng.bytes))}self.addEventListener("message",E),self.postMessage({forge:{prng:{needed:d}}})};else{var u=function(d){var v=d.data;v.forge&&v.forge.prng&&t.seedFile(v.forge.prng.needed,function(E,y){l.postMessage({forge:{prng:{err:E,bytes:y}}})})};l.addEventListener("message",u)}},t};var We=j;(function(){We.random&&We.random.getBytes||(function(e){var t={},a=new Array(4),r=We.util.createBuffer();t.formatKey=function(d){var v=We.util.createBuffer(d);return d=new Array(4),d[0]=v.getInt32(),d[1]=v.getInt32(),d[2]=v.getInt32(),d[3]=v.getInt32(),We.aes._expandKey(d,!1)},t.formatSeed=function(d){var v=We.util.createBuffer(d);return d=new Array(4),d[0]=v.getInt32(),d[1]=v.getInt32(),d[2]=v.getInt32(),d[3]=v.getInt32(),d},t.cipher=function(d,v){return We.aes._updateBlock(d,v,a,!1),r.putInt32(a[0]),r.putInt32(a[1]),r.putInt32(a[2]),r.putInt32(a[3]),r.getBytes()},t.increment=function(d){return++d[3],d},t.md=We.md.sha256;function n(){var d=We.prng.create(t);return d.getBytes=function(v,E){return d.generate(v,E)},d.getBytesSync=function(v){return d.generate(v)},d}var i=n(),s=null,o=We.util.globalScope,c=o.crypto||o.msCrypto;if(c&&c.getRandomValues&&(s=function(d){return c.getRandomValues(d)}),!We.util.isNodejs&&!s){if(i.collectInt(+new Date,32),typeof navigator<"u"){var l="";for(var u in navigator)try{typeof navigator[u]=="string"&&(l+=navigator[u])}catch{}i.collect(l),l=null}e&&(e().mousemove(function(d){i.collectInt(d.clientX,16),i.collectInt(d.clientY,16)}),e().keypress(function(d){i.collectInt(d.charCode,8)}))}if(!We.random)We.random=i;else for(var u in i)We.random[u]=i[u];We.random.createInstance=n})(typeof jQuery<"u"?jQuery:null)})();var lt=j,Tc=[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],M0=[1,2,3,5],ud=function(e,t){return e<<t&65535|(e&65535)>>16-t},fd=function(e,t){return(e&65535)>>t|e<<16-t&65535};lt.rc2=lt.rc2||{},lt.rc2.expandKey=function(e,t){typeof e=="string"&&(e=lt.util.createBuffer(e)),t=t||128;var a=e,r=e.length(),n=t,i=Math.ceil(n/8),s=255>>(n&7),o;for(o=r;o<128;o++)a.putByte(Tc[a.at(o-1)+a.at(o-r)&255]);for(a.setAt(128-i,Tc[a.at(128-i)&s]),o=127-i;o>=0;o--)a.setAt(o,Tc[a.at(o+1)^a.at(o+i)]);return a};var F0=function(e,t,a){var r=!1,n=null,i=null,s=null,o,c,l,u,d=[];for(e=lt.rc2.expandKey(e,t),l=0;l<64;l++)d.push(e.getInt16Le());a?(o=function(y){for(l=0;l<4;l++)y[l]+=d[u]+(y[(l+3)%4]&y[(l+2)%4])+(~y[(l+3)%4]&y[(l+1)%4]),y[l]=ud(y[l],M0[l]),u++},c=function(y){for(l=0;l<4;l++)y[l]+=d[y[(l+3)%4]&63]}):(o=function(y){for(l=3;l>=0;l--)y[l]=fd(y[l],M0[l]),y[l]-=d[u]+(y[(l+3)%4]&y[(l+2)%4])+(~y[(l+3)%4]&y[(l+1)%4]),u--},c=function(y){for(l=3;l>=0;l--)y[l]-=d[y[(l+3)%4]&63]});var v=function(y){var x=[];for(l=0;l<4;l++){var b=n.getInt16Le();s!==null&&(a?b^=s.getInt16Le():s.putInt16Le(b)),x.push(b&65535)}u=a?0:63;for(var A=0;A<y.length;A++)for(var w=0;w<y[A][0];w++)y[A][1](x);for(l=0;l<4;l++)s!==null&&(a?s.putInt16Le(x[l]):x[l]^=s.getInt16Le()),i.putInt16Le(x[l])},E=null;return E={start:function(y,x){y&&typeof y=="string"&&(y=lt.util.createBuffer(y)),r=!1,n=lt.util.createBuffer(),i=x||new lt.util.createBuffer,s=y,E.output=i},update:function(y){for(r||n.putBuffer(y);n.length()>=8;)v([[5,o],[1,c],[6,o],[1,c],[5,o]])},finish:function(y){var x=!0;if(a)if(y)x=y(8,n,!a);else{var b=n.length()===8?8:8-n.length();n.fillWithByte(b,b)}if(x&&(r=!0,E.update()),!a&&(x=n.length()===0,x))if(y)x=y(8,i,!a);else{var A=i.length(),w=i.at(A-1);w>A?x=!1:i.truncate(w)}return x}},E};lt.rc2.startEncrypting=function(e,t,a){var r=lt.rc2.createEncryptionCipher(e,128);return r.start(t,a),r},lt.rc2.createEncryptionCipher=function(e,t){return F0(e,t,!0)},lt.rc2.startDecrypting=function(e,t,a){var r=lt.rc2.createDecryptionCipher(e,128);return r.start(t,a),r},lt.rc2.createDecryptionCipher=function(e,t){return F0(e,t,!1)};var bc=j;bc.jsbn=bc.jsbn||{};var Pt;function _(e,t,a){this.data=[],e!=null&&(typeof e=="number"?this.fromNumber(e,t,a):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}bc.jsbn.BigInteger=_;function ee(){return new _(null)}function dd(e,t,a,r,n,i){for(;--i>=0;){var s=t*this.data[e++]+a.data[r]+n;n=Math.floor(s/67108864),a.data[r++]=s&67108863}return n}function pd(e,t,a,r,n,i){for(var s=t&32767,o=t>>15;--i>=0;){var c=this.data[e]&32767,l=this.data[e++]>>15,u=o*c+l*s;c=s*c+((u&32767)<<15)+a.data[r]+(n&1073741823),n=(c>>>30)+(u>>>15)+o*l+(n>>>30),a.data[r++]=c&1073741823}return n}function K0(e,t,a,r,n,i){for(var s=t&16383,o=t>>14;--i>=0;){var c=this.data[e]&16383,l=this.data[e++]>>14,u=o*c+l*s;c=s*c+((u&16383)<<14)+a.data[r]+n,n=(c>>28)+(u>>14)+o*l,a.data[r++]=c&268435455}return n}typeof navigator>"u"?(_.prototype.am=K0,Pt=28):navigator.appName=="Microsoft Internet Explorer"?(_.prototype.am=pd,Pt=30):navigator.appName!="Netscape"?(_.prototype.am=dd,Pt=26):(_.prototype.am=K0,Pt=28),_.prototype.DB=Pt,_.prototype.DM=(1<<Pt)-1,_.prototype.DV=1<<Pt;var Ic=52;_.prototype.FV=Math.pow(2,Ic),_.prototype.F1=Ic-Pt,_.prototype.F2=2*Pt-Ic;var hd="0123456789abcdefghijklmnopqrstuvwxyz",Fo=new Array,fr,yt;for(fr=48,yt=0;yt<=9;++yt)Fo[fr++]=yt;for(fr=97,yt=10;yt<36;++yt)Fo[fr++]=yt;for(fr=65,yt=10;yt<36;++yt)Fo[fr++]=yt;function q0(e){return hd.charAt(e)}function H0(e,t){var a=Fo[e.charCodeAt(t)];return a??-1}function gd(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 vd(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 qt(e){var t=ee();return t.fromInt(e),t}function yd(e,t){var a;if(t==16)a=4;else if(t==8)a=3;else if(t==256)a=8;else if(t==2)a=1;else if(t==32)a=5;else if(t==4)a=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var r=e.length,n=!1,i=0;--r>=0;){var s=a==8?e[r]&255:H0(e,r);if(s<0){e.charAt(r)=="-"&&(n=!0);continue}n=!1,i==0?this.data[this.t++]=s:i+a>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-i)-1)<<i,this.data[this.t++]=s>>this.DB-i):this.data[this.t-1]|=s<<i,i+=a,i>=this.DB&&(i-=this.DB)}a==8&&(e[0]&128)!=0&&(this.s=-1,i>0&&(this.data[this.t-1]|=(1<<this.DB-i)-1<<i)),this.clamp(),n&&_.ZERO.subTo(this,this)}function md(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function Ed(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var a=(1<<t)-1,r,n=!1,i="",s=this.t,o=this.DB-s*this.DB%t;if(s-- >0)for(o<this.DB&&(r=this.data[s]>>o)>0&&(n=!0,i=q0(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)&a,o<=0&&(o+=this.DB,--s)),r>0&&(n=!0),n&&(i+=q0(r));return n?i:"0"}function Cd(){var e=ee();return _.ZERO.subTo(this,e),e}function xd(){return this.s<0?this.negate():this}function Sd(e){var t=this.s-e.s;if(t!=0)return t;var a=this.t;if(t=a-e.t,t!=0)return this.s<0?-t:t;for(;--a>=0;)if((t=this.data[a]-e.data[a])!=0)return t;return 0}function Ko(e){var t=1,a;return(a=e>>>16)!=0&&(e=a,t+=16),(a=e>>8)!=0&&(e=a,t+=8),(a=e>>4)!=0&&(e=a,t+=4),(a=e>>2)!=0&&(e=a,t+=2),(a=e>>1)!=0&&(e=a,t+=1),t}function Td(){return this.t<=0?0:this.DB*(this.t-1)+Ko(this.data[this.t-1]^this.s&this.DM)}function bd(e,t){var a;for(a=this.t-1;a>=0;--a)t.data[a+e]=this.data[a];for(a=e-1;a>=0;--a)t.data[a]=0;t.t=this.t+e,t.s=this.s}function Id(e,t){for(var a=e;a<this.t;++a)t.data[a-e]=this.data[a];t.t=Math.max(this.t-e,0),t.s=this.s}function Ad(e,t){var a=e%this.DB,r=this.DB-a,n=(1<<r)-1,i=Math.floor(e/this.DB),s=this.s<<a&this.DM,o;for(o=this.t-1;o>=0;--o)t.data[o+i+1]=this.data[o]>>r|s,s=(this.data[o]&n)<<a;for(o=i-1;o>=0;--o)t.data[o]=0;t.data[i]=s,t.t=this.t+i+1,t.s=this.s,t.clamp()}function Bd(e,t){t.s=this.s;var a=Math.floor(e/this.DB);if(a>=this.t){t.t=0;return}var r=e%this.DB,n=this.DB-r,i=(1<<r)-1;t.data[0]=this.data[a]>>r;for(var s=a+1;s<this.t;++s)t.data[s-a-1]|=(this.data[s]&i)<<n,t.data[s-a]=this.data[s]>>r;r>0&&(t.data[this.t-a-1]|=(this.s&i)<<n),t.t=this.t-a,t.clamp()}function wd(e,t){for(var a=0,r=0,n=Math.min(e.t,this.t);a<n;)r+=this.data[a]-e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;a<this.t;)r+=this.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;a<e.t;)r-=e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t.data[a++]=this.DV+r:r>0&&(t.data[a++]=r),t.t=a,t.clamp()}function Nd(e,t){var a=this.abs(),r=e.abs(),n=a.t;for(t.t=n+r.t;--n>=0;)t.data[n]=0;for(n=0;n<r.t;++n)t.data[n+a.t]=a.am(0,r.data[n],t,n,0,a.t);t.s=0,t.clamp(),this.s!=e.s&&_.ZERO.subTo(t,t)}function _d(e){for(var t=this.abs(),a=e.t=2*t.t;--a>=0;)e.data[a]=0;for(a=0;a<t.t-1;++a){var r=t.am(a,t.data[a],e,2*a,0,1);(e.data[a+t.t]+=t.am(a+1,2*t.data[a],e,2*a+1,r,t.t-a-1))>=t.DV&&(e.data[a+t.t]-=t.DV,e.data[a+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(a,t.data[a],e,2*a,0,1)),e.s=0,e.clamp()}function Rd(e,t,a){var r=e.abs();if(!(r.t<=0)){var n=this.abs();if(n.t<r.t){t?.fromInt(0),a!=null&&this.copyTo(a);return}a==null&&(a=ee());var i=ee(),s=this.s,o=e.s,c=this.DB-Ko(r.data[r.t-1]);c>0?(r.lShiftTo(c,i),n.lShiftTo(c,a)):(r.copyTo(i),n.copyTo(a));var l=i.t,u=i.data[l-1];if(u!=0){var d=u*(1<<this.F1)+(l>1?i.data[l-2]>>this.F2:0),v=this.FV/d,E=(1<<this.F1)/d,y=1<<this.F2,x=a.t,b=x-l,A=t??ee();for(i.dlShiftTo(b,A),a.compareTo(A)>=0&&(a.data[a.t++]=1,a.subTo(A,a)),_.ONE.dlShiftTo(l,A),A.subTo(i,i);i.t<l;)i.data[i.t++]=0;for(;--b>=0;){var w=a.data[--x]==u?this.DM:Math.floor(a.data[x]*v+(a.data[x-1]+y)*E);if((a.data[x]+=i.am(0,w,a,b,0,l))<w)for(i.dlShiftTo(b,A),a.subTo(A,a);a.data[x]<--w;)a.subTo(A,a)}t!=null&&(a.drShiftTo(l,t),s!=o&&_.ZERO.subTo(t,t)),a.t=l,a.clamp(),c>0&&a.rShiftTo(c,a),s<0&&_.ZERO.subTo(a,a)}}}function kd(e){var t=ee();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(_.ZERO)>0&&e.subTo(t,t),t}function Zt(e){this.m=e}function Ld(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function Dd(e){return e}function Ud(e){e.divRemTo(this.m,null,e)}function Pd(e,t,a){e.multiplyTo(t,a),this.reduce(a)}function Od(e,t){e.squareTo(t),this.reduce(t)}Zt.prototype.convert=Ld,Zt.prototype.revert=Dd,Zt.prototype.reduce=Ud,Zt.prototype.mulTo=Pd,Zt.prototype.sqrTo=Od;function Vd(){if(this.t<1)return 0;var e=this.data[0];if((e&1)==0)return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Jt(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function Md(e){var t=ee();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(_.ZERO)>0&&this.m.subTo(t,t),t}function Fd(e){var t=ee();return e.copyTo(t),this.reduce(t),t}function Kd(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var a=e.data[t]&32767,r=a*this.mpl+((a*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(a=t+this.m.t,e.data[a]+=this.m.am(0,r,e,t,0,this.m.t);e.data[a]>=e.DV;)e.data[a]-=e.DV,e.data[++a]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function qd(e,t){e.squareTo(t),this.reduce(t)}function Hd(e,t,a){e.multiplyTo(t,a),this.reduce(a)}Jt.prototype.convert=Md,Jt.prototype.revert=Fd,Jt.prototype.reduce=Kd,Jt.prototype.mulTo=Hd,Jt.prototype.sqrTo=qd;function Gd(){return(this.t>0?this.data[0]&1:this.s)==0}function zd(e,t){if(e>4294967295||e<1)return _.ONE;var a=ee(),r=ee(),n=t.convert(this),i=Ko(e)-1;for(n.copyTo(a);--i>=0;)if(t.sqrTo(a,r),(e&1<<i)>0)t.mulTo(r,n,a);else{var s=a;a=r,r=s}return t.revert(a)}function $d(e,t){var a;return e<256||t.isEven()?a=new Zt(t):a=new Jt(t),this.exp(e,a)}_.prototype.copyTo=gd,_.prototype.fromInt=vd,_.prototype.fromString=yd,_.prototype.clamp=md,_.prototype.dlShiftTo=bd,_.prototype.drShiftTo=Id,_.prototype.lShiftTo=Ad,_.prototype.rShiftTo=Bd,_.prototype.subTo=wd,_.prototype.multiplyTo=Nd,_.prototype.squareTo=_d,_.prototype.divRemTo=Rd,_.prototype.invDigit=Vd,_.prototype.isEven=Gd,_.prototype.exp=zd,_.prototype.toString=Ed,_.prototype.negate=Cd,_.prototype.abs=xd,_.prototype.compareTo=Sd,_.prototype.bitLength=Td,_.prototype.mod=kd,_.prototype.modPowInt=$d,_.ZERO=qt(0),_.ONE=qt(1);function Qd(){var e=ee();return this.copyTo(e),e}function jd(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function Xd(){return this.t==0?this.s:this.data[0]<<24>>24}function Yd(){return this.t==0?this.s:this.data[0]<<16>>16}function Wd(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function Zd(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function Jd(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),a=Math.pow(e,t),r=qt(a),n=ee(),i=ee(),s="";for(this.divRemTo(r,n,i);n.signum()>0;)s=(a+i.intValue()).toString(e).substr(1)+s,n.divRemTo(r,n,i);return i.intValue().toString(e)+s}function ep(e,t){this.fromInt(0),t==null&&(t=10);for(var a=this.chunkSize(t),r=Math.pow(t,a),n=!1,i=0,s=0,o=0;o<e.length;++o){var c=H0(e,o);if(c<0){e.charAt(o)=="-"&&this.signum()==0&&(n=!0);continue}s=t*s+c,++i>=a&&(this.dMultiply(r),this.dAddOffset(s,0),i=0,s=0)}i>0&&(this.dMultiply(Math.pow(t,i)),this.dAddOffset(s,0)),n&&_.ZERO.subTo(this,this)}function tp(e,t,a){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,a),this.testBit(e-1)||this.bitwiseTo(_.ONE.shiftLeft(e-1),Ac,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(_.ONE.shiftLeft(e-1),this);else{var r=new Array,n=e&7;r.length=(e>>3)+1,t.nextBytes(r),n>0?r[0]&=(1<<n)-1:r[0]=0,this.fromString(r,256)}}function rp(){var e=this.t,t=new Array;t[0]=this.s;var a=this.DB-e*this.DB%8,r,n=0;if(e-- >0)for(a<this.DB&&(r=this.data[e]>>a)!=(this.s&this.DM)>>a&&(t[n++]=r|this.s<<this.DB-a);e>=0;)a<8?(r=(this.data[e]&(1<<a)-1)<<8-a,r|=this.data[--e]>>(a+=this.DB-8)):(r=this.data[e]>>(a-=8)&255,a<=0&&(a+=this.DB,--e)),(r&128)!=0&&(r|=-256),n==0&&(this.s&128)!=(r&128)&&++n,(n>0||r!=this.s)&&(t[n++]=r);return t}function ap(e){return this.compareTo(e)==0}function np(e){return this.compareTo(e)<0?this:e}function sp(e){return this.compareTo(e)>0?this:e}function ip(e,t,a){var r,n,i=Math.min(e.t,this.t);for(r=0;r<i;++r)a.data[r]=t(this.data[r],e.data[r]);if(e.t<this.t){for(n=e.s&this.DM,r=i;r<this.t;++r)a.data[r]=t(this.data[r],n);a.t=this.t}else{for(n=this.s&this.DM,r=i;r<e.t;++r)a.data[r]=t(n,e.data[r]);a.t=e.t}a.s=t(this.s,e.s),a.clamp()}function op(e,t){return e&t}function cp(e){var t=ee();return this.bitwiseTo(e,op,t),t}function Ac(e,t){return e|t}function lp(e){var t=ee();return this.bitwiseTo(e,Ac,t),t}function G0(e,t){return e^t}function up(e){var t=ee();return this.bitwiseTo(e,G0,t),t}function z0(e,t){return e&~t}function fp(e){var t=ee();return this.bitwiseTo(e,z0,t),t}function dp(){for(var e=ee(),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 pp(e){var t=ee();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function hp(e){var t=ee();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function gp(e){if(e==0)return-1;var t=0;return(e&65535)==0&&(e>>=16,t+=16),(e&255)==0&&(e>>=8,t+=8),(e&15)==0&&(e>>=4,t+=4),(e&3)==0&&(e>>=2,t+=2),(e&1)==0&&++t,t}function vp(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+gp(this.data[e]);return this.s<0?this.t*this.DB:-1}function yp(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function mp(){for(var e=0,t=this.s&this.DM,a=0;a<this.t;++a)e+=yp(this.data[a]^t);return e}function Ep(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function Cp(e,t){var a=_.ONE.shiftLeft(e);return this.bitwiseTo(a,t,a),a}function xp(e){return this.changeBit(e,Ac)}function Sp(e){return this.changeBit(e,z0)}function Tp(e){return this.changeBit(e,G0)}function bp(e,t){for(var a=0,r=0,n=Math.min(e.t,this.t);a<n;)r+=this.data[a]+e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;a<this.t;)r+=this.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;a<e.t;)r+=e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t.data[a++]=r:r<-1&&(t.data[a++]=this.DV+r),t.t=a,t.clamp()}function Ip(e){var t=ee();return this.addTo(e,t),t}function Ap(e){var t=ee();return this.subTo(e,t),t}function Bp(e){var t=ee();return this.multiplyTo(e,t),t}function wp(){var e=ee();return this.squareTo(e),e}function Np(e){var t=ee();return this.divRemTo(e,t,null),t}function _p(e){var t=ee();return this.divRemTo(e,null,t),t}function Rp(e){var t=ee(),a=ee();return this.divRemTo(e,t,a),new Array(t,a)}function kp(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function Lp(e,t){if(e!=0){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 Eo(){}function $0(e){return e}function Dp(e,t,a){e.multiplyTo(t,a)}function Up(e,t){e.squareTo(t)}Eo.prototype.convert=$0,Eo.prototype.revert=$0,Eo.prototype.mulTo=Dp,Eo.prototype.sqrTo=Up;function Pp(e){return this.exp(e,new Eo)}function Op(e,t,a){var r=Math.min(this.t+e.t,t);for(a.s=0,a.t=r;r>0;)a.data[--r]=0;var n;for(n=a.t-this.t;r<n;++r)a.data[r+this.t]=this.am(0,e.data[r],a,r,0,this.t);for(n=Math.min(e.t,t);r<n;++r)this.am(0,e.data[r],a,r,0,t-r);a.clamp()}function Vp(e,t,a){--t;var r=a.t=this.t+e.t-t;for(a.s=0;--r>=0;)a.data[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)a.data[this.t+r-t]=this.am(t-r,e.data[r],a,0,0,this.t+r-t);a.clamp(),a.drShiftTo(1,a)}function dr(e){this.r2=ee(),this.q3=ee(),_.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function Mp(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=ee();return e.copyTo(t),this.reduce(t),t}function Fp(e){return e}function Kp(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 qp(e,t){e.squareTo(t),this.reduce(t)}function Hp(e,t,a){e.multiplyTo(t,a),this.reduce(a)}dr.prototype.convert=Mp,dr.prototype.revert=Fp,dr.prototype.reduce=Kp,dr.prototype.mulTo=Hp,dr.prototype.sqrTo=qp;function Gp(e,t){var a=e.bitLength(),r,n=qt(1),i;if(a<=0)return n;a<18?r=1:a<48?r=3:a<144?r=4:a<768?r=5:r=6,a<8?i=new Zt(t):t.isEven()?i=new dr(t):i=new Jt(t);var s=new Array,o=3,c=r-1,l=(1<<r)-1;if(s[1]=i.convert(this),r>1){var u=ee();for(i.sqrTo(s[1],u);o<=l;)s[o]=ee(),i.mulTo(u,s[o-2],s[o]),o+=2}var d=e.t-1,v,E=!0,y=ee(),x;for(a=Ko(e.data[d])-1;d>=0;){for(a>=c?v=e.data[d]>>a-c&l:(v=(e.data[d]&(1<<a+1)-1)<<c-a,d>0&&(v|=e.data[d-1]>>this.DB+a-c)),o=r;(v&1)==0;)v>>=1,--o;if((a-=o)<0&&(a+=this.DB,--d),E)s[v].copyTo(n),E=!1;else{for(;o>1;)i.sqrTo(n,y),i.sqrTo(y,n),o-=2;o>0?i.sqrTo(n,y):(x=n,n=y,y=x),i.mulTo(y,s[v],n)}for(;d>=0&&(e.data[d]&1<<a)==0;)i.sqrTo(n,y),x=n,n=y,y=x,--a<0&&(a=this.DB-1,--d)}return i.revert(n)}function zp(e){var t=this.s<0?this.negate():this.clone(),a=e.s<0?e.negate():e.clone();if(t.compareTo(a)<0){var r=t;t=a,a=r}var n=t.getLowestSetBit(),i=a.getLowestSetBit();if(i<0)return t;for(n<i&&(i=n),i>0&&(t.rShiftTo(i,t),a.rShiftTo(i,a));t.signum()>0;)(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=a.getLowestSetBit())>0&&a.rShiftTo(n,a),t.compareTo(a)>=0?(t.subTo(a,t),t.rShiftTo(1,t)):(a.subTo(t,a),a.rShiftTo(1,a));return i>0&&a.lShiftTo(i,a),a}function $p(e){if(e<=0)return 0;var t=this.DV%e,a=this.s<0?e-1:0;if(this.t>0)if(t==0)a=this.data[0]%e;else for(var r=this.t-1;r>=0;--r)a=(t*a+this.data[r])%e;return a}function Qp(e){if(this.signum()==0)return _.ZERO;var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return _.ZERO;for(var a=e.clone(),r=this.clone(),n=qt(1),i=qt(0),s=qt(0),o=qt(1);a.signum()!=0;){for(;a.isEven();)a.rShiftTo(1,a),t?((!n.isEven()||!i.isEven())&&(n.addTo(this,n),i.subTo(e,i)),n.rShiftTo(1,n)):i.isEven()||i.subTo(e,i),i.rShiftTo(1,i);for(;r.isEven();)r.rShiftTo(1,r),t?((!s.isEven()||!o.isEven())&&(s.addTo(this,s),o.subTo(e,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);a.compareTo(r)>=0?(a.subTo(r,a),t&&n.subTo(s,n),i.subTo(o,i)):(r.subTo(a,r),t&&s.subTo(n,s),o.subTo(i,o))}if(r.compareTo(_.ONE)!=0)return _.ZERO;if(o.compareTo(e)>=0)return o.subtract(e);if(o.signum()<0)o.addTo(e,o);else return o;return o.signum()<0?o.add(e):o}var Tt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],jp=(1<<26)/Tt[Tt.length-1];function Xp(e){var t,a=this.abs();if(a.t==1&&a.data[0]<=Tt[Tt.length-1]){for(t=0;t<Tt.length;++t)if(a.data[0]==Tt[t])return!0;return!1}if(a.isEven())return!1;for(t=1;t<Tt.length;){for(var r=Tt[t],n=t+1;n<Tt.length&&r<jp;)r*=Tt[n++];for(r=a.modInt(r);t<n;)if(r%Tt[t++]==0)return!1}return a.millerRabin(e)}function Yp(e){var t=this.subtract(_.ONE),a=t.getLowestSetBit();if(a<=0)return!1;for(var r=t.shiftRight(a),n=Wp(),i,s=0;s<e;++s){do i=new _(this.bitLength(),n);while(i.compareTo(_.ONE)<=0||i.compareTo(t)>=0);var o=i.modPow(r,this);if(o.compareTo(_.ONE)!=0&&o.compareTo(t)!=0){for(var c=1;c++<a&&o.compareTo(t)!=0;)if(o=o.modPowInt(2,this),o.compareTo(_.ONE)==0)return!1;if(o.compareTo(t)!=0)return!1}}return!0}function Wp(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256)}}}_.prototype.chunkSize=Wd,_.prototype.toRadix=Jd,_.prototype.fromRadix=ep,_.prototype.fromNumber=tp,_.prototype.bitwiseTo=ip,_.prototype.changeBit=Cp,_.prototype.addTo=bp,_.prototype.dMultiply=kp,_.prototype.dAddOffset=Lp,_.prototype.multiplyLowerTo=Op,_.prototype.multiplyUpperTo=Vp,_.prototype.modInt=$p,_.prototype.millerRabin=Yp,_.prototype.clone=Qd,_.prototype.intValue=jd,_.prototype.byteValue=Xd,_.prototype.shortValue=Yd,_.prototype.signum=Zd,_.prototype.toByteArray=rp,_.prototype.equals=ap,_.prototype.min=np,_.prototype.max=sp,_.prototype.and=cp,_.prototype.or=lp,_.prototype.xor=up,_.prototype.andNot=fp,_.prototype.not=dp,_.prototype.shiftLeft=pp,_.prototype.shiftRight=hp,_.prototype.getLowestSetBit=vp,_.prototype.bitCount=mp,_.prototype.testBit=Ep,_.prototype.setBit=xp,_.prototype.clearBit=Sp,_.prototype.flipBit=Tp,_.prototype.add=Ip,_.prototype.subtract=Ap,_.prototype.multiply=Bp,_.prototype.divide=Np,_.prototype.remainder=_p,_.prototype.divideAndRemainder=Rp,_.prototype.modPow=Gp,_.prototype.modInverse=Qp,_.prototype.pow=Pp,_.prototype.gcd=zp,_.prototype.isProbablePrime=Xp,_.prototype.square=wp;var Nt=j,Q0=Nt.sha1=Nt.sha1||{};Nt.md.sha1=Nt.md.algorithms.sha1=Q0,Q0.create=function(){j0||Zp();var e=null,t=Nt.util.createBuffer(),a=new Array(80),r={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var n=r.messageLengthSize/4,i=0;i<n;++i)r.fullMessageLength.push(0);return t=Nt.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},r},r.start(),r.update=function(n,i){i==="utf8"&&(n=Nt.util.encodeUtf8(n));var s=n.length;r.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=s[1],s[1]=s[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(n),X0(e,a,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var n=Nt.util.createBuffer();n.putBytes(t.bytes());var i=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,s=i&r.blockLength-1;n.putBytes(Bc.substr(0,r.blockLength-s));for(var o,c,l=r.fullMessageLength[0]*8,u=0;u<r.fullMessageLength.length-1;++u)o=r.fullMessageLength[u+1]*8,c=o/4294967296>>>0,l+=c,n.putInt32(l>>>0),l=o>>>0;n.putInt32(l);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};X0(d,a,n);var v=Nt.util.createBuffer();return v.putInt32(d.h0),v.putInt32(d.h1),v.putInt32(d.h2),v.putInt32(d.h3),v.putInt32(d.h4),v},r};var Bc=null,j0=!1;function Zp(){Bc="\x80",Bc+=Nt.util.fillString("\0",64),j0=!0}function X0(e,t,a){for(var r,n,i,s,o,c,l,u,d=a.length();d>=64;){for(n=e.h0,i=e.h1,s=e.h2,o=e.h3,c=e.h4,u=0;u<16;++u)r=a.getInt32(),t[u]=r,l=o^i&(s^o),r=(n<<5|n>>>27)+l+c+1518500249+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;for(;u<20;++u)r=t[u-3]^t[u-8]^t[u-14]^t[u-16],r=r<<1|r>>>31,t[u]=r,l=o^i&(s^o),r=(n<<5|n>>>27)+l+c+1518500249+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;for(;u<32;++u)r=t[u-3]^t[u-8]^t[u-14]^t[u-16],r=r<<1|r>>>31,t[u]=r,l=i^s^o,r=(n<<5|n>>>27)+l+c+1859775393+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;for(;u<40;++u)r=t[u-6]^t[u-16]^t[u-28]^t[u-32],r=r<<2|r>>>30,t[u]=r,l=i^s^o,r=(n<<5|n>>>27)+l+c+1859775393+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;for(;u<60;++u)r=t[u-6]^t[u-16]^t[u-28]^t[u-32],r=r<<2|r>>>30,t[u]=r,l=i&s|o&(i^s),r=(n<<5|n>>>27)+l+c+2400959708+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;for(;u<80;++u)r=t[u-6]^t[u-16]^t[u-28]^t[u-32],r=r<<2|r>>>30,t[u]=r,l=i^s^o,r=(n<<5|n>>>27)+l+c+3395469782+r,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=r;e.h0=e.h0+n|0,e.h1=e.h1+i|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,d-=64}}var _t=j,Y0=_t.pkcs1=_t.pkcs1||{};Y0.encode_rsa_oaep=function(e,t,a){var r,n,i,s;typeof a=="string"?(r=a,n=arguments[3]||void 0,i=arguments[4]||void 0):a&&(r=a.label||void 0,n=a.seed||void 0,i=a.md||void 0,a.mgf1&&a.mgf1.md&&(s=a.mgf1.md)),i?i.start():i=_t.md.sha1.create(),s||(s=i);var o=Math.ceil(e.n.bitLength()/8),c=o-2*i.digestLength-2;if(t.length>c){var l=new Error("RSAES-OAEP input message length is too long.");throw l.length=t.length,l.maxLength=c,l}r||(r=""),i.update(r,"raw");for(var u=i.digest(),d="",v=c-t.length,E=0;E<v;E++)d+="\0";var y=u.getBytes()+d+""+t;if(!n)n=_t.random.getBytes(i.digestLength);else if(n.length!==i.digestLength){var l=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw l.seedLength=n.length,l.digestLength=i.digestLength,l}var x=qo(n,o-i.digestLength-1,s),b=_t.util.xorBytes(y,x,y.length),A=qo(b,i.digestLength,s),w=_t.util.xorBytes(n,A,n.length);return"\0"+w+b},Y0.decode_rsa_oaep=function(e,t,a){var r,n,i;typeof a=="string"?(r=a,n=arguments[3]||void 0):a&&(r=a.label||void 0,n=a.md||void 0,a.mgf1&&a.mgf1.md&&(i=a.mgf1.md));var s=Math.ceil(e.n.bitLength()/8);if(t.length!==s){var b=new Error("RSAES-OAEP encoded message length is invalid.");throw b.length=t.length,b.expectedLength=s,b}if(n===void 0?n=_t.md.sha1.create():n.start(),i||(i=n),s<2*n.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");r||(r=""),n.update(r,"raw");for(var o=n.digest().getBytes(),c=t.charAt(0),l=t.substring(1,n.digestLength+1),u=t.substring(1+n.digestLength),d=qo(u,n.digestLength,i),v=_t.util.xorBytes(l,d,l.length),E=qo(v,s-n.digestLength-1,i),y=_t.util.xorBytes(u,E,u.length),x=y.substring(0,n.digestLength),b=c!=="\0",A=0;A<n.digestLength;++A)b|=o.charAt(A)!==x.charAt(A);for(var w=1,N=n.digestLength,M=n.digestLength;M<y.length;M++){var U=y.charCodeAt(M),L=U&1^1,z=w?65534:0;b|=U&z,w=w&L,N+=w}if(b||y.charCodeAt(N)!==1)throw new Error("Invalid RSAES-OAEP padding.");return y.substring(N+1)};function qo(e,t,a){a||(a=_t.md.sha1.create());for(var r="",n=Math.ceil(t/a.digestLength),i=0;i<n;++i){var s=String.fromCharCode(i>>24&255,i>>16&255,i>>8&255,i&255);a.start(),a.update(e+s),r+=a.digest().getBytes()}return r.substring(0,t)}var er=j;(function(){if(er.prime)return;var e=er.prime=er.prime||{},t=er.jsbn.BigInteger,a=[6,4,2,4,2,4,6,2],r=new t(null);r.fromInt(30);var n=function(d,v){return d|v};e.generateProbablePrime=function(d,v,E){typeof v=="function"&&(E=v,v={}),v=v||{};var y=v.algorithm||"PRIMEINC";typeof y=="string"&&(y={name:y}),y.options=y.options||{};var x=v.prng||er.random,b={nextBytes:function(A){for(var w=x.getBytesSync(A.length),N=0;N<A.length;++N)A[N]=w.charCodeAt(N)}};if(y.name==="PRIMEINC")return i(d,b,y.options,E);throw new Error("Invalid prime generation algorithm: "+y.name)};function i(d,v,E,y){return"workers"in E?c(d,v,E,y):s(d,v,E,y)}function s(d,v,E,y){var x=l(d,v),b=0,A=u(x.bitLength());"millerRabinTests"in E&&(A=E.millerRabinTests);var w=10;"maxBlockTime"in E&&(w=E.maxBlockTime),o(x,d,v,b,A,w,y)}function o(d,v,E,y,x,b,A){var w=+new Date;do{if(d.bitLength()>v&&(d=l(v,E)),d.isProbablePrime(x))return A(null,d);d.dAddOffset(a[y++%8],0)}while(b<0||+new Date-w<b);er.util.setImmediate(function(){o(d,v,E,y,x,b,A)})}function c(d,v,E,y){if(typeof Worker>"u")return s(d,v,E,y);var x=l(d,v),b=E.workers,A=E.workLoad||100,w=A*30/8,N=E.workerScript||"forge/prime.worker.js";if(b===-1)return er.util.estimateCores(function(U,L){U&&(L=2),b=L-1,M()});M();function M(){b=Math.max(1,b);for(var U=[],L=0;L<b;++L)U[L]=new Worker(N);for(var L=0;L<b;++L)U[L].addEventListener("message",X);var z=!1;function X(ne){if(!z){var ie=ne.data;if(ie.found){for(var oe=0;oe<U.length;++oe)U[oe].terminate();return z=!0,y(null,new t(ie.prime,16))}x.bitLength()>d&&(x=l(d,v));var ge=x.toString(16);ne.target.postMessage({hex:ge,workLoad:A}),x.dAddOffset(w,0)}}}}function l(d,v){var E=new t(d,v),y=d-1;return E.testBit(y)||E.bitwiseTo(t.ONE.shiftLeft(y),n,E),E.dAddOffset(31-E.mod(r).byteValue(),0),E}function u(d){return d<=100?27:d<=150?18:d<=200?15:d<=250?12:d<=300?9:d<=350?8:d<=400?7:d<=500?6:d<=600?5:d<=800?4:d<=1250?3:2}})();var H=j;if(typeof re>"u")var re=H.jsbn.BigInteger;var wc=H.util.isNodejs?ac:null,I=H.asn1,mt=H.util;H.pki=H.pki||{},H.pki.rsa=H.rsa=H.rsa||{};var $=H.pki,Jp=[6,4,2,4,2,4,6,2],eh={name:"PrivateKeyInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},th={name:"RSAPrivateKey",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},rh={name:"RSAPublicKey",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},ah=H.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:I.Class.UNIVERSAL,type:I.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},nh={name:"DigestInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:I.Class.UNIVERSAL,type:I.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},sh=function(e){var t;if(e.algorithm in $.oids)t=$.oids[e.algorithm];else{var a=new Error("Unknown message digest algorithm.");throw a.algorithm=e.algorithm,a}var r=I.oidToDer(t).getBytes(),n=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[]),i=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[]);i.value.push(I.create(I.Class.UNIVERSAL,I.Type.OID,!1,r)),i.value.push(I.create(I.Class.UNIVERSAL,I.Type.NULL,!1,""));var s=I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,e.digest().getBytes());return n.value.push(i),n.value.push(s),I.toDer(n).getBytes()},W0=function(e,t,a){if(a)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(re.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(re.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var r;do r=new re(H.util.bytesToHex(H.random.getBytes(t.n.bitLength()/8)),16);while(r.compareTo(t.n)>=0||!r.gcd(t.n).equals(re.ONE));e=e.multiply(r.modPow(t.e,t.n)).mod(t.n);for(var n=e.mod(t.p).modPow(t.dP,t.p),i=e.mod(t.q).modPow(t.dQ,t.q);n.compareTo(i)<0;)n=n.add(t.p);var s=n.subtract(i).multiply(t.qInv).mod(t.p).multiply(t.q).add(i);return s=s.multiply(r.modInverse(t.n)).mod(t.n),s};$.rsa.encrypt=function(e,t,a){var r=a,n,i=Math.ceil(t.n.bitLength()/8);a!==!1&&a!==!0?(r=a===2,n=Z0(e,t,a)):(n=H.util.createBuffer(),n.putBytes(e));for(var s=new re(n.toHex(),16),o=W0(s,t,r),c=o.toString(16),l=H.util.createBuffer(),u=i-Math.ceil(c.length/2);u>0;)l.putByte(0),--u;return l.putBytes(H.util.hexToBytes(c)),l.getBytes()},$.rsa.decrypt=function(e,t,a,r){var n=Math.ceil(t.n.bitLength()/8);if(e.length!==n){var i=new Error("Encrypted message length is invalid.");throw i.length=e.length,i.expected=n,i}var s=new re(H.util.createBuffer(e).toHex(),16);if(s.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var o=W0(s,t,a),c=o.toString(16),l=H.util.createBuffer(),u=n-Math.ceil(c.length/2);u>0;)l.putByte(0),--u;return l.putBytes(H.util.hexToBytes(c)),r!==!1?Ho(l.getBytes(),t,a):l.getBytes()},$.rsa.createKeyPairGenerationState=function(e,t,a){typeof e=="string"&&(e=parseInt(e,10)),e=e||2048,a=a||{};var r=a.prng||H.random,n={nextBytes:function(o){for(var c=r.getBytesSync(o.length),l=0;l<o.length;++l)o[l]=c.charCodeAt(l)}},i=a.algorithm||"PRIMEINC",s;if(i==="PRIMEINC")s={algorithm:i,state:0,bits:e,rng:n,eInt:t||65537,e:new re(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},s.e.fromInt(s.eInt);else throw new Error("Invalid key generation algorithm: "+i);return s},$.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var a=new re(null);a.fromInt(30);for(var r=0,n=function(d,v){return d|v},i=+new Date,s,o=0;e.keys===null&&(t<=0||o<t);){if(e.state===0){var c=e.p===null?e.pBits:e.qBits,l=c-1;e.pqState===0?(e.num=new re(c,e.rng),e.num.testBit(l)||e.num.bitwiseTo(re.ONE.shiftLeft(l),n,e.num),e.num.dAddOffset(31-e.num.mod(a).byteValue(),0),r=0,++e.pqState):e.pqState===1?e.num.bitLength()>c?e.pqState=0:e.num.isProbablePrime(oh(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(Jp[r++%8],0):e.pqState===2?e.pqState=e.num.subtract(re.ONE).gcd(e.e).compareTo(re.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(re.ONE),e.q1=e.q.subtract(re.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(re.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var u=e.e.modInverse(e.phi);e.keys={privateKey:$.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:$.rsa.setPublicKey(e.n,e.e)}}s=+new Date,o+=s-i,i=s}return e.keys!==null},$.rsa.generateKeyPair=function(e,t,a,r){if(arguments.length===1?typeof e=="object"?(a=e,e=void 0):typeof e=="function"&&(r=e,e=void 0):arguments.length===2?typeof e=="number"?typeof t=="function"?(r=t,t=void 0):typeof t!="number"&&(a=t,t=void 0):(a=e,r=t,e=void 0,t=void 0):arguments.length===3&&(typeof t=="number"?typeof a=="function"&&(r=a,a=void 0):(r=a,a=t,t=void 0)),a=a||{},e===void 0&&(e=a.bits||2048),t===void 0&&(t=a.e||65537),!a.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(r){if(J0("generateKeyPair"))return wc.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(o,c,l){if(o)return r(o);r(null,{privateKey:$.privateKeyFromPem(l),publicKey:$.publicKeyFromPem(c)})});if(el("generateKey")&&el("exportKey"))return mt.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:rl(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(o){return mt.globalScope.crypto.subtle.exportKey("pkcs8",o.privateKey)}).then(void 0,function(o){r(o)}).then(function(o){if(o){var c=$.privateKeyFromAsn1(I.fromDer(H.util.createBuffer(o)));r(null,{privateKey:c,publicKey:$.setRsaPublicKey(c.n,c.e)})}});if(tl("generateKey")&&tl("exportKey")){var n=mt.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:rl(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);n.oncomplete=function(o){var c=o.target.result,l=mt.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);l.oncomplete=function(u){var d=u.target.result,v=$.privateKeyFromAsn1(I.fromDer(H.util.createBuffer(d)));r(null,{privateKey:v,publicKey:$.setRsaPublicKey(v.n,v.e)})},l.onerror=function(u){r(u)}},n.onerror=function(o){r(o)};return}}else if(J0("generateKeyPairSync")){var i=wc.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:$.privateKeyFromPem(i.privateKey),publicKey:$.publicKeyFromPem(i.publicKey)}}}var s=$.rsa.createKeyPairGenerationState(e,t,a);if(!r)return $.rsa.stepKeyPairGenerationState(s,0),s.keys;ih(s,a,r)},$.setRsaPublicKey=$.rsa.setPublicKey=function(e,t){var a={n:e,e:t};return a.encrypt=function(r,n,i){if(typeof n=="string"?n=n.toUpperCase():n===void 0&&(n="RSAES-PKCS1-V1_5"),n==="RSAES-PKCS1-V1_5")n={encode:function(o,c,l){return Z0(o,c,2).getBytes()}};else if(n==="RSA-OAEP"||n==="RSAES-OAEP")n={encode:function(o,c){return H.pkcs1.encode_rsa_oaep(c,o,i)}};else if(["RAW","NONE","NULL",null].indexOf(n)!==-1)n={encode:function(o){return o}};else if(typeof n=="string")throw new Error('Unsupported encryption scheme: "'+n+'".');var s=n.encode(r,a,!0);return $.rsa.encrypt(s,a,!0)},a.verify=function(r,n,i,s){typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSASSA-PKCS1-V1_5"),s===void 0&&(s={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in s||(s._parseAllDigestBytes=!0),"_skipPaddingChecks"in s||(s._skipPaddingChecks=!1),i==="RSASSA-PKCS1-V1_5"?i={verify:function(c,l){l=Ho(l,a,!0,void 0,s);var u=I.fromDer(l,{parseAllBytes:s._parseAllDigestBytes}),d={},v=[];if(!I.validate(u,nh,d,v)||u.value.length!==2){var E=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw E.errors=v,E}var y=I.derToOid(d.algorithmIdentifier);if(!(y===H.oids.md2||y===H.oids.md5||y===H.oids.sha1||y===H.oids.sha224||y===H.oids.sha256||y===H.oids.sha384||y===H.oids.sha512||y===H.oids["sha512-224"]||y===H.oids["sha512-256"])){var E=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw E.oid=y,E}if((y===H.oids.md2||y===H.oids.md5)&&!("parameters"in d))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return c===d.digest}}:(i==="NONE"||i==="NULL"||i===null)&&(i={verify:function(c,l){return l=Ho(l,a,!0,void 0,s),c===l}});var o=$.rsa.decrypt(n,a,!0,!1);return i.verify(r,o,a.n.bitLength())},a},$.setRsaPrivateKey=$.rsa.setPrivateKey=function(e,t,a,r,n,i,s,o){var c={n:e,e:t,d:a,p:r,q:n,dP:i,dQ:s,qInv:o};return c.decrypt=function(l,u,d){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var v=$.rsa.decrypt(l,c,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:Ho};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(E,y){return H.pkcs1.decode_rsa_oaep(y,E,d)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(E){return E}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(v,c,!1)},c.sign=function(l,u){var d=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:sh},d=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return l}},d=1);var v=u.encode(l,c.n.bitLength());return $.rsa.encrypt(v,c,d)},c},$.wrapRsaPrivateKey=function(e){return I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,I.integerToDer(0).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer($.oids.rsaEncryption).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.NULL,!1,"")]),I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,I.toDer(e).getBytes())])},$.privateKeyFromAsn1=function(e){var t={},a=[];if(I.validate(e,eh,t,a)&&(e=I.fromDer(H.util.createBuffer(t.privateKey))),t={},a=[],!I.validate(e,th,t,a)){var r=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw r.errors=a,r}var n,i,s,o,c,l,u,d;return n=H.util.createBuffer(t.privateKeyModulus).toHex(),i=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(),l=H.util.createBuffer(t.privateKeyExponent1).toHex(),u=H.util.createBuffer(t.privateKeyExponent2).toHex(),d=H.util.createBuffer(t.privateKeyCoefficient).toHex(),$.setRsaPrivateKey(new re(n,16),new re(i,16),new re(s,16),new re(o,16),new re(c,16),new re(l,16),new re(u,16),new re(d,16))},$.privateKeyToAsn1=$.privateKeyToRSAPrivateKey=function(e){return I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,I.integerToDer(0).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Rt(e.n)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Rt(e.e)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Rt(e.d)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Rt(e.p)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Rt(e.q)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Rt(e.dP)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Rt(e.dQ)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Rt(e.qInv))])},$.publicKeyFromAsn1=function(e){var t={},a=[];if(I.validate(e,ah,t,a)){var r=I.derToOid(t.publicKeyOid);if(r!==$.oids.rsaEncryption){var n=new Error("Cannot read public key. Unknown OID.");throw n.oid=r,n}e=t.rsaPublicKey}if(a=[],!I.validate(e,rh,t,a)){var n=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw n.errors=a,n}var i=H.util.createBuffer(t.publicKeyModulus).toHex(),s=H.util.createBuffer(t.publicKeyExponent).toHex();return $.setRsaPublicKey(new re(i,16),new re(s,16))},$.publicKeyToAsn1=$.publicKeyToSubjectPublicKeyInfo=function(e){return I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer($.oids.rsaEncryption).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.NULL,!1,"")]),I.create(I.Class.UNIVERSAL,I.Type.BITSTRING,!1,[$.publicKeyToRSAPublicKey(e)])])},$.publicKeyToRSAPublicKey=function(e){return I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Rt(e.n)),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,Rt(e.e))])};function Z0(e,t,a){var r=H.util.createBuffer(),n=Math.ceil(t.n.bitLength()/8);if(e.length>n-11){var i=new Error("Message is too long for PKCS#1 v1.5 padding.");throw i.length=e.length,i.max=n-11,i}r.putByte(0),r.putByte(a);var s=n-3-e.length,o;if(a===0||a===1){o=a===0?0:255;for(var c=0;c<s;++c)r.putByte(o)}else for(;s>0;){for(var l=0,u=H.random.getBytes(s),c=0;c<s;++c)o=u.charCodeAt(c),o===0?++l:r.putByte(o);s=l}return r.putByte(0),r.putBytes(e),r}function Ho(e,t,a,r,n){var i=Math.ceil(t.n.bitLength()/8),s=H.util.createBuffer(e),o=s.getByte(),c=s.getByte();if(o!==0||a&&c!==0&&c!==1||!a&&c!==2||a&&c===0&&typeof r>"u")throw new Error("Encryption block is invalid.");var l=0;if(c===0){l=i-3-r;for(var u=0;u<l;++u)if(s.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(c===1){for(l=0;s.length()>1;){if(s.getByte()!==255){--s.read;break}++l}if(l<8&&!(n&&n._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(c===2){for(l=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++l}if(l<8&&!(n&&n._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var d=s.getByte();if(d!==0||l!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function ih(e,t,a){typeof t=="function"&&(a=t,t={}),t=t||{};var r={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(r.prng=t.prng),n();function n(){i(e.pBits,function(o,c){if(o)return a(o);if(e.p=c,e.q!==null)return s(o,e.q);i(e.qBits,s)})}function i(o,c){H.prime.generateProbablePrime(o,r,c)}function s(o,c){if(o)return a(o);if(e.q=c,e.p.compareTo(e.q)<0){var l=e.p;e.p=e.q,e.q=l}if(e.p.subtract(re.ONE).gcd(e.e).compareTo(re.ONE)!==0){e.p=null,n();return}if(e.q.subtract(re.ONE).gcd(e.e).compareTo(re.ONE)!==0){e.q=null,i(e.qBits,s);return}if(e.p1=e.p.subtract(re.ONE),e.q1=e.q.subtract(re.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(re.ONE)!==0){e.p=e.q=null,n();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,i(e.qBits,s);return}var u=e.e.modInverse(e.phi);e.keys={privateKey:$.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:$.rsa.setPublicKey(e.n,e.e)},a(null,e.keys)}}function Rt(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var a=H.util.hexToBytes(t);return a.length>1&&(a.charCodeAt(0)===0&&(a.charCodeAt(1)&128)===0||a.charCodeAt(0)===255&&(a.charCodeAt(1)&128)===128)?a.substr(1):a}function oh(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 J0(e){return H.util.isNodejs&&typeof wc[e]=="function"}function el(e){return typeof mt.globalScope<"u"&&typeof mt.globalScope.crypto=="object"&&typeof mt.globalScope.crypto.subtle=="object"&&typeof mt.globalScope.crypto.subtle[e]=="function"}function tl(e){return typeof mt.globalScope<"u"&&typeof mt.globalScope.msCrypto=="object"&&typeof mt.globalScope.msCrypto.subtle=="object"&&typeof mt.globalScope.msCrypto.subtle[e]=="function"}function rl(e){for(var t=H.util.hexToBytes(e.toString(16)),a=new Uint8Array(t.length),r=0;r<t.length;++r)a[r]=t.charCodeAt(r);return a}var F=j;if(typeof ch>"u")var ch=F.jsbn.BigInteger;var B=F.asn1,Q=F.pki=F.pki||{};Q.pbe=F.pbe=F.pbe||{};var tr=Q.oids,lh={name:"EncryptedPrivateKeyInfo",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:B.Class.UNIVERSAL,type:B.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:B.Class.UNIVERSAL,type:B.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},uh={name:"PBES2Algorithms",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:B.Class.UNIVERSAL,type:B.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:B.Class.UNIVERSAL,type:B.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:B.Class.UNIVERSAL,type:B.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:B.Class.UNIVERSAL,type:B.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:B.Class.UNIVERSAL,type:B.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:B.Class.UNIVERSAL,type:B.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:B.Class.UNIVERSAL,type:B.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},fh={name:"pkcs-12PbeParams",tagClass:B.Class.UNIVERSAL,type:B.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:B.Class.UNIVERSAL,type:B.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:B.Class.UNIVERSAL,type:B.Type.INTEGER,constructed:!1,capture:"iterations"}]};Q.encryptPrivateKeyInfo=function(e,t,a){a=a||{},a.saltSize=a.saltSize||8,a.count=a.count||2048,a.algorithm=a.algorithm||"aes128",a.prfAlgorithm=a.prfAlgorithm||"sha1";var r=F.random.getBytesSync(a.saltSize),n=a.count,i=B.integerToDer(n),s,o,c;if(a.algorithm.indexOf("aes")===0||a.algorithm==="des"){var l,u,d;switch(a.algorithm){case"aes128":s=16,l=16,u=tr["aes128-CBC"],d=F.aes.createEncryptionCipher;break;case"aes192":s=24,l=16,u=tr["aes192-CBC"],d=F.aes.createEncryptionCipher;break;case"aes256":s=32,l=16,u=tr["aes256-CBC"],d=F.aes.createEncryptionCipher;break;case"des":s=8,l=8,u=tr.desCBC,d=F.des.createEncryptionCipher;break;default:var v=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw v.algorithm=a.algorithm,v}var E="hmacWith"+a.prfAlgorithm.toUpperCase(),y=sl(E),x=F.pkcs5.pbkdf2(t,r,n,s,y),b=F.random.getBytesSync(l),A=d(x);A.start(b),A.update(B.toDer(e)),A.finish(),c=A.output.getBytes();var w=dh(r,i,s,E);o=B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[B.create(B.Class.UNIVERSAL,B.Type.OID,!1,B.oidToDer(tr.pkcs5PBES2).getBytes()),B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[B.create(B.Class.UNIVERSAL,B.Type.OID,!1,B.oidToDer(tr.pkcs5PBKDF2).getBytes()),w]),B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[B.create(B.Class.UNIVERSAL,B.Type.OID,!1,B.oidToDer(u).getBytes()),B.create(B.Class.UNIVERSAL,B.Type.OCTETSTRING,!1,b)])])])}else if(a.algorithm==="3des"){s=24;var N=new F.util.ByteBuffer(r),x=Q.pbe.generatePkcs12Key(t,N,1,n,s),b=Q.pbe.generatePkcs12Key(t,N,2,n,s),A=F.des.createEncryptionCipher(x);A.start(b),A.update(B.toDer(e)),A.finish(),c=A.output.getBytes(),o=B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[B.create(B.Class.UNIVERSAL,B.Type.OID,!1,B.oidToDer(tr["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[B.create(B.Class.UNIVERSAL,B.Type.OCTETSTRING,!1,r),B.create(B.Class.UNIVERSAL,B.Type.INTEGER,!1,i.getBytes())])])}else{var v=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw v.algorithm=a.algorithm,v}var M=B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[o,B.create(B.Class.UNIVERSAL,B.Type.OCTETSTRING,!1,c)]);return M},Q.decryptPrivateKeyInfo=function(e,t){var a=null,r={},n=[];if(!B.validate(e,lh,r,n)){var i=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=n,i}var s=B.derToOid(r.encryptionOid),o=Q.pbe.getCipher(s,r.encryptionParams,t),c=F.util.createBuffer(r.encryptedData);return o.update(c),o.finish()&&(a=B.fromDer(o.output)),a},Q.encryptedPrivateKeyToPem=function(e,t){var a={type:"ENCRYPTED PRIVATE KEY",body:B.toDer(e).getBytes()};return F.pem.encode(a,{maxline:t})},Q.encryptedPrivateKeyFromPem=function(e){var t=F.pem.decode(e)[0];if(t.type!=="ENCRYPTED PRIVATE KEY"){var a=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return B.fromDer(t.body)},Q.encryptRsaPrivateKey=function(e,t,a){if(a=a||{},!a.legacy){var r=Q.wrapRsaPrivateKey(Q.privateKeyToAsn1(e));return r=Q.encryptPrivateKeyInfo(r,t,a),Q.encryptedPrivateKeyToPem(r)}var n,i,s,o;switch(a.algorithm){case"aes128":n="AES-128-CBC",s=16,i=F.random.getBytesSync(16),o=F.aes.createEncryptionCipher;break;case"aes192":n="AES-192-CBC",s=24,i=F.random.getBytesSync(16),o=F.aes.createEncryptionCipher;break;case"aes256":n="AES-256-CBC",s=32,i=F.random.getBytesSync(16),o=F.aes.createEncryptionCipher;break;case"3des":n="DES-EDE3-CBC",s=24,i=F.random.getBytesSync(8),o=F.des.createEncryptionCipher;break;case"des":n="DES-CBC",s=8,i=F.random.getBytesSync(8),o=F.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+a.algorithm+'".');throw c.algorithm=a.algorithm,c}var l=F.pbe.opensslDeriveBytes(t,i.substr(0,8),s),u=o(l);u.start(i),u.update(B.toDer(Q.privateKeyToAsn1(e))),u.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:n,parameters:F.util.bytesToHex(i).toUpperCase()},body:u.output.getBytes()};return F.pem.encode(d)},Q.decryptRsaPrivateKey=function(e,t){var a=null,r=F.pem.decode(e)[0];if(r.type!=="ENCRYPTED PRIVATE KEY"&&r.type!=="PRIVATE KEY"&&r.type!=="RSA PRIVATE KEY"){var n=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw n.headerType=n,n}if(r.procType&&r.procType.type==="ENCRYPTED"){var i,s;switch(r.dekInfo.algorithm){case"DES-CBC":i=8,s=F.des.createDecryptionCipher;break;case"DES-EDE3-CBC":i=24,s=F.des.createDecryptionCipher;break;case"AES-128-CBC":i=16,s=F.aes.createDecryptionCipher;break;case"AES-192-CBC":i=24,s=F.aes.createDecryptionCipher;break;case"AES-256-CBC":i=32,s=F.aes.createDecryptionCipher;break;case"RC2-40-CBC":i=5,s=function(d){return F.rc2.createDecryptionCipher(d,40)};break;case"RC2-64-CBC":i=8,s=function(d){return F.rc2.createDecryptionCipher(d,64)};break;case"RC2-128-CBC":i=16,s=function(d){return F.rc2.createDecryptionCipher(d,128)};break;default:var n=new Error('Could not decrypt private key; unsupported encryption algorithm "'+r.dekInfo.algorithm+'".');throw n.algorithm=r.dekInfo.algorithm,n}var o=F.util.hexToBytes(r.dekInfo.parameters),c=F.pbe.opensslDeriveBytes(t,o.substr(0,8),i),l=s(c);if(l.start(o),l.update(F.util.createBuffer(r.body)),l.finish())a=l.output.getBytes();else return a}else a=r.body;return r.type==="ENCRYPTED PRIVATE KEY"?a=Q.decryptPrivateKeyInfo(B.fromDer(a),t):a=B.fromDer(a),a!==null&&(a=Q.privateKeyFromAsn1(a)),a},Q.pbe.generatePkcs12Key=function(e,t,a,r,n,i){var s,o;if(typeof i>"u"||i===null){if(!("sha1"in F.md))throw new Error('"sha1" hash algorithm unavailable.');i=F.md.sha1.create()}var c=i.digestLength,l=i.blockLength,u=new F.util.ByteBuffer,d=new F.util.ByteBuffer;if(e!=null){for(o=0;o<e.length;o++)d.putInt16(e.charCodeAt(o));d.putInt16(0)}var v=d.length(),E=t.length(),y=new F.util.ByteBuffer;y.fillWithByte(a,l);var x=l*Math.ceil(E/l),b=new F.util.ByteBuffer;for(o=0;o<x;o++)b.putByte(t.at(o%E));var A=l*Math.ceil(v/l),w=new F.util.ByteBuffer;for(o=0;o<A;o++)w.putByte(d.at(o%v));var N=b;N.putBuffer(w);for(var M=Math.ceil(n/c),U=1;U<=M;U++){var L=new F.util.ByteBuffer;L.putBytes(y.bytes()),L.putBytes(N.bytes());for(var z=0;z<r;z++)i.start(),i.update(L.getBytes()),L=i.digest();var X=new F.util.ByteBuffer;for(o=0;o<l;o++)X.putByte(L.at(o%c));var ne=Math.ceil(E/l)+Math.ceil(v/l),ie=new F.util.ByteBuffer;for(s=0;s<ne;s++){var oe=new F.util.ByteBuffer(N.getBytes(l)),ge=511;for(o=X.length()-1;o>=0;o--)ge=ge>>8,ge+=X.at(o)+oe.at(o),oe.setAt(o,ge&255);ie.putBuffer(oe)}N=ie,u.putBuffer(L)}return u.truncate(u.length()-n),u},Q.pbe.getCipher=function(e,t,a){switch(e){case Q.oids.pkcs5PBES2:return Q.pbe.getCipherForPBES2(e,t,a);case Q.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case Q.oids["pbewithSHAAnd40BitRC2-CBC"]:return Q.pbe.getCipherForPKCS12PBE(e,t,a);default:var r=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw r.oid=e,r.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],r}},Q.pbe.getCipherForPBES2=function(e,t,a){var r={},n=[];if(!B.validate(t,uh,r,n)){var i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=n,i}if(e=B.derToOid(r.kdfOid),e!==Q.oids.pkcs5PBKDF2){var i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw i.oid=e,i.supportedOids=["pkcs5PBKDF2"],i}if(e=B.derToOid(r.encOid),e!==Q.oids["aes128-CBC"]&&e!==Q.oids["aes192-CBC"]&&e!==Q.oids["aes256-CBC"]&&e!==Q.oids["des-EDE3-CBC"]&&e!==Q.oids.desCBC){var i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw i.oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i}var s=r.kdfSalt,o=F.util.createBuffer(r.kdfIterationCount);o=o.getInt(o.length()<<3);var c,l;switch(Q.oids[e]){case"aes128-CBC":c=16,l=F.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,l=F.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,l=F.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,l=F.des.createDecryptionCipher;break;case"desCBC":c=8,l=F.des.createDecryptionCipher;break}var u=nl(r.prfOid),d=F.pkcs5.pbkdf2(a,s,o,c,u),v=r.encIv,E=l(d);return E.start(v),E},Q.pbe.getCipherForPKCS12PBE=function(e,t,a){var r={},n=[];if(!B.validate(t,fh,r,n)){var i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=n,i}var s=F.util.createBuffer(r.salt),o=F.util.createBuffer(r.iterations);o=o.getInt(o.length()<<3);var c,l,u;switch(e){case Q.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,l=8,u=F.des.startDecrypting;break;case Q.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,l=8,u=function(x,b){var A=F.rc2.createDecryptionCipher(x,40);return A.start(b,null),A};break;default:var i=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw i.oid=e,i}var d=nl(r.prfOid),v=Q.pbe.generatePkcs12Key(a,s,1,o,c,d);d.start();var E=Q.pbe.generatePkcs12Key(a,s,2,o,l,d);return u(v,E)},Q.pbe.opensslDeriveBytes=function(e,t,a,r){if(typeof r>"u"||r===null){if(!("md5"in F.md))throw new Error('"md5" hash algorithm unavailable.');r=F.md.md5.create()}t===null&&(t="");for(var n=[al(r,e+t)],i=16,s=1;i<a;++s,i+=16)n.push(al(r,n[s-1]+e+t));return n.join("").substr(0,a)};function al(e,t){return e.start().update(t).digest().getBytes()}function nl(e){var t;if(!e)t="hmacWithSHA1";else if(t=Q.oids[B.derToOid(e)],!t){var a=new Error("Unsupported PRF OID.");throw a.oid=e,a.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],a}return sl(t)}function sl(e){var t=F.md;switch(e){case"hmacWithSHA224":t=F.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var a=new Error("Unsupported PRF algorithm.");throw a.algorithm=e,a.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],a}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function dh(e,t,a,r){var n=B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[B.create(B.Class.UNIVERSAL,B.Type.OCTETSTRING,!1,e),B.create(B.Class.UNIVERSAL,B.Type.INTEGER,!1,t.getBytes())]);return r!=="hmacWithSHA1"&&n.value.push(B.create(B.Class.UNIVERSAL,B.Type.INTEGER,!1,F.util.hexToBytes(a.toString(16))),B.create(B.Class.UNIVERSAL,B.Type.SEQUENCE,!0,[B.create(B.Class.UNIVERSAL,B.Type.OID,!1,B.oidToDer(Q.oids[r]).getBytes()),B.create(B.Class.UNIVERSAL,B.Type.NULL,!1,"")])),n}var pr=j,V=pr.asn1,hr=pr.pkcs7asn1=pr.pkcs7asn1||{};pr.pkcs7=pr.pkcs7||{},pr.pkcs7.asn1=hr;var il={name:"ContentInfo",tagClass:V.Class.UNIVERSAL,type:V.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:V.Class.UNIVERSAL,type:V.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:V.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};hr.contentInfoValidator=il;var ol={name:"EncryptedContentInfo",tagClass:V.Class.UNIVERSAL,type:V.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:V.Class.UNIVERSAL,type:V.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:V.Class.UNIVERSAL,type:V.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:V.Class.UNIVERSAL,type:V.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:V.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:V.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};hr.envelopedDataValidator={name:"EnvelopedData",tagClass:V.Class.UNIVERSAL,type:V.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:V.Class.UNIVERSAL,type:V.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:V.Class.UNIVERSAL,type:V.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(ol)},hr.encryptedDataValidator={name:"EncryptedData",tagClass:V.Class.UNIVERSAL,type:V.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:V.Class.UNIVERSAL,type:V.Type.INTEGER,constructed:!1,capture:"version"}].concat(ol)};var ph={name:"SignerInfo",tagClass:V.Class.UNIVERSAL,type:V.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:V.Class.UNIVERSAL,type:V.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:V.Class.UNIVERSAL,type:V.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:V.Class.UNIVERSAL,type:V.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:V.Class.UNIVERSAL,type:V.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:V.Class.UNIVERSAL,type:V.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:V.Class.UNIVERSAL,type:V.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:V.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:V.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:V.Class.UNIVERSAL,type:V.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:V.Class.UNIVERSAL,type:V.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:V.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};hr.signedDataValidator={name:"SignedData",tagClass:V.Class.UNIVERSAL,type:V.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:V.Class.UNIVERSAL,type:V.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:V.Class.UNIVERSAL,type:V.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},il,{name:"SignedData.Certificates",tagClass:V.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:V.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:V.Class.UNIVERSAL,type:V.Type.SET,capture:"signerInfos",optional:!0,value:[ph]}]},hr.recipientInfoValidator={name:"RecipientInfo",tagClass:V.Class.UNIVERSAL,type:V.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:V.Class.UNIVERSAL,type:V.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:V.Class.UNIVERSAL,type:V.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:V.Class.UNIVERSAL,type:V.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:V.Class.UNIVERSAL,type:V.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:V.Class.UNIVERSAL,type:V.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:V.Class.UNIVERSAL,type:V.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:V.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:V.Class.UNIVERSAL,type:V.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]};var rr=j;rr.mgf=rr.mgf||{};var hh=rr.mgf.mgf1=rr.mgf1=rr.mgf1||{};hh.create=function(e){var t={generate:function(a,r){for(var n=new rr.util.ByteBuffer,i=Math.ceil(r/e.digestLength),s=0;s<i;s++){var o=new rr.util.ByteBuffer;o.putInt32(s),e.start(),e.update(a+o.getBytes()),n.putBuffer(e.digest())}return n.truncate(n.length()-r),n.getBytes()}};return t};var Go=j;Go.mgf=Go.mgf||{},Go.mgf.mgf1=Go.mgf1;var ar=j,gh=ar.pss=ar.pss||{};gh.create=function(e){arguments.length===3&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,a=e.mgf,r=t.digestLength,n=e.salt||null;typeof n=="string"&&(n=ar.util.createBuffer(n));var i;if("saltLength"in e)i=e.saltLength;else if(n!==null)i=n.length();else throw new Error("Salt length not specified or specific salt not given.");if(n!==null&&n.length()!==i)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||ar.random,o={};return o.encode=function(c,l){var u,d=l-1,v=Math.ceil(d/8),E=c.digest().getBytes();if(v<r+i+2)throw new Error("Message is too long to encrypt.");var y;n===null?y=s.getBytesSync(i):y=n.bytes();var x=new ar.util.ByteBuffer;x.fillWithByte(0,8),x.putBytes(E),x.putBytes(y),t.start(),t.update(x.getBytes());var b=t.digest().getBytes(),A=new ar.util.ByteBuffer;A.fillWithByte(0,v-i-r-2),A.putByte(1),A.putBytes(y);var w=A.getBytes(),N=v-r-1,M=a.generate(b,N),U="";for(u=0;u<N;u++)U+=String.fromCharCode(w.charCodeAt(u)^M.charCodeAt(u));var L=65280>>8*v-d&255;return U=String.fromCharCode(U.charCodeAt(0)&~L)+U.substr(1),U+b+"\xBC"},o.verify=function(c,l,u){var d,v=u-1,E=Math.ceil(v/8);if(l=l.substr(-E),E<r+i+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(l.charCodeAt(E-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var y=E-r-1,x=l.substr(0,y),b=l.substr(y,r),A=65280>>8*E-v&255;if((x.charCodeAt(0)&A)!==0)throw new Error("Bits beyond keysize not zero as expected.");var w=a.generate(b,y),N="";for(d=0;d<y;d++)N+=String.fromCharCode(x.charCodeAt(d)^w.charCodeAt(d));N=String.fromCharCode(N.charCodeAt(0)&~A)+N.substr(1);var M=E-r-i-2;for(d=0;d<M;d++)if(N.charCodeAt(d)!==0)throw new Error("Leftmost octets not zero as expected");if(N.charCodeAt(M)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var U=N.substr(-i),L=new ar.util.ByteBuffer;L.fillWithByte(0,8),L.putBytes(c),L.putBytes(U),t.start(),t.update(L.getBytes());var z=t.digest().getBytes();return b===z},o};var q=j,p=q.asn1,D=q.pki=q.pki||{},te=D.oids,ve={};ve.CN=te.commonName,ve.commonName="CN",ve.C=te.countryName,ve.countryName="C",ve.L=te.localityName,ve.localityName="L",ve.ST=te.stateOrProvinceName,ve.stateOrProvinceName="ST",ve.O=te.organizationName,ve.organizationName="O",ve.OU=te.organizationalUnitName,ve.organizationalUnitName="OU",ve.E=te.emailAddress,ve.emailAddress="E";var cl=q.pki.rsa.publicKeyValidator,vh={name:"Certificate",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:p.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:p.Class.UNIVERSAL,type:p.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:p.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:p.Class.UNIVERSAL,type:p.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:p.Class.UNIVERSAL,type:p.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:p.Class.UNIVERSAL,type:p.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:p.Class.UNIVERSAL,type:p.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},cl,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:p.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:p.Class.UNIVERSAL,type:p.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:p.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:p.Class.UNIVERSAL,type:p.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:p.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:p.Class.UNIVERSAL,type:p.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:p.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:p.Class.UNIVERSAL,type:p.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},yh={name:"rsapss",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:p.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:p.Class.UNIVERSAL,type:p.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:p.Class.UNIVERSAL,type:p.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:p.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:p.Class.UNIVERSAL,type:p.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:p.Class.UNIVERSAL,type:p.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:p.Class.UNIVERSAL,type:p.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:p.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:p.Class.UNIVERSAL,type:p.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:p.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:p.Class.UNIVERSAL,type:p.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},mh={name:"CertificationRequestInfo",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},cl,{name:"CertificationRequestInfo.attributes",tagClass:p.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:p.Class.UNIVERSAL,type:p.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:p.Class.UNIVERSAL,type:p.Type.SET,constructed:!0}]}]}]},Eh={name:"CertificationRequest",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[mh,{name:"CertificationRequest.signatureAlgorithm",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:p.Class.UNIVERSAL,type:p.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:p.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:p.Class.UNIVERSAL,type:p.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};D.RDNAttributesAsArray=function(e,t){for(var a=[],r,n,i,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=p.derToOid(n.value[0].value),i.value=n.value[1].value,i.valueTagClass=n.value[1].type,i.type in te&&(i.name=te[i.type],i.name in ve&&(i.shortName=ve[i.name])),t&&(t.update(i.type),t.update(i.value)),a.push(i)}return a},D.CRIAttributesAsArray=function(e){for(var t=[],a=0;a<e.length;++a)for(var r=e[a],n=p.derToOid(r.value[0].value),i=r.value[1].value,s=0;s<i.length;++s){var o={};if(o.type=n,o.value=i[s].value,o.valueTagClass=i[s].type,o.type in te&&(o.name=te[o.type],o.name in ve&&(o.shortName=ve[o.name])),o.type===te.extensionRequest){o.extensions=[];for(var c=0;c<o.value.length;++c)o.extensions.push(D.certificateExtensionFromAsn1(o.value[c]))}t.push(o)}return t};function Ht(e,t){typeof t=="string"&&(t={shortName:t});for(var a=null,r,n=0;a===null&&n<e.attributes.length;++n)r=e.attributes[n],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(a=r);return a}var zo=function(e,t,a){var r={};if(e!==te["RSASSA-PSS"])return r;a&&(r={hash:{algorithmOid:te.sha1},mgf:{algorithmOid:te.mgf1,hash:{algorithmOid:te.sha1}},saltLength:20});var n={},i=[];if(!p.validate(t,yh,n,i)){var s=new Error("Cannot read RSASSA-PSS parameter block.");throw s.errors=i,s}return n.hashOid!==void 0&&(r.hash=r.hash||{},r.hash.algorithmOid=p.derToOid(n.hashOid)),n.maskGenOid!==void 0&&(r.mgf=r.mgf||{},r.mgf.algorithmOid=p.derToOid(n.maskGenOid),r.mgf.hash=r.mgf.hash||{},r.mgf.hash.algorithmOid=p.derToOid(n.maskGenHashOid)),n.saltLength!==void 0&&(r.saltLength=n.saltLength.charCodeAt(0)),r},$o=function(e){switch(te[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return q.md.sha1.create();case"md5WithRSAEncryption":return q.md.md5.create();case"sha256WithRSAEncryption":return q.md.sha256.create();case"sha384WithRSAEncryption":return q.md.sha384.create();case"sha512WithRSAEncryption":return q.md.sha512.create();case"RSASSA-PSS":return q.md.sha256.create();default:var t=new Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},ll=function(e){var t=e.certificate,a;switch(t.signatureOid){case te.sha1WithRSAEncryption:case te.sha1WithRSASignature:break;case te["RSASSA-PSS"]:var r,n;if(r=te[t.signatureParameters.mgf.hash.algorithmOid],r===void 0||q.md[r]===void 0){var i=new Error("Unsupported MGF hash function.");throw i.oid=t.signatureParameters.mgf.hash.algorithmOid,i.name=r,i}if(n=te[t.signatureParameters.mgf.algorithmOid],n===void 0||q.mgf[n]===void 0){var i=new Error("Unsupported MGF function.");throw i.oid=t.signatureParameters.mgf.algorithmOid,i.name=n,i}if(n=q.mgf[n].create(q.md[r].create()),r=te[t.signatureParameters.hash.algorithmOid],r===void 0||q.md[r]===void 0){var i=new Error("Unsupported RSASSA-PSS hash function.");throw i.oid=t.signatureParameters.hash.algorithmOid,i.name=r,i}a=q.pss.create(q.md[r].create(),n,t.signatureParameters.saltLength);break}return t.publicKey.verify(e.md.digest().getBytes(),e.signature,a)};D.certificateFromPem=function(e,t,a){var r=q.pem.decode(e)[0];if(r.type!=="CERTIFICATE"&&r.type!=="X509 CERTIFICATE"&&r.type!=="TRUSTED CERTIFICATE"){var n=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw n.headerType=r.type,n}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var i=p.fromDer(r.body,a);return D.certificateFromAsn1(i,t)},D.certificateToPem=function(e,t){var a={type:"CERTIFICATE",body:p.toDer(D.certificateToAsn1(e)).getBytes()};return q.pem.encode(a,{maxline:t})},D.publicKeyFromPem=function(e){var t=q.pem.decode(e)[0];if(t.type!=="PUBLIC KEY"&&t.type!=="RSA PUBLIC KEY"){var a=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var r=p.fromDer(t.body);return D.publicKeyFromAsn1(r)},D.publicKeyToPem=function(e,t){var a={type:"PUBLIC KEY",body:p.toDer(D.publicKeyToAsn1(e)).getBytes()};return q.pem.encode(a,{maxline:t})},D.publicKeyToRSAPublicKeyPem=function(e,t){var a={type:"RSA PUBLIC KEY",body:p.toDer(D.publicKeyToRSAPublicKey(e)).getBytes()};return q.pem.encode(a,{maxline:t})},D.getPublicKeyFingerprint=function(e,t){t=t||{};var a=t.md||q.md.sha1.create(),r=t.type||"RSAPublicKey",n;switch(r){case"RSAPublicKey":n=p.toDer(D.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":n=p.toDer(D.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}a.start(),a.update(n);var i=a.digest();if(t.encoding==="hex"){var s=i.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}else{if(t.encoding==="binary")return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return i},D.certificationRequestFromPem=function(e,t,a){var r=q.pem.decode(e)[0];if(r.type!=="CERTIFICATE REQUEST"){var n=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw n.headerType=r.type,n}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var i=p.fromDer(r.body,a);return D.certificationRequestFromAsn1(i,t)},D.certificationRequestToPem=function(e,t){var a={type:"CERTIFICATE REQUEST",body:p.toDer(D.certificationRequestToAsn1(e)).getBytes()};return q.pem.encode(a,{maxline:t})},D.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 Ht(e.issuer,t)},e.issuer.addField=function(t){Et([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return Ht(e.subject,t)},e.subject.addField=function(t){Et([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,a){Et(t),e.subject.attributes=t,delete e.subject.uniqueId,a&&(e.subject.uniqueId=a),e.subject.hash=null},e.setIssuer=function(t,a){Et(t),e.issuer.attributes=t,delete e.issuer.uniqueId,a&&(e.issuer.uniqueId=a),e.issuer.hash=null},e.setExtensions=function(t){for(var a=0;a<t.length;++a)ul(t[a],{cert:e});e.extensions=t},e.getExtension=function(t){typeof t=="string"&&(t={name:t});for(var a=null,r,n=0;a===null&&n<e.extensions.length;++n)r=e.extensions[n],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(a=r);return a},e.sign=function(t,a){e.md=a||q.md.sha1.create();var r=te[e.md.algorithm+"WithRSAEncryption"];if(!r){var n=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw n.algorithm=e.md.algorithm,n}e.signatureOid=e.siginfo.algorithmOid=r,e.tbsCertificate=D.getTBSCertificate(e);var i=p.toDer(e.tbsCertificate);e.md.update(i.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var a=!1;if(!e.issued(t)){var r=t.issuer,n=e.subject,i=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 i.expectedIssuer=n.attributes,i.actualIssuer=r.attributes,i}var s=t.md;if(s===null){s=$o({signatureOid:t.signatureOid,type:"certificate"});var o=t.tbsCertificate||D.getTBSCertificate(t),c=p.toDer(o);s.update(c.getBytes())}return s!==null&&(a=ll({certificate:e,md:s,signature:t.signature})),a},e.isIssuer=function(t){var a=!1,r=e.issuer,n=t.subject;if(r.hash&&n.hash)a=r.hash===n.hash;else if(r.attributes.length===n.attributes.length){a=!0;for(var i,s,o=0;a&&o<r.attributes.length;++o)i=r.attributes[o],s=n.attributes[o],(i.type!==s.type||i.value!==s.value)&&(a=!1)}return a},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return D.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=te.subjectKeyIdentifier,a=0;a<e.extensions.length;++a){var r=e.extensions[a];if(r.id===t){var n=e.generateSubjectKeyIdentifier().getBytes();return q.util.hexToBytes(r.subjectKeyIdentifier)===n}}return!1},e},D.certificateFromAsn1=function(e,t){var a={},r=[];if(!p.validate(e,vh,a,r)){var n=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw n.errors=r,n}var i=p.derToOid(a.publicKeyOid);if(i!==D.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var s=D.createCertificate();s.version=a.certVersion?a.certVersion.charCodeAt(0):0;var o=q.util.createBuffer(a.certSerialNumber);s.serialNumber=o.toHex(),s.signatureOid=q.asn1.derToOid(a.certSignatureOid),s.signatureParameters=zo(s.signatureOid,a.certSignatureParams,!0),s.siginfo.algorithmOid=q.asn1.derToOid(a.certinfoSignatureOid),s.siginfo.parameters=zo(s.siginfo.algorithmOid,a.certinfoSignatureParams,!1),s.signature=a.certSignature;var c=[];if(a.certValidity1UTCTime!==void 0&&c.push(p.utcTimeToDate(a.certValidity1UTCTime)),a.certValidity2GeneralizedTime!==void 0&&c.push(p.generalizedTimeToDate(a.certValidity2GeneralizedTime)),a.certValidity3UTCTime!==void 0&&c.push(p.utcTimeToDate(a.certValidity3UTCTime)),a.certValidity4GeneralizedTime!==void 0&&c.push(p.generalizedTimeToDate(a.certValidity4GeneralizedTime)),c.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(c.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(s.validity.notBefore=c[0],s.validity.notAfter=c[1],s.tbsCertificate=a.tbsCertificate,t){s.md=$o({signatureOid:s.signatureOid,type:"certificate"});var l=p.toDer(s.tbsCertificate);s.md.update(l.getBytes())}var u=q.md.sha1.create(),d=p.toDer(a.certIssuer);u.update(d.getBytes()),s.issuer.getField=function(y){return Ht(s.issuer,y)},s.issuer.addField=function(y){Et([y]),s.issuer.attributes.push(y)},s.issuer.attributes=D.RDNAttributesAsArray(a.certIssuer),a.certIssuerUniqueId&&(s.issuer.uniqueId=a.certIssuerUniqueId),s.issuer.hash=u.digest().toHex();var v=q.md.sha1.create(),E=p.toDer(a.certSubject);return v.update(E.getBytes()),s.subject.getField=function(y){return Ht(s.subject,y)},s.subject.addField=function(y){Et([y]),s.subject.attributes.push(y)},s.subject.attributes=D.RDNAttributesAsArray(a.certSubject),a.certSubjectUniqueId&&(s.subject.uniqueId=a.certSubjectUniqueId),s.subject.hash=v.digest().toHex(),a.certExtensions?s.extensions=D.certificateExtensionsFromAsn1(a.certExtensions):s.extensions=[],s.publicKey=D.publicKeyFromAsn1(a.subjectPublicKeyInfo),s},D.certificateExtensionsFromAsn1=function(e){for(var t=[],a=0;a<e.value.length;++a)for(var r=e.value[a],n=0;n<r.value.length;++n)t.push(D.certificateExtensionFromAsn1(r.value[n]));return t},D.certificateExtensionFromAsn1=function(e){var t={};if(t.id=p.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===p.Type.BOOLEAN?(t.critical=e.value[1].value.charCodeAt(0)!==0,t.value=e.value[2].value):t.value=e.value[1].value,t.id in te){if(t.name=te[t.id],t.name==="keyUsage"){var a=p.fromDer(t.value),r=0,n=0;a.value.length>1&&(r=a.value.charCodeAt(1),n=a.value.length>2?a.value.charCodeAt(2):0),t.digitalSignature=(r&128)===128,t.nonRepudiation=(r&64)===64,t.keyEncipherment=(r&32)===32,t.dataEncipherment=(r&16)===16,t.keyAgreement=(r&8)===8,t.keyCertSign=(r&4)===4,t.cRLSign=(r&2)===2,t.encipherOnly=(r&1)===1,t.decipherOnly=(n&128)===128}else if(t.name==="basicConstraints"){var a=p.fromDer(t.value);a.value.length>0&&a.value[0].type===p.Type.BOOLEAN?t.cA=a.value[0].value.charCodeAt(0)!==0:t.cA=!1;var i=null;a.value.length>0&&a.value[0].type===p.Type.INTEGER?i=a.value[0].value:a.value.length>1&&(i=a.value[1].value),i!==null&&(t.pathLenConstraint=p.derToInteger(i))}else if(t.name==="extKeyUsage")for(var a=p.fromDer(t.value),s=0;s<a.value.length;++s){var o=p.derToOid(a.value[s].value);o in te?t[te[o]]=!0:t[o]=!0}else if(t.name==="nsCertType"){var a=p.fromDer(t.value),r=0;a.value.length>1&&(r=a.value.charCodeAt(1)),t.client=(r&128)===128,t.server=(r&64)===64,t.email=(r&32)===32,t.objsign=(r&16)===16,t.reserved=(r&8)===8,t.sslCA=(r&4)===4,t.emailCA=(r&2)===2,t.objCA=(r&1)===1}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.altNames=[];for(var c,a=p.fromDer(t.value),l=0;l<a.value.length;++l){c=a.value[l];var u={type:c.type,value:c.value};switch(t.altNames.push(u),c.type){case 1:case 2:case 6:break;case 7:u.ip=q.util.bytesToIP(c.value);break;case 8:u.oid=p.derToOid(c.value);break}}}else if(t.name==="subjectKeyIdentifier"){var a=p.fromDer(t.value);t.subjectKeyIdentifier=q.util.bytesToHex(a.value)}}return t},D.certificationRequestFromAsn1=function(e,t){var a={},r=[];if(!p.validate(e,Eh,a,r)){var n=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw n.errors=r,n}var i=p.derToOid(a.publicKeyOid);if(i!==D.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var s=D.createCertificationRequest();if(s.version=a.csrVersion?a.csrVersion.charCodeAt(0):0,s.signatureOid=q.asn1.derToOid(a.csrSignatureOid),s.signatureParameters=zo(s.signatureOid,a.csrSignatureParams,!0),s.siginfo.algorithmOid=q.asn1.derToOid(a.csrSignatureOid),s.siginfo.parameters=zo(s.siginfo.algorithmOid,a.csrSignatureParams,!1),s.signature=a.csrSignature,s.certificationRequestInfo=a.certificationRequestInfo,t){s.md=$o({signatureOid:s.signatureOid,type:"certification request"});var o=p.toDer(s.certificationRequestInfo);s.md.update(o.getBytes())}var c=q.md.sha1.create();return s.subject.getField=function(l){return Ht(s.subject,l)},s.subject.addField=function(l){Et([l]),s.subject.attributes.push(l)},s.subject.attributes=D.RDNAttributesAsArray(a.certificationRequestInfoSubject,c),s.subject.hash=c.digest().toHex(),s.publicKey=D.publicKeyFromAsn1(a.subjectPublicKeyInfo),s.getAttribute=function(l){return Ht(s,l)},s.addAttribute=function(l){Et([l]),s.attributes.push(l)},s.attributes=D.CRIAttributesAsArray(a.certificationRequestInfoAttributes||[]),s},D.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 Ht(e.subject,t)},e.subject.addField=function(t){Et([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return Ht(e,t)},e.addAttribute=function(t){Et([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){Et(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){Et(t),e.attributes=t},e.sign=function(t,a){e.md=a||q.md.sha1.create();var r=te[e.md.algorithm+"WithRSAEncryption"];if(!r){var n=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw n.algorithm=e.md.algorithm,n}e.signatureOid=e.siginfo.algorithmOid=r,e.certificationRequestInfo=D.getCertificationRequestInfo(e);var i=p.toDer(e.certificationRequestInfo);e.md.update(i.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,a=e.md;if(a===null){a=$o({signatureOid:e.signatureOid,type:"certification request"});var r=e.certificationRequestInfo||D.getCertificationRequestInfo(e),n=p.toDer(r);a.update(n.getBytes())}return a!==null&&(t=ll({certificate:e,md:a,signature:e.signature})),t},e};function gr(e){for(var t=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[]),a,r,n=e.attributes,i=0;i<n.length;++i){a=n[i];var s=a.value,o=p.Type.PRINTABLESTRING;"valueTagClass"in a&&(o=a.valueTagClass,o===p.Type.UTF8&&(s=q.util.encodeUtf8(s))),r=p.create(p.Class.UNIVERSAL,p.Type.SET,!0,[p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(a.type).getBytes()),p.create(p.Class.UNIVERSAL,o,!1,s)])]),t.value.push(r)}return t}function Et(e){for(var t,a=0;a<e.length;++a){if(t=e[a],typeof t.name>"u"&&(t.type&&t.type in D.oids?t.name=D.oids[t.type]:t.shortName&&t.shortName in ve&&(t.name=D.oids[ve[t.shortName]])),typeof t.type>"u")if(t.name&&t.name in D.oids)t.type=D.oids[t.name];else{var r=new Error("Attribute type not specified.");throw r.attribute=t,r}if(typeof t.shortName>"u"&&t.name&&t.name in ve&&(t.shortName=ve[t.name]),t.type===te.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=p.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var n=0;n<t.extensions.length;++n)t.value.push(D.certificateExtensionToAsn1(ul(t.extensions[n])))}if(typeof t.value>"u"){var r=new Error("Attribute value not specified.");throw r.attribute=t,r}}}function ul(e,t){if(t=t||{},typeof e.name>"u"&&e.id&&e.id in D.oids&&(e.name=D.oids[e.id]),typeof e.id>"u")if(e.name&&e.name in D.oids)e.id=D.oids[e.name];else{var a=new Error("Extension ID not specified.");throw a.extension=e,a}if(typeof e.value<"u")return e;if(e.name==="keyUsage"){var r=0,n=0,i=0;e.digitalSignature&&(n|=128,r=7),e.nonRepudiation&&(n|=64,r=6),e.keyEncipherment&&(n|=32,r=5),e.dataEncipherment&&(n|=16,r=4),e.keyAgreement&&(n|=8,r=3),e.keyCertSign&&(n|=4,r=2),e.cRLSign&&(n|=2,r=1),e.encipherOnly&&(n|=1,r=0),e.decipherOnly&&(i|=128,r=7);var s=String.fromCharCode(r);i!==0?s+=String.fromCharCode(n)+String.fromCharCode(i):n!==0&&(s+=String.fromCharCode(n)),e.value=p.create(p.Class.UNIVERSAL,p.Type.BITSTRING,!1,s)}else if(e.name==="basicConstraints")e.value=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(p.create(p.Class.UNIVERSAL,p.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in e&&e.value.value.push(p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,p.integerToDer(e.pathLenConstraint).getBytes()));else if(e.name==="extKeyUsage"){e.value=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[]);var o=e.value.value;for(var c in e)e[c]===!0&&(c in te?o.push(p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(te[c]).getBytes())):c.indexOf(".")!==-1&&o.push(p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(c).getBytes())))}else if(e.name==="nsCertType"){var r=0,n=0;e.client&&(n|=128,r=7),e.server&&(n|=64,r=6),e.email&&(n|=32,r=5),e.objsign&&(n|=16,r=4),e.reserved&&(n|=8,r=3),e.sslCA&&(n|=4,r=2),e.emailCA&&(n|=2,r=1),e.objCA&&(n|=1,r=0);var s=String.fromCharCode(r);n!==0&&(s+=String.fromCharCode(n)),e.value=p.create(p.Class.UNIVERSAL,p.Type.BITSTRING,!1,s)}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.value=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[]);for(var l,u=0;u<e.altNames.length;++u){l=e.altNames[u];var s=l.value;if(l.type===7&&l.ip){if(s=q.util.bytesFromIP(l.ip),s===null){var a=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw a.extension=e,a}}else l.type===8&&(l.oid?s=p.oidToDer(p.oidToDer(l.oid)):s=p.oidToDer(s));e.value.value.push(p.create(p.Class.CONTEXT_SPECIFIC,l.type,!1,s))}}else if(e.name==="nsComment"&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=p.create(p.Class.UNIVERSAL,p.Type.IA5STRING,!1,e.comment)}else if(e.name==="subjectKeyIdentifier"&&t.cert){var d=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=d.toHex(),e.value=p.create(p.Class.UNIVERSAL,p.Type.OCTETSTRING,!1,d.getBytes())}else if(e.name==="authorityKeyIdentifier"&&t.cert){e.value=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[]);var o=e.value.value;if(e.keyIdentifier){var v=e.keyIdentifier===!0?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;o.push(p.create(p.Class.CONTEXT_SPECIFIC,0,!1,v))}if(e.authorityCertIssuer){var E=[p.create(p.Class.CONTEXT_SPECIFIC,4,!0,[gr(e.authorityCertIssuer===!0?t.cert.issuer:e.authorityCertIssuer)])];o.push(p.create(p.Class.CONTEXT_SPECIFIC,1,!0,E))}if(e.serialNumber){var y=q.util.hexToBytes(e.serialNumber===!0?t.cert.serialNumber:e.serialNumber);o.push(p.create(p.Class.CONTEXT_SPECIFIC,2,!1,y))}}else if(e.name==="cRLDistributionPoints"){e.value=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[]);for(var o=e.value.value,x=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[]),b=p.create(p.Class.CONTEXT_SPECIFIC,0,!0,[]),l,u=0;u<e.altNames.length;++u){l=e.altNames[u];var s=l.value;if(l.type===7&&l.ip){if(s=q.util.bytesFromIP(l.ip),s===null){var a=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw a.extension=e,a}}else l.type===8&&(l.oid?s=p.oidToDer(p.oidToDer(l.oid)):s=p.oidToDer(s));b.value.push(p.create(p.Class.CONTEXT_SPECIFIC,l.type,!1,s))}x.value.push(p.create(p.Class.CONTEXT_SPECIFIC,0,!0,[b])),o.push(x)}if(typeof e.value>"u"){var a=new Error("Extension value not specified.");throw a.extension=e,a}return e}function Nc(e,t){switch(e){case te["RSASSA-PSS"]:var a=[];return t.hash.algorithmOid!==void 0&&a.push(p.create(p.Class.CONTEXT_SPECIFIC,0,!0,[p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(t.hash.algorithmOid).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.NULL,!1,"")])])),t.mgf.algorithmOid!==void 0&&a.push(p.create(p.Class.CONTEXT_SPECIFIC,1,!0,[p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(t.mgf.algorithmOid).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(t.mgf.hash.algorithmOid).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.NULL,!1,"")])])])),t.saltLength!==void 0&&a.push(p.create(p.Class.CONTEXT_SPECIFIC,2,!0,[p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,p.integerToDer(t.saltLength).getBytes())])),p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,a);default:return p.create(p.Class.UNIVERSAL,p.Type.NULL,!1,"")}}function Ch(e){var t=p.create(p.Class.CONTEXT_SPECIFIC,0,!0,[]);if(e.attributes.length===0)return t;for(var a=e.attributes,r=0;r<a.length;++r){var n=a[r],i=n.value,s=p.Type.UTF8;"valueTagClass"in n&&(s=n.valueTagClass),s===p.Type.UTF8&&(i=q.util.encodeUtf8(i));var o=!1;"valueConstructed"in n&&(o=n.valueConstructed);var c=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(n.type).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.SET,!0,[p.create(p.Class.UNIVERSAL,s,o,i)])]);t.value.push(c)}return t}var xh=new Date("1950-01-01T00:00:00Z"),Sh=new Date("2050-01-01T00:00:00Z");function fl(e){return e>=xh&&e<Sh?p.create(p.Class.UNIVERSAL,p.Type.UTCTIME,!1,p.dateToUtcTime(e)):p.create(p.Class.UNIVERSAL,p.Type.GENERALIZEDTIME,!1,p.dateToGeneralizedTime(e))}D.getTBSCertificate=function(e){var t=fl(e.validity.notBefore),a=fl(e.validity.notAfter),r=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.CONTEXT_SPECIFIC,0,!0,[p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,p.integerToDer(e.version).getBytes())]),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,q.util.hexToBytes(e.serialNumber)),p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(e.siginfo.algorithmOid).getBytes()),Nc(e.siginfo.algorithmOid,e.siginfo.parameters)]),gr(e.issuer),p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[t,a]),gr(e.subject),D.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&r.value.push(p.create(p.Class.CONTEXT_SPECIFIC,1,!0,[p.create(p.Class.UNIVERSAL,p.Type.BITSTRING,!1,"\0"+e.issuer.uniqueId)])),e.subject.uniqueId&&r.value.push(p.create(p.Class.CONTEXT_SPECIFIC,2,!0,[p.create(p.Class.UNIVERSAL,p.Type.BITSTRING,!1,"\0"+e.subject.uniqueId)])),e.extensions.length>0&&r.value.push(D.certificateExtensionsToAsn1(e.extensions)),r},D.getCertificationRequestInfo=function(e){var t=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,p.integerToDer(e.version).getBytes()),gr(e.subject),D.publicKeyToAsn1(e.publicKey),Ch(e)]);return t},D.distinguishedNameToAsn1=function(e){return gr(e)},D.certificateToAsn1=function(e){var t=e.tbsCertificate||D.getTBSCertificate(e);return p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[t,p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(e.signatureOid).getBytes()),Nc(e.signatureOid,e.signatureParameters)]),p.create(p.Class.UNIVERSAL,p.Type.BITSTRING,!1,"\0"+e.signature)])},D.certificateExtensionsToAsn1=function(e){var t=p.create(p.Class.CONTEXT_SPECIFIC,3,!0,[]),a=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[]);t.value.push(a);for(var r=0;r<e.length;++r)a.value.push(D.certificateExtensionToAsn1(e[r]));return t},D.certificateExtensionToAsn1=function(e){var t=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[]);t.value.push(p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(e.id).getBytes())),e.critical&&t.value.push(p.create(p.Class.UNIVERSAL,p.Type.BOOLEAN,!1,"\xFF"));var a=e.value;return typeof e.value!="string"&&(a=p.toDer(a).getBytes()),t.value.push(p.create(p.Class.UNIVERSAL,p.Type.OCTETSTRING,!1,a)),t},D.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||D.getCertificationRequestInfo(e);return p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[t,p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(e.signatureOid).getBytes()),Nc(e.signatureOid,e.signatureParameters)]),p.create(p.Class.UNIVERSAL,p.Type.BITSTRING,!1,"\0"+e.signature)])},D.createCaStore=function(e){var t={certs:{}};t.getIssuer=function(s){var o=a(s.issuer);return o},t.addCertificate=function(s){if(typeof s=="string"&&(s=q.pki.certificateFromPem(s)),r(s.subject),!t.hasCertificate(s))if(s.subject.hash in t.certs){var o=t.certs[s.subject.hash];q.util.isArray(o)||(o=[o]),o.push(s),t.certs[s.subject.hash]=o}else t.certs[s.subject.hash]=s},t.hasCertificate=function(s){typeof s=="string"&&(s=q.pki.certificateFromPem(s));var o=a(s.subject);if(!o)return!1;q.util.isArray(o)||(o=[o]);for(var c=p.toDer(D.certificateToAsn1(s)).getBytes(),l=0;l<o.length;++l){var u=p.toDer(D.certificateToAsn1(o[l])).getBytes();if(c===u)return!0}return!1},t.listAllCertificates=function(){var s=[];for(var o in t.certs)if(t.certs.hasOwnProperty(o)){var c=t.certs[o];if(!q.util.isArray(c))s.push(c);else for(var l=0;l<c.length;++l)s.push(c[l])}return s},t.removeCertificate=function(s){var o;if(typeof s=="string"&&(s=q.pki.certificateFromPem(s)),r(s.subject),!t.hasCertificate(s))return null;var c=a(s.subject);if(!q.util.isArray(c))return o=t.certs[s.subject.hash],delete t.certs[s.subject.hash],o;for(var l=p.toDer(D.certificateToAsn1(s)).getBytes(),u=0;u<c.length;++u){var d=p.toDer(D.certificateToAsn1(c[u])).getBytes();l===d&&(o=c[u],c.splice(u,1))}return c.length===0&&delete t.certs[s.subject.hash],o};function a(s){return r(s),t.certs[s.hash]||null}function r(s){if(!s.hash){var o=q.md.sha1.create();s.attributes=D.RDNAttributesAsArray(gr(s),o),s.hash=o.digest().toHex()}}if(e)for(var n=0;n<e.length;++n){var i=e[n];t.addCertificate(i)}return t},D.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"},D.verifyCertificateChain=function(e,t,a){typeof a=="function"&&(a={verify:a}),a=a||{},t=t.slice(0);var r=t.slice(0),n=a.validityCheckDate;typeof n>"u"&&(n=new Date);var i=!0,s=null,o=0;do{var c=t.shift(),l=null,u=!1;if(n&&(n<c.validity.notBefore||n>c.validity.notAfter)&&(s={message:"Certificate is not valid yet or has expired.",error:D.certificateError.certificate_expired,notBefore:c.validity.notBefore,notAfter:c.validity.notAfter,now:n}),s===null){if(l=t[0]||e.getIssuer(c),l===null&&c.isIssuer(c)&&(u=!0,l=c),l){var d=l;q.util.isArray(d)||(d=[d]);for(var v=!1;!v&&d.length>0;){l=d.shift();try{v=l.verify(c)}catch{}}v||(s={message:"Certificate signature is invalid.",error:D.certificateError.bad_certificate})}s===null&&(!l||u)&&!e.hasCertificate(c)&&(s={message:"Certificate is not trusted.",error:D.certificateError.unknown_ca})}if(s===null&&l&&!c.isIssuer(l)&&(s={message:"Certificate issuer is invalid.",error:D.certificateError.bad_certificate}),s===null)for(var E={keyUsage:!0,basicConstraints:!0},y=0;s===null&&y<c.extensions.length;++y){var x=c.extensions[y];x.critical&&!(x.name in E)&&(s={message:"Certificate has an unsupported critical extension.",error:D.certificateError.unsupported_certificate})}if(s===null&&(!i||t.length===0&&(!l||u))){var b=c.getExtension("basicConstraints"),A=c.getExtension("keyUsage");if(A!==null&&(!A.keyCertSign||b===null)&&(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:D.certificateError.bad_certificate}),s===null&&b===null&&(s={message:"Certificate is missing basicConstraints extension and cannot be used as a CA.",error:D.certificateError.bad_certificate}),s===null&&b!==null&&!b.cA&&(s={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:D.certificateError.bad_certificate}),s===null&&A!==null&&"pathLenConstraint"in b){var w=o-1;w>b.pathLenConstraint&&(s={message:"Certificate basicConstraints pathLenConstraint violated.",error:D.certificateError.bad_certificate})}}var N=s===null?!0:s.error,M=a.verify?a.verify(N,o,r):N;if(M===!0)s=null;else throw N===!0&&(s={message:"The application rejected the certificate.",error:D.certificateError.bad_certificate}),(M||M===0)&&(typeof M=="object"&&!q.util.isArray(M)?(M.message&&(s.message=M.message),M.error&&(s.error=M.error)):typeof M=="string"&&(s.error=M)),s;i=!1,++o}while(t.length>0);return!0};var fe=j,C=fe.asn1,W=fe.pki,Co=fe.pkcs12=fe.pkcs12||{},dl={name:"ContentInfo",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:C.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},Th={name:"PFX",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:C.Class.UNIVERSAL,type:C.Type.INTEGER,constructed:!1,capture:"version"},dl,{name:"PFX.macData",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:C.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:C.Class.UNIVERSAL,type:C.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:C.Class.UNIVERSAL,type:C.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:C.Class.UNIVERSAL,type:C.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},bh={name:"SafeBag",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:C.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:C.Class.UNIVERSAL,type:C.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},Ih={name:"Attribute",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:C.Class.UNIVERSAL,type:C.Type.SET,constructed:!0,capture:"values"}]},Ah={name:"CertBag",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:C.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:C.Class.UNIVERSAL,type:C.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function xo(e,t,a,r){for(var n=[],i=0;i<e.length;i++)for(var s=0;s<e[i].safeBags.length;s++){var o=e[i].safeBags[s];if(!(r!==void 0&&o.type!==r)){if(t===null){n.push(o);continue}o.attributes[t]!==void 0&&o.attributes[t].indexOf(a)>=0&&n.push(o)}}return n}Co.pkcs12FromAsn1=function(e,t,a){typeof t=="string"?(a=t,t=!0):t===void 0&&(t=!0);var r={},n=[];if(!C.validate(e,Th,r,n)){var i=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw i.errors=i,i}var s={version:r.version.charCodeAt(0),safeContents:[],getBags:function(b){var A={},w;return"localKeyId"in b?w=b.localKeyId:"localKeyIdHex"in b&&(w=fe.util.hexToBytes(b.localKeyIdHex)),w===void 0&&!("friendlyName"in b)&&"bagType"in b&&(A[b.bagType]=xo(s.safeContents,null,null,b.bagType)),w!==void 0&&(A.localKeyId=xo(s.safeContents,"localKeyId",w,b.bagType)),"friendlyName"in b&&(A.friendlyName=xo(s.safeContents,"friendlyName",b.friendlyName,b.bagType)),A},getBagsByFriendlyName:function(b,A){return xo(s.safeContents,"friendlyName",b,A)},getBagsByLocalKeyId:function(b,A){return xo(s.safeContents,"localKeyId",b,A)}};if(r.version.charCodeAt(0)!==3){var i=new Error("PKCS#12 PFX of version other than 3 not supported.");throw i.version=r.version.charCodeAt(0),i}if(C.derToOid(r.contentType)!==W.oids.data){var i=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw i.oid=C.derToOid(r.contentType),i}var o=r.content.value[0];if(o.tagClass!==C.Class.UNIVERSAL||o.type!==C.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(o=_c(o),r.mac){var c=null,l=0,u=C.derToOid(r.macAlgorithm);switch(u){case W.oids.sha1:c=fe.md.sha1.create(),l=20;break;case W.oids.sha256:c=fe.md.sha256.create(),l=32;break;case W.oids.sha384:c=fe.md.sha384.create(),l=48;break;case W.oids.sha512:c=fe.md.sha512.create(),l=64;break;case W.oids.md5:c=fe.md.md5.create(),l=16;break}if(c===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+u);var d=new fe.util.ByteBuffer(r.macSalt),v="macIterations"in r?parseInt(fe.util.bytesToHex(r.macIterations),16):1,E=Co.generateKey(a,d,3,v,l,c),y=fe.hmac.create();y.start(c,E),y.update(o.value);var x=y.getMac();if(x.getBytes()!==r.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(e.value)&&e.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");return Bh(s,o.value,t,a),s};function _c(e){if(e.composed||e.constructed){for(var t=fe.util.createBuffer(),a=0;a<e.value.length;++a)t.putBytes(e.value[a].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function Bh(e,t,a,r){if(t=C.fromDer(t,a),t.tagClass!==C.Class.UNIVERSAL||t.type!==C.Type.SEQUENCE||t.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var n=0;n<t.value.length;n++){var i=t.value[n],s={},o=[];if(!C.validate(i,dl,s,o)){var c=new Error("Cannot read ContentInfo.");throw c.errors=o,c}var l={encrypted:!1},u=null,d=s.content.value[0];switch(C.derToOid(s.contentType)){case W.oids.data:if(d.tagClass!==C.Class.UNIVERSAL||d.type!==C.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");u=_c(d).value;break;case W.oids.encryptedData:u=wh(d,r),l.encrypted=!0;break;default:var c=new Error("Unsupported PKCS#12 contentType.");throw c.contentType=C.derToOid(s.contentType),c}l.safeBags=Nh(u,a,r),e.safeContents.push(l)}}function wh(e,t){var a={},r=[];if(!C.validate(e,fe.pkcs7.asn1.encryptedDataValidator,a,r)){var n=new Error("Cannot read EncryptedContentInfo.");throw n.errors=r,n}var i=C.derToOid(a.contentType);if(i!==W.oids.data){var n=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw n.oid=i,n}i=C.derToOid(a.encAlgorithm);var s=W.pbe.getCipher(i,a.encParameter,t),o=_c(a.encryptedContentAsn1),c=fe.util.createBuffer(o.value);if(s.update(c),!s.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return s.output.getBytes()}function Nh(e,t,a){if(!t&&e.length===0)return[];if(e=C.fromDer(e,t),e.tagClass!==C.Class.UNIVERSAL||e.type!==C.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var r=[],n=0;n<e.value.length;n++){var i=e.value[n],s={},o=[];if(!C.validate(i,bh,s,o)){var c=new Error("Cannot read SafeBag.");throw c.errors=o,c}var l={type:C.derToOid(s.bagId),attributes:_h(s.bagAttributes)};r.push(l);var u,d,v=s.bagValue.value[0];switch(l.type){case W.oids.pkcs8ShroudedKeyBag:if(v=W.decryptPrivateKeyInfo(v,a),v===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case W.oids.keyBag:try{l.key=W.privateKeyFromAsn1(v)}catch{l.key=null,l.asn1=v}continue;case W.oids.certBag:u=Ah,d=function(){if(C.derToOid(s.certId)!==W.oids.x509Certificate){var y=new Error("Unsupported certificate type, only X.509 supported.");throw y.oid=C.derToOid(s.certId),y}var x=C.fromDer(s.cert,t);try{l.cert=W.certificateFromAsn1(x,!0)}catch{l.cert=null,l.asn1=x}};break;default:var c=new Error("Unsupported PKCS#12 SafeBag type.");throw c.oid=l.type,c}if(u!==void 0&&!C.validate(v,u,s,o)){var c=new Error("Cannot read PKCS#12 "+u.name);throw c.errors=o,c}d()}return r}function _h(e){var t={};if(e!==void 0)for(var a=0;a<e.length;++a){var r={},n=[];if(!C.validate(e[a],Ih,r,n)){var i=new Error("Cannot read PKCS#12 BagAttribute.");throw i.errors=n,i}var s=C.derToOid(r.oid);if(W.oids[s]!==void 0){t[W.oids[s]]=[];for(var o=0;o<r.values.length;++o)t[W.oids[s]].push(r.values[o].value)}}return t}Co.toPkcs12Asn1=function(e,t,a,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||r.encAlgorithm||"aes128","useMac"in r||(r.useMac=!0),"localKeyId"in r||(r.localKeyId=null),"generateLocalKeyId"in r||(r.generateLocalKeyId=!0);var n=r.localKeyId,i;if(n!==null)n=fe.util.hexToBytes(n);else if(r.generateLocalKeyId)if(t){var s=fe.util.isArray(t)?t[0]:t;typeof s=="string"&&(s=W.certificateFromPem(s));var o=fe.md.sha1.create();o.update(C.toDer(W.certificateToAsn1(s)).getBytes()),n=o.digest().getBytes()}else n=fe.random.getBytes(20);var c=[];n!==null&&c.push(C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(W.oids.localKeyId).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.SET,!0,[C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,n)])])),"friendlyName"in r&&c.push(C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(W.oids.friendlyName).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.SET,!0,[C.create(C.Class.UNIVERSAL,C.Type.BMPSTRING,!1,r.friendlyName)])])),c.length>0&&(i=C.create(C.Class.UNIVERSAL,C.Type.SET,!0,c));var l=[],u=[];t!==null&&(fe.util.isArray(t)?u=t:u=[t]);for(var d=[],v=0;v<u.length;++v){t=u[v],typeof t=="string"&&(t=W.certificateFromPem(t));var E=v===0?i:void 0,y=W.certificateToAsn1(t),x=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(W.oids.certBag).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(W.oids.x509Certificate).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,C.toDer(y).getBytes())])])]),E]);d.push(x)}if(d.length>0){var b=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,d),A=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(W.oids.data).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,C.toDer(b).getBytes())])]);l.push(A)}var w=null;if(e!==null){var N=W.wrapRsaPrivateKey(W.privateKeyToAsn1(e));a===null?w=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(W.oids.keyBag).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[N]),i]):w=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(W.oids.pkcs8ShroudedKeyBag).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[W.encryptPrivateKeyInfo(N,a,r)]),i]);var M=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[w]),U=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(W.oids.data).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,C.toDer(M).getBytes())])]);l.push(U)}var L=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,l),z;if(r.useMac){var o=fe.md.sha1.create(),X=new fe.util.ByteBuffer(fe.random.getBytes(r.saltSize)),ne=r.count,e=Co.generateKey(a,X,3,ne,20),ie=fe.hmac.create();ie.start(o,e),ie.update(C.toDer(L).getBytes());var oe=ie.getMac();z=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(W.oids.sha1).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.NULL,!1,"")]),C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,oe.getBytes())]),C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,X.getBytes()),C.create(C.Class.UNIVERSAL,C.Type.INTEGER,!1,C.integerToDer(ne).getBytes())])}return C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.INTEGER,!1,C.integerToDer(3).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(W.oids.data).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,C.toDer(L).getBytes())])]),z])},Co.generateKey=fe.pbe.generatePkcs12Key;var Gt=j,Rc=Gt.asn1,vr=Gt.pki=Gt.pki||{};vr.pemToDer=function(e){var t=Gt.pem.decode(e)[0];if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Gt.util.createBuffer(t.body)},vr.privateKeyFromPem=function(e){var t=Gt.pem.decode(e)[0];if(t.type!=="PRIVATE KEY"&&t.type!=="RSA PRIVATE KEY"){var a=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var r=Rc.fromDer(t.body);return vr.privateKeyFromAsn1(r)},vr.privateKeyToPem=function(e,t){var a={type:"RSA PRIVATE KEY",body:Rc.toDer(vr.privateKeyToAsn1(e)).getBytes()};return Gt.pem.encode(a,{maxline:t})},vr.privateKeyInfoToPem=function(e,t){var a={type:"PRIVATE KEY",body:Rc.toDer(e).getBytes()};return Gt.pem.encode(a,{maxline:t})};var R=j,Qo=function(e,t,a,r){var n=R.util.createBuffer(),i=e.length>>1,s=i+(e.length&1),o=e.substr(0,s),c=e.substr(i,s),l=R.util.createBuffer(),u=R.hmac.create();a=t+a;var d=Math.ceil(r/16),v=Math.ceil(r/20);u.start("MD5",o);var E=R.util.createBuffer();l.putBytes(a);for(var y=0;y<d;++y)u.start(null,null),u.update(l.getBytes()),l.putBuffer(u.digest()),u.start(null,null),u.update(l.bytes()+a),E.putBuffer(u.digest());u.start("SHA1",c);var x=R.util.createBuffer();l.clear(),l.putBytes(a);for(var y=0;y<v;++y)u.start(null,null),u.update(l.getBytes()),l.putBuffer(u.digest()),u.start(null,null),u.update(l.bytes()+a),x.putBuffer(u.digest());return n.putBytes(R.util.xorBytes(E.getBytes(),x.getBytes(),r)),n},Rh=function(e,t,a){var r=R.hmac.create();r.start("SHA1",e);var n=R.util.createBuffer();return n.putInt32(t[0]),n.putInt32(t[1]),n.putByte(a.type),n.putByte(a.version.major),n.putByte(a.version.minor),n.putInt16(a.length),n.putBytes(a.fragment.bytes()),r.update(n.getBytes()),r.digest().getBytes()},kh=function(e,t,a){var r=!1;try{var n=e.deflate(t.fragment.getBytes());t.fragment=R.util.createBuffer(n),t.length=n.length,r=!0}catch{}return r},Lh=function(e,t,a){var r=!1;try{var n=e.inflate(t.fragment.getBytes());t.fragment=R.util.createBuffer(n),t.length=n.length,r=!0}catch{}return r},pt=function(e,t){var a=0;switch(t){case 1:a=e.getByte();break;case 2:a=e.getInt16();break;case 3:a=e.getInt24();break;case 4:a=e.getInt32();break}return R.util.createBuffer(e.getBytes(a))},Ct=function(e,t,a){e.putInt(a.length(),t<<3),e.putBuffer(a)},g={};g.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}},g.SupportedVersions=[g.Versions.TLS_1_1,g.Versions.TLS_1_0],g.Version=g.SupportedVersions[0],g.MaxFragment=15360,g.ConnectionEnd={server:0,client:1},g.PRFAlgorithm={tls_prf_sha256:0},g.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},g.CipherType={stream:0,block:1,aead:2},g.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},g.CompressionMethod={none:0,deflate:1},g.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},g.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},g.Alert={},g.Alert.Level={warning:1,fatal:2},g.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},g.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},g.CipherSuites={},g.getCipherSuite=function(e){var t=null;for(var a in g.CipherSuites){var r=g.CipherSuites[a];if(r.id[0]===e.charCodeAt(0)&&r.id[1]===e.charCodeAt(1)){t=r;break}}return t},g.handleUnexpected=function(e,t){var a=!e.open&&e.entity===g.ConnectionEnd.client;a||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unexpected_message}})},g.handleHelloRequest=function(e,t,a){!e.handshaking&&e.handshakes>0&&(g.queue(e,g.createAlert(e,{level:g.Alert.Level.warning,description:g.Alert.Description.no_renegotiation})),g.flush(e)),e.process()},g.parseHelloMessage=function(e,t,a){var r=null,n=e.entity===g.ConnectionEnd.client;if(a<38)e.error(e,{message:n?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});else{var i=t.fragment,s=i.length();if(r={version:{major:i.getByte(),minor:i.getByte()},random:R.util.createBuffer(i.getBytes(32)),session_id:pt(i,1),extensions:[]},n?(r.cipher_suite=i.getBytes(2),r.compression_method=i.getByte()):(r.cipher_suites=pt(i,2),r.compression_methods=pt(i,1)),s=a-(s-i.length()),s>0){for(var o=pt(i,2);o.length()>0;)r.extensions.push({type:[o.getByte(),o.getByte()],data:pt(o,2)});if(!n)for(var c=0;c<r.extensions.length;++c){var l=r.extensions[c];if(l.type[0]===0&&l.type[1]===0)for(var u=pt(l.data,2);u.length()>0;){var d=u.getByte();if(d!==0)break;e.session.extensions.server_name.serverNameList.push(pt(u,2).getBytes())}}}if(e.session.version&&(r.version.major!==e.session.version.major||r.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}});if(n)e.session.cipherSuite=g.getCipherSuite(r.cipher_suite);else for(var v=R.util.createBuffer(r.cipher_suites.bytes());v.length()>0&&(e.session.cipherSuite=g.getCipherSuite(v.getBytes(2)),e.session.cipherSuite===null););if(e.session.cipherSuite===null)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.handshake_failure},cipherSuite:R.util.bytesToHex(r.cipher_suite)});n?e.session.compressionMethod=r.compression_method:e.session.compressionMethod=g.CompressionMethod.none}return r},g.createSecurityParameters=function(e,t){var a=e.entity===g.ConnectionEnd.client,r=t.random.bytes(),n=a?e.session.sp.client_random:r,i=a?r:g.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:g.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:n,server_random:i}},g.handleServerHello=function(e,t,a){var r=g.parseHelloMessage(e,t,a);if(!e.fail){if(r.version.minor<=e.version.minor)e.version.minor=r.version.minor;else return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}});e.session.version=e.version;var n=r.session_id.bytes();n.length>0&&n===e.session.id?(e.expect=hl,e.session.resuming=!0,e.session.sp.server_random=r.random.bytes()):(e.expect=Uh,e.session.resuming=!1,g.createSecurityParameters(e,r)),e.session.id=n,e.process()}},g.handleClientHello=function(e,t,a){var r=g.parseHelloMessage(e,t,a);if(!e.fail){var n=r.session_id.bytes(),i=null;if(e.sessionCache&&(i=e.sessionCache.getSession(n),i===null?n="":(i.version.major!==r.version.major||i.version.minor>r.version.minor)&&(i=null,n="")),n.length===0&&(n=R.random.getBytes(32)),e.session.id=n,e.session.clientHelloVersion=r.version,e.session.sp={},i)e.version=e.session.version=i.version,e.session.sp=i.sp;else{for(var s,o=1;o<g.SupportedVersions.length&&(s=g.SupportedVersions[o],!(s.minor<=r.version.minor));++o);e.version={major:s.major,minor:s.minor},e.session.version=e.version}i!==null?(e.expect=Lc,e.session.resuming=!0,e.session.sp.client_random=r.random.bytes()):(e.expect=e.verifyClient!==!1?qh:kc,e.session.resuming=!1,g.createSecurityParameters(e,r)),e.open=!0,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerHello(e)})),e.session.resuming?(g.queue(e,g.createRecord(e,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),e.state.pending=g.createConnectionState(e),e.state.current.write=e.state.pending.write,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createFinished(e)}))):(g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificate(e)})),e.fail||(g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerKeyExchange(e)})),e.verifyClient!==!1&&g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificateRequest(e)})),g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerHelloDone(e)})))),g.flush(e),e.process()}},g.handleCertificate=function(e,t,a){if(a<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=t.fragment,n={certificate_list:pt(r,3)},i,s,o=[];try{for(;n.certificate_list.length()>0;)i=pt(n.certificate_list,3),s=R.asn1.fromDer(i),i=R.pki.certificateFromAsn1(s,!0),o.push(i)}catch(l){return e.error(e,{message:"Could not parse certificate list.",cause:l,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate}})}var c=e.entity===g.ConnectionEnd.client;(c||e.verifyClient===!0)&&o.length===0?e.error(e,{message:c?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}}):o.length===0?e.expect=c?pl:kc:(c?e.session.serverCertificate=o[0]:e.session.clientCertificate=o[0],g.verifyCertificateChain(e,o)&&(e.expect=c?pl:kc)),e.process()},g.handleServerKeyExchange=function(e,t,a){if(a>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unsupported_certificate}});e.expect=Ph,e.process()},g.handleClientKeyExchange=function(e,t,a){if(a<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unsupported_certificate}});var r=t.fragment,n={enc_pre_master_secret:pt(r,2).getBytes()},i=null;if(e.getPrivateKey)try{i=e.getPrivateKey(e,e.session.serverCertificate),i=R.pki.privateKeyFromPem(i)}catch(c){e.error(e,{message:"Could not get private key.",cause:c,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}})}if(i===null)return e.error(e,{message:"No private key set.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}});try{var s=e.session.sp;s.pre_master_secret=i.decrypt(n.enc_pre_master_secret);var o=e.session.clientHelloVersion;if(o.major!==s.pre_master_secret.charCodeAt(0)||o.minor!==s.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{s.pre_master_secret=R.random.getBytes(48)}e.expect=Lc,e.session.clientCertificate!==null&&(e.expect=Hh),e.process()},g.handleCertificateRequest=function(e,t,a){if(a<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=t.fragment,n={certificate_types:pt(r,1),certificate_authorities:pt(r,2)};e.session.certificateRequest=n,e.expect=Oh,e.process()},g.handleCertificateVerify=function(e,t,a){if(a<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=t.fragment;r.read-=4;var n=r.bytes();r.read+=4;var i={signature:pt(r,2).getBytes()},s=R.util.createBuffer();s.putBuffer(e.session.md5.digest()),s.putBuffer(e.session.sha1.digest()),s=s.getBytes();try{var o=e.session.clientCertificate;if(!o.publicKey.verify(s,i.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(n),e.session.sha1.update(n)}catch{return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.handshake_failure}})}e.expect=Lc,e.process()},g.handleServerHelloDone=function(e,t,a){if(a>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.record_overflow}});if(e.serverCertificate===null){var r={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.insufficient_security}},n=0,i=e.verify(e,r.alert.description,n,[]);if(i!==!0)return(i||i===0)&&(typeof i=="object"&&!R.util.isArray(i)?(i.message&&(r.message=i.message),i.alert&&(r.alert.description=i.alert)):typeof i=="number"&&(r.alert.description=i)),e.error(e,r)}e.session.certificateRequest!==null&&(t=g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificate(e)}),g.queue(e,t)),t=g.createRecord(e,{type:g.ContentType.handshake,data:g.createClientKeyExchange(e)}),g.queue(e,t),e.expect=Fh;var s=function(o,c){o.session.certificateRequest!==null&&o.session.clientCertificate!==null&&g.queue(o,g.createRecord(o,{type:g.ContentType.handshake,data:g.createCertificateVerify(o,c)})),g.queue(o,g.createRecord(o,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),o.state.pending=g.createConnectionState(o),o.state.current.write=o.state.pending.write,g.queue(o,g.createRecord(o,{type:g.ContentType.handshake,data:g.createFinished(o)})),o.expect=hl,g.flush(o),o.process()};if(e.session.certificateRequest===null||e.session.clientCertificate===null)return s(e,null);g.getClientSignature(e,s)},g.handleChangeCipherSpec=function(e,t){if(t.fragment.getByte()!==1)return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var a=e.entity===g.ConnectionEnd.client;(e.session.resuming&&a||!e.session.resuming&&!a)&&(e.state.pending=g.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&a||e.session.resuming&&!a)&&(e.state.pending=null),e.expect=a?Vh:Gh,e.process()},g.handleFinished=function(e,t,a){var r=t.fragment;r.read-=4;var n=r.bytes();r.read+=4;var i=t.fragment.getBytes();r=R.util.createBuffer(),r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest());var s=e.entity===g.ConnectionEnd.client,o=s?"server finished":"client finished",c=e.session.sp,l=12,u=Qo;if(r=u(c.master_secret,o,r.getBytes(),l),r.getBytes()!==i)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.decrypt_error}});e.session.md5.update(n),e.session.sha1.update(n),(e.session.resuming&&s||!e.session.resuming&&!s)&&(g.queue(e,g.createRecord(e,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createFinished(e)}))),e.expect=s?Mh:zh,e.handshaking=!1,++e.handshakes,e.peerCertificate=s?e.session.serverCertificate:e.session.clientCertificate,g.flush(e),e.isConnected=!0,e.connected(e),e.process()},g.handleAlert=function(e,t){var a=t.fragment,r={level:a.getByte(),description:a.getByte()},n;switch(r.description){case g.Alert.Description.close_notify:n="Connection closed.";break;case g.Alert.Description.unexpected_message:n="Unexpected message.";break;case g.Alert.Description.bad_record_mac:n="Bad record MAC.";break;case g.Alert.Description.decryption_failed:n="Decryption failed.";break;case g.Alert.Description.record_overflow:n="Record overflow.";break;case g.Alert.Description.decompression_failure:n="Decompression failed.";break;case g.Alert.Description.handshake_failure:n="Handshake failure.";break;case g.Alert.Description.bad_certificate:n="Bad certificate.";break;case g.Alert.Description.unsupported_certificate:n="Unsupported certificate.";break;case g.Alert.Description.certificate_revoked:n="Certificate revoked.";break;case g.Alert.Description.certificate_expired:n="Certificate expired.";break;case g.Alert.Description.certificate_unknown:n="Certificate unknown.";break;case g.Alert.Description.illegal_parameter:n="Illegal parameter.";break;case g.Alert.Description.unknown_ca:n="Unknown certificate authority.";break;case g.Alert.Description.access_denied:n="Access denied.";break;case g.Alert.Description.decode_error:n="Decode error.";break;case g.Alert.Description.decrypt_error:n="Decrypt error.";break;case g.Alert.Description.export_restriction:n="Export restriction.";break;case g.Alert.Description.protocol_version:n="Unsupported protocol version.";break;case g.Alert.Description.insufficient_security:n="Insufficient security.";break;case g.Alert.Description.internal_error:n="Internal error.";break;case g.Alert.Description.user_canceled:n="User canceled.";break;case g.Alert.Description.no_renegotiation:n="Renegotiation not supported.";break;default:n="Unknown error.";break}if(r.description===g.Alert.Description.close_notify)return e.close();e.error(e,{message:n,send:!1,origin:e.entity===g.ConnectionEnd.client?"server":"client",alert:r}),e.process()},g.handleHandshake=function(e,t){var a=t.fragment,r=a.getByte(),n=a.getInt24();if(n>a.length())return e.fragmented=t,t.fragment=R.util.createBuffer(),a.read-=4,e.process();e.fragmented=null,a.read-=4;var i=a.bytes(n+4);a.read+=4,r in Xo[e.entity][e.expect]?(e.entity===g.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:R.md.md5.create(),sha1:R.md.sha1.create()}),r!==g.HandshakeType.hello_request&&r!==g.HandshakeType.certificate_verify&&r!==g.HandshakeType.finished&&(e.session.md5.update(i),e.session.sha1.update(i)),Xo[e.entity][e.expect][r](e,t,n)):g.handleUnexpected(e,t)},g.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},g.handleHeartbeat=function(e,t){var a=t.fragment,r=a.getByte(),n=a.getInt16(),i=a.getBytes(n);if(r===g.HeartbeatMessageType.heartbeat_request){if(e.handshaking||n>i.length)return e.process();g.queue(e,g.createRecord(e,{type:g.ContentType.heartbeat,data:g.createHeartbeat(g.HeartbeatMessageType.heartbeat_response,i)})),g.flush(e)}else if(r===g.HeartbeatMessageType.heartbeat_response){if(i!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,R.util.createBuffer(i))}e.process()};var Dh=0,Uh=1,pl=2,Ph=3,Oh=4,hl=5,Vh=6,Mh=7,Fh=8,Kh=0,qh=1,kc=2,Hh=3,Lc=4,Gh=5,zh=6,h=g.handleUnexpected,gl=g.handleChangeCipherSpec,Ie=g.handleAlert,Ze=g.handleHandshake,vl=g.handleApplicationData,Ae=g.handleHeartbeat,Dc=[];Dc[g.ConnectionEnd.client]=[[h,Ie,Ze,h,Ae],[h,Ie,Ze,h,Ae],[h,Ie,Ze,h,Ae],[h,Ie,Ze,h,Ae],[h,Ie,Ze,h,Ae],[gl,Ie,h,h,Ae],[h,Ie,Ze,h,Ae],[h,Ie,Ze,vl,Ae],[h,Ie,Ze,h,Ae]],Dc[g.ConnectionEnd.server]=[[h,Ie,Ze,h,Ae],[h,Ie,Ze,h,Ae],[h,Ie,Ze,h,Ae],[h,Ie,Ze,h,Ae],[gl,Ie,h,h,Ae],[h,Ie,Ze,h,Ae],[h,Ie,Ze,vl,Ae],[h,Ie,Ze,h,Ae]];var zt=g.handleHelloRequest,$h=g.handleServerHello,yl=g.handleCertificate,ml=g.handleServerKeyExchange,Uc=g.handleCertificateRequest,jo=g.handleServerHelloDone,El=g.handleFinished,Xo=[];Xo[g.ConnectionEnd.client]=[[h,h,$h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[zt,h,h,h,h,h,h,h,h,h,h,yl,ml,Uc,jo,h,h,h,h,h,h],[zt,h,h,h,h,h,h,h,h,h,h,h,ml,Uc,jo,h,h,h,h,h,h],[zt,h,h,h,h,h,h,h,h,h,h,h,h,Uc,jo,h,h,h,h,h,h],[zt,h,h,h,h,h,h,h,h,h,h,h,h,h,jo,h,h,h,h,h,h],[zt,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[zt,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,El],[zt,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[zt,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h]];var Qh=g.handleClientHello,jh=g.handleClientKeyExchange,Xh=g.handleCertificateVerify;Xo[g.ConnectionEnd.server]=[[h,Qh,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,yl,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,jh,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,Xh,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,El],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h]],g.generateKeys=function(e,t){var a=Qo,r=t.client_random+t.server_random;e.session.resuming||(t.master_secret=a(t.pre_master_secret,"master secret",r,48).bytes(),t.pre_master_secret=null),r=t.server_random+t.client_random;var n=2*t.mac_key_length+2*t.enc_key_length,i=e.version.major===g.Versions.TLS_1_0.major&&e.version.minor===g.Versions.TLS_1_0.minor;i&&(n+=2*t.fixed_iv_length);var s=a(t.master_secret,"key expansion",r,n),o={client_write_MAC_key:s.getBytes(t.mac_key_length),server_write_MAC_key:s.getBytes(t.mac_key_length),client_write_key:s.getBytes(t.enc_key_length),server_write_key:s.getBytes(t.enc_key_length)};return i&&(o.client_write_IV=s.getBytes(t.fixed_iv_length),o.server_write_IV=s.getBytes(t.fixed_iv_length)),o},g.createConnectionState=function(e){var t=e.entity===g.ConnectionEnd.client,a=function(){var i={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(s){return!0},compressionState:null,compressFunction:function(s){return!0},updateSequenceNumber:function(){i.sequenceNumber[1]===4294967295?(i.sequenceNumber[1]=0,++i.sequenceNumber[0]):++i.sequenceNumber[1]}};return i},r={read:a(),write:a()};if(r.read.update=function(i,s){return r.read.cipherFunction(s,r.read)?r.read.compressFunction(i,s,r.read)||i.error(i,{message:"Could not decompress record.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.decompression_failure}}):i.error(i,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_record_mac}}),!i.fail},r.write.update=function(i,s){return r.write.compressFunction(i,s,r.write)?r.write.cipherFunction(s,r.write)||i.error(i,{message:"Could not encrypt record.",send:!1,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}):i.error(i,{message:"Could not compress record.",send:!1,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}),!i.fail},e.session){var n=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(n),n.keys=g.generateKeys(e,n),r.read.macKey=t?n.keys.server_write_MAC_key:n.keys.client_write_MAC_key,r.write.macKey=t?n.keys.client_write_MAC_key:n.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(r,e,n),n.compression_algorithm){case g.CompressionMethod.none:break;case g.CompressionMethod.deflate:r.read.compressFunction=Lh,r.write.compressFunction=kh;break;default:throw new Error("Unsupported compression algorithm.")}}return r},g.createRandom=function(){var e=new Date,t=+e+e.getTimezoneOffset()*6e4,a=R.util.createBuffer();return a.putInt32(t),a.putBytes(R.random.getBytes(28)),a},g.createRecord=function(e,t){if(!t.data)return null;var a={type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data};return a},g.createAlert=function(e,t){var a=R.util.createBuffer();return a.putByte(t.level),a.putByte(t.description),g.createRecord(e,{type:g.ContentType.alert,data:a})},g.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=R.util.createBuffer(),a=0;a<e.cipherSuites.length;++a){var r=e.cipherSuites[a];t.putByte(r.id[0]),t.putByte(r.id[1])}var n=t.length(),i=R.util.createBuffer();i.putByte(g.CompressionMethod.none);var s=i.length(),o=R.util.createBuffer();if(e.virtualHost){var c=R.util.createBuffer();c.putByte(0),c.putByte(0);var l=R.util.createBuffer();l.putByte(0),Ct(l,2,R.util.createBuffer(e.virtualHost));var u=R.util.createBuffer();Ct(u,2,l),Ct(c,2,u),o.putBuffer(c)}var d=o.length();d>0&&(d+=2);var v=e.session.id,E=v.length+1+2+4+28+2+n+1+s+d,y=R.util.createBuffer();return y.putByte(g.HandshakeType.client_hello),y.putInt24(E),y.putByte(e.version.major),y.putByte(e.version.minor),y.putBytes(e.session.sp.client_random),Ct(y,1,R.util.createBuffer(v)),Ct(y,2,t),Ct(y,1,i),d>0&&Ct(y,2,o),y},g.createServerHello=function(e){var t=e.session.id,a=t.length+1+2+4+28+2+1,r=R.util.createBuffer();return r.putByte(g.HandshakeType.server_hello),r.putInt24(a),r.putByte(e.version.major),r.putByte(e.version.minor),r.putBytes(e.session.sp.server_random),Ct(r,1,R.util.createBuffer(t)),r.putByte(e.session.cipherSuite.id[0]),r.putByte(e.session.cipherSuite.id[1]),r.putByte(e.session.compressionMethod),r},g.createCertificate=function(e){var t=e.entity===g.ConnectionEnd.client,a=null;if(e.getCertificate){var r;t?r=e.session.certificateRequest:r=e.session.extensions.server_name.serverNameList,a=e.getCertificate(e,r)}var n=R.util.createBuffer();if(a!==null)try{R.util.isArray(a)||(a=[a]);for(var i=null,s=0;s<a.length;++s){var o=R.pem.decode(a[s])[0];if(o.type!=="CERTIFICATE"&&o.type!=="X509 CERTIFICATE"&&o.type!=="TRUSTED CERTIFICATE"){var c=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw c.headerType=o.type,c}if(o.procType&&o.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var l=R.util.createBuffer(o.body);i===null&&(i=R.asn1.fromDer(l.bytes(),!1));var u=R.util.createBuffer();Ct(u,3,l),n.putBuffer(u)}a=R.pki.certificateFromAsn1(i),t?e.session.clientCertificate=a:e.session.serverCertificate=a}catch(E){return e.error(e,{message:"Could not send certificate list.",cause:E,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate}})}var d=3+n.length(),v=R.util.createBuffer();return v.putByte(g.HandshakeType.certificate),v.putInt24(d),Ct(v,3,n),v},g.createClientKeyExchange=function(e){var t=R.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(R.random.getBytes(46));var a=e.session.sp;a.pre_master_secret=t.getBytes();var r=e.session.serverCertificate.publicKey;t=r.encrypt(a.pre_master_secret);var n=t.length+2,i=R.util.createBuffer();return i.putByte(g.HandshakeType.client_key_exchange),i.putInt24(n),i.putInt16(t.length),i.putBytes(t),i},g.createServerKeyExchange=function(e){var t=R.util.createBuffer();return t},g.getClientSignature=function(e,t){var a=R.util.createBuffer();a.putBuffer(e.session.md5.digest()),a.putBuffer(e.session.sha1.digest()),a=a.getBytes(),e.getSignature=e.getSignature||function(r,n,i){var s=null;if(r.getPrivateKey)try{s=r.getPrivateKey(r,r.session.clientCertificate),s=R.pki.privateKeyFromPem(s)}catch(o){r.error(r,{message:"Could not get private key.",cause:o,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}})}s===null?r.error(r,{message:"No private key set.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}):n=s.sign(n,null),i(r,n)},e.getSignature(e,a,t)},g.createCertificateVerify=function(e,t){var a=t.length+2,r=R.util.createBuffer();return r.putByte(g.HandshakeType.certificate_verify),r.putInt24(a),r.putInt16(t.length),r.putBytes(t),r},g.createCertificateRequest=function(e){var t=R.util.createBuffer();t.putByte(1);var a=R.util.createBuffer();for(var r in e.caStore.certs){var n=e.caStore.certs[r],i=R.pki.distinguishedNameToAsn1(n.subject),s=R.asn1.toDer(i);a.putInt16(s.length()),a.putBuffer(s)}var o=1+t.length()+2+a.length(),c=R.util.createBuffer();return c.putByte(g.HandshakeType.certificate_request),c.putInt24(o),Ct(c,1,t),Ct(c,2,a),c},g.createServerHelloDone=function(e){var t=R.util.createBuffer();return t.putByte(g.HandshakeType.server_hello_done),t.putInt24(0),t},g.createChangeCipherSpec=function(){var e=R.util.createBuffer();return e.putByte(1),e},g.createFinished=function(e){var t=R.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var a=e.entity===g.ConnectionEnd.client,r=e.session.sp,n=12,i=Qo,s=a?"client finished":"server finished";t=i(r.master_secret,s,t.getBytes(),n);var o=R.util.createBuffer();return o.putByte(g.HandshakeType.finished),o.putInt24(t.length()),o.putBuffer(t),o},g.createHeartbeat=function(e,t,a){typeof a>"u"&&(a=t.length);var r=R.util.createBuffer();r.putByte(e),r.putInt16(a),r.putBytes(t);var n=r.length(),i=Math.max(16,n-a-3);return r.putBytes(R.random.getBytes(i)),r},g.queue=function(e,t){if(t&&!(t.fragment.length()===0&&(t.type===g.ContentType.handshake||t.type===g.ContentType.alert||t.type===g.ContentType.change_cipher_spec))){if(t.type===g.ContentType.handshake){var a=t.fragment.bytes();e.session.md5.update(a),e.session.sha1.update(a),a=null}var r;if(t.fragment.length()<=g.MaxFragment)r=[t];else{r=[];for(var n=t.fragment.bytes();n.length>g.MaxFragment;)r.push(g.createRecord(e,{type:t.type,data:R.util.createBuffer(n.slice(0,g.MaxFragment))})),n=n.slice(g.MaxFragment);n.length>0&&r.push(g.createRecord(e,{type:t.type,data:R.util.createBuffer(n)}))}for(var i=0;i<r.length&&!e.fail;++i){var s=r[i],o=e.state.current.write;o.update(e,s)&&e.records.push(s)}}},g.flush=function(e){for(var t=0;t<e.records.length;++t){var a=e.records[t];e.tlsData.putByte(a.type),e.tlsData.putByte(a.version.major),e.tlsData.putByte(a.version.minor),e.tlsData.putInt16(a.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var Pc=function(e){switch(e){case!0:return!0;case R.pki.certificateError.bad_certificate:return g.Alert.Description.bad_certificate;case R.pki.certificateError.unsupported_certificate:return g.Alert.Description.unsupported_certificate;case R.pki.certificateError.certificate_revoked:return g.Alert.Description.certificate_revoked;case R.pki.certificateError.certificate_expired:return g.Alert.Description.certificate_expired;case R.pki.certificateError.certificate_unknown:return g.Alert.Description.certificate_unknown;case R.pki.certificateError.unknown_ca:return g.Alert.Description.unknown_ca;default:return g.Alert.Description.bad_certificate}},Yh=function(e){switch(e){case!0:return!0;case g.Alert.Description.bad_certificate:return R.pki.certificateError.bad_certificate;case g.Alert.Description.unsupported_certificate:return R.pki.certificateError.unsupported_certificate;case g.Alert.Description.certificate_revoked:return R.pki.certificateError.certificate_revoked;case g.Alert.Description.certificate_expired:return R.pki.certificateError.certificate_expired;case g.Alert.Description.certificate_unknown:return R.pki.certificateError.certificate_unknown;case g.Alert.Description.unknown_ca:return R.pki.certificateError.unknown_ca;default:return R.pki.certificateError.bad_certificate}};g.verifyCertificateChain=function(e,t){try{var a={};for(var r in e.verifyOptions)a[r]=e.verifyOptions[r];a.verify=function(i,s,o){var c=Pc(i),l=e.verify(e,i,s,o);if(l!==!0){if(typeof l=="object"&&!R.util.isArray(l)){var u=new Error("The application rejected the certificate.");throw u.send=!0,u.alert={level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate},l.message&&(u.message=l.message),l.alert&&(u.alert.description=l.alert),u}l!==i&&(l=Yh(l))}return l},R.pki.verifyCertificateChain(e.caStore,t,a)}catch(i){var n=i;(typeof n!="object"||R.util.isArray(n))&&(n={send:!0,alert:{level:g.Alert.Level.fatal,description:Pc(i)}}),"send"in n||(n.send=!0),"alert"in n||(n.alert={level:g.Alert.Level.fatal,description:Pc(n.error)}),e.error(e,n)}return!e.fail},g.createSessionCache=function(e,t){var a=null;if(e&&e.getSession&&e.setSession&&e.order)a=e;else{a={},a.cache=e||{},a.capacity=Math.max(t||100,1),a.order=[];for(var r in e)a.order.length<=t?a.order.push(r):delete e[r];a.getSession=function(n){var i=null,s=null;if(n?s=R.util.bytesToHex(n):a.order.length>0&&(s=a.order[0]),s!==null&&s in a.cache){i=a.cache[s],delete a.cache[s];for(var o in a.order)if(a.order[o]===s){a.order.splice(o,1);break}}return i},a.setSession=function(n,i){if(a.order.length===a.capacity){var s=a.order.shift();delete a.cache[s]}var s=R.util.bytesToHex(n);a.order.push(s),a.cache[s]=i}}return a},g.createConnection=function(e){var t=null;e.caStore?R.util.isArray(e.caStore)?t=R.pki.createCaStore(e.caStore):t=e.caStore:t=R.pki.createCaStore();var a=e.cipherSuites||null;if(a===null){a=[];for(var r in g.CipherSuites)a.push(g.CipherSuites[r])}var n=e.server?g.ConnectionEnd.server:g.ConnectionEnd.client,i=e.sessionCache?g.createSessionCache(e.sessionCache):null,s={version:{major:g.Version.major,minor:g.Version.minor},entity:n,sessionId:e.sessionId,caStore:t,sessionCache:i,cipherSuites:a,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(u,d,v,E){return d},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:R.util.createBuffer(),tlsData:R.util.createBuffer(),data:R.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(u,d){d.origin=d.origin||(u.entity===g.ConnectionEnd.client?"client":"server"),d.send&&(g.queue(u,g.createAlert(u,d.alert)),g.flush(u));var v=d.fatal!==!1;v&&(u.fail=!0),e.error(u,d),v&&u.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};s.reset=function(u){s.version={major:g.Version.major,minor:g.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=s.entity===g.ConnectionEnd.client?Dh:Kh,s.fragmented=null,s.records=[],s.open=!1,s.handshakes=0,s.handshaking=!1,s.isConnected=!1,s.fail=!(u||typeof u>"u"),s.input.clear(),s.tlsData.clear(),s.data.clear(),s.state.current=g.createConnectionState(s)},s.reset();var o=function(u,d){var v=d.type-g.ContentType.change_cipher_spec,E=Dc[u.entity][u.expect];v in E?E[v](u,d):g.handleUnexpected(u,d)},c=function(u){var d=0,v=u.input,E=v.length();if(E<5)d=5-E;else{u.record={type:v.getByte(),version:{major:v.getByte(),minor:v.getByte()},length:v.getInt16(),fragment:R.util.createBuffer(),ready:!1};var y=u.record.version.major===u.version.major;y&&u.session&&u.session.version&&(y=u.record.version.minor===u.version.minor),y||u.error(u,{message:"Incompatible TLS version.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}})}return d},l=function(u){var d=0,v=u.input,E=v.length();if(E<u.record.length)d=u.record.length-E;else{u.record.fragment.putBytes(v.getBytes(u.record.length)),v.compact();var y=u.state.current.read;y.update(u,u.record)&&(u.fragmented!==null&&(u.fragmented.type===u.record.type?(u.fragmented.fragment.putBuffer(u.record.fragment),u.record=u.fragmented):u.error(u,{message:"Invalid fragmented record.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unexpected_message}})),u.record.ready=!0)}return d};return s.handshake=function(u){if(s.entity!==g.ConnectionEnd.client)s.error(s,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(s.handshaking)s.error(s,{message:"Handshake already in progress.",fatal:!1});else{s.fail&&!s.open&&s.handshakes===0&&(s.fail=!1),s.handshaking=!0,u=u||"";var d=null;u.length>0&&(s.sessionCache&&(d=s.sessionCache.getSession(u)),d===null&&(u="")),u.length===0&&s.sessionCache&&(d=s.sessionCache.getSession(),d!==null&&(u=d.id)),s.session={id:u,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:R.md.md5.create(),sha1:R.md.sha1.create()},d&&(s.version=d.version,s.session.sp=d.sp),s.session.sp.client_random=g.createRandom().getBytes(),s.open=!0,g.queue(s,g.createRecord(s,{type:g.ContentType.handshake,data:g.createClientHello(s)})),g.flush(s)}},s.process=function(u){var d=0;return u&&s.input.putBytes(u),s.fail||(s.record!==null&&s.record.ready&&s.record.fragment.isEmpty()&&(s.record=null),s.record===null&&(d=c(s)),!s.fail&&s.record!==null&&!s.record.ready&&(d=l(s)),!s.fail&&s.record!==null&&s.record.ready&&o(s,s.record)),d},s.prepare=function(u){return g.queue(s,g.createRecord(s,{type:g.ContentType.application_data,data:R.util.createBuffer(u)})),g.flush(s)},s.prepareHeartbeatRequest=function(u,d){return u instanceof R.util.ByteBuffer&&(u=u.bytes()),typeof d>"u"&&(d=u.length),s.expectedHeartbeatPayload=u,g.queue(s,g.createRecord(s,{type:g.ContentType.heartbeat,data:g.createHeartbeat(g.HeartbeatMessageType.heartbeat_request,u,d)})),g.flush(s)},s.close=function(u){if(!s.fail&&s.sessionCache&&s.session){var d={id:s.session.id,version:s.session.version,sp:s.session.sp};d.sp.keys=null,s.sessionCache.setSession(d.id,d)}s.open&&(s.open=!1,s.input.clear(),(s.isConnected||s.handshaking)&&(s.isConnected=s.handshaking=!1,g.queue(s,g.createAlert(s,{level:g.Alert.Level.warning,description:g.Alert.Description.close_notify})),g.flush(s)),s.closed(s)),s.reset(u)},s},R.tls=R.tls||{};for(var Oc in g)typeof g[Oc]!="function"&&(R.tls[Oc]=g[Oc]);R.tls.prf_tls1=Qo,R.tls.hmac_sha1=Rh,R.tls.createSessionCache=g.createSessionCache,R.tls.createConnection=g.createConnection;var $t=j,xt=$t.tls;xt.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=xt.BulkCipherAlgorithm.aes,e.cipher_type=xt.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=xt.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:Cl},xt.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=xt.BulkCipherAlgorithm.aes,e.cipher_type=xt.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=xt.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:Cl};function Cl(e,t,a){var r=t.entity===$t.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:$t.cipher.createDecipher("AES-CBC",r?a.keys.server_write_key:a.keys.client_write_key),iv:r?a.keys.server_write_IV:a.keys.client_write_IV},e.write.cipherState={init:!1,cipher:$t.cipher.createCipher("AES-CBC",r?a.keys.client_write_key:a.keys.server_write_key),iv:r?a.keys.client_write_IV:a.keys.server_write_IV},e.read.cipherFunction=eg,e.write.cipherFunction=Wh,e.read.macLength=e.write.macLength=a.mac_length,e.read.macFunction=e.write.macFunction=xt.hmac_sha1}function Wh(e,t){var a=!1,r=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(r),t.updateSequenceNumber();var n;e.version.minor===xt.Versions.TLS_1_0.minor?n=t.cipherState.init?null:t.cipherState.iv:n=$t.random.getBytesSync(16),t.cipherState.init=!0;var i=t.cipherState.cipher;return i.start({iv:n}),e.version.minor>=xt.Versions.TLS_1_1.minor&&i.output.putBytes(n),i.update(e.fragment),i.finish(Zh)&&(e.fragment=i.output,e.length=e.fragment.length(),a=!0),a}function Zh(e,t,a){if(!a){var r=e-t.length()%e;t.fillWithByte(r-1,r)}return!0}function Jh(e,t,a){var r=!0;if(a){for(var n=t.length(),i=t.last(),s=n-1-i;s<n-1;++s)r=r&&t.at(s)==i;r&&t.truncate(i+1)}return r}function eg(e,t){var a=!1,r;e.version.minor===xt.Versions.TLS_1_0.minor?r=t.cipherState.init?null:t.cipherState.iv:r=e.fragment.getBytes(16),t.cipherState.init=!0;var n=t.cipherState.cipher;n.start({iv:r}),n.update(e.fragment),a=n.finish(Jh);var i=t.macLength,s=$t.random.getBytesSync(i),o=n.output.length();o>=i?(e.fragment=n.output.getBytes(o-i),s=n.output.getBytes(i)):e.fragment=n.output.getBytes(),e.fragment=$t.util.createBuffer(e.fragment),e.length=e.fragment.length();var c=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),a=tg(t.macKey,s,c)&&a,a}function tg(e,t,a){var r=$t.hmac.create();return r.start("SHA1",e),r.update(t),t=r.digest().getBytes(),r.start(null,null),r.update(a),a=r.digest().getBytes(),t===a}var pe=j,So=pe.sha512=pe.sha512||{};pe.md.sha512=pe.md.algorithms.sha512=So;var xl=pe.sha384=pe.sha512.sha384=pe.sha512.sha384||{};xl.create=function(){return So.create("SHA-384")},pe.md.sha384=pe.md.algorithms.sha384=xl,pe.sha512.sha256=pe.sha512.sha256||{create:function(){return So.create("SHA-512/256")}},pe.md["sha512/256"]=pe.md.algorithms["sha512/256"]=pe.sha512.sha256,pe.sha512.sha224=pe.sha512.sha224||{create:function(){return So.create("SHA-512/224")}},pe.md["sha512/224"]=pe.md.algorithms["sha512/224"]=pe.sha512.sha224,So.create=function(e){if(Sl||rg(),typeof e>"u"&&(e="SHA-512"),!(e in nr))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=nr[e],a=null,r=pe.util.createBuffer(),n=new Array(80),i=0;i<80;++i)n[i]=new Array(2);var s=64;switch(e){case"SHA-384":s=48;break;case"SHA-512/256":s=32;break;case"SHA-512/224":s=28;break}var o={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:s,messageLength:0,fullMessageLength:null,messageLengthSize:16};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength128=[];for(var c=o.messageLengthSize/4,l=0;l<c;++l)o.fullMessageLength.push(0);r=pe.util.createBuffer(),a=new Array(t.length);for(var l=0;l<t.length;++l)a[l]=t[l].slice(0);return o},o.start(),o.update=function(c,l){l==="utf8"&&(c=pe.util.encodeUtf8(c));var u=c.length;o.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var d=o.fullMessageLength.length-1;d>=0;--d)o.fullMessageLength[d]+=u[1],u[1]=u[0]+(o.fullMessageLength[d]/4294967296>>>0),o.fullMessageLength[d]=o.fullMessageLength[d]>>>0,u[0]=u[1]/4294967296>>>0;return r.putBytes(c),Tl(a,n,r),(r.read>2048||r.length()===0)&&r.compact(),o},o.digest=function(){var c=pe.util.createBuffer();c.putBytes(r.bytes());var l=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,u=l&o.blockLength-1;c.putBytes(Vc.substr(0,o.blockLength-u));for(var d,v,E=o.fullMessageLength[0]*8,y=0;y<o.fullMessageLength.length-1;++y)d=o.fullMessageLength[y+1]*8,v=d/4294967296>>>0,E+=v,c.putInt32(E>>>0),E=d>>>0;c.putInt32(E);for(var x=new Array(a.length),y=0;y<a.length;++y)x[y]=a[y].slice(0);Tl(x,n,c);var b=pe.util.createBuffer(),A;e==="SHA-512"?A=x.length:e==="SHA-384"?A=x.length-2:A=x.length-4;for(var y=0;y<A;++y)b.putInt32(x[y][0]),(y!==A-1||e!=="SHA-512/224")&&b.putInt32(x[y][1]);return b},o};var Vc=null,Sl=!1,Mc=null,nr=null;function rg(){Vc="\x80",Vc+=pe.util.fillString("\0",128),Mc=[[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]],nr={},nr["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],nr["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],nr["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],nr["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],Sl=!0}function Tl(e,t,a){for(var r,n,i,s,o,c,l,u,d,v,E,y,x,b,A,w,N,M,U,L,z,X,ne,ie,oe,ge,ft,gt,ce,ye,K,Xt,ir,me,Ee,xe=a.length();xe>=128;){for(ce=0;ce<16;++ce)t[ce][0]=a.getInt32()>>>0,t[ce][1]=a.getInt32()>>>0;for(;ce<80;++ce)Xt=t[ce-2],ye=Xt[0],K=Xt[1],r=((ye>>>19|K<<13)^(K>>>29|ye<<3)^ye>>>6)>>>0,n=((ye<<13|K>>>19)^(K<<3|ye>>>29)^(ye<<26|K>>>6))>>>0,me=t[ce-15],ye=me[0],K=me[1],i=((ye>>>1|K<<31)^(ye>>>8|K<<24)^ye>>>7)>>>0,s=((ye<<31|K>>>1)^(ye<<24|K>>>8)^(ye<<25|K>>>7))>>>0,ir=t[ce-7],Ee=t[ce-16],K=n+ir[1]+s+Ee[1],t[ce][0]=r+ir[0]+i+Ee[0]+(K/4294967296>>>0)>>>0,t[ce][1]=K>>>0;for(x=e[0][0],b=e[0][1],A=e[1][0],w=e[1][1],N=e[2][0],M=e[2][1],U=e[3][0],L=e[3][1],z=e[4][0],X=e[4][1],ne=e[5][0],ie=e[5][1],oe=e[6][0],ge=e[6][1],ft=e[7][0],gt=e[7][1],ce=0;ce<80;++ce)l=((z>>>14|X<<18)^(z>>>18|X<<14)^(X>>>9|z<<23))>>>0,u=((z<<18|X>>>14)^(z<<14|X>>>18)^(X<<23|z>>>9))>>>0,d=(oe^z&(ne^oe))>>>0,v=(ge^X&(ie^ge))>>>0,o=((x>>>28|b<<4)^(b>>>2|x<<30)^(b>>>7|x<<25))>>>0,c=((x<<4|b>>>28)^(b<<30|x>>>2)^(b<<25|x>>>7))>>>0,E=(x&A|N&(x^A))>>>0,y=(b&w|M&(b^w))>>>0,K=gt+u+v+Mc[ce][1]+t[ce][1],r=ft+l+d+Mc[ce][0]+t[ce][0]+(K/4294967296>>>0)>>>0,n=K>>>0,K=c+y,i=o+E+(K/4294967296>>>0)>>>0,s=K>>>0,ft=oe,gt=ge,oe=ne,ge=ie,ne=z,ie=X,K=L+n,z=U+r+(K/4294967296>>>0)>>>0,X=K>>>0,U=N,L=M,N=A,M=w,A=x,w=b,K=n+s,x=r+i+(K/4294967296>>>0)>>>0,b=K>>>0;K=e[0][1]+b,e[0][0]=e[0][0]+x+(K/4294967296>>>0)>>>0,e[0][1]=K>>>0,K=e[1][1]+w,e[1][0]=e[1][0]+A+(K/4294967296>>>0)>>>0,e[1][1]=K>>>0,K=e[2][1]+M,e[2][0]=e[2][0]+N+(K/4294967296>>>0)>>>0,e[2][1]=K>>>0,K=e[3][1]+L,e[3][0]=e[3][0]+U+(K/4294967296>>>0)>>>0,e[3][1]=K>>>0,K=e[4][1]+X,e[4][0]=e[4][0]+z+(K/4294967296>>>0)>>>0,e[4][1]=K>>>0,K=e[5][1]+ie,e[5][0]=e[5][0]+ne+(K/4294967296>>>0)>>>0,e[5][1]=K>>>0,K=e[6][1]+ge,e[6][0]=e[6][0]+oe+(K/4294967296>>>0)>>>0,e[6][1]=K>>>0,K=e[7][1]+gt,e[7][0]=e[7][0]+ft+(K/4294967296>>>0)>>>0,e[7][1]=K>>>0,xe-=128}}var Fc={},ag=j,be=ag.asn1;Fc.privateKeyValidator={name:"PrivateKeyInfo",tagClass:be.Class.UNIVERSAL,type:be.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:be.Class.UNIVERSAL,type:be.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:be.Class.UNIVERSAL,type:be.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:be.Class.UNIVERSAL,type:be.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:be.Class.UNIVERSAL,type:be.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},Fc.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:be.Class.UNIVERSAL,type:be.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:be.Class.UNIVERSAL,type:be.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:be.Class.UNIVERSAL,type:be.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:be.Class.UNIVERSAL,type:be.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]};var Be=j,bl=Fc,ng=bl.publicKeyValidator,sg=bl.privateKeyValidator;if(typeof ig>"u")var ig=Be.jsbn.BigInteger;var Kc=Be.util.ByteBuffer,ut=typeof Buffer>"u"?Uint8Array:Buffer;Be.pki=Be.pki||{},Be.pki.ed25519=Be.ed25519=Be.ed25519||{};var Z=Be.ed25519;Z.constants={},Z.constants.PUBLIC_KEY_BYTE_LENGTH=32,Z.constants.PRIVATE_KEY_BYTE_LENGTH=64,Z.constants.SEED_BYTE_LENGTH=32,Z.constants.SIGN_BYTE_LENGTH=64,Z.constants.HASH_BYTE_LENGTH=64,Z.generateKeyPair=function(e){e=e||{};var t=e.seed;if(t===void 0)t=Be.random.getBytesSync(Z.constants.SEED_BYTE_LENGTH);else if(typeof t=="string"){if(t.length!==Z.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Z.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=Ot({message:t,encoding:"binary"});for(var a=new ut(Z.constants.PUBLIC_KEY_BYTE_LENGTH),r=new ut(Z.constants.PRIVATE_KEY_BYTE_LENGTH),n=0;n<32;++n)r[n]=t[n];return ug(a,r),{publicKey:a,privateKey:r}},Z.privateKeyFromAsn1=function(e){var t={},a=[],r=Be.asn1.validate(e,sg,t,a);if(!r){var n=new Error("Invalid Key.");throw n.errors=a,n}var i=Be.asn1.derToOid(t.privateKeyOid),s=Be.oids.EdDSA25519;if(i!==s)throw new Error('Invalid OID "'+i+'"; OID must be "'+s+'".');var o=t.privateKey,c=Ot({message:Be.asn1.fromDer(o).value,encoding:"binary"});return{privateKeyBytes:c}},Z.publicKeyFromAsn1=function(e){var t={},a=[],r=Be.asn1.validate(e,ng,t,a);if(!r){var n=new Error("Invalid Key.");throw n.errors=a,n}var i=Be.asn1.derToOid(t.publicKeyOid),s=Be.oids.EdDSA25519;if(i!==s)throw new Error('Invalid OID "'+i+'"; OID must be "'+s+'".');var o=t.ed25519PublicKey;if(o.length!==Z.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return Ot({message:o,encoding:"binary"})},Z.publicKeyFromPrivateKey=function(e){e=e||{};var t=Ot({message:e.privateKey,encoding:"binary"});if(t.length!==Z.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Z.constants.PRIVATE_KEY_BYTE_LENGTH);for(var a=new ut(Z.constants.PUBLIC_KEY_BYTE_LENGTH),r=0;r<a.length;++r)a[r]=t[32+r];return a},Z.sign=function(e){e=e||{};var t=Ot(e),a=Ot({message:e.privateKey,encoding:"binary"});if(a.length===Z.constants.SEED_BYTE_LENGTH){var r=Z.generateKeyPair({seed:a});a=r.privateKey}else if(a.length!==Z.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Z.constants.SEED_BYTE_LENGTH+" or "+Z.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new ut(Z.constants.SIGN_BYTE_LENGTH+t.length);fg(n,t,t.length,a);for(var i=new ut(Z.constants.SIGN_BYTE_LENGTH),s=0;s<i.length;++s)i[s]=n[s];return i},Z.verify=function(e){e=e||{};var t=Ot(e);if(e.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var a=Ot({message:e.signature,encoding:"binary"});if(a.length!==Z.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+Z.constants.SIGN_BYTE_LENGTH);var r=Ot({message:e.publicKey,encoding:"binary"});if(r.length!==Z.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+Z.constants.PUBLIC_KEY_BYTE_LENGTH);var n=new ut(Z.constants.SIGN_BYTE_LENGTH+t.length),i=new ut(Z.constants.SIGN_BYTE_LENGTH+t.length),s;for(s=0;s<Z.constants.SIGN_BYTE_LENGTH;++s)n[s]=a[s];for(s=0;s<t.length;++s)n[s+Z.constants.SIGN_BYTE_LENGTH]=t[s];return dg(i,n,n.length,r)>=0};function Ot(e){var t=e.message;if(t instanceof Uint8Array||t instanceof ut)return t;var a=e.encoding;if(t===void 0)if(e.md)t=e.md.digest().getBytes(),a="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof t=="string"&&!a)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof t=="string"){if(typeof Buffer<"u")return Buffer.from(t,a);t=new Kc(t,a)}else if(!(t instanceof Kc))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var r=new ut(t.length()),n=0;n<r.length;++n)r[n]=t.at(n);return r}var qc=G(),Yo=G([1]),og=G([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),cg=G([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),Il=G([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Al=G([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),To=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),lg=G([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function bo(e,t){var a=Be.md.sha512.create(),r=new Kc(e);a.update(r.getBytes(t),"binary");var n=a.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(n,"binary");for(var i=new ut(Z.constants.HASH_BYTE_LENGTH),s=0;s<64;++s)i[s]=n.charCodeAt(s);return i}function ug(e,t){var a=[G(),G(),G(),G()],r,n=bo(t,32);for(n[0]&=248,n[31]&=127,n[31]|=64,$c(a,n),zc(e,a),r=0;r<32;++r)t[r+32]=e[r];return 0}function fg(e,t,a,r){var n,i,s=new Float64Array(64),o=[G(),G(),G(),G()],c=bo(r,32);c[0]&=248,c[31]&=127,c[31]|=64;var l=a+64;for(n=0;n<a;++n)e[64+n]=t[n];for(n=0;n<32;++n)e[32+n]=c[32+n];var u=bo(e.subarray(32),a+32);for(Hc(u),$c(o,u),zc(e,o),n=32;n<64;++n)e[n]=r[n];var d=bo(e,a+64);for(Hc(d),n=32;n<64;++n)s[n]=0;for(n=0;n<32;++n)s[n]=u[n];for(n=0;n<32;++n)for(i=0;i<32;i++)s[n+i]+=d[n]*c[i];return Bl(e.subarray(32),s),l}function dg(e,t,a,r){var n,i,s=new ut(32),o=[G(),G(),G(),G()],c=[G(),G(),G(),G()];if(i=-1,a<64||hg(c,r)||!pg(t,32))return-1;for(n=0;n<a;++n)e[n]=t[n];for(n=0;n<32;++n)e[n+32]=r[n];var l=bo(e,a);if(Hc(l),kl(o,c,l),$c(c,t.subarray(32)),Gc(o,c),zc(s,o),a-=64,_l(t,0,s,0)){for(n=0;n<a;++n)e[n]=0;return-1}for(n=0;n<a;++n)e[n]=t[n+64];return i=a,i}function pg(e,t){var a;for(a=31;a>=0;--a){if(e[t+a]<To[a])return!0;if(e[t+a]>To[a])return!1}return!1}function Bl(e,t){var a,r,n,i;for(r=63;r>=32;--r){for(a=0,n=r-32,i=r-12;n<i;++n)t[n]+=a-16*t[r]*To[n-(r-32)],a=t[n]+128>>8,t[n]-=a*256;t[n]+=a,t[r]=0}for(a=0,n=0;n<32;++n)t[n]+=a-(t[31]>>4)*To[n],a=t[n]>>8,t[n]&=255;for(n=0;n<32;++n)t[n]-=a*To[n];for(r=0;r<32;++r)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function Hc(e){for(var t=new Float64Array(64),a=0;a<64;++a)t[a]=e[a],e[a]=0;Bl(e,t)}function Gc(e,t){var a=G(),r=G(),n=G(),i=G(),s=G(),o=G(),c=G(),l=G(),u=G();mr(a,e[1],e[0]),mr(u,t[1],t[0]),le(a,a,u),yr(r,e[0],e[1]),yr(u,t[0],t[1]),le(r,r,u),le(n,e[3],t[3]),le(n,n,cg),le(i,e[2],t[2]),yr(i,i,i),mr(s,r,a),mr(o,i,n),yr(c,i,n),yr(l,r,a),le(e[0],s,o),le(e[1],l,c),le(e[2],c,o),le(e[3],s,l)}function wl(e,t,a){for(var r=0;r<4;++r)Ll(e[r],t[r],a)}function zc(e,t){var a=G(),r=G(),n=G();mg(n,t[2]),le(a,t[0],n),le(r,t[1],n),Wo(e,r),e[31]^=Rl(a)<<7}function Wo(e,t){var a,r,n,i=G(),s=G();for(a=0;a<16;++a)s[a]=t[a];for(Qc(s),Qc(s),Qc(s),r=0;r<2;++r){for(i[0]=s[0]-65517,a=1;a<15;++a)i[a]=s[a]-65535-(i[a-1]>>16&1),i[a-1]&=65535;i[15]=s[15]-32767-(i[14]>>16&1),n=i[15]>>16&1,i[14]&=65535,Ll(s,i,1-n)}for(a=0;a<16;a++)e[2*a]=s[a]&255,e[2*a+1]=s[a]>>8}function hg(e,t){var a=G(),r=G(),n=G(),i=G(),s=G(),o=G(),c=G();return Qt(e[2],Yo),gg(e[1],t),sr(n,e[1]),le(i,n,og),mr(n,n,e[2]),yr(i,e[2],i),sr(s,i),sr(o,s),le(c,o,s),le(a,c,n),le(a,a,i),vg(a,a),le(a,a,n),le(a,a,i),le(a,a,i),le(e[0],a,i),sr(r,e[0]),le(r,r,i),Nl(r,n)&&le(e[0],e[0],lg),sr(r,e[0]),le(r,r,i),Nl(r,n)?-1:(Rl(e[0])===t[31]>>7&&mr(e[0],qc,e[0]),le(e[3],e[0],e[1]),0)}function gg(e,t){var a;for(a=0;a<16;++a)e[a]=t[2*a]+(t[2*a+1]<<8);e[15]&=32767}function vg(e,t){var a=G(),r;for(r=0;r<16;++r)a[r]=t[r];for(r=250;r>=0;--r)sr(a,a),r!==1&&le(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}function Nl(e,t){var a=new ut(32),r=new ut(32);return Wo(a,e),Wo(r,t),_l(a,0,r,0)}function _l(e,t,a,r){return yg(e,t,a,r,32)}function yg(e,t,a,r,n){var i,s=0;for(i=0;i<n;++i)s|=e[t+i]^a[r+i];return(1&s-1>>>8)-1}function Rl(e){var t=new ut(32);return Wo(t,e),t[0]&1}function kl(e,t,a){var r,n;for(Qt(e[0],qc),Qt(e[1],Yo),Qt(e[2],Yo),Qt(e[3],qc),n=255;n>=0;--n)r=a[n/8|0]>>(n&7)&1,wl(e,t,r),Gc(t,e),Gc(e,e),wl(e,t,r)}function $c(e,t){var a=[G(),G(),G(),G()];Qt(a[0],Il),Qt(a[1],Al),Qt(a[2],Yo),le(a[3],Il,Al),kl(e,a,t)}function Qt(e,t){var a;for(a=0;a<16;a++)e[a]=t[a]|0}function mg(e,t){var a=G(),r;for(r=0;r<16;++r)a[r]=t[r];for(r=253;r>=0;--r)sr(a,a),r!==2&&r!==4&&le(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}function Qc(e){var t,a,r=1;for(t=0;t<16;++t)a=e[t]+r+65535,r=Math.floor(a/65536),e[t]=a-r*65536;e[0]+=r-1+37*(r-1)}function Ll(e,t,a){for(var r,n=~(a-1),i=0;i<16;++i)r=n&(e[i]^t[i]),e[i]^=r,t[i]^=r}function G(e){var t,a=new Float64Array(16);if(e)for(t=0;t<e.length;++t)a[t]=e[t];return a}function yr(e,t,a){for(var r=0;r<16;++r)e[r]=t[r]+a[r]}function mr(e,t,a){for(var r=0;r<16;++r)e[r]=t[r]-a[r]}function sr(e,t){le(e,t,t)}function le(e,t,a){var r,n,i=0,s=0,o=0,c=0,l=0,u=0,d=0,v=0,E=0,y=0,x=0,b=0,A=0,w=0,N=0,M=0,U=0,L=0,z=0,X=0,ne=0,ie=0,oe=0,ge=0,ft=0,gt=0,ce=0,ye=0,K=0,Xt=0,ir=0,me=a[0],Ee=a[1],xe=a[2],we=a[3],Ne=a[4],_e=a[5],Re=a[6],ke=a[7],Le=a[8],De=a[9],Ue=a[10],Pe=a[11],Oe=a[12],Ve=a[13],Me=a[14],Fe=a[15];r=t[0],i+=r*me,s+=r*Ee,o+=r*xe,c+=r*we,l+=r*Ne,u+=r*_e,d+=r*Re,v+=r*ke,E+=r*Le,y+=r*De,x+=r*Ue,b+=r*Pe,A+=r*Oe,w+=r*Ve,N+=r*Me,M+=r*Fe,r=t[1],s+=r*me,o+=r*Ee,c+=r*xe,l+=r*we,u+=r*Ne,d+=r*_e,v+=r*Re,E+=r*ke,y+=r*Le,x+=r*De,b+=r*Ue,A+=r*Pe,w+=r*Oe,N+=r*Ve,M+=r*Me,U+=r*Fe,r=t[2],o+=r*me,c+=r*Ee,l+=r*xe,u+=r*we,d+=r*Ne,v+=r*_e,E+=r*Re,y+=r*ke,x+=r*Le,b+=r*De,A+=r*Ue,w+=r*Pe,N+=r*Oe,M+=r*Ve,U+=r*Me,L+=r*Fe,r=t[3],c+=r*me,l+=r*Ee,u+=r*xe,d+=r*we,v+=r*Ne,E+=r*_e,y+=r*Re,x+=r*ke,b+=r*Le,A+=r*De,w+=r*Ue,N+=r*Pe,M+=r*Oe,U+=r*Ve,L+=r*Me,z+=r*Fe,r=t[4],l+=r*me,u+=r*Ee,d+=r*xe,v+=r*we,E+=r*Ne,y+=r*_e,x+=r*Re,b+=r*ke,A+=r*Le,w+=r*De,N+=r*Ue,M+=r*Pe,U+=r*Oe,L+=r*Ve,z+=r*Me,X+=r*Fe,r=t[5],u+=r*me,d+=r*Ee,v+=r*xe,E+=r*we,y+=r*Ne,x+=r*_e,b+=r*Re,A+=r*ke,w+=r*Le,N+=r*De,M+=r*Ue,U+=r*Pe,L+=r*Oe,z+=r*Ve,X+=r*Me,ne+=r*Fe,r=t[6],d+=r*me,v+=r*Ee,E+=r*xe,y+=r*we,x+=r*Ne,b+=r*_e,A+=r*Re,w+=r*ke,N+=r*Le,M+=r*De,U+=r*Ue,L+=r*Pe,z+=r*Oe,X+=r*Ve,ne+=r*Me,ie+=r*Fe,r=t[7],v+=r*me,E+=r*Ee,y+=r*xe,x+=r*we,b+=r*Ne,A+=r*_e,w+=r*Re,N+=r*ke,M+=r*Le,U+=r*De,L+=r*Ue,z+=r*Pe,X+=r*Oe,ne+=r*Ve,ie+=r*Me,oe+=r*Fe,r=t[8],E+=r*me,y+=r*Ee,x+=r*xe,b+=r*we,A+=r*Ne,w+=r*_e,N+=r*Re,M+=r*ke,U+=r*Le,L+=r*De,z+=r*Ue,X+=r*Pe,ne+=r*Oe,ie+=r*Ve,oe+=r*Me,ge+=r*Fe,r=t[9],y+=r*me,x+=r*Ee,b+=r*xe,A+=r*we,w+=r*Ne,N+=r*_e,M+=r*Re,U+=r*ke,L+=r*Le,z+=r*De,X+=r*Ue,ne+=r*Pe,ie+=r*Oe,oe+=r*Ve,ge+=r*Me,ft+=r*Fe,r=t[10],x+=r*me,b+=r*Ee,A+=r*xe,w+=r*we,N+=r*Ne,M+=r*_e,U+=r*Re,L+=r*ke,z+=r*Le,X+=r*De,ne+=r*Ue,ie+=r*Pe,oe+=r*Oe,ge+=r*Ve,ft+=r*Me,gt+=r*Fe,r=t[11],b+=r*me,A+=r*Ee,w+=r*xe,N+=r*we,M+=r*Ne,U+=r*_e,L+=r*Re,z+=r*ke,X+=r*Le,ne+=r*De,ie+=r*Ue,oe+=r*Pe,ge+=r*Oe,ft+=r*Ve,gt+=r*Me,ce+=r*Fe,r=t[12],A+=r*me,w+=r*Ee,N+=r*xe,M+=r*we,U+=r*Ne,L+=r*_e,z+=r*Re,X+=r*ke,ne+=r*Le,ie+=r*De,oe+=r*Ue,ge+=r*Pe,ft+=r*Oe,gt+=r*Ve,ce+=r*Me,ye+=r*Fe,r=t[13],w+=r*me,N+=r*Ee,M+=r*xe,U+=r*we,L+=r*Ne,z+=r*_e,X+=r*Re,ne+=r*ke,ie+=r*Le,oe+=r*De,ge+=r*Ue,ft+=r*Pe,gt+=r*Oe,ce+=r*Ve,ye+=r*Me,K+=r*Fe,r=t[14],N+=r*me,M+=r*Ee,U+=r*xe,L+=r*we,z+=r*Ne,X+=r*_e,ne+=r*Re,ie+=r*ke,oe+=r*Le,ge+=r*De,ft+=r*Ue,gt+=r*Pe,ce+=r*Oe,ye+=r*Ve,K+=r*Me,Xt+=r*Fe,r=t[15],M+=r*me,U+=r*Ee,L+=r*xe,z+=r*we,X+=r*Ne,ne+=r*_e,ie+=r*Re,oe+=r*ke,ge+=r*Le,ft+=r*De,gt+=r*Ue,ce+=r*Pe,ye+=r*Oe,K+=r*Ve,Xt+=r*Me,ir+=r*Fe,i+=38*U,s+=38*L,o+=38*z,c+=38*X,l+=38*ne,u+=38*ie,d+=38*oe,v+=38*ge,E+=38*ft,y+=38*gt,x+=38*ce,b+=38*ye,A+=38*K,w+=38*Xt,N+=38*ir,n=1,r=i+n+65535,n=Math.floor(r/65536),i=r-n*65536,r=s+n+65535,n=Math.floor(r/65536),s=r-n*65536,r=o+n+65535,n=Math.floor(r/65536),o=r-n*65536,r=c+n+65535,n=Math.floor(r/65536),c=r-n*65536,r=l+n+65535,n=Math.floor(r/65536),l=r-n*65536,r=u+n+65535,n=Math.floor(r/65536),u=r-n*65536,r=d+n+65535,n=Math.floor(r/65536),d=r-n*65536,r=v+n+65535,n=Math.floor(r/65536),v=r-n*65536,r=E+n+65535,n=Math.floor(r/65536),E=r-n*65536,r=y+n+65535,n=Math.floor(r/65536),y=r-n*65536,r=x+n+65535,n=Math.floor(r/65536),x=r-n*65536,r=b+n+65535,n=Math.floor(r/65536),b=r-n*65536,r=A+n+65535,n=Math.floor(r/65536),A=r-n*65536,r=w+n+65535,n=Math.floor(r/65536),w=r-n*65536,r=N+n+65535,n=Math.floor(r/65536),N=r-n*65536,r=M+n+65535,n=Math.floor(r/65536),M=r-n*65536,i+=n-1+37*(n-1),n=1,r=i+n+65535,n=Math.floor(r/65536),i=r-n*65536,r=s+n+65535,n=Math.floor(r/65536),s=r-n*65536,r=o+n+65535,n=Math.floor(r/65536),o=r-n*65536,r=c+n+65535,n=Math.floor(r/65536),c=r-n*65536,r=l+n+65535,n=Math.floor(r/65536),l=r-n*65536,r=u+n+65535,n=Math.floor(r/65536),u=r-n*65536,r=d+n+65535,n=Math.floor(r/65536),d=r-n*65536,r=v+n+65535,n=Math.floor(r/65536),v=r-n*65536,r=E+n+65535,n=Math.floor(r/65536),E=r-n*65536,r=y+n+65535,n=Math.floor(r/65536),y=r-n*65536,r=x+n+65535,n=Math.floor(r/65536),x=r-n*65536,r=b+n+65535,n=Math.floor(r/65536),b=r-n*65536,r=A+n+65535,n=Math.floor(r/65536),A=r-n*65536,r=w+n+65535,n=Math.floor(r/65536),w=r-n*65536,r=N+n+65535,n=Math.floor(r/65536),N=r-n*65536,r=M+n+65535,n=Math.floor(r/65536),M=r-n*65536,i+=n-1+37*(n-1),e[0]=i,e[1]=s,e[2]=o,e[3]=c,e[4]=l,e[5]=u,e[6]=d,e[7]=v,e[8]=E,e[9]=y,e[10]=x,e[11]=b,e[12]=A,e[13]=w,e[14]=N,e[15]=M}var ht=j;ht.kem=ht.kem||{};var Dl=ht.jsbn.BigInteger;ht.kem.rsa={},ht.kem.rsa.create=function(e,t){t=t||{};var a=t.prng||ht.random,r={};return r.encrypt=function(n,i){var s=Math.ceil(n.n.bitLength()/8),o;do o=new Dl(ht.util.bytesToHex(a.getBytesSync(s)),16).mod(n.n);while(o.compareTo(Dl.ONE)<=0);o=ht.util.hexToBytes(o.toString(16));var c=s-o.length;c>0&&(o=ht.util.fillString("\0",c)+o);var l=n.encrypt(o,"NONE"),u=e.generate(o,i);return{encapsulation:l,key:u}},r.decrypt=function(n,i,s){var o=n.decrypt(i,"NONE");return e.generate(o,s)},r},ht.kem.kdf1=function(e,t){Ul(this,e,0,t||e.digestLength)},ht.kem.kdf2=function(e,t){Ul(this,e,1,t||e.digestLength)};function Ul(e,t,a,r){e.generate=function(n,i){for(var s=new ht.util.ByteBuffer,o=Math.ceil(i/r)+a,c=new ht.util.ByteBuffer,l=a;l<o;++l){c.putInt32(l),t.start(),t.update(n+c.getBytes());var u=t.digest();s.putBytes(u.getBytes(r))}return s.truncate(s.length()-i),s.getBytes()}}var J=j;J.log=J.log||{},J.log.levels=["none","error","warning","info","debug","verbose","max"];var Zo={},jc=[],Io=null;J.log.LEVEL_LOCKED=2,J.log.NO_LEVEL_CHECK=4,J.log.INTERPOLATE=8;for(var jt=0;jt<J.log.levels.length;++jt){var Pl=J.log.levels[jt];Zo[Pl]={index:jt,name:Pl.toUpperCase()}}J.log.logMessage=function(e){for(var t=Zo[e.level].index,a=0;a<jc.length;++a){var r=jc[a];if(r.flags&J.log.NO_LEVEL_CHECK)r.f(e);else{var n=Zo[r.level].index;t<=n&&r.f(r,e)}}},J.log.prepareStandard=function(e){"standard"in e||(e.standard=Zo[e.level].name+" ["+e.category+"] "+e.message)},J.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]),e.full=J.util.format.apply(this,t)}},J.log.prepareStandardFull=function(e){"standardFull"in e||(J.log.prepareStandard(e),e.standardFull=e.standard)};for(var Ol=["error","warning","info","debug","verbose"],jt=0;jt<Ol.length;++jt)(function(t){J.log[t]=function(a,r){var n=Array.prototype.slice.call(arguments).slice(2),i={timestamp:new Date,level:t,category:a,message:r,arguments:n};J.log.logMessage(i)}})(Ol[jt]);if(J.log.makeLogger=function(e){var t={flags:0,f:e};return J.log.setLevel(t,"none"),t},J.log.setLevel=function(e,t){var a=!1;if(e&&!(e.flags&J.log.LEVEL_LOCKED))for(var r=0;r<J.log.levels.length;++r){var n=J.log.levels[r];if(t==n){e.level=t,a=!0;break}}return a},J.log.lock=function(e,t){typeof t>"u"||t?e.flags|=J.log.LEVEL_LOCKED:e.flags&=~J.log.LEVEL_LOCKED},J.log.addLogger=function(e){jc.push(e)},typeof console<"u"&&"log"in console){var Ao;if(console.error&&console.warn&&console.info&&console.debug){var Eg={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},Zc=function(e,t){J.log.prepareStandard(t);var a=Eg[t.level],r=[t.standard];r=r.concat(t.arguments.slice()),a.apply(console,r)};Ao=J.log.makeLogger(Zc)}else{var Zc=function(t,a){J.log.prepareStandardFull(a),console.log(a.standardFull)};Ao=J.log.makeLogger(Zc)}J.log.setLevel(Ao,"debug"),J.log.addLogger(Ao),Io=Ao}else console={log:function(){}};if(Io!==null&&typeof window<"u"&&window.location){var Jo=new URL(window.location.href).searchParams;if(Jo.has("console.level")&&J.log.setLevel(Io,Jo.get("console.level").slice(-1)[0]),Jo.has("console.lock")){var Cg=Jo.get("console.lock").slice(-1)[0];Cg=="true"&&J.log.lock(Io)}}J.log.consoleLogger=Io;var P=j,S=P.asn1,Je=P.pkcs7=P.pkcs7||{};Je.messageFromPem=function(e){var t=P.pem.decode(e)[0];if(t.type!=="PKCS7"){var a=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw a.headerType=t.type,a}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var r=S.fromDer(t.body);return Je.messageFromAsn1(r)},Je.messageToPem=function(e,t){var a={type:"PKCS7",body:S.toDer(e.toAsn1()).getBytes()};return P.pem.encode(a,{maxline:t})},Je.messageFromAsn1=function(e){var t={},a=[];if(!S.validate(e,Je.asn1.contentInfoValidator,t,a)){var r=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw r.errors=a,r}var n=S.derToOid(t.contentType),i;switch(n){case P.pki.oids.envelopedData:i=Je.createEnvelopedData();break;case P.pki.oids.encryptedData:i=Je.createEncryptedData();break;case P.pki.oids.signedData:i=Je.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+n+" is not (yet) supported.")}return i.fromAsn1(t.content.value[0]),i},Je.createSignedData=function(){var e=null;return e={type:P.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(r){if(Yc(e,r,Je.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var n=e.rawCapture.certificates.value,i=0;i<n.length;++i)e.certificates.push(P.pki.certificateFromAsn1(n[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var r=[],n=0;n<e.certificates.length;++n)r.push(P.pki.certificateToAsn1(e.certificates[n]));var i=[],s=S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,S.integerToDer(e.version).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return r.length>0&&s.value[0].value.push(S.create(S.Class.CONTEXT_SPECIFIC,0,!0,r)),i.length>0&&s.value[0].value.push(S.create(S.Class.CONTEXT_SPECIFIC,1,!0,i)),s.value[0].value.push(S.create(S.Class.UNIVERSAL,S.Type.SET,!0,e.signerInfos)),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.type).getBytes()),s])},addSigner:function(r){var n=r.issuer,i=r.serialNumber;if(r.certificate){var s=r.certificate;typeof s=="string"&&(s=P.pki.certificateFromPem(s)),n=s.issuer.attributes,i=s.serialNumber}var o=r.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof o=="string"&&(o=P.pki.privateKeyFromPem(o));var c=r.digestAlgorithm||P.pki.oids.sha1;switch(c){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: "+c)}var l=r.authenticatedAttributes||[];if(l.length>0){for(var u=!1,d=!1,v=0;v<l.length;++v){var E=l[v];if(!u&&E.type===P.pki.oids.contentType){if(u=!0,d)break;continue}if(!d&&E.type===P.pki.oids.messageDigest){if(d=!0,u)break;continue}}if(!u||!d)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:o,version:1,issuer:n,serialNumber:i,digestAlgorithm:c,signatureAlgorithm:P.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:l,unauthenticatedAttributes:[]})},sign:function(r){if(r=r||{},(typeof e.content!="object"||e.contentInfo===null)&&(e.contentInfo=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(P.pki.oids.data).getBytes())]),"content"in e)){var n;e.content instanceof P.util.ByteBuffer?n=e.content.bytes():typeof e.content=="string"&&(n=P.util.encodeUtf8(e.content)),r.detached?e.detachedContent=S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,n):e.contentInfo.value.push(S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,n)]))}if(e.signers.length!==0){var i=t();a(i)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(r){typeof r=="string"&&(r=P.pki.certificateFromPem(r)),e.certificates.push(r)},addCertificateRevokationList:function(r){throw new Error("PKCS#7 CRL support not yet implemented.")}},e;function t(){for(var r={},n=0;n<e.signers.length;++n){var i=e.signers[n],s=i.digestAlgorithm;s in r||(r[s]=P.md[P.pki.oids[s]].create()),i.authenticatedAttributes.length===0?i.md=r[s]:i.md=P.md[P.pki.oids[s]].create()}e.digestAlgorithmIdentifiers=[];for(var s in r)e.digestAlgorithmIdentifiers.push(S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(s).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.NULL,!1,"")]));return r}function a(r){var n;if(e.detachedContent?n=e.detachedContent:(n=e.contentInfo.value[1],n=n.value[0]),!n)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var i=S.derToOid(e.contentInfo.value[0].value),s=S.toDer(n);s.getByte(),S.getBerValueLength(s),s=s.getBytes();for(var o in r)r[o].start().update(s);for(var c=new Date,l=0;l<e.signers.length;++l){var u=e.signers[l];if(u.authenticatedAttributes.length===0){if(i!==P.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{u.authenticatedAttributesAsn1=S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var d=S.create(S.Class.UNIVERSAL,S.Type.SET,!0,[]),v=0;v<u.authenticatedAttributes.length;++v){var E=u.authenticatedAttributes[v];E.type===P.pki.oids.messageDigest?E.value=r[u.digestAlgorithm].digest():E.type===P.pki.oids.signingTime&&(E.value||(E.value=c)),d.value.push(Xc(E)),u.authenticatedAttributesAsn1.value.push(Xc(E))}s=S.toDer(d).getBytes(),u.md.start().update(s)}u.signature=u.key.sign(u.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=Ag(e.signers)}},Je.createEncryptedData=function(){var e=null;return e={type:P.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:P.pki.oids["aes256-CBC"]},fromAsn1:function(t){Yc(e,t,Je.asn1.encryptedDataValidator)},decrypt:function(t){t!==void 0&&(e.encryptedContent.key=t),Vl(e)}},e},Je.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 a=Yc(e,t,Je.asn1.envelopedDataValidator);e.recipients=Tg(a.recipientInfos.value)},toAsn1:function(){return S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.type).getBytes()),S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,S.integerToDer(e.version).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SET,!0,bg(e.recipients)),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,Bg(e.encryptedContent))])])])},findRecipient:function(t){for(var a=t.issuer.attributes,r=0;r<e.recipients.length;++r){var n=e.recipients[r],i=n.issuer;if(n.serialNumber===t.serialNumber&&i.length===a.length){for(var s=!0,o=0;o<a.length;++o)if(i[o].type!==a[o].type||i[o].value!==a[o].value){s=!1;break}if(s)return n}}return null},decrypt:function(t,a){if(e.encryptedContent.key===void 0&&t!==void 0&&a!==void 0)switch(t.encryptedContent.algorithm){case P.pki.oids.rsaEncryption:case P.pki.oids.desCBC:var r=a.decrypt(t.encryptedContent.content);e.encryptedContent.key=P.util.createBuffer(r);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}Vl(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,a){if(e.encryptedContent.content===void 0){a=a||e.encryptedContent.algorithm,t=t||e.encryptedContent.key;var r,n,i;switch(a){case P.pki.oids["aes128-CBC"]:r=16,n=16,i=P.aes.createEncryptionCipher;break;case P.pki.oids["aes192-CBC"]:r=24,n=16,i=P.aes.createEncryptionCipher;break;case P.pki.oids["aes256-CBC"]:r=32,n=16,i=P.aes.createEncryptionCipher;break;case P.pki.oids["des-EDE3-CBC"]:r=24,n=8,i=P.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+a)}if(t===void 0)t=P.util.createBuffer(P.random.getBytes(r));else if(t.length()!=r)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+r+".");e.encryptedContent.algorithm=a,e.encryptedContent.key=t,e.encryptedContent.parameter=P.util.createBuffer(P.random.getBytes(n));var s=i(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(c.encryptedContent.content===void 0)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)}}}},e};function xg(e){var t={},a=[];if(!S.validate(e,Je.asn1.recipientInfoValidator,t,a)){var r=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw r.errors=a,r}return{version:t.version.charCodeAt(0),issuer:P.pki.RDNAttributesAsArray(t.issuer),serialNumber:P.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:S.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function Sg(e){return S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,S.integerToDer(e.version).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[P.pki.distinguishedNameToAsn1({attributes:e.issuer}),S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,P.util.hexToBytes(e.serialNumber))]),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.encryptedContent.algorithm).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.NULL,!1,"")]),S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function Tg(e){for(var t=[],a=0;a<e.length;++a)t.push(xg(e[a]));return t}function bg(e){for(var t=[],a=0;a<e.length;++a)t.push(Sg(e[a]));return t}function Ig(e){var t=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,S.integerToDer(e.version).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[P.pki.distinguishedNameToAsn1({attributes:e.issuer}),S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,P.util.hexToBytes(e.serialNumber))]),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.digestAlgorithm).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.signatureAlgorithm).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.NULL,!1,"")])),t.value.push(S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var a=S.create(S.Class.CONTEXT_SPECIFIC,1,!0,[]),r=0;r<e.unauthenticatedAttributes.length;++r){var n=e.unauthenticatedAttributes[r];a.values.push(Xc(n))}t.value.push(a)}return t}function Ag(e){for(var t=[],a=0;a<e.length;++a)t.push(Ig(e[a]));return t}function Xc(e){var t;if(e.type===P.pki.oids.contentType)t=S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.value).getBytes());else if(e.type===P.pki.oids.messageDigest)t=S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===P.pki.oids.signingTime){var a=new Date("1950-01-01T00:00:00Z"),r=new Date("2050-01-01T00:00:00Z"),n=e.value;if(typeof n=="string"){var i=Date.parse(n);isNaN(i)?n.length===13?n=S.utcTimeToDate(n):n=S.generalizedTimeToDate(n):n=new Date(i)}n>=a&&n<r?t=S.create(S.Class.UNIVERSAL,S.Type.UTCTIME,!1,S.dateToUtcTime(n)):t=S.create(S.Class.UNIVERSAL,S.Type.GENERALIZEDTIME,!1,S.dateToGeneralizedTime(n))}return S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.type).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SET,!0,[t])])}function Bg(e){return[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(P.pki.oids.data).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(e.algorithm).getBytes()),e.parameter?S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,e.parameter.getBytes()):void 0]),S.create(S.Class.CONTEXT_SPECIFIC,0,!0,[S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,e.content.getBytes())])]}function Yc(e,t,a){var r={},n=[];if(!S.validate(t,a,r,n)){var i=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw i.errors=i,i}var s=S.derToOid(r.contentType);if(s!==P.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(r.encryptedContent){var o="";if(P.util.isArray(r.encryptedContent))for(var c=0;c<r.encryptedContent.length;++c){if(r.encryptedContent[c].type!==S.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=r.encryptedContent[c].value}else o=r.encryptedContent;e.encryptedContent={algorithm:S.derToOid(r.encAlgorithm),parameter:P.util.createBuffer(r.encParameter.value),content:P.util.createBuffer(o)}}if(r.content){var o="";if(P.util.isArray(r.content))for(var c=0;c<r.content.length;++c){if(r.content[c].type!==S.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=r.content[c].value}else o=r.content;e.content=P.util.createBuffer(o)}return e.version=r.version.charCodeAt(0),e.rawCapture=r,r}function Vl(e){if(e.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(e.content===void 0){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 Ce=j,ec=Ce.ssh=Ce.ssh||{};ec.privateKeyToPutty=function(e,t,a){a=a||"",t=t||"";var r="ssh-rsa",n=t===""?"none":"aes256-cbc",i="PuTTY-User-Key-File-2: "+r+`\r
15
+ `;i+="Encryption: "+n+`\r
16
+ `,i+="Comment: "+a+`\r
17
+ `;var s=Ce.util.createBuffer();Er(s,r),kt(s,e.e),kt(s,e.n);var o=Ce.util.encode64(s.bytes(),64),c=Math.floor(o.length/66)+1;i+="Public-Lines: "+c+`\r
18
+ `,i+=o;var l=Ce.util.createBuffer();kt(l,e.d),kt(l,e.p),kt(l,e.q),kt(l,e.qInv);var u;if(!t)u=Ce.util.encode64(l.bytes(),64);else{var d=l.length()+16-1;d-=d%16;var v=tc(l.bytes());v.truncate(v.length()-d+l.length()),l.putBuffer(v);var E=Ce.util.createBuffer();E.putBuffer(tc("\0\0\0\0",t)),E.putBuffer(tc("\0\0\0",t));var y=Ce.aes.createEncryptionCipher(E.truncate(8),"CBC");y.start(Ce.util.createBuffer().fillWithByte(0,16)),y.update(l.copy()),y.finish();var x=y.output;x.truncate(16),u=Ce.util.encode64(x.bytes(),64)}c=Math.floor(u.length/66)+1,i+=`\r
43
19
  Private-Lines: `+c+`\r
44
- `,s+=u;var b=El("putty-private-key-file-mac-key",t),C=qe.util.createBuffer();er(C,a),er(C,n),er(C,r),C.putInt32(i.length()),C.putBuffer(i),C.putInt32(l.length()),C.putBuffer(l);var B=qe.hmac.create();return B.start("sha1",b),B.update(C.bytes()),s+=`\r
45
- Private-MAC: `+B.digest().toHex()+`\r
46
- `,s},bl.publicKeyToOpenSSH=function(e,t){var r="ssh-rsa";t=t||"";var a=qe.util.createBuffer();return er(a,r),Wt(a,e.e),Wt(a,e.n),r+" "+qe.util.encode64(a.bytes())+" "+t},bl.privateKeyToOpenSSH=function(e,t){return t?qe.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):qe.pki.privateKeyToPem(e)},bl.getPublicKeyFingerprint=function(e,t){t=t||{};var r=t.md||qe.md.md5.create(),a="ssh-rsa",n=qe.util.createBuffer();er(n,a),Wt(n,e.e),Wt(n,e.n),r.start(),r.update(n.getBytes());var s=r.digest();if(t.encoding==="hex"){var i=s.toHex();return t.delimiter?i.match(/.{2}/g).join(t.delimiter):i}else{if(t.encoding==="binary")return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return s};function Wt(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var a=qe.util.hexToBytes(r);e.putInt32(a.length),e.putBytes(a)}function er(e,t){e.putInt32(t.length),e.putString(t)}function El(){for(var e=qe.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}var Cc=re;const R2=e=>{const t=Cc.util.hexToBytes(e.entitySecret),r=Cc.pki.publicKeyFromPem(e.publicKey).encrypt(t,"RSA-OAEP",{md:Cc.md.sha256.create(),mgf1:{md:Cc.md.sha256.create()}});return Cc.util.encode64(r)},nm=e=>async()=>{let t=e.storage?await e.storage.get("publicKey"):void 0;if(t===void 0){const r=await O1(e)();if(!r.data?.publicKey)throw new Error("Could not fetch public key");t=r.data.publicKey,e.storage&&await e.storage.set("publicKey",t)}return R2({entitySecret:e.entitySecret,publicKey:t})},Cl=()=>pm();var im="10.5.1";const k2=e=>async({idempotencyKey:t,fee:r,xRequestId:a,...n})=>{try{return Tt(await e.client.DeployImport.deployContract({entitySecretCiphertext:await nm(e)(),idempotencyKey:t??Cl(),...r.config,...n},a))}catch(s){throw rt(s)?at(s):s}},N2=e=>async({xRequestId:t,...r})=>{try{return Tt(await e.client.DeployImport.estimateContractDeploy(r,t))}catch(a){throw rt(a)?at(a):a}},L2=e=>async({id:t,xRequestId:r})=>{try{return Tt(await e.client.ViewUpdate.getContract(t,r))}catch(a){throw rt(a)?at(a):a}},U2=e=>async({idempotencyKey:t,xRequestId:r,...a})=>{try{return Tt(await e.client.DeployImport.importContract({idempotencyKey:t??Cl(),...a},r))}catch(n){throw rt(n)?at(n):n}},P2=e=>async t=>{try{return Tt(await e.client.ViewUpdate.listContracts(t?.blockchain,t?.contractInputType,t?.deployerAddress,t?.name,t?.status,t?.from,t?.to,t?.pageBefore,t?.pageAfter,t?.pageSize,t?.xRequestId))}catch(r){throw rt(r)?at(r):r}},D2=e=>async({xRequestId:t,...r})=>{try{return Tt(await e.client.Interact.queryContract(r,t))}catch(a){throw rt(a)?at(a):a}},O2=e=>async({id:t,xRequestId:r,...a})=>{try{return Tt(await e.client.ViewUpdate.updateContract(t,a,r))}catch(n){throw rt(n)?at(n):n}},F2=e=>async({idempotencyKey:t,xRequestId:r,...a})=>{try{return Tt(await e.client.EventMonitors.createEventMonitor(r,{idempotencyKey:t??Cl(),...a}))}catch(n){throw rt(n)?at(n):n}},M2=e=>async({xRequestId:t,...r})=>{try{return await e.client.EventMonitors.deleteEventMonitor(r.id,t)}catch(a){throw rt(a)?at(a):a}},V2=e=>async t=>{try{return Tt(await e.client.EventMonitors.getEventMonitors(t?.contractAddress,t?.blockchain,t?.eventSignature,t?.from,t?.to,t?.pageBefore,t?.pageAfter,t?.pageSize,t?.xRequestId))}catch(r){throw rt(r)?at(r):r}},q2=e=>async t=>{try{return Tt(await e.client.EventMonitors.listEventLogs(t?.contractAddress,t?.blockchain,t?.from,t?.to,t?.pageBefore,t?.pageAfter,t?.pageSize,t?.xRequestId))}catch(r){throw rt(r)?at(r):r}},j2=e=>async({id:t,xRequestId:r,...a})=>{try{return Tt(await e.client.EventMonitors.updateEventMonitor(t,r,a))}catch(n){throw rt(n)?at(n):n}},K2=e=>async({id:t,idempotencyKey:r,fee:a,xRequestId:n,...s})=>{try{return Tt(await e.client.Templates.deployContractTemplate(t,{entitySecretCiphertext:await nm(e)(),idempotencyKey:r??Cl(),...a.config,...s},n))}catch(i){throw rt(i)?at(i):i}},z2=e=>async({id:t,xRequestId:r,...a})=>{try{return Tt(await e.client.Templates.estimateContractTemplateDeploy(t,a,r))}catch(n){throw rt(n)?at(n):n}};var H2=Object.defineProperty,$2=(e,t,r)=>t in e?H2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,G2=(e,t,r)=>$2(e,typeof t!="symbol"?t+"":t,r);const xp="https://api.circle.com";class sm{constructor(t){G2(this,"params");const{apiKey:r,baseUrl:a,entitySecret:n,storage:s,userAgent:i,headers:o}=t;this.params={client:new Oy(a??xp,{apiKey:r,version:im,userAgent:i},o),configurationsClient:new my(a??xp,{apiKey:r,version:im,userAgent:i},o),entitySecret:n,storage:s??new q1}}deployContract(t){return k2(this.params)(t)}estimateContractDeploymentFee(t){return N2(this.params)(t)}importContract(t){return U2(this.params)(t)}getContract(t){return L2(this.params)(t)}listContracts(t){return P2(this.params)(t)}updateContract(t){return O2(this.params)(t)}queryContract(t){return D2(this.params)(t)}deployContractTemplate(t){return K2(this.params)(t)}estimateContractTemplateDeploymentFee(t){return z2(this.params)(t)}createEventMonitor(t){return F2(this.params)(t)}listEventMonitors(t){return V2(this.params)(t)}updateEventMonitor(t){return j2(this.params)(t)}deleteEventMonitor(t){return M2(this.params)(t)}listEventLogs(t){return q2(this.params)(t)}}function Q2(e){return new sm(e)}export{wr as BadGatewayError,xr as BadRequestError,Uy as Blockchain,sm as CircleSmartContractPlatformClient,Rr as ConnectionAbortedError,Br as ConnectionRefusedError,Ur as ConnectionResetError,_r as ConnectionTimeoutError,kr as DNSNotFoundError,Nr as DNSTimeoutError,Bu as Error110700,_u as Error110701,Ru as Error110702,ku as Error110703,Dr as Error155101,Or as Error155102,Fr as Error155103,Mr as Error155104,Vr as Error155105,qr as Error155106,jr as Error155107,Kr as Error155108,zr as Error155109,Hr as Error155110,$r as Error155111,Gr as Error155112,Qr as Error155113,Wr as Error155114,Xr as Error155115,Yr as Error155116,Jr as Error155117,Zr as Error155118,en as Error155119,tn as Error155120,an as Error155121,rn as Error155122,nn as Error155123,sn as Error155124,on as Error155130,cn as Error155131,ln as Error155132,un as Error155133,pn as Error155134,dn as Error155135,fn as Error155136,mn as Error155137,hn as Error155138,vn as Error155139,gn as Error155140,xn as Error155141,yn as Error155142,bn as Error155143,En as Error155144,Cn as Error155145,Sn as Error155146,Tn as Error155150,wn as Error155151,An as Error155152,In as Error155154,Bn as Error155155,_n as Error155156,Rn as Error155157,kn as Error155158,Nn as Error155159,Ln as Error155160,Un as Error155201,Pn as Error155202,Dn as Error155203,On as Error155204,Fn as Error155205,Mn as Error155206,Vn as Error155207,qn as Error155208,jn as Error155209,Kn as Error155210,zn as Error155211,Hn as Error155215,$n as Error155218,Gn as Error155219,Qn as Error155220,Wn as Error155221,Xn as Error155222,Yn as Error155223,Jn as Error155224,Zn as Error155225,ei as Error155226,ti as Error155227,ai as Error155228,ri as Error155229,ni as Error155230,ii as Error155231,si as Error155232,oi as Error155233,ci as Error155234,li as Error155235,ui as Error155236,pi as Error155237,di as Error155238,fi as Error155239,mi as Error155240,hi as Error155241,vi as Error155242,gi as Error155243,xi as Error155244,yi as Error155245,bi as Error155247,Ei as Error155254,Ci as Error155257,Si as Error155258,Ti as Error155262,wi as Error155264,Ai as Error155501,Ii as Error155502,Bi as Error155503,_i as Error155504,Ri as Error155505,ki as Error155506,Ni as Error155507,Li as Error155508,Ui as Error155509,Pi as Error155510,Di as Error155511,Oi as Error155512,Fi as Error155514,Mi as Error155515,Vi as Error155516,qi as Error155517,ji as Error155601,Ki as Error155701,zi as Error155702,Hi as Error155703,$i as Error155704,Gi as Error155705,Qi as Error155706,Wi as Error155707,Xi as Error155708,Yi as Error155709,Ji as Error155710,Zi as Error155711,es as Error155712,ts as Error155713,as as Error155714,rs as Error155715,ns as Error155716,is as Error155717,ss as Error155718,os as Error155719,cs as Error155720,ls as Error155721,us as Error155801,ps as Error155802,ds as Error155803,fs as Error155804,ms as Error155805,hs as Error155806,vs as Error155807,gs as Error155808,xs as Error156001,ys as Error156002,bs as Error156003,Es as Error156004,Cs as Error156005,Ss as Error156006,Ts as Error156007,ws as Error156008,As as Error156009,Is as Error156010,Bs as Error156011,_s as Error156012,Rs as Error156013,ks as Error156014,Ns as Error156015,Ls as Error156016,Us as Error156017,Ps as Error156018,Ds as Error156019,Os as Error156020,Fs as Error156021,Ms as Error156023,Vs as Error156024,qs as Error156025,js as Error156026,Ks as Error156027,zs as Error156030,Hs as Error156031,$s as Error156032,Gs as Error175001,Qs as Error175002,Ws as Error175003,Xs as Error175004,Ys as Error175005,Js as Error175006,Zs as Error175007,eo as Error175008,to as Error175009,ao as Error175010,ro as Error175011,no as Error175012,io as Error175013,so as Error175201,oo as Error175202,co as Error175203,lo as Error175204,uo as Error175205,po as Error175301,fo as Error175302,mo as Error175303,ho as Error175401,vo as Error175402,go as Error175403,xo as Error175404,yo as Error175405,bo as Error175406,Eo as Error175407,Co as Error175408,So as Error175409,To as Error175410,wo as Error177001,Ao as Error177002,Io as Error177003,Bo as Error177004,_o as Error177005,Ro as Error177006,ko as Error177007,No as Error177008,Lo as Error177009,Uo as Error177010,Po as Error177011,Do as Error177012,Oo as Error177013,Fo as Error177014,Mo as Error177015,Vo as Error177016,qo as Error177017,jo as Error177018,Ko as Error177019,zo as Error177020,Ho as Error177021,$o as Error177022,Go as Error177023,Qo as Error177024,Wo as Error177025,Xo as Error177026,Yo as Error177301,Jo as Error177302,Zo as Error177303,ec as Error177304,tc as Error177305,ac as Error177601,rc as Error177602,nc as Error177603,ic as Error177604,sc as Error177605,oc as Error177606,cc as Error177607,lc as Error177901,br as ForbiddenError,Ir as GatewayTimeoutError,Pr as HostUnreachableError,gr as HttpError,kt as HttpRequestError,E as HttpResponseError,Sr as InternalServerError,Lr as NetworkUnreachableError,Er as NotFoundError,Tr as NotImplementedError,Cr as RatelimitError,Ar as ServiceUnavailableError,yr as UnauthorizedError,xp as defaultBaseUrl,at as fromAxiosError,Q2 as initiateSmartContractPlatformClient};
20
+ `,i+=u;var b=tc("putty-private-key-file-mac-key",t),A=Ce.util.createBuffer();Er(A,r),Er(A,n),Er(A,a),A.putInt32(s.length()),A.putBuffer(s),A.putInt32(l.length()),A.putBuffer(l);var w=Ce.hmac.create();return w.start("sha1",b),w.update(A.bytes()),i+=`\r
21
+ Private-MAC: `+w.digest().toHex()+`\r
22
+ `,i},ec.publicKeyToOpenSSH=function(e,t){var a="ssh-rsa";t=t||"";var r=Ce.util.createBuffer();return Er(r,a),kt(r,e.e),kt(r,e.n),a+" "+Ce.util.encode64(r.bytes())+" "+t},ec.privateKeyToOpenSSH=function(e,t){return t?Ce.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):Ce.pki.privateKeyToPem(e)},ec.getPublicKeyFingerprint=function(e,t){t=t||{};var a=t.md||Ce.md.md5.create(),r="ssh-rsa",n=Ce.util.createBuffer();Er(n,r),kt(n,e.e),kt(n,e.n),a.start(),a.update(n.getBytes());var i=a.digest();if(t.encoding==="hex"){var s=i.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}else{if(t.encoding==="binary")return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return i};function kt(e,t){var a=t.toString(16);a[0]>="8"&&(a="00"+a);var r=Ce.util.hexToBytes(a);e.putInt32(r.length),e.putBytes(r)}function Er(e,t){e.putInt32(t.length),e.putString(t)}function tc(){for(var e=Ce.md.sha1.create(),t=arguments.length,a=0;a<t;++a)e.update(arguments[a]);return e.digest()}var Bo=j;const wg=e=>{const t=Bo.util.hexToBytes(e.entitySecret),a=Bo.pki.publicKeyFromPem(e.publicKey).encrypt(t,"RSA-OAEP",{md:Bo.md.sha256.create(),mgf1:{md:Bo.md.sha256.create()}});return Bo.util.encode64(a)},Ml=e=>async()=>{let t=e.storage?await e.storage.get("publicKey"):void 0;if(t===void 0){const a=await Df(e)();if(!a.data?.publicKey)throw new Error("Could not fetch public key");t=a.data.publicKey,e.storage&&await e.storage.set("publicKey",t)}return wg({entitySecret:e.entitySecret,publicKey:t})},rc=()=>ql();var Fl="10.5.5";const Ng=e=>async({idempotencyKey:t,fee:a,xRequestId:r,...n})=>{try{return ct(await e.client.DeployImport.deployContract({entitySecretCiphertext:await Ml(e)(),idempotencyKey:t??rc(),...a.config,...n},r))}catch(i){throw qe(i)?Ke(i):i}},_g=e=>async({xRequestId:t,...a})=>{try{return ct(await e.client.DeployImport.estimateContractDeploy(a,t))}catch(r){throw qe(r)?Ke(r):r}},Rg=e=>async({id:t,xRequestId:a})=>{try{return ct(await e.client.ViewUpdate.getContract(t,a))}catch(r){throw qe(r)?Ke(r):r}},kg=e=>async({idempotencyKey:t,xRequestId:a,...r})=>{try{return ct(await e.client.DeployImport.importContract({idempotencyKey:t??rc(),...r},a))}catch(n){throw qe(n)?Ke(n):n}},Lg=e=>async t=>{try{return ct(await e.client.ViewUpdate.listContracts(t?.blockchain,t?.contractInputType,t?.deployerAddress,t?.name,t?.status,t?.from,t?.to,t?.pageBefore,t?.pageAfter,t?.pageSize,t?.xRequestId))}catch(a){throw qe(a)?Ke(a):a}},Dg=e=>async({xRequestId:t,...a})=>{try{return ct(await e.client.Interact.queryContract(a,t))}catch(r){throw qe(r)?Ke(r):r}},Ug=e=>async({id:t,xRequestId:a,...r})=>{try{return ct(await e.client.ViewUpdate.updateContract(t,r,a))}catch(n){throw qe(n)?Ke(n):n}},Pg=e=>async({idempotencyKey:t,xRequestId:a,...r})=>{try{return ct(await e.client.EventMonitors.createEventMonitor(a,{idempotencyKey:t??rc(),...r}))}catch(n){throw qe(n)?Ke(n):n}},Og=e=>async({xRequestId:t,...a})=>{try{return await e.client.EventMonitors.deleteEventMonitor(a.id,t)}catch(r){throw qe(r)?Ke(r):r}},Vg=e=>async t=>{try{return ct(await e.client.EventMonitors.getEventMonitors(t?.contractAddress,t?.blockchain,t?.eventSignature,t?.from,t?.to,t?.pageBefore,t?.pageAfter,t?.pageSize,t?.xRequestId))}catch(a){throw qe(a)?Ke(a):a}},Mg=e=>async t=>{try{return ct(await e.client.EventMonitors.listEventLogs(t?.contractAddress,t?.blockchain,t?.from,t?.to,t?.pageBefore,t?.pageAfter,t?.pageSize,t?.xRequestId))}catch(a){throw qe(a)?Ke(a):a}},Fg=e=>async({id:t,xRequestId:a,...r})=>{try{return ct(await e.client.EventMonitors.updateEventMonitor(t,a,r))}catch(n){throw qe(n)?Ke(n):n}},Kg=e=>async({id:t,idempotencyKey:a,fee:r,xRequestId:n,...i})=>{try{return ct(await e.client.Templates.deployContractTemplate(t,{entitySecretCiphertext:await Ml(e)(),idempotencyKey:a??rc(),...r.config,...i},n))}catch(s){throw qe(s)?Ke(s):s}},qg=e=>async({id:t,xRequestId:a,...r})=>{try{return ct(await e.client.Templates.estimateContractTemplateDeploy(t,r,a))}catch(n){throw qe(n)?Ke(n):n}};var Hg=Object.defineProperty,Gg=(e,t,a)=>t in e?Hg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,zg=(e,t,a)=>Gg(e,typeof t!="symbol"?t+"":t,a);const Wc="https://api.circle.com";class Kl{constructor(t){zg(this,"params");const{apiKey:a,baseUrl:r,entitySecret:n,storage:i,userAgent:s,headers:o}=t;this.params={client:new Lu(r??Wc,{apiKey:a,version:Fl,userAgent:s},o),configurationsClient:new uu(r??Wc,{apiKey:a,version:Fl,userAgent:s},o),entitySecret:n,storage:i??new Vf}}deployContract(t){return Ng(this.params)(t)}estimateContractDeploymentFee(t){return _g(this.params)(t)}importContract(t){return kg(this.params)(t)}getContract(t){return Rg(this.params)(t)}listContracts(t){return Lg(this.params)(t)}updateContract(t){return Ug(this.params)(t)}queryContract(t){return Dg(this.params)(t)}deployContractTemplate(t){return Kg(this.params)(t)}estimateContractTemplateDeploymentFee(t){return qg(this.params)(t)}createEventMonitor(t){return Pg(this.params)(t)}listEventMonitors(t){return Vg(this.params)(t)}updateEventMonitor(t){return Fg(this.params)(t)}deleteEventMonitor(t){return Og(this.params)(t)}listEventLogs(t){return Mg(this.params)(t)}}function $g(e){return new Kl(e)}export{_r as BadGatewayError,Tr as BadRequestError,_u as Blockchain,Kl as CircleSmartContractPlatformClient,Ur as ConnectionAbortedError,Lr as ConnectionRefusedError,Mr as ConnectionResetError,Dr as ConnectionTimeoutError,Pr as DNSNotFoundError,Or as DNSTimeoutError,oc as Error110700,cc as Error110701,lc as Error110702,uc as Error110703,Kr as Error155101,qr as Error155102,Hr as Error155103,Gr as Error155104,zr as Error155105,$r as Error155106,Qr as Error155107,jr as Error155108,Xr as Error155109,Yr as Error155110,Wr as Error155111,Zr as Error155112,Jr as Error155113,ea as Error155114,ta as Error155115,ra as Error155116,aa as Error155117,na as Error155118,sa as Error155119,ia as Error155120,oa as Error155121,ca as Error155122,la as Error155123,ua as Error155124,fa as Error155130,da as Error155131,pa as Error155132,ha as Error155133,ga as Error155134,va as Error155135,ya as Error155136,ma as Error155137,Ea as Error155138,Ca as Error155139,xa as Error155140,Sa as Error155141,Ta as Error155142,ba as Error155143,Ia as Error155144,Aa as Error155145,Ba as Error155146,wa as Error155150,Na as Error155151,_a as Error155152,Ra as Error155154,ka as Error155155,La as Error155156,Da as Error155157,Ua as Error155158,Pa as Error155159,Oa as Error155160,Va as Error155201,Ma as Error155202,Fa as Error155203,Ka as Error155204,qa as Error155205,Ha as Error155206,Ga as Error155207,za as Error155208,$a as Error155209,Qa as Error155210,ja as Error155211,Xa as Error155215,Ya as Error155218,Wa as Error155219,Za as Error155220,Ja as Error155221,en as Error155222,tn as Error155223,rn as Error155224,an as Error155225,nn as Error155226,sn as Error155227,on as Error155228,cn as Error155229,ln as Error155230,un as Error155231,fn as Error155232,dn as Error155233,pn as Error155234,hn as Error155235,gn as Error155236,vn as Error155237,yn as Error155238,mn as Error155239,En as Error155240,Cn as Error155241,xn as Error155242,Sn as Error155243,Tn as Error155244,bn as Error155245,In as Error155247,An as Error155254,Bn as Error155257,wn as Error155258,Nn as Error155262,_n as Error155264,Rn as Error155501,kn as Error155502,Ln as Error155503,Dn as Error155504,Un as Error155505,Pn as Error155506,On as Error155507,Vn as Error155508,Mn as Error155509,Fn as Error155510,Kn as Error155511,qn as Error155512,Hn as Error155514,Gn as Error155515,zn as Error155516,$n as Error155517,Qn as Error155601,jn as Error155701,Xn as Error155702,Yn as Error155703,Wn as Error155704,Zn as Error155705,Jn as Error155706,es as Error155707,ts as Error155708,rs as Error155709,as as Error155710,ns as Error155711,ss as Error155712,is as Error155713,os as Error155714,cs as Error155715,ls as Error155716,us as Error155717,fs as Error155718,ds as Error155719,ps as Error155720,hs as Error155721,gs as Error155801,vs as Error155802,ys as Error155803,ms as Error155804,Es as Error155805,Cs as Error155806,xs as Error155807,Ss as Error155808,Ts as Error156001,bs as Error156002,Is as Error156003,As as Error156004,Bs as Error156005,ws as Error156006,Ns as Error156007,_s as Error156008,Rs as Error156009,ks as Error156010,Ls as Error156011,Ds as Error156012,Us as Error156013,Ps as Error156014,Os as Error156015,Vs as Error156016,Ms as Error156017,Fs as Error156018,Ks as Error156019,qs as Error156020,Hs as Error156021,Gs as Error156023,zs as Error156024,$s as Error156025,Qs as Error156026,js as Error156027,Xs as Error156030,Ys as Error156031,Ws as Error156032,Zs as Error175001,Js as Error175002,ei as Error175003,ti as Error175004,ri as Error175005,ai as Error175006,ni as Error175007,si as Error175008,ii as Error175009,oi as Error175010,ci as Error175011,li as Error175012,ui as Error175013,fi as Error175201,di as Error175202,pi as Error175203,hi as Error175204,gi as Error175205,vi as Error175301,yi as Error175302,mi as Error175303,Ei as Error175401,Ci as Error175402,xi as Error175403,Si as Error175404,Ti as Error175405,bi as Error175406,Ii as Error175407,Ai as Error175408,Bi as Error175409,wi as Error175410,Ni as Error177001,_i as Error177002,Ri as Error177003,ki as Error177004,Li as Error177005,Di as Error177006,Ui as Error177007,Pi as Error177008,Oi as Error177009,Vi as Error177010,Mi as Error177011,Fi as Error177012,Ki as Error177013,qi as Error177014,Hi as Error177015,Gi as Error177016,zi as Error177017,$i as Error177018,Qi as Error177019,ji as Error177020,Xi as Error177021,Yi as Error177022,Wi as Error177023,Zi as Error177024,Ji as Error177025,eo as Error177026,to as Error177301,ro as Error177302,ao as Error177303,no as Error177304,so as Error177305,io as Error177601,oo as Error177602,co as Error177603,lo as Error177604,uo as Error177605,fo as Error177606,po as Error177607,ho as Error177901,Ir as ForbiddenError,kr as GatewayTimeoutError,Fr as HostUnreachableError,Sr as HttpError,vt as HttpRequestError,m as HttpResponseError,wr as InternalServerError,Vr as NetworkUnreachableError,Ar as NotFoundError,Nr as NotImplementedError,Br as RatelimitError,Rr as ServiceUnavailableError,br as UnauthorizedError,Wc as defaultBaseUrl,Ke as fromAxiosError,$g as initiateSmartContractPlatformClient};