nfets 0.0.15 → 0.0.17

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,238 +0,0 @@
1
- import{a as dw,b as CK,c as bK,d as xK}from"./chunk-3WPW27WV.mjs";import{a as o,b as gt,d as ye,f as pw}from"./chunk-W6MRGYXP.mjs";var $t=ye((Hle,OP)=>{"use strict";OP.exports={options:{usePureJavaScript:!1}}});var VP=ye((Kle,LP)=>{"use strict";var Mb={};LP.exports=Mb;var kP={};Mb.encode=function(r,e,t){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(t!==void 0&&typeof t!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(r instanceof Uint8Array))n=_$(r,e);else{var s=0,i=e.length,a=e.charAt(0),u=[0];for(s=0;s<r.length;++s){for(var l=0,f=r[s];l<u.length;++l)f+=u[l]<<8,u[l]=f%i,f=f/i|0;for(;f>0;)u.push(f%i),f=f/i|0}for(s=0;r[s]===0&&s<r.length-1;++s)n+=a;for(s=u.length-1;s>=0;--s)n+=e[u[s]]}if(t){var h=new RegExp(".{1,"+t+"}","g");n=n.match(h).join(`\r
2
- `)}return n};Mb.decode=function(r,e){if(typeof r!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var t=kP[e];if(!t){t=kP[e]=[];for(var n=0;n<e.length;++n)t[e.charCodeAt(n)]=n}r=r.replace(/\s/g,"");for(var s=e.length,i=e.charAt(0),a=[0],n=0;n<r.length;n++){var u=t[r.charCodeAt(n)];if(u===void 0)return;for(var l=0,f=u;l<a.length;++l)f+=a[l]*s,a[l]=f&255,f>>=8;for(;f>0;)a.push(f&255),f>>=8}for(var h=0;r[h]===i&&h<r.length-1;++h)a.push(0);return typeof Buffer<"u"?Buffer.from(a.reverse()):new Uint8Array(a.reverse())};function _$(r,e){var t=0,n=e.length,s=e.charAt(0),i=[0];for(t=0;t<r.length();++t){for(var a=0,u=r.at(t);a<i.length;++a)u+=i[a]<<8,i[a]=u%n,u=u/n|0;for(;u>0;)i.push(u%n),u=u/n|0}var l="";for(t=0;r.at(t)===0&&t<r.length()-1;++t)l+=s;for(t=i.length-1;t>=0;--t)l+=e[i[t]];return l}o(_$,"_encodeWithByteBuffer")});var ur=ye((Xle,FP)=>{"use strict";var UP=$t(),MP=VP(),re=FP.exports=UP.util=UP.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){re.nextTick=process.nextTick,typeof setImmediate=="function"?re.setImmediate=setImmediate:re.setImmediate=re.nextTick;return}if(typeof setImmediate=="function"){re.setImmediate=function(){return setImmediate.apply(void 0,arguments)},re.nextTick=function(u){return setImmediate(u)};return}if(re.setImmediate=function(u){setTimeout(u,0)},typeof window<"u"&&typeof window.postMessage=="function"){let u=function(l){if(l.source===window&&l.data===r){l.stopPropagation();var f=e.slice();e.length=0,f.forEach(function(h){h()})}};var a=u;o(u,"handler");var r="forge.setImmediate",e=[];re.setImmediate=function(l){e.push(l),e.length===1&&window.postMessage(r,"*")},window.addEventListener("message",u,!0)}if(typeof MutationObserver<"u"){var t=Date.now(),n=!0,s=document.createElement("div"),e=[];new MutationObserver(function(){var l=e.slice();e.length=0,l.forEach(function(f){f()})}).observe(s,{attributes:!0});var i=re.setImmediate;re.setImmediate=function(l){Date.now()-t>15?(t=Date.now(),i(l)):(e.push(l),e.length===1&&s.setAttribute("a",n=!n))}}re.nextTick=re.setImmediate})();re.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;re.globalScope=(function(){return re.isNodejs?global:typeof self>"u"?window:self})();re.isArray=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"};re.isArrayBuffer=function(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer};re.isArrayBufferView=function(r){return r&&re.isArrayBuffer(r.buffer)&&r.byteLength!==void 0};function ym(r){if(!(r===8||r===16||r===24||r===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+r)}o(ym,"_checkBitsParam");re.ByteBuffer=jb;function jb(r){if(this.data="",this.read=0,typeof r=="string")this.data=r;else if(re.isArrayBuffer(r)||re.isArrayBufferView(r))if(typeof Buffer<"u"&&r instanceof Buffer)this.data=r.toString("binary");else{var e=new Uint8Array(r);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var t=0;t<e.length;++t)this.putByte(e[t])}}else(r instanceof jb||typeof r=="object"&&typeof r.data=="string"&&typeof r.read=="number")&&(this.data=r.data,this.read=r.read);this._constructedStringLength=0}o(jb,"ByteStringBuffer");re.ByteStringBuffer=jb;var R$=4096;re.ByteStringBuffer.prototype._optimizeConstructedString=function(r){this._constructedStringLength+=r,this._constructedStringLength>R$&&(this.data.substr(0,1),this._constructedStringLength=0)};re.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};re.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};re.ByteStringBuffer.prototype.putByte=function(r){return this.putBytes(String.fromCharCode(r))};re.ByteStringBuffer.prototype.fillWithByte=function(r,e){r=String.fromCharCode(r);for(var t=this.data;e>0;)e&1&&(t+=r),e>>>=1,e>0&&(r+=r);return this.data=t,this._optimizeConstructedString(e),this};re.ByteStringBuffer.prototype.putBytes=function(r){return this.data+=r,this._optimizeConstructedString(r.length),this};re.ByteStringBuffer.prototype.putString=function(r){return this.putBytes(re.encodeUtf8(r))};re.ByteStringBuffer.prototype.putInt16=function(r){return this.putBytes(String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};re.ByteStringBuffer.prototype.putInt24=function(r){return this.putBytes(String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};re.ByteStringBuffer.prototype.putInt32=function(r){return this.putBytes(String.fromCharCode(r>>24&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};re.ByteStringBuffer.prototype.putInt16Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255))};re.ByteStringBuffer.prototype.putInt24Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r>>16&255))};re.ByteStringBuffer.prototype.putInt32Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>24&255))};re.ByteStringBuffer.prototype.putInt=function(r,e){ym(e);var t="";do e-=8,t+=String.fromCharCode(r>>e&255);while(e>0);return this.putBytes(t)};re.ByteStringBuffer.prototype.putSignedInt=function(r,e){return r<0&&(r+=2<<e-1),this.putInt(r,e)};re.ByteStringBuffer.prototype.putBuffer=function(r){return this.putBytes(r.getBytes())};re.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};re.ByteStringBuffer.prototype.getInt16=function(){var r=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,r};re.ByteStringBuffer.prototype.getInt24=function(){var r=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,r};re.ByteStringBuffer.prototype.getInt32=function(){var r=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,r};re.ByteStringBuffer.prototype.getInt16Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,r};re.ByteStringBuffer.prototype.getInt24Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,r};re.ByteStringBuffer.prototype.getInt32Le=function(){var r=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,r};re.ByteStringBuffer.prototype.getInt=function(r){ym(r);var e=0;do e=(e<<8)+this.data.charCodeAt(this.read++),r-=8;while(r>0);return e};re.ByteStringBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};re.ByteStringBuffer.prototype.getBytes=function(r){var e;return r?(r=Math.min(this.length(),r),e=this.data.slice(this.read,this.read+r),this.read+=r):r===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};re.ByteStringBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};re.ByteStringBuffer.prototype.at=function(r){return this.data.charCodeAt(this.read+r)};re.ByteStringBuffer.prototype.setAt=function(r,e){return this.data=this.data.substr(0,this.read+r)+String.fromCharCode(e)+this.data.substr(this.read+r+1),this};re.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};re.ByteStringBuffer.prototype.copy=function(){var r=re.createBuffer(this.data);return r.read=this.read,r};re.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};re.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};re.ByteStringBuffer.prototype.truncate=function(r){var e=Math.max(0,this.length()-r);return this.data=this.data.substr(this.read,e),this.read=0,this};re.ByteStringBuffer.prototype.toHex=function(){for(var r="",e=this.read;e<this.data.length;++e){var t=this.data.charCodeAt(e);t<16&&(r+="0"),r+=t.toString(16)}return r};re.ByteStringBuffer.prototype.toString=function(){return re.decodeUtf8(this.bytes())};function P$(r,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var t=re.isArrayBuffer(r),n=re.isArrayBufferView(r);if(t||n){t?this.data=new DataView(r):this.data=new DataView(r.buffer,r.byteOffset,r.byteLength),this.write="writeOffset"in e?e.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,r!=null&&this.putBytes(r),"writeOffset"in e&&(this.write=e.writeOffset)}o(P$,"DataBuffer");re.DataBuffer=P$;re.DataBuffer.prototype.length=function(){return this.write-this.read};re.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};re.DataBuffer.prototype.accommodate=function(r,e){if(this.length()>=r)return this;e=Math.max(e||this.growSize,r);var t=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(t),this.data=new DataView(n.buffer),this};re.DataBuffer.prototype.putByte=function(r){return this.accommodate(1),this.data.setUint8(this.write++,r),this};re.DataBuffer.prototype.fillWithByte=function(r,e){this.accommodate(e);for(var t=0;t<e;++t)this.data.setUint8(r);return this};re.DataBuffer.prototype.putBytes=function(r,e){if(re.isArrayBufferView(r)){var t=new Uint8Array(r.buffer,r.byteOffset,r.byteLength),n=t.byteLength-t.byteOffset;this.accommodate(n);var s=new Uint8Array(this.data.buffer,this.write);return s.set(t),this.write+=n,this}if(re.isArrayBuffer(r)){var t=new Uint8Array(r);this.accommodate(t.byteLength);var s=new Uint8Array(this.data.buffer);return s.set(t,this.write),this.write+=t.byteLength,this}if(r instanceof re.DataBuffer||typeof r=="object"&&typeof r.read=="number"&&typeof r.write=="number"&&re.isArrayBufferView(r.data)){var t=new Uint8Array(r.data.byteLength,r.read,r.length());this.accommodate(t.byteLength);var s=new Uint8Array(r.data.byteLength,this.write);return s.set(t),this.write+=t.byteLength,this}if(r instanceof re.ByteStringBuffer&&(r=r.data,e="binary"),e=e||"binary",typeof r=="string"){var i;if(e==="hex")return this.accommodate(Math.ceil(r.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=re.binary.hex.decode(r,i,this.write),this;if(e==="base64")return this.accommodate(Math.ceil(r.length/4)*3),i=new Uint8Array(this.data.buffer,this.write),this.write+=re.binary.base64.decode(r,i,this.write),this;if(e==="utf8"&&(r=re.encodeUtf8(r),e="binary"),e==="binary"||e==="raw")return this.accommodate(r.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=re.binary.raw.decode(i),this;if(e==="utf16")return this.accommodate(r.length*2),i=new Uint16Array(this.data.buffer,this.write),this.write+=re.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+r)};re.DataBuffer.prototype.putBuffer=function(r){return this.putBytes(r),r.clear(),this};re.DataBuffer.prototype.putString=function(r){return this.putBytes(r,"utf16")};re.DataBuffer.prototype.putInt16=function(r){return this.accommodate(2),this.data.setInt16(this.write,r),this.write+=2,this};re.DataBuffer.prototype.putInt24=function(r){return this.accommodate(3),this.data.setInt16(this.write,r>>8&65535),this.data.setInt8(this.write,r>>16&255),this.write+=3,this};re.DataBuffer.prototype.putInt32=function(r){return this.accommodate(4),this.data.setInt32(this.write,r),this.write+=4,this};re.DataBuffer.prototype.putInt16Le=function(r){return this.accommodate(2),this.data.setInt16(this.write,r,!0),this.write+=2,this};re.DataBuffer.prototype.putInt24Le=function(r){return this.accommodate(3),this.data.setInt8(this.write,r>>16&255),this.data.setInt16(this.write,r>>8&65535,!0),this.write+=3,this};re.DataBuffer.prototype.putInt32Le=function(r){return this.accommodate(4),this.data.setInt32(this.write,r,!0),this.write+=4,this};re.DataBuffer.prototype.putInt=function(r,e){ym(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,r>>e&255);while(e>0);return this};re.DataBuffer.prototype.putSignedInt=function(r,e){return ym(e),this.accommodate(e/8),r<0&&(r+=2<<e-1),this.putInt(r,e)};re.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};re.DataBuffer.prototype.getInt16=function(){var r=this.data.getInt16(this.read);return this.read+=2,r};re.DataBuffer.prototype.getInt24=function(){var r=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,r};re.DataBuffer.prototype.getInt32=function(){var r=this.data.getInt32(this.read);return this.read+=4,r};re.DataBuffer.prototype.getInt16Le=function(){var r=this.data.getInt16(this.read,!0);return this.read+=2,r};re.DataBuffer.prototype.getInt24Le=function(){var r=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,r};re.DataBuffer.prototype.getInt32Le=function(){var r=this.data.getInt32(this.read,!0);return this.read+=4,r};re.DataBuffer.prototype.getInt=function(r){ym(r);var e=0;do e=(e<<8)+this.data.getInt8(this.read++),r-=8;while(r>0);return e};re.DataBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};re.DataBuffer.prototype.getBytes=function(r){var e;return r?(r=Math.min(this.length(),r),e=this.data.slice(this.read,this.read+r),this.read+=r):r===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};re.DataBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};re.DataBuffer.prototype.at=function(r){return this.data.getUint8(this.read+r)};re.DataBuffer.prototype.setAt=function(r,e){return this.data.setUint8(r,e),this};re.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};re.DataBuffer.prototype.copy=function(){return new re.DataBuffer(this)};re.DataBuffer.prototype.compact=function(){if(this.read>0){var r=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(r.byteLength);e.set(r),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};re.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};re.DataBuffer.prototype.truncate=function(r){return this.write=Math.max(0,this.length()-r),this.read=Math.min(this.read,this.write),this};re.DataBuffer.prototype.toHex=function(){for(var r="",e=this.read;e<this.data.byteLength;++e){var t=this.data.getUint8(e);t<16&&(r+="0"),r+=t.toString(16)}return r};re.DataBuffer.prototype.toString=function(r){var e=new Uint8Array(this.data,this.read,this.length());if(r=r||"utf8",r==="binary"||r==="raw")return re.binary.raw.encode(e);if(r==="hex")return re.binary.hex.encode(e);if(r==="base64")return re.binary.base64.encode(e);if(r==="utf8")return re.text.utf8.decode(e);if(r==="utf16")return re.text.utf16.decode(e);throw new Error("Invalid encoding: "+r)};re.createBuffer=function(r,e){return e=e||"raw",r!==void 0&&e==="utf8"&&(r=re.encodeUtf8(r)),new re.ByteBuffer(r)};re.fillString=function(r,e){for(var t="";e>0;)e&1&&(t+=r),e>>>=1,e>0&&(r+=r);return t};re.xorBytes=function(r,e,t){for(var n="",s="",i="",a=0,u=0;t>0;--t,++a)s=r.charCodeAt(a)^e.charCodeAt(a),u>=10&&(n+=i,i="",u=0),i+=String.fromCharCode(s),++u;return n+=i,n};re.hexToBytes=function(r){var e="",t=0;for(r.length&!0&&(t=1,e+=String.fromCharCode(parseInt(r[0],16)));t<r.length;t+=2)e+=String.fromCharCode(parseInt(r.substr(t,2),16));return e};re.bytesToHex=function(r){return re.createBuffer(r).toHex()};re.int32ToBytes=function(r){return String.fromCharCode(r>>24&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255)};var gu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",yu=[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],jP="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";re.encode64=function(r,e){for(var t="",n="",s,i,a,u=0;u<r.length;)s=r.charCodeAt(u++),i=r.charCodeAt(u++),a=r.charCodeAt(u++),t+=gu.charAt(s>>2),t+=gu.charAt((s&3)<<4|i>>4),isNaN(i)?t+="==":(t+=gu.charAt((i&15)<<2|a>>6),t+=isNaN(a)?"=":gu.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
3
- `,t=t.substr(e));return n+=t,n};re.decode64=function(r){r=r.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",t,n,s,i,a=0;a<r.length;)t=yu[r.charCodeAt(a++)-43],n=yu[r.charCodeAt(a++)-43],s=yu[r.charCodeAt(a++)-43],i=yu[r.charCodeAt(a++)-43],e+=String.fromCharCode(t<<2|n>>4),s!==64&&(e+=String.fromCharCode((n&15)<<4|s>>2),i!==64&&(e+=String.fromCharCode((s&3)<<6|i)));return e};re.encodeUtf8=function(r){return unescape(encodeURIComponent(r))};re.decodeUtf8=function(r){return decodeURIComponent(escape(r))};re.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:MP.encode,decode:MP.decode}};re.binary.raw.encode=function(r){return String.fromCharCode.apply(null,r)};re.binary.raw.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(r.length)),t=t||0;for(var s=t,i=0;i<r.length;++i)n[s++]=r.charCodeAt(i);return e?s-t:n};re.binary.hex.encode=re.bytesToHex;re.binary.hex.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(Math.ceil(r.length/2))),t=t||0;var s=0,i=t;for(r.length&1&&(s=1,n[i++]=parseInt(r[0],16));s<r.length;s+=2)n[i++]=parseInt(r.substr(s,2),16);return e?i-t:n};re.binary.base64.encode=function(r,e){for(var t="",n="",s,i,a,u=0;u<r.byteLength;)s=r[u++],i=r[u++],a=r[u++],t+=gu.charAt(s>>2),t+=gu.charAt((s&3)<<4|i>>4),isNaN(i)?t+="==":(t+=gu.charAt((i&15)<<2|a>>6),t+=isNaN(a)?"=":gu.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
4
- `,t=t.substr(e));return n+=t,n};re.binary.base64.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(Math.ceil(r.length/4)*3)),r=r.replace(/[^A-Za-z0-9\+\/\=]/g,""),t=t||0;for(var s,i,a,u,l=0,f=t;l<r.length;)s=yu[r.charCodeAt(l++)-43],i=yu[r.charCodeAt(l++)-43],a=yu[r.charCodeAt(l++)-43],u=yu[r.charCodeAt(l++)-43],n[f++]=s<<2|i>>4,a!==64&&(n[f++]=(i&15)<<4|a>>2,u!==64&&(n[f++]=(a&3)<<6|u));return e?f-t:n.subarray(0,f)};re.binary.base58.encode=function(r,e){return re.binary.baseN.encode(r,jP,e)};re.binary.base58.decode=function(r,e){return re.binary.baseN.decode(r,jP,e)};re.text={utf8:{},utf16:{}};re.text.utf8.encode=function(r,e,t){r=re.encodeUtf8(r);var n=e;n||(n=new Uint8Array(r.length)),t=t||0;for(var s=t,i=0;i<r.length;++i)n[s++]=r.charCodeAt(i);return e?s-t:n};re.text.utf8.decode=function(r){return re.decodeUtf8(String.fromCharCode.apply(null,r))};re.text.utf16.encode=function(r,e,t){var n=e;n||(n=new Uint8Array(r.length*2));var s=new Uint16Array(n.buffer);t=t||0;for(var i=t,a=t,u=0;u<r.length;++u)s[a++]=r.charCodeAt(u),i+=2;return e?i-t:n};re.text.utf16.decode=function(r){return String.fromCharCode.apply(null,new Uint16Array(r.buffer))};re.deflate=function(r,e,t){if(e=re.decode64(r.deflate(re.encode64(e)).rval),t){var n=2,s=e.charCodeAt(1);s&32&&(n=6),e=e.substring(n,e.length-4)}return e};re.inflate=function(r,e,t){var n=r.inflate(re.encode64(e)).rval;return n===null?null:re.decode64(n)};var Fb=o(function(r,e,t){if(!r)throw new Error("WebStorage not available.");var n;if(t===null?n=r.removeItem(e):(t=re.encode64(JSON.stringify(t)),n=r.setItem(e,t)),typeof n<"u"&&n.rval!==!0){var s=new Error(n.error.message);throw s.id=n.error.id,s.name=n.error.name,s}},"_setStorageObject"),qb=o(function(r,e){if(!r)throw new Error("WebStorage not available.");var t=r.getItem(e);if(r.init)if(t.rval===null){if(t.error){var n=new Error(t.error.message);throw n.id=t.error.id,n.name=t.error.name,n}t=null}else t=t.rval;return t!==null&&(t=JSON.parse(re.decode64(t))),t},"_getStorageObject"),O$=o(function(r,e,t,n){var s=qb(r,e);s===null&&(s={}),s[t]=n,Fb(r,e,s)},"_setItem"),k$=o(function(r,e,t){var n=qb(r,e);return n!==null&&(n=t in n?n[t]:null),n},"_getItem"),L$=o(function(r,e,t){var n=qb(r,e);if(n!==null&&t in n){delete n[t];var s=!0;for(var i in n){s=!1;break}s&&(n=null),Fb(r,e,n)}},"_removeItem"),V$=o(function(r,e){Fb(r,e,null)},"_clearItems"),xw=o(function(r,e,t){var n=null;typeof t>"u"&&(t=["web","flash"]);var s,i=!1,a=null;for(var u in t){s=t[u];try{if(s==="flash"||s==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=r.apply(this,e),i=s==="flash"}(s==="web"||s==="both")&&(e[0]=localStorage,n=r.apply(this,e),i=!0)}catch(l){a=l}if(i)break}if(!i)throw a;return n},"_callStorageFunction");re.setItem=function(r,e,t,n,s){xw(O$,arguments,s)};re.getItem=function(r,e,t,n){return xw(k$,arguments,n)};re.removeItem=function(r,e,t,n){xw(L$,arguments,n)};re.clearItems=function(r,e,t){xw(V$,arguments,t)};re.isEmpty=function(r){for(var e in r)if(r.hasOwnProperty(e))return!1;return!0};re.format=function(r){for(var e=/%./g,t,n,s=0,i=[],a=0;t=e.exec(r);){n=r.substring(a,e.lastIndex-2),n.length>0&&i.push(n),a=e.lastIndex;var u=t[0][1];switch(u){case"s":case"o":s<arguments.length?i.push(arguments[s+++1]):i.push("<?>");break;case"%":i.push("%");break;default:i.push("<%"+u+"?>")}}return i.push(r.substring(a)),i.join("")};re.formatNumber=function(r,e,t,n){var s=r,i=isNaN(e=Math.abs(e))?2:e,a=t===void 0?",":t,u=n===void 0?".":n,l=s<0?"-":"",f=parseInt(s=Math.abs(+s||0).toFixed(i),10)+"",h=f.length>3?f.length%3:0;return l+(h?f.substr(0,h)+u:"")+f.substr(h).replace(/(\d{3})(?=\d)/g,"$1"+u)+(i?a+Math.abs(s-f).toFixed(i).slice(2):"")};re.formatSize=function(r){return r>=1073741824?r=re.formatNumber(r/1073741824,2,".","")+" GiB":r>=1048576?r=re.formatNumber(r/1048576,2,".","")+" MiB":r>=1024?r=re.formatNumber(r/1024,0)+" KiB":r=re.formatNumber(r,0)+" bytes",r};re.bytesFromIP=function(r){return r.indexOf(".")!==-1?re.bytesFromIPv4(r):r.indexOf(":")!==-1?re.bytesFromIPv6(r):null};re.bytesFromIPv4=function(r){if(r=r.split("."),r.length!==4)return null;for(var e=re.createBuffer(),t=0;t<r.length;++t){var n=parseInt(r[t],10);if(isNaN(n))return null;e.putByte(n)}return e.getBytes()};re.bytesFromIPv6=function(r){var e=0;r=r.split(":").filter(function(a){return a.length===0&&++e,!0});for(var t=(8-r.length+e)*2,n=re.createBuffer(),s=0;s<8;++s){if(!r[s]||r[s].length===0){n.fillWithByte(0,t),t=0;continue}var i=re.hexToBytes(r[s]);i.length<2&&n.putByte(0),n.putBytes(i)}return n.getBytes()};re.bytesToIP=function(r){return r.length===4?re.bytesToIPv4(r):r.length===16?re.bytesToIPv6(r):null};re.bytesToIPv4=function(r){if(r.length!==4)return null;for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t));return e.join(".")};re.bytesToIPv6=function(r){if(r.length!==16)return null;for(var e=[],t=[],n=0,s=0;s<r.length;s+=2){for(var i=re.bytesToHex(r[s]+r[s+1]);i[0]==="0"&&i!=="0";)i=i.substr(1);if(i==="0"){var a=t[t.length-1],u=e.length;!a||u!==a.end+1?t.push({start:u,end:u}):(a.end=u,a.end-a.start>t[n].end-t[n].start&&(n=t.length-1))}e.push(i)}if(t.length>0){var l=t[n];l.end-l.start>0&&(e.splice(l.start,l.end-l.start+1,""),l.start===0&&e.unshift(""),l.end===7&&e.push(""))}return e.join(":")};re.estimateCores=function(r,e){if(typeof r=="function"&&(e=r,r={}),r=r||{},"cores"in re&&!r.update)return e(null,re.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return re.cores=navigator.hardwareConcurrency,e(null,re.cores);if(typeof Worker>"u")return re.cores=1,e(null,re.cores);if(typeof Blob>"u")return re.cores=2,e(null,re.cores);var t=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(a){for(var u=Date.now(),l=u+4;Date.now()<l;);self.postMessage({st:u,et:l})})}).toString(),")()"],{type:"application/javascript"}));n([],5,16);function n(a,u,l){if(u===0){var f=Math.floor(a.reduce(function(h,m){return h+m},0)/a.length);return re.cores=Math.max(1,f),URL.revokeObjectURL(t),e(null,re.cores)}s(l,function(h,m){a.push(i(l,m)),n(a,u-1,l)})}o(n,"sample");function s(a,u){for(var l=[],f=[],h=0;h<a;++h){var m=new Worker(t);m.addEventListener("message",function(g){if(f.push(g.data),f.length===a){for(var w=0;w<a;++w)l[w].terminate();u(null,f)}}),l.push(m)}for(var h=0;h<a;++h)l[h].postMessage(h)}o(s,"map");function i(a,u){for(var l=[],f=0;f<a;++f)for(var h=u[f],m=l[f]=[],g=0;g<a;++g)if(f!==g){var w=u[g];(h.st>w.st&&h.st<w.et||w.st>h.st&&w.st<h.et)&&m.push(g)}return l.reduce(function(y,S){return Math.max(y,S.length)},0)}o(i,"reduce")}});var Nw=ye((Wle,qP)=>{"use strict";var An=$t();ur();qP.exports=An.cipher=An.cipher||{};An.cipher.algorithms=An.cipher.algorithms||{};An.cipher.createCipher=function(r,e){var t=r;if(typeof t=="string"&&(t=An.cipher.getAlgorithm(t),t&&(t=t())),!t)throw new Error("Unsupported algorithm: "+r);return new An.cipher.BlockCipher({algorithm:t,key:e,decrypt:!1})};An.cipher.createDecipher=function(r,e){var t=r;if(typeof t=="string"&&(t=An.cipher.getAlgorithm(t),t&&(t=t())),!t)throw new Error("Unsupported algorithm: "+r);return new An.cipher.BlockCipher({algorithm:t,key:e,decrypt:!0})};An.cipher.registerAlgorithm=function(r,e){r=r.toUpperCase(),An.cipher.algorithms[r]=e};An.cipher.getAlgorithm=function(r){return r=r.toUpperCase(),r in An.cipher.algorithms?An.cipher.algorithms[r]:null};var Hb=An.cipher.BlockCipher=function(r){this.algorithm=r.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=r.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=r.decrypt,this.algorithm.initialize(r)};Hb.prototype.start=function(r){r=r||{};var e={};for(var t in r)e[t]=r[t];e.decrypt=this._decrypt,this._finish=!1,this._input=An.util.createBuffer(),this.output=r.output||An.util.createBuffer(),this.mode.start(e)};Hb.prototype.update=function(r){for(r&&this._input.putBuffer(r);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Hb.prototype.finish=function(r){r&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(t){return r(this.blockSize,t,!1)},this.mode.unpad=function(t){return r(this.blockSize,t,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var $b=ye((Jle,HP)=>{"use strict";var Cn=$t();ur();Cn.cipher=Cn.cipher||{};var zt=HP.exports=Cn.cipher.modes=Cn.cipher.modes||{};zt.ecb=function(r){r=r||{},this.name="ECB",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};zt.ecb.prototype.start=function(r){};zt.ecb.prototype.encrypt=function(r,e,t){if(r.length()<this.blockSize&&!(t&&r.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=r.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])};zt.ecb.prototype.decrypt=function(r,e,t){if(r.length()<this.blockSize&&!(t&&r.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=r.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])};zt.ecb.prototype.pad=function(r,e){var t=r.length()===this.blockSize?this.blockSize:this.blockSize-r.length();return r.fillWithByte(t,t),!0};zt.ecb.prototype.unpad=function(r,e){if(e.overflow>0)return!1;var t=r.length(),n=r.at(t-1);return n>this.blockSize<<2?!1:(r.truncate(n),!0)};zt.cbc=function(r){r=r||{},this.name="CBC",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};zt.cbc.prototype.start=function(r){if(r.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in r)this._iv=Tw(r.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};zt.cbc.prototype.encrypt=function(r,e,t){if(r.length()<this.blockSize&&!(t&&r.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^r.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n]);this._prev=this._outBlock};zt.cbc.prototype.decrypt=function(r,e,t){if(r.length()<this.blockSize&&!(t&&r.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=r.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)};zt.cbc.prototype.pad=function(r,e){var t=r.length()===this.blockSize?this.blockSize:this.blockSize-r.length();return r.fillWithByte(t,t),!0};zt.cbc.prototype.unpad=function(r,e){if(e.overflow>0)return!1;var t=r.length(),n=r.at(t-1);return n>this.blockSize<<2?!1:(r.truncate(n),!0)};zt.cfb=function(r){r=r||{},this.name="CFB",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Cn.util.createBuffer(),this._partialBytes=0};zt.cfb.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");this._iv=Tw(r.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};zt.cfb.prototype.encrypt=function(r,e,t){var n=r.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)this._inBlock[s]=r.getInt32()^this._outBlock[s],e.putInt32(this._inBlock[s]);return}var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialBlock[s]=r.getInt32()^this._outBlock[s],this._partialOutput.putInt32(this._partialBlock[s]);if(i>0)r.read-=this.blockSize;else for(var s=0;s<this._ints;++s)this._inBlock[s]=this._partialBlock[s];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!t)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};zt.cfb.prototype.decrypt=function(r,e,t){var n=r.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)this._inBlock[s]=r.getInt32(),e.putInt32(this._inBlock[s]^this._outBlock[s]);return}var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialBlock[s]=r.getInt32(),this._partialOutput.putInt32(this._partialBlock[s]^this._outBlock[s]);if(i>0)r.read-=this.blockSize;else for(var s=0;s<this._ints;++s)this._inBlock[s]=this._partialBlock[s];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!t)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};zt.ofb=function(r){r=r||{},this.name="OFB",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Cn.util.createBuffer(),this._partialBytes=0};zt.ofb.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");this._iv=Tw(r.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};zt.ofb.prototype.encrypt=function(r,e,t){var n=r.length();if(r.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)e.putInt32(r.getInt32()^this._outBlock[s]),this._inBlock[s]=this._outBlock[s];return}var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialOutput.putInt32(r.getInt32()^this._outBlock[s]);if(i>0)r.read-=this.blockSize;else for(var s=0;s<this._ints;++s)this._inBlock[s]=this._outBlock[s];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!t)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};zt.ofb.prototype.decrypt=zt.ofb.prototype.encrypt;zt.ctr=function(r){r=r||{},this.name="CTR",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Cn.util.createBuffer(),this._partialBytes=0};zt.ctr.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");this._iv=Tw(r.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};zt.ctr.prototype.encrypt=function(r,e,t){var n=r.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var s=0;s<this._ints;++s)e.putInt32(r.getInt32()^this._outBlock[s]);else{var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialOutput.putInt32(r.getInt32()^this._outBlock[s]);if(i>0&&(r.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!t)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}Iw(this._inBlock)};zt.ctr.prototype.decrypt=zt.ctr.prototype.encrypt;zt.gcm=function(r){r=r||{},this.name="GCM",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Cn.util.createBuffer(),this._partialBytes=0,this._R=3774873600};zt.gcm.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");var e=Cn.util.createBuffer(r.iv);this._cipherLength=0;var t;if("additionalData"in r?t=Cn.util.createBuffer(r.additionalData):t=Cn.util.createBuffer(),"tagLength"in r?this._tagLength=r.tagLength:this._tagLength=128,this._tag=null,r.decrypt&&(this._tag=Cn.util.createBuffer(r.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Kb(n*8)))}this._inBlock=this._j0.slice(0),Iw(this._inBlock),this._partialBytes=0,t=Cn.util.createBuffer(t),this._aDataLength=Kb(t.length()*8);var s=t.length()%this.blockSize;for(s&&t.fillWithByte(0,this.blockSize-s),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])};zt.gcm.prototype.encrypt=function(r,e,t){var n=r.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)e.putInt32(this._outBlock[s]^=r.getInt32());this._cipherLength+=this.blockSize}else{var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialOutput.putInt32(r.getInt32()^this._outBlock[s]);if(i<=0||t){if(t){var a=n%this.blockSize;this._cipherLength+=a,this._partialOutput.truncate(this.blockSize-a)}else this._cipherLength+=this.blockSize;for(var s=0;s<this._ints;++s)this._outBlock[s]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!t)return r.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Iw(this._inBlock)};zt.gcm.prototype.decrypt=function(r,e,t){var n=r.length();if(n<this.blockSize&&!(t&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Iw(this._inBlock),this._hashBlock[0]=r.getInt32(),this._hashBlock[1]=r.getInt32(),this._hashBlock[2]=r.getInt32(),this._hashBlock[3]=r.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var s=0;s<this._ints;++s)e.putInt32(this._outBlock[s]^this._hashBlock[s]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize};zt.gcm.prototype.afterFinish=function(r,e){var t=!0;e.decrypt&&e.overflow&&r.truncate(this.blockSize-e.overflow),this.tag=Cn.util.createBuffer();var n=this._aDataLength.concat(Kb(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,n);var s=[];this.cipher.encrypt(this._j0,s);for(var i=0;i<this._ints;++i)this.tag.putInt32(this._s[i]^s[i]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),e.decrypt&&this.tag.bytes()!==this._tag&&(t=!1),t};zt.gcm.prototype.multiply=function(r,e){for(var t=[0,0,0,0],n=e.slice(0),s=0;s<128;++s){var i=r[s/32|0]&1<<31-s%32;i&&(t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3]),this.pow(n,n)}return t};zt.gcm.prototype.pow=function(r,e){for(var t=r[3]&1,n=3;n>0;--n)e[n]=r[n]>>>1|(r[n-1]&1)<<31;e[0]=r[0]>>>1,t&&(e[0]^=this._R)};zt.gcm.prototype.tableMultiply=function(r){for(var e=[0,0,0,0],t=0;t<32;++t){var n=t/8|0,s=r[n]>>>(7-t%8)*4&15,i=this._m[t][s];e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3]}return e};zt.gcm.prototype.ghash=function(r,e,t){return e[0]^=t[0],e[1]^=t[1],e[2]^=t[2],e[3]^=t[3],this.tableMultiply(e)};zt.gcm.prototype.generateHashTable=function(r,e){for(var t=8/e,n=4*t,s=16*t,i=new Array(s),a=0;a<s;++a){var u=[0,0,0,0],l=a/n|0,f=(n-1-a%n)*e;u[l]=1<<e-1<<f,i[a]=this.generateSubHashTable(this.multiply(u,r),e)}return i};zt.gcm.prototype.generateSubHashTable=function(r,e){var t=1<<e,n=t>>>1,s=new Array(t);s[n]=r.slice(0);for(var i=n>>>1;i>0;)this.pow(s[2*i],s[i]=[]),i>>=1;for(i=2;i<n;){for(var a=1;a<i;++a){var u=s[i],l=s[a];s[i+a]=[u[0]^l[0],u[1]^l[1],u[2]^l[2],u[3]^l[3]]}i*=2}for(s[0]=[0,0,0,0],i=n+1;i<t;++i){var f=s[i^n];s[i]=[r[0]^f[0],r[1]^f[1],r[2]^f[2],r[3]^f[3]]}return s};function Tw(r,e){if(typeof r=="string"&&(r=Cn.util.createBuffer(r)),Cn.util.isArray(r)&&r.length>4){var t=r;r=Cn.util.createBuffer();for(var n=0;n<t.length;++n)r.putByte(t[n])}if(r.length()<e)throw new Error("Invalid IV length; got "+r.length()+" bytes and expected "+e+" bytes.");if(!Cn.util.isArray(r)){for(var s=[],i=e/4,n=0;n<i;++n)s.push(r.getInt32());r=s}return r}o(Tw,"transformIV");function Iw(r){r[r.length-1]=r[r.length-1]+1&4294967295}o(Iw,"inc32");function Kb(r){return[r/4294967296|0,r&4294967295]}o(Kb,"from64To32")});var vu=ye((Yle,GP)=>{"use strict";var Ir=$t();Nw();$b();ur();GP.exports=Ir.aes=Ir.aes||{};Ir.aes.startEncrypting=function(r,e,t,n){var s=Bw({key:r,output:t,decrypt:!1,mode:n});return s.start(e),s};Ir.aes.createEncryptionCipher=function(r,e){return Bw({key:r,output:null,decrypt:!1,mode:e})};Ir.aes.startDecrypting=function(r,e,t,n){var s=Bw({key:r,output:t,decrypt:!0,mode:n});return s.start(e),s};Ir.aes.createDecryptionCipher=function(r,e){return Bw({key:r,output:null,decrypt:!0,mode:e})};Ir.aes.Algorithm=function(r,e){Wb||$P();var t=this;t.name=r,t.mode=new e({blockSize:16,cipher:{encrypt:o(function(n,s){return Gb(t._w,n,s,!1)},"encrypt"),decrypt:o(function(n,s){return Gb(t._w,n,s,!0)},"decrypt")}}),t._init=!1};Ir.aes.Algorithm.prototype.initialize=function(r){if(!this._init){var e=r.key,t;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=Ir.util.createBuffer(e);else if(Ir.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){t=e,e=Ir.util.createBuffer();for(var n=0;n<t.length;++n)e.putByte(t[n])}if(!Ir.util.isArray(e)){t=e,e=[];var s=t.length();if(s===16||s===24||s===32){s=s>>>2;for(var n=0;n<s;++n)e.push(t.getInt32())}}if(!Ir.util.isArray(e)||!(e.length===4||e.length===6||e.length===8))throw new Error("Invalid key parameter.");var i=this.mode.name,a=["CFB","OFB","CTR","GCM"].indexOf(i)!==-1;this._w=XP(e,r.decrypt&&!a),this._init=!0}};Ir.aes._expandKey=function(r,e){return Wb||$P(),XP(r,e)};Ir.aes._updateBlock=Gb;Fh("AES-ECB",Ir.cipher.modes.ecb);Fh("AES-CBC",Ir.cipher.modes.cbc);Fh("AES-CFB",Ir.cipher.modes.cfb);Fh("AES-OFB",Ir.cipher.modes.ofb);Fh("AES-CTR",Ir.cipher.modes.ctr);Fh("AES-GCM",Ir.cipher.modes.gcm);function Fh(r,e){var t=o(function(){return new Ir.aes.Algorithm(r,e)},"factory");Ir.cipher.registerAlgorithm(r,t)}o(Fh,"registerAlgorithm");var Wb=!1,jh=4,us,Xb,KP,fc,ji;function $P(){Wb=!0,KP=[0,1,2,4,8,16,32,64,128,27,54];for(var r=new Array(256),e=0;e<128;++e)r[e]=e<<1,r[e+128]=e+128<<1^283;us=new Array(256),Xb=new Array(256),fc=new Array(4),ji=new Array(4);for(var e=0;e<4;++e)fc[e]=new Array(256),ji[e]=new Array(256);for(var t=0,n=0,s,i,a,u,l,f,h,e=0;e<256;++e){u=n^n<<1^n<<2^n<<3^n<<4,u=u>>8^u&255^99,us[t]=u,Xb[u]=t,l=r[u],s=r[t],i=r[s],a=r[i],f=l<<24^u<<16^u<<8^(u^l),h=(s^i^a)<<24^(t^a)<<16^(t^i^a)<<8^(t^s^a);for(var m=0;m<4;++m)fc[m][t]=f,ji[m][u]=h,f=f<<24|f>>>8,h=h<<24|h>>>8;t===0?t=n=1:(t=s^r[r[r[s^a]]],n^=r[r[n]])}}o($P,"initialize");function XP(r,e){for(var t=r.slice(0),n,s=1,i=t.length,a=i+6+1,u=jh*a,l=i;l<u;++l)n=t[l-1],l%i===0?(n=us[n>>>16&255]<<24^us[n>>>8&255]<<16^us[n&255]<<8^us[n>>>24]^KP[s]<<24,s++):i>6&&l%i===4&&(n=us[n>>>24]<<24^us[n>>>16&255]<<16^us[n>>>8&255]<<8^us[n&255]),t[l]=t[l-i]^n;if(e){var f,h=ji[0],m=ji[1],g=ji[2],w=ji[3],y=t.slice(0);u=t.length;for(var l=0,S=u-jh;l<u;l+=jh,S-=jh)if(l===0||l===u-jh)y[l]=t[S],y[l+1]=t[S+3],y[l+2]=t[S+2],y[l+3]=t[S+1];else for(var E=0;E<jh;++E)f=t[S+E],y[l+(3&-E)]=h[us[f>>>24]]^m[us[f>>>16&255]]^g[us[f>>>8&255]]^w[us[f&255]];t=y}return t}o(XP,"_expandKey");function Gb(r,e,t,n){var s=r.length/4-1,i,a,u,l,f;n?(i=ji[0],a=ji[1],u=ji[2],l=ji[3],f=Xb):(i=fc[0],a=fc[1],u=fc[2],l=fc[3],f=us);var h,m,g,w,y,S,E;h=e[0]^r[0],m=e[n?3:1]^r[1],g=e[2]^r[2],w=e[n?1:3]^r[3];for(var b=3,T=1;T<s;++T)y=i[h>>>24]^a[m>>>16&255]^u[g>>>8&255]^l[w&255]^r[++b],S=i[m>>>24]^a[g>>>16&255]^u[w>>>8&255]^l[h&255]^r[++b],E=i[g>>>24]^a[w>>>16&255]^u[h>>>8&255]^l[m&255]^r[++b],w=i[w>>>24]^a[h>>>16&255]^u[m>>>8&255]^l[g&255]^r[++b],h=y,m=S,g=E;t[0]=f[h>>>24]<<24^f[m>>>16&255]<<16^f[g>>>8&255]<<8^f[w&255]^r[++b],t[n?3:1]=f[m>>>24]<<24^f[g>>>16&255]<<16^f[w>>>8&255]<<8^f[h&255]^r[++b],t[2]=f[g>>>24]<<24^f[w>>>16&255]<<16^f[h>>>8&255]<<8^f[m&255]^r[++b],t[n?1:3]=f[w>>>24]<<24^f[h>>>16&255]<<16^f[m>>>8&255]<<8^f[g&255]^r[++b]}o(Gb,"_updateBlock");function Bw(r){r=r||{};var e=(r.mode||"CBC").toUpperCase(),t="AES-"+e,n;r.decrypt?n=Ir.cipher.createDecipher(t,r.key):n=Ir.cipher.createCipher(t,r.key);var s=n.start;return n.start=function(i,a){var u=null;a instanceof Ir.util.ByteBuffer&&(u=a,a={}),a=a||{},a.output=u,a.iv=i,s.call(n,a)},n}o(Bw,"_createCipher")});var wu=ye((Zle,WP)=>{"use strict";var vm=$t();vm.pki=vm.pki||{};var Jb=WP.exports=vm.pki.oids=vm.oids=vm.oids||{};function Ue(r,e){Jb[r]=e,Jb[e]=r}o(Ue,"_IN");function yr(r,e){Jb[r]=e}o(yr,"_I_");Ue("1.2.840.113549.1.1.1","rsaEncryption");Ue("1.2.840.113549.1.1.4","md5WithRSAEncryption");Ue("1.2.840.113549.1.1.5","sha1WithRSAEncryption");Ue("1.2.840.113549.1.1.7","RSAES-OAEP");Ue("1.2.840.113549.1.1.8","mgf1");Ue("1.2.840.113549.1.1.9","pSpecified");Ue("1.2.840.113549.1.1.10","RSASSA-PSS");Ue("1.2.840.113549.1.1.11","sha256WithRSAEncryption");Ue("1.2.840.113549.1.1.12","sha384WithRSAEncryption");Ue("1.2.840.113549.1.1.13","sha512WithRSAEncryption");Ue("1.3.101.112","EdDSA25519");Ue("1.2.840.10040.4.3","dsa-with-sha1");Ue("1.3.14.3.2.7","desCBC");Ue("1.3.14.3.2.26","sha1");Ue("1.3.14.3.2.29","sha1WithRSASignature");Ue("2.16.840.1.101.3.4.2.1","sha256");Ue("2.16.840.1.101.3.4.2.2","sha384");Ue("2.16.840.1.101.3.4.2.3","sha512");Ue("2.16.840.1.101.3.4.2.4","sha224");Ue("2.16.840.1.101.3.4.2.5","sha512-224");Ue("2.16.840.1.101.3.4.2.6","sha512-256");Ue("1.2.840.113549.2.2","md2");Ue("1.2.840.113549.2.5","md5");Ue("1.2.840.113549.1.7.1","data");Ue("1.2.840.113549.1.7.2","signedData");Ue("1.2.840.113549.1.7.3","envelopedData");Ue("1.2.840.113549.1.7.4","signedAndEnvelopedData");Ue("1.2.840.113549.1.7.5","digestedData");Ue("1.2.840.113549.1.7.6","encryptedData");Ue("1.2.840.113549.1.9.1","emailAddress");Ue("1.2.840.113549.1.9.2","unstructuredName");Ue("1.2.840.113549.1.9.3","contentType");Ue("1.2.840.113549.1.9.4","messageDigest");Ue("1.2.840.113549.1.9.5","signingTime");Ue("1.2.840.113549.1.9.6","counterSignature");Ue("1.2.840.113549.1.9.7","challengePassword");Ue("1.2.840.113549.1.9.8","unstructuredAddress");Ue("1.2.840.113549.1.9.14","extensionRequest");Ue("1.2.840.113549.1.9.20","friendlyName");Ue("1.2.840.113549.1.9.21","localKeyId");Ue("1.2.840.113549.1.9.22.1","x509Certificate");Ue("1.2.840.113549.1.12.10.1.1","keyBag");Ue("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");Ue("1.2.840.113549.1.12.10.1.3","certBag");Ue("1.2.840.113549.1.12.10.1.4","crlBag");Ue("1.2.840.113549.1.12.10.1.5","secretBag");Ue("1.2.840.113549.1.12.10.1.6","safeContentsBag");Ue("1.2.840.113549.1.5.13","pkcs5PBES2");Ue("1.2.840.113549.1.5.12","pkcs5PBKDF2");Ue("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");Ue("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");Ue("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");Ue("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");Ue("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");Ue("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");Ue("1.2.840.113549.2.7","hmacWithSHA1");Ue("1.2.840.113549.2.8","hmacWithSHA224");Ue("1.2.840.113549.2.9","hmacWithSHA256");Ue("1.2.840.113549.2.10","hmacWithSHA384");Ue("1.2.840.113549.2.11","hmacWithSHA512");Ue("1.2.840.113549.3.7","des-EDE3-CBC");Ue("2.16.840.1.101.3.4.1.2","aes128-CBC");Ue("2.16.840.1.101.3.4.1.22","aes192-CBC");Ue("2.16.840.1.101.3.4.1.42","aes256-CBC");Ue("2.5.4.3","commonName");Ue("2.5.4.4","surname");Ue("2.5.4.5","serialNumber");Ue("2.5.4.6","countryName");Ue("2.5.4.7","localityName");Ue("2.5.4.8","stateOrProvinceName");Ue("2.5.4.9","streetAddress");Ue("2.5.4.10","organizationName");Ue("2.5.4.11","organizationalUnitName");Ue("2.5.4.12","title");Ue("2.5.4.13","description");Ue("2.5.4.15","businessCategory");Ue("2.5.4.17","postalCode");Ue("2.5.4.42","givenName");Ue("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");Ue("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");Ue("2.16.840.1.113730.1.1","nsCertType");Ue("2.16.840.1.113730.1.13","nsComment");yr("2.5.29.1","authorityKeyIdentifier");yr("2.5.29.2","keyAttributes");yr("2.5.29.3","certificatePolicies");yr("2.5.29.4","keyUsageRestriction");yr("2.5.29.5","policyMapping");yr("2.5.29.6","subtreesConstraint");yr("2.5.29.7","subjectAltName");yr("2.5.29.8","issuerAltName");yr("2.5.29.9","subjectDirectoryAttributes");yr("2.5.29.10","basicConstraints");yr("2.5.29.11","nameConstraints");yr("2.5.29.12","policyConstraints");yr("2.5.29.13","basicConstraints");Ue("2.5.29.14","subjectKeyIdentifier");Ue("2.5.29.15","keyUsage");yr("2.5.29.16","privateKeyUsagePeriod");Ue("2.5.29.17","subjectAltName");Ue("2.5.29.18","issuerAltName");Ue("2.5.29.19","basicConstraints");yr("2.5.29.20","cRLNumber");yr("2.5.29.21","cRLReason");yr("2.5.29.22","expirationDate");yr("2.5.29.23","instructionCode");yr("2.5.29.24","invalidityDate");yr("2.5.29.25","cRLDistributionPoints");yr("2.5.29.26","issuingDistributionPoint");yr("2.5.29.27","deltaCRLIndicator");yr("2.5.29.28","issuingDistributionPoint");yr("2.5.29.29","certificateIssuer");yr("2.5.29.30","nameConstraints");Ue("2.5.29.31","cRLDistributionPoints");Ue("2.5.29.32","certificatePolicies");yr("2.5.29.33","policyMappings");yr("2.5.29.34","policyConstraints");Ue("2.5.29.35","authorityKeyIdentifier");yr("2.5.29.36","policyConstraints");Ue("2.5.29.37","extKeyUsage");yr("2.5.29.46","freshestCRL");yr("2.5.29.54","inhibitAnyPolicy");Ue("1.3.6.1.4.1.11129.2.4.2","timestampList");Ue("1.3.6.1.5.5.7.1.1","authorityInfoAccess");Ue("1.3.6.1.5.5.7.3.1","serverAuth");Ue("1.3.6.1.5.5.7.3.2","clientAuth");Ue("1.3.6.1.5.5.7.3.3","codeSigning");Ue("1.3.6.1.5.5.7.3.4","emailProtection");Ue("1.3.6.1.5.5.7.3.8","timeStamping")});var Fi=ye((tce,zP)=>{"use strict";var Lr=$t();ur();wu();var Qe=zP.exports=Lr.asn1=Lr.asn1||{};Qe.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};Qe.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};Qe.create=function(r,e,t,n,s){if(Lr.util.isArray(n)){for(var i=[],a=0;a<n.length;++a)n[a]!==void 0&&i.push(n[a]);n=i}var u={tagClass:r,type:e,constructed:t,composed:t||Lr.util.isArray(n),value:n};return s&&"bitStringContents"in s&&(u.bitStringContents=s.bitStringContents,u.original=Qe.copy(u)),u};Qe.copy=function(r,e){var t;if(Lr.util.isArray(r)){t=[];for(var n=0;n<r.length;++n)t.push(Qe.copy(r[n],e));return t}return typeof r=="string"?r:(t={tagClass:r.tagClass,type:r.type,constructed:r.constructed,composed:r.composed,value:Qe.copy(r.value,e)},e&&!e.excludeBitStringContents&&(t.bitStringContents=r.bitStringContents),t)};Qe.equals=function(r,e,t){if(Lr.util.isArray(r)){if(!Lr.util.isArray(e)||r.length!==e.length)return!1;for(var n=0;n<r.length;++n)if(!Qe.equals(r[n],e[n]))return!1;return!0}if(typeof r!=typeof e)return!1;if(typeof r=="string")return r===e;var s=r.tagClass===e.tagClass&&r.type===e.type&&r.constructed===e.constructed&&r.composed===e.composed&&Qe.equals(r.value,e.value);return t&&t.includeBitStringContents&&(s=s&&r.bitStringContents===e.bitStringContents),s};Qe.getBerValueLength=function(r){var e=r.getByte();if(e!==128){var t,n=e&128;return n?t=r.getInt((e&127)<<3):t=e,t}};function wm(r,e,t){if(t>e){var n=new Error("Too few bytes to parse DER.");throw n.available=r.length(),n.remaining=e,n.requested=t,n}}o(wm,"_checkBufferLength");var U$=o(function(r,e){var t=r.getByte();if(e--,t!==128){var n,s=t&128;if(!s)n=t;else{var i=t&127;wm(r,e,i),n=r.getInt(i<<3)}if(n<0)throw new Error("Negative length: "+n);return n}},"_getValueLength");Qe.fromDer=function(r,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof r=="string"&&(r=Lr.util.createBuffer(r));var t=r.length(),n=Dw(r,r.length(),0,e);if(e.parseAllBytes&&r.length()!==0){var s=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw s.byteCount=t,s.remaining=r.length(),s}return n};function Dw(r,e,t,n){var s;wm(r,e,2);var i=r.getByte();e--;var a=i&192,u=i&31;s=r.length();var l=U$(r,e);if(e-=s-r.length(),l!==void 0&&l>e){if(n.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=r.length(),f.remaining=e,f.requested=l,f}l=e}var h,m,g=(i&32)===32;if(g)if(h=[],l===void 0)for(;;){if(wm(r,e,2),r.bytes(2)==="\0\0"){r.getBytes(2),e-=2;break}s=r.length(),h.push(Dw(r,e,t+1,n)),e-=s-r.length()}else for(;l>0;)s=r.length(),h.push(Dw(r,l,t+1,n)),e-=s-r.length(),l-=s-r.length();if(h===void 0&&a===Qe.Class.UNIVERSAL&&u===Qe.Type.BITSTRING&&(m=r.bytes(l)),h===void 0&&n.decodeBitStrings&&a===Qe.Class.UNIVERSAL&&u===Qe.Type.BITSTRING&&l>1){var w=r.read,y=e,S=0;if(u===Qe.Type.BITSTRING&&(wm(r,e,1),S=r.getByte(),e--),S===0)try{s=r.length();var E={strict:!0,decodeBitStrings:!0},b=Dw(r,e,t+1,E),T=s-r.length();e-=T,u==Qe.Type.BITSTRING&&T++;var A=b.tagClass;T===l&&(A===Qe.Class.UNIVERSAL||A===Qe.Class.CONTEXT_SPECIFIC)&&(h=[b])}catch{}h===void 0&&(r.read=w,e=y)}if(h===void 0){if(l===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");l=e}if(u===Qe.Type.BMPSTRING)for(h="";l>0;l-=2)wm(r,e,2),h+=String.fromCharCode(r.getInt16()),e-=2;else h=r.getBytes(l),e-=l}var C=m===void 0?null:{bitStringContents:m};return Qe.create(a,u,g,h,C)}o(Dw,"_fromDer");Qe.toDer=function(r){var e=Lr.util.createBuffer(),t=r.tagClass|r.type,n=Lr.util.createBuffer(),s=!1;if("bitStringContents"in r&&(s=!0,r.original&&(s=Qe.equals(r,r.original))),s)n.putBytes(r.bitStringContents);else if(r.composed){r.constructed?t|=32:n.putByte(0);for(var i=0;i<r.value.length;++i)r.value[i]!==void 0&&n.putBuffer(Qe.toDer(r.value[i]))}else if(r.type===Qe.Type.BMPSTRING)for(var i=0;i<r.value.length;++i)n.putInt16(r.value.charCodeAt(i));else r.type===Qe.Type.INTEGER&&r.value.length>1&&(r.value.charCodeAt(0)===0&&(r.value.charCodeAt(1)&128)===0||r.value.charCodeAt(0)===255&&(r.value.charCodeAt(1)&128)===128)?n.putBytes(r.value.substr(1)):n.putBytes(r.value);if(e.putByte(t),n.length()<=127)e.putByte(n.length()&127);else{var a=n.length(),u="";do u+=String.fromCharCode(a&255),a=a>>>8;while(a>0);e.putByte(u.length|128);for(var i=u.length-1;i>=0;--i)e.putByte(u.charCodeAt(i))}return e.putBuffer(n),e};Qe.oidToDer=function(r){var e=r.split("."),t=Lr.util.createBuffer();t.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,s,i,a,u=2;u<e.length;++u){n=!0,s=[],i=parseInt(e[u],10);do a=i&127,i=i>>>7,n||(a|=128),s.push(a),n=!1;while(i>0);for(var l=s.length-1;l>=0;--l)t.putByte(s[l])}return t};Qe.derToOid=function(r){var e;typeof r=="string"&&(r=Lr.util.createBuffer(r));var t=r.getByte();e=Math.floor(t/40)+"."+t%40;for(var n=0;r.length()>0;)t=r.getByte(),n=n<<7,t&128?n+=t&127:(e+="."+(n+t),n=0);return e};Qe.utcTimeToDate=function(r){var e=new Date,t=parseInt(r.substr(0,2),10);t=t>=50?1900+t:2e3+t;var n=parseInt(r.substr(2,2),10)-1,s=parseInt(r.substr(4,2),10),i=parseInt(r.substr(6,2),10),a=parseInt(r.substr(8,2),10),u=0;if(r.length>11){var l=r.charAt(10),f=10;l!=="+"&&l!=="-"&&(u=parseInt(r.substr(10,2),10),f+=2)}if(e.setUTCFullYear(t,n,s),e.setUTCHours(i,a,u,0),f&&(l=r.charAt(f),l==="+"||l==="-")){var h=parseInt(r.substr(f+1,2),10),m=parseInt(r.substr(f+4,2),10),g=h*60+m;g*=6e4,l==="+"?e.setTime(+e-g):e.setTime(+e+g)}return e};Qe.generalizedTimeToDate=function(r){var e=new Date,t=parseInt(r.substr(0,4),10),n=parseInt(r.substr(4,2),10)-1,s=parseInt(r.substr(6,2),10),i=parseInt(r.substr(8,2),10),a=parseInt(r.substr(10,2),10),u=parseInt(r.substr(12,2),10),l=0,f=0,h=!1;r.charAt(r.length-1)==="Z"&&(h=!0);var m=r.length-5,g=r.charAt(m);if(g==="+"||g==="-"){var w=parseInt(r.substr(m+1,2),10),y=parseInt(r.substr(m+4,2),10);f=w*60+y,f*=6e4,g==="+"&&(f*=-1),h=!0}return r.charAt(14)==="."&&(l=parseFloat(r.substr(14),10)*1e3),h?(e.setUTCFullYear(t,n,s),e.setUTCHours(i,a,u,l),e.setTime(+e+f)):(e.setFullYear(t,n,s),e.setHours(i,a,u,l)),e};Qe.dateToUtcTime=function(r){if(typeof r=="string")return r;var e="",t=[];t.push((""+r.getUTCFullYear()).substr(2)),t.push(""+(r.getUTCMonth()+1)),t.push(""+r.getUTCDate()),t.push(""+r.getUTCHours()),t.push(""+r.getUTCMinutes()),t.push(""+r.getUTCSeconds());for(var n=0;n<t.length;++n)t[n].length<2&&(e+="0"),e+=t[n];return e+="Z",e};Qe.dateToGeneralizedTime=function(r){if(typeof r=="string")return r;var e="",t=[];t.push(""+r.getUTCFullYear()),t.push(""+(r.getUTCMonth()+1)),t.push(""+r.getUTCDate()),t.push(""+r.getUTCHours()),t.push(""+r.getUTCMinutes()),t.push(""+r.getUTCSeconds());for(var n=0;n<t.length;++n)t[n].length<2&&(e+="0"),e+=t[n];return e+="Z",e};Qe.integerToDer=function(r){var e=Lr.util.createBuffer();if(r>=-128&&r<128)return e.putSignedInt(r,8);if(r>=-32768&&r<32768)return e.putSignedInt(r,16);if(r>=-8388608&&r<8388608)return e.putSignedInt(r,24);if(r>=-2147483648&&r<2147483648)return e.putSignedInt(r,32);var t=new Error("Integer too large; max is 32-bits.");throw t.integer=r,t};Qe.derToInteger=function(r){typeof r=="string"&&(r=Lr.util.createBuffer(r));var e=r.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return r.getSignedInt(e)};Qe.validate=function(r,e,t,n){var s=!1;if((r.tagClass===e.tagClass||typeof e.tagClass>"u")&&(r.type===e.type||typeof e.type>"u"))if(r.constructed===e.constructed||typeof e.constructed>"u"){if(s=!0,e.value&&Lr.util.isArray(e.value))for(var i=0,a=0;s&&a<e.value.length;++a)s=e.value[a].optional||!1,r.value[i]&&(s=Qe.validate(r.value[i],e.value[a],t,n),s?++i:e.value[a].optional&&(s=!0)),!s&&n&&n.push("["+e.name+'] Tag class "'+e.tagClass+'", type "'+e.type+'" expected value length "'+e.value.length+'", got "'+r.value.length+'"');if(s&&t&&(e.capture&&(t[e.capture]=r.value),e.captureAsn1&&(t[e.captureAsn1]=r),e.captureBitStringContents&&"bitStringContents"in r&&(t[e.captureBitStringContents]=r.bitStringContents),e.captureBitStringValue&&"bitStringContents"in r)){var u;if(r.bitStringContents.length<2)t[e.captureBitStringValue]="";else{var l=r.bitStringContents.charCodeAt(0);if(l!==0)throw new Error("captureBitStringValue only supported for zero unused bits");t[e.captureBitStringValue]=r.bitStringContents.slice(1)}}}else n&&n.push("["+e.name+'] Expected constructed "'+e.constructed+'", got "'+r.constructed+'"');else n&&(r.tagClass!==e.tagClass&&n.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+r.tagClass+'"'),r.type!==e.type&&n.push("["+e.name+'] Expected type "'+e.type+'", got "'+r.type+'"'));return s};var JP=/[^\\u0000-\\u00ff]/;Qe.prettyPrint=function(r,e,t){var n="";e=e||0,t=t||2,e>0&&(n+=`
5
- `);for(var s="",i=0;i<e*t;++i)s+=" ";switch(n+=s+"Tag: ",r.tagClass){case Qe.Class.UNIVERSAL:n+="Universal:";break;case Qe.Class.APPLICATION:n+="Application:";break;case Qe.Class.CONTEXT_SPECIFIC:n+="Context-Specific:";break;case Qe.Class.PRIVATE:n+="Private:";break}if(r.tagClass===Qe.Class.UNIVERSAL)switch(n+=r.type,r.type){case Qe.Type.NONE:n+=" (None)";break;case Qe.Type.BOOLEAN:n+=" (Boolean)";break;case Qe.Type.INTEGER:n+=" (Integer)";break;case Qe.Type.BITSTRING:n+=" (Bit string)";break;case Qe.Type.OCTETSTRING:n+=" (Octet string)";break;case Qe.Type.NULL:n+=" (Null)";break;case Qe.Type.OID:n+=" (Object Identifier)";break;case Qe.Type.ODESC:n+=" (Object Descriptor)";break;case Qe.Type.EXTERNAL:n+=" (External or Instance of)";break;case Qe.Type.REAL:n+=" (Real)";break;case Qe.Type.ENUMERATED:n+=" (Enumerated)";break;case Qe.Type.EMBEDDED:n+=" (Embedded PDV)";break;case Qe.Type.UTF8:n+=" (UTF8)";break;case Qe.Type.ROID:n+=" (Relative Object Identifier)";break;case Qe.Type.SEQUENCE:n+=" (Sequence)";break;case Qe.Type.SET:n+=" (Set)";break;case Qe.Type.PRINTABLESTRING:n+=" (Printable String)";break;case Qe.Type.IA5String:n+=" (IA5String (ASCII))";break;case Qe.Type.UTCTIME:n+=" (UTC time)";break;case Qe.Type.GENERALIZEDTIME:n+=" (Generalized time)";break;case Qe.Type.BMPSTRING:n+=" (BMP String)";break}else n+=r.type;if(n+=`
6
- `,n+=s+"Constructed: "+r.constructed+`
7
- `,r.composed){for(var a=0,u="",i=0;i<r.value.length;++i)r.value[i]!==void 0&&(a+=1,u+=Qe.prettyPrint(r.value[i],e+1,t),i+1<r.value.length&&(u+=","));n+=s+"Sub values: "+a+u}else{if(n+=s+"Value: ",r.type===Qe.Type.OID){var l=Qe.derToOid(r.value);n+=l,Lr.pki&&Lr.pki.oids&&l in Lr.pki.oids&&(n+=" ("+Lr.pki.oids[l]+") ")}if(r.type===Qe.Type.INTEGER)try{n+=Qe.derToInteger(r.value)}catch{n+="0x"+Lr.util.bytesToHex(r.value)}else if(r.type===Qe.Type.BITSTRING){if(r.value.length>1?n+="0x"+Lr.util.bytesToHex(r.value.slice(1)):n+="(none)",r.value.length>0){var f=r.value.charCodeAt(0);f==1?n+=" (1 unused bit shown)":f>1&&(n+=" ("+f+" unused bits shown)")}}else if(r.type===Qe.Type.OCTETSTRING)JP.test(r.value)||(n+="("+r.value+") "),n+="0x"+Lr.util.bytesToHex(r.value);else if(r.type===Qe.Type.UTF8)try{n+=Lr.util.decodeUtf8(r.value)}catch(h){if(h.message==="URI malformed")n+="0x"+Lr.util.bytesToHex(r.value)+" (malformed UTF8)";else throw h}else r.type===Qe.Type.PRINTABLESTRING||r.type===Qe.Type.IA5String?n+=r.value:JP.test(r.value)?n+="0x"+Lr.util.bytesToHex(r.value):r.value.length===0?n+="[null]":n+=r.value}return n}});var da=ye((nce,YP)=>{"use strict";var _w=$t();YP.exports=_w.md=_w.md||{};_w.md.algorithms=_w.md.algorithms||{}});var qh=ye((sce,QP)=>{"use strict";var fo=$t();da();ur();var M$=QP.exports=fo.hmac=fo.hmac||{};M$.create=function(){var r=null,e=null,t=null,n=null,s={};return s.start=function(i,a){if(i!==null)if(typeof i=="string")if(i=i.toLowerCase(),i in fo.md.algorithms)e=fo.md.algorithms[i].create();else throw new Error('Unknown hash algorithm "'+i+'"');else e=i;if(a===null)a=r;else{if(typeof a=="string")a=fo.util.createBuffer(a);else if(fo.util.isArray(a)){var u=a;a=fo.util.createBuffer();for(var l=0;l<u.length;++l)a.putByte(u[l])}var f=a.length();f>e.blockLength&&(e.start(),e.update(a.bytes()),a=e.digest()),t=fo.util.createBuffer(),n=fo.util.createBuffer(),f=a.length();for(var l=0;l<f;++l){var u=a.at(l);t.putByte(54^u),n.putByte(92^u)}if(f<e.blockLength)for(var u=e.blockLength-f,l=0;l<u;++l)t.putByte(54),n.putByte(92);r=a,t=t.bytes(),n=n.bytes()}e.start(),e.update(t)},s.update=function(i){e.update(i)},s.getMac=function(){var i=e.digest().bytes();return e.start(),e.update(n),e.update(i),e.digest()},s.digest=s.getMac,s}});var Pw=ye((ice,rO)=>{"use strict";var ma=$t();da();ur();var eO=rO.exports=ma.md5=ma.md5||{};ma.md.md5=ma.md.algorithms.md5=eO;eO.create=function(){tO||j$();var r=null,e=ma.util.createBuffer(),t=new Array(16),n={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var s=n.messageLengthSize/4,i=0;i<s;++i)n.fullMessageLength.push(0);return e=ma.util.createBuffer(),r={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},n},n.start(),n.update=function(s,i){i==="utf8"&&(s=ma.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var u=n.fullMessageLength.length-1;u>=0;--u)n.fullMessageLength[u]+=a[1],a[1]=a[0]+(n.fullMessageLength[u]/4294967296>>>0),n.fullMessageLength[u]=n.fullMessageLength[u]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),ZP(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=ma.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(zb.substr(0,n.blockLength-a));for(var u,l=0,f=n.fullMessageLength.length-1;f>=0;--f)u=n.fullMessageLength[f]*8+l,l=u/4294967296>>>0,s.putInt32Le(u>>>0);var h={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3};ZP(h,t,s);var m=ma.util.createBuffer();return m.putInt32Le(h.h0),m.putInt32Le(h.h1),m.putInt32Le(h.h2),m.putInt32Le(h.h3),m},n};var zb=null,Rw=null,Sm=null,Hh=null,tO=!1;function j$(){zb="\x80",zb+=ma.util.fillString("\0",64),Rw=[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],Sm=[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],Hh=new Array(64);for(var r=0;r<64;++r)Hh[r]=Math.floor(Math.abs(Math.sin(r+1))*4294967296);tO=!0}o(j$,"_init");function ZP(r,e,t){for(var n,s,i,a,u,l,f,h,m=t.length();m>=64;){for(s=r.h0,i=r.h1,a=r.h2,u=r.h3,h=0;h<16;++h)e[h]=t.getInt32Le(),l=u^i&(a^u),n=s+l+Hh[h]+e[h],f=Sm[h],s=u,u=a,a=i,i+=n<<f|n>>>32-f;for(;h<32;++h)l=a^u&(i^a),n=s+l+Hh[h]+e[Rw[h]],f=Sm[h],s=u,u=a,a=i,i+=n<<f|n>>>32-f;for(;h<48;++h)l=i^a^u,n=s+l+Hh[h]+e[Rw[h]],f=Sm[h],s=u,u=a,a=i,i+=n<<f|n>>>32-f;for(;h<64;++h)l=a^(i|~u),n=s+l+Hh[h]+e[Rw[h]],f=Sm[h],s=u,u=a,a=i,i+=n<<f|n>>>32-f;r.h0=r.h0+s|0,r.h1=r.h1+i|0,r.h2=r.h2+a|0,r.h3=r.h3+u|0,m-=64}}o(ZP,"_update")});var hc=ye((oce,sO)=>{"use strict";var kw=$t();ur();var nO=sO.exports=kw.pem=kw.pem||{};nO.encode=function(r,e){e=e||{};var t="-----BEGIN "+r.type+`-----\r
8
- `,n;if(r.procType&&(n={name:"Proc-Type",values:[String(r.procType.version),r.procType.type]},t+=Ow(n)),r.contentDomain&&(n={name:"Content-Domain",values:[r.contentDomain]},t+=Ow(n)),r.dekInfo&&(n={name:"DEK-Info",values:[r.dekInfo.algorithm]},r.dekInfo.parameters&&n.values.push(r.dekInfo.parameters),t+=Ow(n)),r.headers)for(var s=0;s<r.headers.length;++s)t+=Ow(r.headers[s]);return r.procType&&(t+=`\r
9
- `),t+=kw.util.encode64(r.body,e.maxline||64)+`\r
10
- `,t+="-----END "+r.type+`-----\r
11
- `,t};nO.decode=function(r){for(var e=[],t=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,n=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,s=/\r?\n/,i;i=t.exec(r),!!i;){var a=i[1];a==="NEW CERTIFICATE REQUEST"&&(a="CERTIFICATE REQUEST");var u={type:a,procType:null,contentDomain:null,dekInfo:null,headers:[],body:kw.util.decode64(i[3])};if(e.push(u),!!i[2]){for(var l=i[2].split(s),f=0;i&&f<l.length;){for(var h=l[f].replace(/\s+$/,""),m=f+1;m<l.length;++m){var g=l[m];if(!/\s/.test(g[0]))break;h+=g,f=m}if(i=h.match(n),i){for(var w={name:i[1],values:[]},y=i[2].split(","),S=0;S<y.length;++S)w.values.push(F$(y[S]));if(u.procType)if(!u.contentDomain&&w.name==="Content-Domain")u.contentDomain=y[0]||"";else if(!u.dekInfo&&w.name==="DEK-Info"){if(w.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');u.dekInfo={algorithm:y[0],parameters:y[1]||null}}else u.headers.push(w);else{if(w.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(w.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');u.procType={version:y[0],type:y[1]}}}++f}if(u.procType==="ENCRYPTED"&&!u.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(e.length===0)throw new Error("Invalid PEM formatted message.");return e};function Ow(r){for(var e=r.name+": ",t=[],n=o(function(l,f){return" "+f},"insertSpace"),s=0;s<r.values.length;++s)t.push(r.values[s].replace(/^(\S+\r\n)/,n));e+=t.join(",")+`\r
12
- `;for(var i=0,a=-1,s=0;s<e.length;++s,++i)if(i>65&&a!==-1){var u=e[a];u===","?(++a,e=e.substr(0,a)+`\r
13
- `+e.substr(a)):e=e.substr(0,a)+`\r
14
- `+u+e.substr(a+1),i=s-a-1,a=-1,++s}else(e[s]===" "||e[s]===" "||e[s]===",")&&(a=s);return e}o(Ow,"foldHeader");function F$(r){return r.replace(/^\s+/,"")}o(F$,"ltrim")});var Em=ye((lce,aO)=>{"use strict";var jr=$t();Nw();$b();ur();aO.exports=jr.des=jr.des||{};jr.des.startEncrypting=function(r,e,t,n){var s=Lw({key:r,output:t,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return s.start(e),s};jr.des.createEncryptionCipher=function(r,e){return Lw({key:r,output:null,decrypt:!1,mode:e})};jr.des.startDecrypting=function(r,e,t,n){var s=Lw({key:r,output:t,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return s.start(e),s};jr.des.createDecryptionCipher=function(r,e){return Lw({key:r,output:null,decrypt:!0,mode:e})};jr.des.Algorithm=function(r,e){var t=this;t.name=r,t.mode=new e({blockSize:8,cipher:{encrypt:o(function(n,s){return iO(t._keys,n,s,!1)},"encrypt"),decrypt:o(function(n,s){return iO(t._keys,n,s,!0)},"decrypt")}}),t._init=!1};jr.des.Algorithm.prototype.initialize=function(r){if(!this._init){var e=jr.util.createBuffer(r.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=z$(e),this._init=!0}};ga("DES-ECB",jr.cipher.modes.ecb);ga("DES-CBC",jr.cipher.modes.cbc);ga("DES-CFB",jr.cipher.modes.cfb);ga("DES-OFB",jr.cipher.modes.ofb);ga("DES-CTR",jr.cipher.modes.ctr);ga("3DES-ECB",jr.cipher.modes.ecb);ga("3DES-CBC",jr.cipher.modes.cbc);ga("3DES-CFB",jr.cipher.modes.cfb);ga("3DES-OFB",jr.cipher.modes.ofb);ga("3DES-CTR",jr.cipher.modes.ctr);function ga(r,e){var t=o(function(){return new jr.des.Algorithm(r,e)},"factory");jr.cipher.registerAlgorithm(r,t)}o(ga,"registerAlgorithm");var q$=[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],H$=[-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],K$=[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],$$=[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],X$=[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],G$=[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],W$=[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],J$=[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 z$(r){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],t=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],s=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],i=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],a=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],l=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],m=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],g=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],w=[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],S=r.length()>8?3:1,E=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],T=0,A,C=0;C<S;C++){var x=r.getInt32(),B=r.getInt32();A=(x>>>4^B)&252645135,B^=A,x^=A<<4,A=(B>>>-16^x)&65535,x^=A,B^=A<<-16,A=(x>>>2^B)&858993459,B^=A,x^=A<<2,A=(B>>>-16^x)&65535,x^=A,B^=A<<-16,A=(x>>>1^B)&1431655765,B^=A,x^=A<<1,A=(B>>>8^x)&16711935,x^=A,B^=A<<8,A=(x>>>1^B)&1431655765,B^=A,x^=A<<1,A=x<<8|B>>>20&240,x=B<<24|B<<8&16711680|B>>>8&65280|B>>>24&240,B=A;for(var F=0;F<b.length;++F){b[F]?(x=x<<2|x>>>26,B=B<<2|B>>>26):(x=x<<1|x>>>27,B=B<<1|B>>>27),x&=-15,B&=-15;var R=e[x>>>28]|t[x>>>24&15]|n[x>>>20&15]|s[x>>>16&15]|i[x>>>12&15]|a[x>>>8&15]|u[x>>>4&15],H=l[B>>>28]|f[B>>>24&15]|h[B>>>20&15]|m[B>>>16&15]|g[B>>>12&15]|w[B>>>8&15]|y[B>>>4&15];A=(H>>>16^R)&65535,E[T++]=R^A,E[T++]=H^A<<16}}return E}o(z$,"_createKeys");function iO(r,e,t,n){var s=r.length===32?3:9,i;s===3?i=n?[30,-2,-2]:[0,32,2]:i=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var a,u=e[0],l=e[1];a=(u>>>4^l)&252645135,l^=a,u^=a<<4,a=(u>>>16^l)&65535,l^=a,u^=a<<16,a=(l>>>2^u)&858993459,u^=a,l^=a<<2,a=(l>>>8^u)&16711935,u^=a,l^=a<<8,a=(u>>>1^l)&1431655765,l^=a,u^=a<<1,u=u<<1|u>>>31,l=l<<1|l>>>31;for(var f=0;f<s;f+=3){for(var h=i[f+1],m=i[f+2],g=i[f];g!=h;g+=m){var w=l^r[g],y=(l>>>4|l<<28)^r[g+1];a=u,u=l,l=a^(H$[w>>>24&63]|$$[w>>>16&63]|G$[w>>>8&63]|J$[w&63]|q$[y>>>24&63]|K$[y>>>16&63]|X$[y>>>8&63]|W$[y&63])}a=u,u=l,l=a}u=u>>>1|u<<31,l=l>>>1|l<<31,a=(u>>>1^l)&1431655765,l^=a,u^=a<<1,a=(l>>>8^u)&16711935,u^=a,l^=a<<8,a=(l>>>2^u)&858993459,u^=a,l^=a<<2,a=(u>>>16^l)&65535,l^=a,u^=a<<16,a=(u>>>4^l)&252645135,l^=a,u^=a<<4,t[0]=u,t[1]=l}o(iO,"_updateBlock");function Lw(r){r=r||{};var e=(r.mode||"CBC").toUpperCase(),t="DES-"+e,n;r.decrypt?n=jr.cipher.createDecipher(t,r.key):n=jr.cipher.createCipher(t,r.key);var s=n.start;return n.start=function(i,a){var u=null;a instanceof jr.util.ByteBuffer&&(u=a,a={}),a=a||{},a.output=u,a.iv=i,s.call(n,a)},n}o(Lw,"_createCipher")});var Vw=ye((fce,oO)=>{"use strict";var ls=$t();qh();da();ur();var Y$=ls.pkcs5=ls.pkcs5||{},ho;ls.util.isNodejs&&!ls.options.usePureJavaScript&&(ho=gt("crypto"));oO.exports=ls.pbkdf2=Y$.pbkdf2=function(r,e,t,n,s,i){if(typeof s=="function"&&(i=s,s=null),ls.util.isNodejs&&!ls.options.usePureJavaScript&&ho.pbkdf2&&(s===null||typeof s!="object")&&(ho.pbkdf2Sync.length>4||!s||s==="sha1"))return typeof s!="string"&&(s="sha1"),r=Buffer.from(r,"binary"),e=Buffer.from(e,"binary"),i?ho.pbkdf2Sync.length===4?ho.pbkdf2(r,e,t,n,function(A,C){if(A)return i(A);i(null,C.toString("binary"))}):ho.pbkdf2(r,e,t,n,s,function(A,C){if(A)return i(A);i(null,C.toString("binary"))}):ho.pbkdf2Sync.length===4?ho.pbkdf2Sync(r,e,t,n).toString("binary"):ho.pbkdf2Sync(r,e,t,n,s).toString("binary");if((typeof s>"u"||s===null)&&(s="sha1"),typeof s=="string"){if(!(s in ls.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=ls.md[s].create()}var a=s.digestLength;if(n>4294967295*a){var u=new Error("Derived key is too long.");if(i)return i(u);throw u}var l=Math.ceil(n/a),f=n-(l-1)*a,h=ls.hmac.create();h.start(s,r);var m="",g,w,y;if(!i){for(var S=1;S<=l;++S){h.start(null,null),h.update(e),h.update(ls.util.int32ToBytes(S)),g=y=h.digest().getBytes();for(var E=2;E<=t;++E)h.start(null,null),h.update(y),w=h.digest().getBytes(),g=ls.util.xorBytes(g,w,a),y=w;m+=S<l?g:g.substr(0,f)}return m}var S=1,E;function b(){if(S>l)return i(null,m);h.start(null,null),h.update(e),h.update(ls.util.int32ToBytes(S)),g=y=h.digest().getBytes(),E=2,T()}o(b,"outer");function T(){if(E<=t)return h.start(null,null),h.update(y),w=h.digest().getBytes(),g=ls.util.xorBytes(g,w,a),y=w,++E,ls.util.setImmediate(T);m+=S<l?g:g.substr(0,f),++S,b()}o(T,"inner"),b()}});var Qb=ye((pce,hO)=>{"use strict";var ya=$t();da();ur();var lO=hO.exports=ya.sha256=ya.sha256||{};ya.md.sha256=ya.md.algorithms.sha256=lO;lO.create=function(){cO||Q$();var r=null,e=ya.util.createBuffer(),t=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var s=n.messageLengthSize/4,i=0;i<s;++i)n.fullMessageLength.push(0);return e=ya.util.createBuffer(),r={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},n},n.start(),n.update=function(s,i){i==="utf8"&&(s=ya.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var u=n.fullMessageLength.length-1;u>=0;--u)n.fullMessageLength[u]+=a[1],a[1]=a[0]+(n.fullMessageLength[u]/4294967296>>>0),n.fullMessageLength[u]=n.fullMessageLength[u]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),uO(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=ya.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(Yb.substr(0,n.blockLength-a));for(var u,l,f=n.fullMessageLength[0]*8,h=0;h<n.fullMessageLength.length-1;++h)u=n.fullMessageLength[h+1]*8,l=u/4294967296>>>0,f+=l,s.putInt32(f>>>0),f=u>>>0;s.putInt32(f);var m={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3,h4:r.h4,h5:r.h5,h6:r.h6,h7:r.h7};uO(m,t,s);var g=ya.util.createBuffer();return g.putInt32(m.h0),g.putInt32(m.h1),g.putInt32(m.h2),g.putInt32(m.h3),g.putInt32(m.h4),g.putInt32(m.h5),g.putInt32(m.h6),g.putInt32(m.h7),g},n};var Yb=null,cO=!1,fO=null;function Q$(){Yb="\x80",Yb+=ya.util.fillString("\0",64),fO=[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],cO=!0}o(Q$,"_init");function uO(r,e,t){for(var n,s,i,a,u,l,f,h,m,g,w,y,S,E,b,T=t.length();T>=64;){for(f=0;f<16;++f)e[f]=t.getInt32();for(;f<64;++f)n=e[f-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,s=e[f-15],s=(s>>>7|s<<25)^(s>>>18|s<<14)^s>>>3,e[f]=n+e[f-7]+s+e[f-16]|0;for(h=r.h0,m=r.h1,g=r.h2,w=r.h3,y=r.h4,S=r.h5,E=r.h6,b=r.h7,f=0;f<64;++f)a=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),u=E^y&(S^E),i=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),l=h&m|g&(h^m),n=b+a+u+fO[f]+e[f],s=i+l,b=E,E=S,S=y,y=w+n>>>0,w=g,g=m,m=h,h=n+s>>>0;r.h0=r.h0+h|0,r.h1=r.h1+m|0,r.h2=r.h2+g|0,r.h3=r.h3+w|0,r.h4=r.h4+y|0,r.h5=r.h5+S|0,r.h6=r.h6+E|0,r.h7=r.h7+b|0,T-=64}}o(uO,"_update")});var Zb=ye((mce,pO)=>{"use strict";var va=$t();ur();var Uw=null;va.util.isNodejs&&!va.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Uw=gt("crypto"));var Z$=pO.exports=va.prng=va.prng||{};Z$.create=function(r){for(var e={plugin:r,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},t=r.md,n=new Array(32),s=0;s<32;++s)n[s]=t.create();e.pools=n,e.pool=0,e.generate=function(f,h){if(!h)return e.generateSync(f);var m=e.plugin.cipher,g=e.plugin.increment,w=e.plugin.formatKey,y=e.plugin.formatSeed,S=va.util.createBuffer();e.key=null,E();function E(b){if(b)return h(b);if(S.length()>=f)return h(null,S.getBytes(f));if(e.generated>1048575&&(e.key=null),e.key===null)return va.util.nextTick(function(){i(E)});var T=m(e.key,e.seed);e.generated+=T.length,S.putBytes(T),e.key=w(m(e.key,g(e.seed))),e.seed=y(m(e.key,e.seed)),va.util.setImmediate(E)}o(E,"generate")},e.generateSync=function(f){var h=e.plugin.cipher,m=e.plugin.increment,g=e.plugin.formatKey,w=e.plugin.formatSeed;e.key=null;for(var y=va.util.createBuffer();y.length()<f;){e.generated>1048575&&(e.key=null),e.key===null&&a();var S=h(e.key,e.seed);e.generated+=S.length,y.putBytes(S),e.key=g(h(e.key,m(e.seed))),e.seed=w(h(e.key,e.seed))}return y.getBytes(f)};function i(f){if(e.pools[0].messageLength>=32)return u(),f();var h=32-e.pools[0].messageLength<<5;e.seedFile(h,function(m,g){if(m)return f(m);e.collect(g),u(),f()})}o(i,"_reseed");function a(){if(e.pools[0].messageLength>=32)return u();var f=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(f)),u()}o(a,"_reseedSync");function u(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var f=e.plugin.md.create();f.update(e.keyBytes);for(var h=1,m=0;m<32;++m)e.reseeds%h===0&&(f.update(e.pools[m].digest().getBytes()),e.pools[m].start()),h=h<<1;e.keyBytes=f.digest().getBytes(),f.start(),f.update(e.keyBytes);var g=f.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(g),e.generated=0}o(u,"_seed");function l(f){var h=null,m=va.util.globalScope,g=m.crypto||m.msCrypto;g&&g.getRandomValues&&(h=o(function(x){return g.getRandomValues(x)},"getRandomValues"));var w=va.util.createBuffer();if(h)for(;w.length()<f;){var y=Math.max(1,Math.min(f-w.length(),65536)/4),S=new Uint32Array(Math.floor(y));try{h(S);for(var E=0;E<S.length;++E)w.putInt32(S[E])}catch(x){if(!(typeof QuotaExceededError<"u"&&x instanceof QuotaExceededError))throw x}}if(w.length()<f)for(var b,T,A,C=Math.floor(Math.random()*65536);w.length()<f;){T=16807*(C&65535),b=16807*(C>>16),T+=(b&32767)<<16,T+=b>>15,T=(T&2147483647)+(T>>31),C=T&4294967295;for(var E=0;E<3;++E)A=C>>>(E<<3),A^=Math.floor(Math.random()*256),w.putByte(A&255)}return w.getBytes(f)}return o(l,"defaultSeedFile"),Uw?(e.seedFile=function(f,h){Uw.randomBytes(f,function(m,g){if(m)return h(m);h(null,g.toString())})},e.seedFileSync=function(f){return Uw.randomBytes(f).toString()}):(e.seedFile=function(f,h){try{h(null,l(f))}catch(m){h(m)}},e.seedFileSync=l),e.collect=function(f){for(var h=f.length,m=0;m<h;++m)e.pools[e.pool].update(f.substr(m,1)),e.pool=e.pool===31?0:e.pool+1},e.collectInt=function(f,h){for(var m="",g=0;g<h;g+=8)m+=String.fromCharCode(f>>g&255);e.collect(m)},e.registerWorker=function(f){if(f===self)e.seedFile=function(m,g){function w(y){var S=y.data;S.forge&&S.forge.prng&&(self.removeEventListener("message",w),g(S.forge.prng.err,S.forge.prng.bytes))}o(w,"listener"),self.addEventListener("message",w),self.postMessage({forge:{prng:{needed:m}}})};else{var h=o(function(m){var g=m.data;g.forge&&g.forge.prng&&e.seedFile(g.forge.prng.needed,function(w,y){f.postMessage({forge:{prng:{err:w,bytes:y}}})})},"listener");f.addEventListener("message",h)}},e}});var ci=ye((yce,ex)=>{"use strict";var bn=$t();vu();Qb();Zb();ur();(function(){if(bn.random&&bn.random.getBytes){ex.exports=bn.random;return}(function(r){var e={},t=new Array(4),n=bn.util.createBuffer();e.formatKey=function(m){var g=bn.util.createBuffer(m);return m=new Array(4),m[0]=g.getInt32(),m[1]=g.getInt32(),m[2]=g.getInt32(),m[3]=g.getInt32(),bn.aes._expandKey(m,!1)},e.formatSeed=function(m){var g=bn.util.createBuffer(m);return m=new Array(4),m[0]=g.getInt32(),m[1]=g.getInt32(),m[2]=g.getInt32(),m[3]=g.getInt32(),m},e.cipher=function(m,g){return bn.aes._updateBlock(m,g,t,!1),n.putInt32(t[0]),n.putInt32(t[1]),n.putInt32(t[2]),n.putInt32(t[3]),n.getBytes()},e.increment=function(m){return++m[3],m},e.md=bn.md.sha256;function s(){var m=bn.prng.create(e);return m.getBytes=function(g,w){return m.generate(g,w)},m.getBytesSync=function(g){return m.generate(g)},m}o(s,"spawnPrng");var i=s(),a=null,u=bn.util.globalScope,l=u.crypto||u.msCrypto;if(l&&l.getRandomValues&&(a=o(function(m){return l.getRandomValues(m)},"getRandomValues")),bn.options.usePureJavaScript||!bn.util.isNodejs&&!a){if(typeof window>"u"||window.document,i.collectInt(+new Date,32),typeof navigator<"u"){var f="";for(var h in navigator)try{typeof navigator[h]=="string"&&(f+=navigator[h])}catch{}i.collect(f),f=null}r&&(r().mousemove(function(m){i.collectInt(m.clientX,16),i.collectInt(m.clientY,16)}),r().keypress(function(m){i.collectInt(m.charCode,8)}))}if(!bn.random)bn.random=i;else for(var h in i)bn.random[h]=i[h];bn.random.createInstance=s,ex.exports=bn.random})(typeof jQuery<"u"?jQuery:null)})()});var rx=ye((wce,gO)=>{"use strict";var Es=$t();ur();var tx=[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],dO=[1,2,3,5],eX=o(function(r,e){return r<<e&65535|(r&65535)>>16-e},"rol"),tX=o(function(r,e){return(r&65535)>>e|r<<16-e&65535},"ror");gO.exports=Es.rc2=Es.rc2||{};Es.rc2.expandKey=function(r,e){typeof r=="string"&&(r=Es.util.createBuffer(r)),e=e||128;var t=r,n=r.length(),s=e,i=Math.ceil(s/8),a=255>>(s&7),u;for(u=n;u<128;u++)t.putByte(tx[t.at(u-1)+t.at(u-n)&255]);for(t.setAt(128-i,tx[t.at(128-i)&a]),u=127-i;u>=0;u--)t.setAt(u,tx[t.at(u+1)^t.at(u+i)]);return t};var mO=o(function(r,e,t){var n=!1,s=null,i=null,a=null,u,l,f,h,m=[];for(r=Es.rc2.expandKey(r,e),f=0;f<64;f++)m.push(r.getInt16Le());t?(u=o(function(y){for(f=0;f<4;f++)y[f]+=m[h]+(y[(f+3)%4]&y[(f+2)%4])+(~y[(f+3)%4]&y[(f+1)%4]),y[f]=eX(y[f],dO[f]),h++},"mixRound"),l=o(function(y){for(f=0;f<4;f++)y[f]+=m[y[(f+3)%4]&63]},"mashRound")):(u=o(function(y){for(f=3;f>=0;f--)y[f]=tX(y[f],dO[f]),y[f]-=m[h]+(y[(f+3)%4]&y[(f+2)%4])+(~y[(f+3)%4]&y[(f+1)%4]),h--},"mixRound"),l=o(function(y){for(f=3;f>=0;f--)y[f]-=m[y[(f+3)%4]&63]},"mashRound"));var g=o(function(y){var S=[];for(f=0;f<4;f++){var E=s.getInt16Le();a!==null&&(t?E^=a.getInt16Le():a.putInt16Le(E)),S.push(E&65535)}h=t?0:63;for(var b=0;b<y.length;b++)for(var T=0;T<y[b][0];T++)y[b][1](S);for(f=0;f<4;f++)a!==null&&(t?a.putInt16Le(S[f]):S[f]^=a.getInt16Le()),i.putInt16Le(S[f])},"runPlan"),w=null;return w={start:o(function(y,S){y&&typeof y=="string"&&(y=Es.util.createBuffer(y)),n=!1,s=Es.util.createBuffer(),i=S||new Es.util.createBuffer,a=y,w.output=i},"start"),update:o(function(y){for(n||s.putBuffer(y);s.length()>=8;)g([[5,u],[1,l],[6,u],[1,l],[5,u]])},"update"),finish:o(function(y){var S=!0;if(t)if(y)S=y(8,s,!t);else{var E=s.length()===8?8:8-s.length();s.fillWithByte(E,E)}if(S&&(n=!0,w.update()),!t&&(S=s.length()===0,S))if(y)S=y(8,i,!t);else{var b=i.length(),T=i.at(b-1);T>b?S=!1:i.truncate(T)}return S},"finish")},w},"createCipher");Es.rc2.startEncrypting=function(r,e,t){var n=Es.rc2.createEncryptionCipher(r,128);return n.start(e,t),n};Es.rc2.createEncryptionCipher=function(r,e){return mO(r,e,!0)};Es.rc2.startDecrypting=function(r,e,t){var n=Es.rc2.createDecryptionCipher(r,128);return n.start(e,t),n};Es.rc2.createDecryptionCipher=function(r,e){return mO(r,e,!1)}});var Cm=ye((Ece,bO)=>{"use strict";var nx=$t();bO.exports=nx.jsbn=nx.jsbn||{};var po,rX=0xdeadbeefcafe,yO=(rX&16777215)==15715070;function Oe(r,e,t){this.data=[],r!=null&&(typeof r=="number"?this.fromNumber(r,e,t):e==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,e))}o(Oe,"BigInteger");nx.jsbn.BigInteger=Oe;function lr(){return new Oe(null)}o(lr,"nbi");function nX(r,e,t,n,s,i){for(;--i>=0;){var a=e*this.data[r++]+t.data[n]+s;s=Math.floor(a/67108864),t.data[n++]=a&67108863}return s}o(nX,"am1");function sX(r,e,t,n,s,i){for(var a=e&32767,u=e>>15;--i>=0;){var l=this.data[r]&32767,f=this.data[r++]>>15,h=u*l+f*a;l=a*l+((h&32767)<<15)+t.data[n]+(s&1073741823),s=(l>>>30)+(h>>>15)+u*f+(s>>>30),t.data[n++]=l&1073741823}return s}o(sX,"am2");function vO(r,e,t,n,s,i){for(var a=e&16383,u=e>>14;--i>=0;){var l=this.data[r]&16383,f=this.data[r++]>>14,h=u*l+f*a;l=a*l+((h&16383)<<14)+t.data[n]+s,s=(l>>28)+(h>>14)+u*f,t.data[n++]=l&268435455}return s}o(vO,"am3");typeof navigator>"u"?(Oe.prototype.am=vO,po=28):yO&&navigator.appName=="Microsoft Internet Explorer"?(Oe.prototype.am=sX,po=30):yO&&navigator.appName!="Netscape"?(Oe.prototype.am=nX,po=26):(Oe.prototype.am=vO,po=28);Oe.prototype.DB=po;Oe.prototype.DM=(1<<po)-1;Oe.prototype.DV=1<<po;var sx=52;Oe.prototype.FV=Math.pow(2,sx);Oe.prototype.F1=sx-po;Oe.prototype.F2=2*po-sx;var iX="0123456789abcdefghijklmnopqrstuvwxyz",Mw=new Array,Kh,fi;Kh=48;for(fi=0;fi<=9;++fi)Mw[Kh++]=fi;Kh=97;for(fi=10;fi<36;++fi)Mw[Kh++]=fi;Kh=65;for(fi=10;fi<36;++fi)Mw[Kh++]=fi;function wO(r){return iX.charAt(r)}o(wO,"int2char");function SO(r,e){var t=Mw[r.charCodeAt(e)];return t??-1}o(SO,"intAt");function aX(r){for(var e=this.t-1;e>=0;--e)r.data[e]=this.data[e];r.t=this.t,r.s=this.s}o(aX,"bnpCopyTo");function oX(r){this.t=1,this.s=r<0?-1:0,r>0?this.data[0]=r:r<-1?this.data[0]=r+this.DV:this.t=0}o(oX,"bnpFromInt");function Su(r){var e=lr();return e.fromInt(r),e}o(Su,"nbv");function uX(r,e){var t;if(e==16)t=4;else if(e==8)t=3;else if(e==256)t=8;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else{this.fromRadix(r,e);return}this.t=0,this.s=0;for(var n=r.length,s=!1,i=0;--n>=0;){var a=t==8?r[n]&255:SO(r,n);if(a<0){r.charAt(n)=="-"&&(s=!0);continue}s=!1,i==0?this.data[this.t++]=a:i+t>this.DB?(this.data[this.t-1]|=(a&(1<<this.DB-i)-1)<<i,this.data[this.t++]=a>>this.DB-i):this.data[this.t-1]|=a<<i,i+=t,i>=this.DB&&(i-=this.DB)}t==8&&(r[0]&128)!=0&&(this.s=-1,i>0&&(this.data[this.t-1]|=(1<<this.DB-i)-1<<i)),this.clamp(),s&&Oe.ZERO.subTo(this,this)}o(uX,"bnpFromString");function lX(){for(var r=this.s&this.DM;this.t>0&&this.data[this.t-1]==r;)--this.t}o(lX,"bnpClamp");function cX(r){if(this.s<0)return"-"+this.negate().toString(r);var e;if(r==16)e=4;else if(r==8)e=3;else if(r==2)e=1;else if(r==32)e=5;else if(r==4)e=2;else return this.toRadix(r);var t=(1<<e)-1,n,s=!1,i="",a=this.t,u=this.DB-a*this.DB%e;if(a-- >0)for(u<this.DB&&(n=this.data[a]>>u)>0&&(s=!0,i=wO(n));a>=0;)u<e?(n=(this.data[a]&(1<<u)-1)<<e-u,n|=this.data[--a]>>(u+=this.DB-e)):(n=this.data[a]>>(u-=e)&t,u<=0&&(u+=this.DB,--a)),n>0&&(s=!0),s&&(i+=wO(n));return s?i:"0"}o(cX,"bnToString");function fX(){var r=lr();return Oe.ZERO.subTo(this,r),r}o(fX,"bnNegate");function hX(){return this.s<0?this.negate():this}o(hX,"bnAbs");function pX(r){var e=this.s-r.s;if(e!=0)return e;var t=this.t;if(e=t-r.t,e!=0)return this.s<0?-e:e;for(;--t>=0;)if((e=this.data[t]-r.data[t])!=0)return e;return 0}o(pX,"bnCompareTo");function jw(r){var e=1,t;return(t=r>>>16)!=0&&(r=t,e+=16),(t=r>>8)!=0&&(r=t,e+=8),(t=r>>4)!=0&&(r=t,e+=4),(t=r>>2)!=0&&(r=t,e+=2),(t=r>>1)!=0&&(r=t,e+=1),e}o(jw,"nbits");function dX(){return this.t<=0?0:this.DB*(this.t-1)+jw(this.data[this.t-1]^this.s&this.DM)}o(dX,"bnBitLength");function mX(r,e){var t;for(t=this.t-1;t>=0;--t)e.data[t+r]=this.data[t];for(t=r-1;t>=0;--t)e.data[t]=0;e.t=this.t+r,e.s=this.s}o(mX,"bnpDLShiftTo");function gX(r,e){for(var t=r;t<this.t;++t)e.data[t-r]=this.data[t];e.t=Math.max(this.t-r,0),e.s=this.s}o(gX,"bnpDRShiftTo");function yX(r,e){var t=r%this.DB,n=this.DB-t,s=(1<<n)-1,i=Math.floor(r/this.DB),a=this.s<<t&this.DM,u;for(u=this.t-1;u>=0;--u)e.data[u+i+1]=this.data[u]>>n|a,a=(this.data[u]&s)<<t;for(u=i-1;u>=0;--u)e.data[u]=0;e.data[i]=a,e.t=this.t+i+1,e.s=this.s,e.clamp()}o(yX,"bnpLShiftTo");function vX(r,e){e.s=this.s;var t=Math.floor(r/this.DB);if(t>=this.t){e.t=0;return}var n=r%this.DB,s=this.DB-n,i=(1<<n)-1;e.data[0]=this.data[t]>>n;for(var a=t+1;a<this.t;++a)e.data[a-t-1]|=(this.data[a]&i)<<s,e.data[a-t]=this.data[a]>>n;n>0&&(e.data[this.t-t-1]|=(this.s&i)<<s),e.t=this.t-t,e.clamp()}o(vX,"bnpRShiftTo");function wX(r,e){for(var t=0,n=0,s=Math.min(r.t,this.t);t<s;)n+=this.data[t]-r.data[t],e.data[t++]=n&this.DM,n>>=this.DB;if(r.t<this.t){for(n-=r.s;t<this.t;)n+=this.data[t],e.data[t++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;t<r.t;)n-=r.data[t],e.data[t++]=n&this.DM,n>>=this.DB;n-=r.s}e.s=n<0?-1:0,n<-1?e.data[t++]=this.DV+n:n>0&&(e.data[t++]=n),e.t=t,e.clamp()}o(wX,"bnpSubTo");function SX(r,e){var t=this.abs(),n=r.abs(),s=t.t;for(e.t=s+n.t;--s>=0;)e.data[s]=0;for(s=0;s<n.t;++s)e.data[s+t.t]=t.am(0,n.data[s],e,s,0,t.t);e.s=0,e.clamp(),this.s!=r.s&&Oe.ZERO.subTo(e,e)}o(SX,"bnpMultiplyTo");function EX(r){for(var e=this.abs(),t=r.t=2*e.t;--t>=0;)r.data[t]=0;for(t=0;t<e.t-1;++t){var n=e.am(t,e.data[t],r,2*t,0,1);(r.data[t+e.t]+=e.am(t+1,2*e.data[t],r,2*t+1,n,e.t-t-1))>=e.DV&&(r.data[t+e.t]-=e.DV,r.data[t+e.t+1]=1)}r.t>0&&(r.data[r.t-1]+=e.am(t,e.data[t],r,2*t,0,1)),r.s=0,r.clamp()}o(EX,"bnpSquareTo");function AX(r,e,t){var n=r.abs();if(!(n.t<=0)){var s=this.abs();if(s.t<n.t){e?.fromInt(0),t!=null&&this.copyTo(t);return}t==null&&(t=lr());var i=lr(),a=this.s,u=r.s,l=this.DB-jw(n.data[n.t-1]);l>0?(n.lShiftTo(l,i),s.lShiftTo(l,t)):(n.copyTo(i),s.copyTo(t));var f=i.t,h=i.data[f-1];if(h!=0){var m=h*(1<<this.F1)+(f>1?i.data[f-2]>>this.F2:0),g=this.FV/m,w=(1<<this.F1)/m,y=1<<this.F2,S=t.t,E=S-f,b=e??lr();for(i.dlShiftTo(E,b),t.compareTo(b)>=0&&(t.data[t.t++]=1,t.subTo(b,t)),Oe.ONE.dlShiftTo(f,b),b.subTo(i,i);i.t<f;)i.data[i.t++]=0;for(;--E>=0;){var T=t.data[--S]==h?this.DM:Math.floor(t.data[S]*g+(t.data[S-1]+y)*w);if((t.data[S]+=i.am(0,T,t,E,0,f))<T)for(i.dlShiftTo(E,b),t.subTo(b,t);t.data[S]<--T;)t.subTo(b,t)}e!=null&&(t.drShiftTo(f,e),a!=u&&Oe.ZERO.subTo(e,e)),t.t=f,t.clamp(),l>0&&t.rShiftTo(l,t),a<0&&Oe.ZERO.subTo(t,t)}}}o(AX,"bnpDivRemTo");function CX(r){var e=lr();return this.abs().divRemTo(r,null,e),this.s<0&&e.compareTo(Oe.ZERO)>0&&r.subTo(e,e),e}o(CX,"bnMod");function pc(r){this.m=r}o(pc,"Classic");function bX(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}o(bX,"cConvert");function xX(r){return r}o(xX,"cRevert");function NX(r){r.divRemTo(this.m,null,r)}o(NX,"cReduce");function TX(r,e,t){r.multiplyTo(e,t),this.reduce(t)}o(TX,"cMulTo");function IX(r,e){r.squareTo(e),this.reduce(e)}o(IX,"cSqrTo");pc.prototype.convert=bX;pc.prototype.revert=xX;pc.prototype.reduce=NX;pc.prototype.mulTo=TX;pc.prototype.sqrTo=IX;function BX(){if(this.t<1)return 0;var r=this.data[0];if((r&1)==0)return 0;var e=r&3;return e=e*(2-(r&15)*e)&15,e=e*(2-(r&255)*e)&255,e=e*(2-((r&65535)*e&65535))&65535,e=e*(2-r*e%this.DV)%this.DV,e>0?this.DV-e:-e}o(BX,"bnpInvDigit");function dc(r){this.m=r,this.mp=r.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<r.DB-15)-1,this.mt2=2*r.t}o(dc,"Montgomery");function DX(r){var e=lr();return r.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),r.s<0&&e.compareTo(Oe.ZERO)>0&&this.m.subTo(e,e),e}o(DX,"montConvert");function _X(r){var e=lr();return r.copyTo(e),this.reduce(e),e}o(_X,"montRevert");function RX(r){for(;r.t<=this.mt2;)r.data[r.t++]=0;for(var e=0;e<this.m.t;++e){var t=r.data[e]&32767,n=t*this.mpl+((t*this.mph+(r.data[e]>>15)*this.mpl&this.um)<<15)&r.DM;for(t=e+this.m.t,r.data[t]+=this.m.am(0,n,r,e,0,this.m.t);r.data[t]>=r.DV;)r.data[t]-=r.DV,r.data[++t]++}r.clamp(),r.drShiftTo(this.m.t,r),r.compareTo(this.m)>=0&&r.subTo(this.m,r)}o(RX,"montReduce");function PX(r,e){r.squareTo(e),this.reduce(e)}o(PX,"montSqrTo");function OX(r,e,t){r.multiplyTo(e,t),this.reduce(t)}o(OX,"montMulTo");dc.prototype.convert=DX;dc.prototype.revert=_X;dc.prototype.reduce=RX;dc.prototype.mulTo=OX;dc.prototype.sqrTo=PX;function kX(){return(this.t>0?this.data[0]&1:this.s)==0}o(kX,"bnpIsEven");function LX(r,e){if(r>4294967295||r<1)return Oe.ONE;var t=lr(),n=lr(),s=e.convert(this),i=jw(r)-1;for(s.copyTo(t);--i>=0;)if(e.sqrTo(t,n),(r&1<<i)>0)e.mulTo(n,s,t);else{var a=t;t=n,n=a}return e.revert(t)}o(LX,"bnpExp");function VX(r,e){var t;return r<256||e.isEven()?t=new pc(e):t=new dc(e),this.exp(r,t)}o(VX,"bnModPowInt");Oe.prototype.copyTo=aX;Oe.prototype.fromInt=oX;Oe.prototype.fromString=uX;Oe.prototype.clamp=lX;Oe.prototype.dlShiftTo=mX;Oe.prototype.drShiftTo=gX;Oe.prototype.lShiftTo=yX;Oe.prototype.rShiftTo=vX;Oe.prototype.subTo=wX;Oe.prototype.multiplyTo=SX;Oe.prototype.squareTo=EX;Oe.prototype.divRemTo=AX;Oe.prototype.invDigit=BX;Oe.prototype.isEven=kX;Oe.prototype.exp=LX;Oe.prototype.toString=cX;Oe.prototype.negate=fX;Oe.prototype.abs=hX;Oe.prototype.compareTo=pX;Oe.prototype.bitLength=dX;Oe.prototype.mod=CX;Oe.prototype.modPowInt=VX;Oe.ZERO=Su(0);Oe.ONE=Su(1);function UX(){var r=lr();return this.copyTo(r),r}o(UX,"bnClone");function MX(){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]}o(MX,"bnIntValue");function jX(){return this.t==0?this.s:this.data[0]<<24>>24}o(jX,"bnByteValue");function FX(){return this.t==0?this.s:this.data[0]<<16>>16}o(FX,"bnShortValue");function qX(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}o(qX,"bnpChunkSize");function HX(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}o(HX,"bnSigNum");function KX(r){if(r==null&&(r=10),this.signum()==0||r<2||r>36)return"0";var e=this.chunkSize(r),t=Math.pow(r,e),n=Su(t),s=lr(),i=lr(),a="";for(this.divRemTo(n,s,i);s.signum()>0;)a=(t+i.intValue()).toString(r).substr(1)+a,s.divRemTo(n,s,i);return i.intValue().toString(r)+a}o(KX,"bnpToRadix");function $X(r,e){this.fromInt(0),e==null&&(e=10);for(var t=this.chunkSize(e),n=Math.pow(e,t),s=!1,i=0,a=0,u=0;u<r.length;++u){var l=SO(r,u);if(l<0){r.charAt(u)=="-"&&this.signum()==0&&(s=!0);continue}a=e*a+l,++i>=t&&(this.dMultiply(n),this.dAddOffset(a,0),i=0,a=0)}i>0&&(this.dMultiply(Math.pow(e,i)),this.dAddOffset(a,0)),s&&Oe.ZERO.subTo(this,this)}o($X,"bnpFromRadix");function XX(r,e,t){if(typeof e=="number")if(r<2)this.fromInt(1);else for(this.fromNumber(r,t),this.testBit(r-1)||this.bitwiseTo(Oe.ONE.shiftLeft(r-1),ix,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(Oe.ONE.shiftLeft(r-1),this);else{var n=new Array,s=r&7;n.length=(r>>3)+1,e.nextBytes(n),s>0?n[0]&=(1<<s)-1:n[0]=0,this.fromString(n,256)}}o(XX,"bnpFromNumber");function GX(){var r=this.t,e=new Array;e[0]=this.s;var t=this.DB-r*this.DB%8,n,s=0;if(r-- >0)for(t<this.DB&&(n=this.data[r]>>t)!=(this.s&this.DM)>>t&&(e[s++]=n|this.s<<this.DB-t);r>=0;)t<8?(n=(this.data[r]&(1<<t)-1)<<8-t,n|=this.data[--r]>>(t+=this.DB-8)):(n=this.data[r]>>(t-=8)&255,t<=0&&(t+=this.DB,--r)),(n&128)!=0&&(n|=-256),s==0&&(this.s&128)!=(n&128)&&++s,(s>0||n!=this.s)&&(e[s++]=n);return e}o(GX,"bnToByteArray");function WX(r){return this.compareTo(r)==0}o(WX,"bnEquals");function JX(r){return this.compareTo(r)<0?this:r}o(JX,"bnMin");function zX(r){return this.compareTo(r)>0?this:r}o(zX,"bnMax");function YX(r,e,t){var n,s,i=Math.min(r.t,this.t);for(n=0;n<i;++n)t.data[n]=e(this.data[n],r.data[n]);if(r.t<this.t){for(s=r.s&this.DM,n=i;n<this.t;++n)t.data[n]=e(this.data[n],s);t.t=this.t}else{for(s=this.s&this.DM,n=i;n<r.t;++n)t.data[n]=e(s,r.data[n]);t.t=r.t}t.s=e(this.s,r.s),t.clamp()}o(YX,"bnpBitwiseTo");function QX(r,e){return r&e}o(QX,"op_and");function ZX(r){var e=lr();return this.bitwiseTo(r,QX,e),e}o(ZX,"bnAnd");function ix(r,e){return r|e}o(ix,"op_or");function eG(r){var e=lr();return this.bitwiseTo(r,ix,e),e}o(eG,"bnOr");function EO(r,e){return r^e}o(EO,"op_xor");function tG(r){var e=lr();return this.bitwiseTo(r,EO,e),e}o(tG,"bnXor");function AO(r,e){return r&~e}o(AO,"op_andnot");function rG(r){var e=lr();return this.bitwiseTo(r,AO,e),e}o(rG,"bnAndNot");function nG(){for(var r=lr(),e=0;e<this.t;++e)r.data[e]=this.DM&~this.data[e];return r.t=this.t,r.s=~this.s,r}o(nG,"bnNot");function sG(r){var e=lr();return r<0?this.rShiftTo(-r,e):this.lShiftTo(r,e),e}o(sG,"bnShiftLeft");function iG(r){var e=lr();return r<0?this.lShiftTo(-r,e):this.rShiftTo(r,e),e}o(iG,"bnShiftRight");function aG(r){if(r==0)return-1;var e=0;return(r&65535)==0&&(r>>=16,e+=16),(r&255)==0&&(r>>=8,e+=8),(r&15)==0&&(r>>=4,e+=4),(r&3)==0&&(r>>=2,e+=2),(r&1)==0&&++e,e}o(aG,"lbit");function oG(){for(var r=0;r<this.t;++r)if(this.data[r]!=0)return r*this.DB+aG(this.data[r]);return this.s<0?this.t*this.DB:-1}o(oG,"bnGetLowestSetBit");function uG(r){for(var e=0;r!=0;)r&=r-1,++e;return e}o(uG,"cbit");function lG(){for(var r=0,e=this.s&this.DM,t=0;t<this.t;++t)r+=uG(this.data[t]^e);return r}o(lG,"bnBitCount");function cG(r){var e=Math.floor(r/this.DB);return e>=this.t?this.s!=0:(this.data[e]&1<<r%this.DB)!=0}o(cG,"bnTestBit");function fG(r,e){var t=Oe.ONE.shiftLeft(r);return this.bitwiseTo(t,e,t),t}o(fG,"bnpChangeBit");function hG(r){return this.changeBit(r,ix)}o(hG,"bnSetBit");function pG(r){return this.changeBit(r,AO)}o(pG,"bnClearBit");function dG(r){return this.changeBit(r,EO)}o(dG,"bnFlipBit");function mG(r,e){for(var t=0,n=0,s=Math.min(r.t,this.t);t<s;)n+=this.data[t]+r.data[t],e.data[t++]=n&this.DM,n>>=this.DB;if(r.t<this.t){for(n+=r.s;t<this.t;)n+=this.data[t],e.data[t++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;t<r.t;)n+=r.data[t],e.data[t++]=n&this.DM,n>>=this.DB;n+=r.s}e.s=n<0?-1:0,n>0?e.data[t++]=n:n<-1&&(e.data[t++]=this.DV+n),e.t=t,e.clamp()}o(mG,"bnpAddTo");function gG(r){var e=lr();return this.addTo(r,e),e}o(gG,"bnAdd");function yG(r){var e=lr();return this.subTo(r,e),e}o(yG,"bnSubtract");function vG(r){var e=lr();return this.multiplyTo(r,e),e}o(vG,"bnMultiply");function wG(r){var e=lr();return this.divRemTo(r,e,null),e}o(wG,"bnDivide");function SG(r){var e=lr();return this.divRemTo(r,null,e),e}o(SG,"bnRemainder");function EG(r){var e=lr(),t=lr();return this.divRemTo(r,e,t),new Array(e,t)}o(EG,"bnDivideAndRemainder");function AG(r){this.data[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}o(AG,"bnpDMultiply");function CG(r,e){if(r!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=r;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}o(CG,"bnpDAddOffset");function Am(){}o(Am,"NullExp");function CO(r){return r}o(CO,"nNop");function bG(r,e,t){r.multiplyTo(e,t)}o(bG,"nMulTo");function xG(r,e){r.squareTo(e)}o(xG,"nSqrTo");Am.prototype.convert=CO;Am.prototype.revert=CO;Am.prototype.mulTo=bG;Am.prototype.sqrTo=xG;function NG(r){return this.exp(r,new Am)}o(NG,"bnPow");function TG(r,e,t){var n=Math.min(this.t+r.t,e);for(t.s=0,t.t=n;n>0;)t.data[--n]=0;var s;for(s=t.t-this.t;n<s;++n)t.data[n+this.t]=this.am(0,r.data[n],t,n,0,this.t);for(s=Math.min(r.t,e);n<s;++n)this.am(0,r.data[n],t,n,0,e-n);t.clamp()}o(TG,"bnpMultiplyLowerTo");function IG(r,e,t){--e;var n=t.t=this.t+r.t-e;for(t.s=0;--n>=0;)t.data[n]=0;for(n=Math.max(e-this.t,0);n<r.t;++n)t.data[this.t+n-e]=this.am(e-n,r.data[n],t,0,0,this.t+n-e);t.clamp(),t.drShiftTo(1,t)}o(IG,"bnpMultiplyUpperTo");function $h(r){this.r2=lr(),this.q3=lr(),Oe.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}o($h,"Barrett");function BG(r){if(r.s<0||r.t>2*this.m.t)return r.mod(this.m);if(r.compareTo(this.m)<0)return r;var e=lr();return r.copyTo(e),this.reduce(e),e}o(BG,"barrettConvert");function DG(r){return r}o(DG,"barrettRevert");function _G(r){for(r.drShiftTo(this.m.t-1,this.r2),r.t>this.m.t+1&&(r.t=this.m.t+1,r.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);r.compareTo(this.r2)<0;)r.dAddOffset(1,this.m.t+1);for(r.subTo(this.r2,r);r.compareTo(this.m)>=0;)r.subTo(this.m,r)}o(_G,"barrettReduce");function RG(r,e){r.squareTo(e),this.reduce(e)}o(RG,"barrettSqrTo");function PG(r,e,t){r.multiplyTo(e,t),this.reduce(t)}o(PG,"barrettMulTo");$h.prototype.convert=BG;$h.prototype.revert=DG;$h.prototype.reduce=_G;$h.prototype.mulTo=PG;$h.prototype.sqrTo=RG;function OG(r,e){var t=r.bitLength(),n,s=Su(1),i;if(t<=0)return s;t<18?n=1:t<48?n=3:t<144?n=4:t<768?n=5:n=6,t<8?i=new pc(e):e.isEven()?i=new $h(e):i=new dc(e);var a=new Array,u=3,l=n-1,f=(1<<n)-1;if(a[1]=i.convert(this),n>1){var h=lr();for(i.sqrTo(a[1],h);u<=f;)a[u]=lr(),i.mulTo(h,a[u-2],a[u]),u+=2}var m=r.t-1,g,w=!0,y=lr(),S;for(t=jw(r.data[m])-1;m>=0;){for(t>=l?g=r.data[m]>>t-l&f:(g=(r.data[m]&(1<<t+1)-1)<<l-t,m>0&&(g|=r.data[m-1]>>this.DB+t-l)),u=n;(g&1)==0;)g>>=1,--u;if((t-=u)<0&&(t+=this.DB,--m),w)a[g].copyTo(s),w=!1;else{for(;u>1;)i.sqrTo(s,y),i.sqrTo(y,s),u-=2;u>0?i.sqrTo(s,y):(S=s,s=y,y=S),i.mulTo(y,a[g],s)}for(;m>=0&&(r.data[m]&1<<t)==0;)i.sqrTo(s,y),S=s,s=y,y=S,--t<0&&(t=this.DB-1,--m)}return i.revert(s)}o(OG,"bnModPow");function kG(r){var e=this.s<0?this.negate():this.clone(),t=r.s<0?r.negate():r.clone();if(e.compareTo(t)<0){var n=e;e=t,t=n}var s=e.getLowestSetBit(),i=t.getLowestSetBit();if(i<0)return e;for(s<i&&(i=s),i>0&&(e.rShiftTo(i,e),t.rShiftTo(i,t));e.signum()>0;)(s=e.getLowestSetBit())>0&&e.rShiftTo(s,e),(s=t.getLowestSetBit())>0&&t.rShiftTo(s,t),e.compareTo(t)>=0?(e.subTo(t,e),e.rShiftTo(1,e)):(t.subTo(e,t),t.rShiftTo(1,t));return i>0&&t.lShiftTo(i,t),t}o(kG,"bnGCD");function LG(r){if(r<=0)return 0;var e=this.DV%r,t=this.s<0?r-1:0;if(this.t>0)if(e==0)t=this.data[0]%r;else for(var n=this.t-1;n>=0;--n)t=(e*t+this.data[n])%r;return t}o(LG,"bnpModInt");function VG(r){var e=r.isEven();if(this.isEven()&&e||r.signum()==0)return Oe.ZERO;for(var t=r.clone(),n=this.clone(),s=Su(1),i=Su(0),a=Su(0),u=Su(1);t.signum()!=0;){for(;t.isEven();)t.rShiftTo(1,t),e?((!s.isEven()||!i.isEven())&&(s.addTo(this,s),i.subTo(r,i)),s.rShiftTo(1,s)):i.isEven()||i.subTo(r,i),i.rShiftTo(1,i);for(;n.isEven();)n.rShiftTo(1,n),e?((!a.isEven()||!u.isEven())&&(a.addTo(this,a),u.subTo(r,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(r,u),u.rShiftTo(1,u);t.compareTo(n)>=0?(t.subTo(n,t),e&&s.subTo(a,s),i.subTo(u,i)):(n.subTo(t,n),e&&a.subTo(s,a),u.subTo(i,u))}if(n.compareTo(Oe.ONE)!=0)return Oe.ZERO;if(u.compareTo(r)>=0)return u.subtract(r);if(u.signum()<0)u.addTo(r,u);else return u;return u.signum()<0?u.add(r):u}o(VG,"bnModInverse");var qi=[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],UG=(1<<26)/qi[qi.length-1];function MG(r){var e,t=this.abs();if(t.t==1&&t.data[0]<=qi[qi.length-1]){for(e=0;e<qi.length;++e)if(t.data[0]==qi[e])return!0;return!1}if(t.isEven())return!1;for(e=1;e<qi.length;){for(var n=qi[e],s=e+1;s<qi.length&&n<UG;)n*=qi[s++];for(n=t.modInt(n);e<s;)if(n%qi[e++]==0)return!1}return t.millerRabin(r)}o(MG,"bnIsProbablePrime");function jG(r){var e=this.subtract(Oe.ONE),t=e.getLowestSetBit();if(t<=0)return!1;for(var n=e.shiftRight(t),s=FG(),i,a=0;a<r;++a){do i=new Oe(this.bitLength(),s);while(i.compareTo(Oe.ONE)<=0||i.compareTo(e)>=0);var u=i.modPow(n,this);if(u.compareTo(Oe.ONE)!=0&&u.compareTo(e)!=0){for(var l=1;l++<t&&u.compareTo(e)!=0;)if(u=u.modPowInt(2,this),u.compareTo(Oe.ONE)==0)return!1;if(u.compareTo(e)!=0)return!1}}return!0}o(jG,"bnpMillerRabin");function FG(){return{nextBytes:o(function(r){for(var e=0;e<r.length;++e)r[e]=Math.floor(Math.random()*256)},"nextBytes")}}o(FG,"bnGetPrng");Oe.prototype.chunkSize=qX;Oe.prototype.toRadix=KX;Oe.prototype.fromRadix=$X;Oe.prototype.fromNumber=XX;Oe.prototype.bitwiseTo=YX;Oe.prototype.changeBit=fG;Oe.prototype.addTo=mG;Oe.prototype.dMultiply=AG;Oe.prototype.dAddOffset=CG;Oe.prototype.multiplyLowerTo=TG;Oe.prototype.multiplyUpperTo=IG;Oe.prototype.modInt=LG;Oe.prototype.millerRabin=jG;Oe.prototype.clone=UX;Oe.prototype.intValue=MX;Oe.prototype.byteValue=jX;Oe.prototype.shortValue=FX;Oe.prototype.signum=HX;Oe.prototype.toByteArray=GX;Oe.prototype.equals=WX;Oe.prototype.min=JX;Oe.prototype.max=zX;Oe.prototype.and=ZX;Oe.prototype.or=eG;Oe.prototype.xor=tG;Oe.prototype.andNot=rG;Oe.prototype.not=nG;Oe.prototype.shiftLeft=sG;Oe.prototype.shiftRight=iG;Oe.prototype.getLowestSetBit=oG;Oe.prototype.bitCount=lG;Oe.prototype.testBit=cG;Oe.prototype.setBit=hG;Oe.prototype.clearBit=pG;Oe.prototype.flipBit=dG;Oe.prototype.add=gG;Oe.prototype.subtract=yG;Oe.prototype.multiply=vG;Oe.prototype.divide=wG;Oe.prototype.remainder=SG;Oe.prototype.divideAndRemainder=EG;Oe.prototype.modPow=OG;Oe.prototype.modInverse=VG;Oe.prototype.pow=NG;Oe.prototype.gcd=kG;Oe.prototype.isProbablePrime=MG});var Xh=ye((Cce,IO)=>{"use strict";var wa=$t();da();ur();var NO=IO.exports=wa.sha1=wa.sha1||{};wa.md.sha1=wa.md.algorithms.sha1=NO;NO.create=function(){TO||qG();var r=null,e=wa.util.createBuffer(),t=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var s=n.messageLengthSize/4,i=0;i<s;++i)n.fullMessageLength.push(0);return e=wa.util.createBuffer(),r={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},n},n.start(),n.update=function(s,i){i==="utf8"&&(s=wa.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var u=n.fullMessageLength.length-1;u>=0;--u)n.fullMessageLength[u]+=a[1],a[1]=a[0]+(n.fullMessageLength[u]/4294967296>>>0),n.fullMessageLength[u]=n.fullMessageLength[u]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),xO(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=wa.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(ax.substr(0,n.blockLength-a));for(var u,l,f=n.fullMessageLength[0]*8,h=0;h<n.fullMessageLength.length-1;++h)u=n.fullMessageLength[h+1]*8,l=u/4294967296>>>0,f+=l,s.putInt32(f>>>0),f=u>>>0;s.putInt32(f);var m={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3,h4:r.h4};xO(m,t,s);var g=wa.util.createBuffer();return g.putInt32(m.h0),g.putInt32(m.h1),g.putInt32(m.h2),g.putInt32(m.h3),g.putInt32(m.h4),g},n};var ax=null,TO=!1;function qG(){ax="\x80",ax+=wa.util.fillString("\0",64),TO=!0}o(qG,"_init");function xO(r,e,t){for(var n,s,i,a,u,l,f,h,m=t.length();m>=64;){for(s=r.h0,i=r.h1,a=r.h2,u=r.h3,l=r.h4,h=0;h<16;++h)n=t.getInt32(),e[h]=n,f=u^i&(a^u),n=(s<<5|s>>>27)+f+l+1518500249+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;h<20;++h)n=e[h-3]^e[h-8]^e[h-14]^e[h-16],n=n<<1|n>>>31,e[h]=n,f=u^i&(a^u),n=(s<<5|s>>>27)+f+l+1518500249+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;h<32;++h)n=e[h-3]^e[h-8]^e[h-14]^e[h-16],n=n<<1|n>>>31,e[h]=n,f=i^a^u,n=(s<<5|s>>>27)+f+l+1859775393+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;h<40;++h)n=e[h-6]^e[h-16]^e[h-28]^e[h-32],n=n<<2|n>>>30,e[h]=n,f=i^a^u,n=(s<<5|s>>>27)+f+l+1859775393+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;h<60;++h)n=e[h-6]^e[h-16]^e[h-28]^e[h-32],n=n<<2|n>>>30,e[h]=n,f=i&a|u&(i^a),n=(s<<5|s>>>27)+f+l+2400959708+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;h<80;++h)n=e[h-6]^e[h-16]^e[h-28]^e[h-32],n=n<<2|n>>>30,e[h]=n,f=i^a^u,n=(s<<5|s>>>27)+f+l+3395469782+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;r.h0=r.h0+s|0,r.h1=r.h1+i|0,r.h2=r.h2+a|0,r.h3=r.h3+u|0,r.h4=r.h4+l|0,m-=64}}o(xO,"_update")});var ox=ye((xce,DO)=>{"use strict";var Sa=$t();ur();ci();Xh();var BO=DO.exports=Sa.pkcs1=Sa.pkcs1||{};BO.encode_rsa_oaep=function(r,e,t){var n,s,i,a;typeof t=="string"?(n=t,s=arguments[3]||void 0,i=arguments[4]||void 0):t&&(n=t.label||void 0,s=t.seed||void 0,i=t.md||void 0,t.mgf1&&t.mgf1.md&&(a=t.mgf1.md)),i?i.start():i=Sa.md.sha1.create(),a||(a=i);var u=Math.ceil(r.n.bitLength()/8),l=u-2*i.digestLength-2;if(e.length>l){var f=new Error("RSAES-OAEP input message length is too long.");throw f.length=e.length,f.maxLength=l,f}n||(n=""),i.update(n,"raw");for(var h=i.digest(),m="",g=l-e.length,w=0;w<g;w++)m+="\0";var y=h.getBytes()+m+""+e;if(!s)s=Sa.random.getBytes(i.digestLength);else if(s.length!==i.digestLength){var f=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw f.seedLength=s.length,f.digestLength=i.digestLength,f}var S=Fw(s,u-i.digestLength-1,a),E=Sa.util.xorBytes(y,S,y.length),b=Fw(E,i.digestLength,a),T=Sa.util.xorBytes(s,b,s.length);return"\0"+T+E};BO.decode_rsa_oaep=function(r,e,t){var n,s,i;typeof t=="string"?(n=t,s=arguments[3]||void 0):t&&(n=t.label||void 0,s=t.md||void 0,t.mgf1&&t.mgf1.md&&(i=t.mgf1.md));var a=Math.ceil(r.n.bitLength()/8);if(e.length!==a){var E=new Error("RSAES-OAEP encoded message length is invalid.");throw E.length=e.length,E.expectedLength=a,E}if(s===void 0?s=Sa.md.sha1.create():s.start(),i||(i=s),a<2*s.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");n||(n=""),s.update(n,"raw");for(var u=s.digest().getBytes(),l=e.charAt(0),f=e.substring(1,s.digestLength+1),h=e.substring(1+s.digestLength),m=Fw(h,s.digestLength,i),g=Sa.util.xorBytes(f,m,f.length),w=Fw(g,a-s.digestLength-1,i),y=Sa.util.xorBytes(h,w,h.length),S=y.substring(0,s.digestLength),E=l!=="\0",b=0;b<s.digestLength;++b)E|=u.charAt(b)!==S.charAt(b);for(var T=1,A=s.digestLength,C=s.digestLength;C<y.length;C++){var x=y.charCodeAt(C),B=x&1^1,F=T?65534:0;E|=x&F,T=T&B,A+=T}if(E||y.charCodeAt(A)!==1)throw new Error("Invalid RSAES-OAEP padding.");return y.substring(A+1)};function Fw(r,e,t){t||(t=Sa.md.sha1.create());for(var n="",s=Math.ceil(e/t.digestLength),i=0;i<s;++i){var a=String.fromCharCode(i>>24&255,i>>16&255,i>>8&255,i&255);t.start(),t.update(r+a),n+=t.digest().getBytes()}return n.substring(0,e)}o(Fw,"rsa_mgf1")});var lx=ye((Tce,ux)=>{"use strict";var Eu=$t();ur();Cm();ci();(function(){if(Eu.prime){ux.exports=Eu.prime;return}var r=ux.exports=Eu.prime=Eu.prime||{},e=Eu.jsbn.BigInteger,t=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var s=o(function(m,g){return m|g},"op_or");r.generateProbablePrime=function(m,g,w){typeof g=="function"&&(w=g,g={}),g=g||{};var y=g.algorithm||"PRIMEINC";typeof y=="string"&&(y={name:y}),y.options=y.options||{};var S=g.prng||Eu.random,E={nextBytes:o(function(b){for(var T=S.getBytesSync(b.length),A=0;A<b.length;++A)b[A]=T.charCodeAt(A)},"nextBytes")};if(y.name==="PRIMEINC")return i(m,E,y.options,w);throw new Error("Invalid prime generation algorithm: "+y.name)};function i(m,g,w,y){return"workers"in w?l(m,g,w,y):a(m,g,w,y)}o(i,"primeincFindPrime");function a(m,g,w,y){var S=f(m,g),E=0,b=h(S.bitLength());"millerRabinTests"in w&&(b=w.millerRabinTests);var T=10;"maxBlockTime"in w&&(T=w.maxBlockTime),u(S,m,g,E,b,T,y)}o(a,"primeincFindPrimeWithoutWorkers");function u(m,g,w,y,S,E,b){var T=+new Date;do{if(m.bitLength()>g&&(m=f(g,w)),m.isProbablePrime(S))return b(null,m);m.dAddOffset(t[y++%8],0)}while(E<0||+new Date-T<E);Eu.util.setImmediate(function(){u(m,g,w,y,S,E,b)})}o(u,"_primeinc");function l(m,g,w,y){if(typeof Worker>"u")return a(m,g,w,y);var S=f(m,g),E=w.workers,b=w.workLoad||100,T=b*30/8,A=w.workerScript||"forge/prime.worker.js";if(E===-1)return Eu.util.estimateCores(function(x,B){x&&(B=2),E=B-1,C()});C();function C(){E=Math.max(1,E);for(var x=[],B=0;B<E;++B)x[B]=new Worker(A);for(var F=E,B=0;B<E;++B)x[B].addEventListener("message",H);var R=!1;function H(q){if(!R){--F;var K=q.data;if(K.found){for(var G=0;G<x.length;++G)x[G].terminate();return R=!0,y(null,new e(K.prime,16))}S.bitLength()>m&&(S=f(m,g));var he=S.toString(16);q.target.postMessage({hex:he,workLoad:b}),S.dAddOffset(T,0)}}o(H,"workerMessage")}o(C,"generate")}o(l,"primeincFindPrimeWithWorkers");function f(m,g){var w=new e(m,g),y=m-1;return w.testBit(y)||w.bitwiseTo(e.ONE.shiftLeft(y),s,w),w.dAddOffset(31-w.mod(n).byteValue(),0),w}o(f,"generateRandom");function h(m){return m<=100?27:m<=150?18:m<=200?15:m<=250?12:m<=300?9:m<=350?8:m<=400?7:m<=500?6:m<=600?5:m<=800?4:m<=1250?3:2}o(h,"getMillerRabinTests")})()});var bm=ye((Bce,VO)=>{"use strict";var vt=$t();Fi();Cm();wu();ox();lx();ci();ur();typeof ir>"u"&&(ir=vt.jsbn.BigInteger);var ir,cx=vt.util.isNodejs?gt("crypto"):null,pe=vt.asn1,hi=vt.util;vt.pki=vt.pki||{};VO.exports=vt.pki.rsa=vt.rsa=vt.rsa||{};var Vt=vt.pki,HG=[6,4,2,4,2,4,6,2],KG={name:"PrivateKeyInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},$G={name:"RSAPrivateKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},XG={name:"RSAPublicKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},GG=vt.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},WG={name:"DigestInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:pe.Class.UNIVERSAL,type:pe.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},JG=o(function(r){var e;if(r.algorithm in Vt.oids)e=Vt.oids[r.algorithm];else{var t=new Error("Unknown message digest algorithm.");throw t.algorithm=r.algorithm,t}var n=pe.oidToDer(e).getBytes(),s=pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[]),i=pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[]);i.value.push(pe.create(pe.Class.UNIVERSAL,pe.Type.OID,!1,n)),i.value.push(pe.create(pe.Class.UNIVERSAL,pe.Type.NULL,!1,""));var a=pe.create(pe.Class.UNIVERSAL,pe.Type.OCTETSTRING,!1,r.digest().getBytes());return s.value.push(i),s.value.push(a),pe.toDer(s).getBytes()},"emsaPkcs1v15encode"),kO=o(function(r,e,t){if(t)return r.modPow(e.e,e.n);if(!e.p||!e.q)return r.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(ir.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(ir.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new ir(vt.util.bytesToHex(vt.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(ir.ONE));r=r.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var s=r.mod(e.p).modPow(e.dP,e.p),i=r.mod(e.q).modPow(e.dQ,e.q);s.compareTo(i)<0;)s=s.add(e.p);var a=s.subtract(i).multiply(e.qInv).mod(e.p).multiply(e.q).add(i);return a=a.multiply(n.modInverse(e.n)).mod(e.n),a},"_modPow");Vt.rsa.encrypt=function(r,e,t){var n=t,s,i=Math.ceil(e.n.bitLength()/8);t!==!1&&t!==!0?(n=t===2,s=LO(r,e,t)):(s=vt.util.createBuffer(),s.putBytes(r));for(var a=new ir(s.toHex(),16),u=kO(a,e,n),l=u.toString(16),f=vt.util.createBuffer(),h=i-Math.ceil(l.length/2);h>0;)f.putByte(0),--h;return f.putBytes(vt.util.hexToBytes(l)),f.getBytes()};Vt.rsa.decrypt=function(r,e,t,n){var s=Math.ceil(e.n.bitLength()/8);if(r.length!==s){var i=new Error("Encrypted message length is invalid.");throw i.length=r.length,i.expected=s,i}var a=new ir(vt.util.createBuffer(r).toHex(),16);if(a.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var u=kO(a,e,t),l=u.toString(16),f=vt.util.createBuffer(),h=s-Math.ceil(l.length/2);h>0;)f.putByte(0),--h;return f.putBytes(vt.util.hexToBytes(l)),n!==!1?qw(f.getBytes(),e,t):f.getBytes()};Vt.rsa.createKeyPairGenerationState=function(r,e,t){typeof r=="string"&&(r=parseInt(r,10)),r=r||2048,t=t||{};var n=t.prng||vt.random,s={nextBytes:o(function(u){for(var l=n.getBytesSync(u.length),f=0;f<u.length;++f)u[f]=l.charCodeAt(f)},"nextBytes")},i=t.algorithm||"PRIMEINC",a;if(i==="PRIMEINC")a={algorithm:i,state:0,bits:r,rng:s,eInt:e||65537,e:new ir(null),p:null,q:null,qBits:r>>1,pBits:r-(r>>1),pqState:0,num:null,keys:null},a.e.fromInt(a.eInt);else throw new Error("Invalid key generation algorithm: "+i);return a};Vt.rsa.stepKeyPairGenerationState=function(r,e){"algorithm"in r||(r.algorithm="PRIMEINC");var t=new ir(null);t.fromInt(30);for(var n=0,s=o(function(m,g){return m|g},"op_or"),i=+new Date,a,u=0;r.keys===null&&(e<=0||u<e);){if(r.state===0){var l=r.p===null?r.pBits:r.qBits,f=l-1;r.pqState===0?(r.num=new ir(l,r.rng),r.num.testBit(f)||r.num.bitwiseTo(ir.ONE.shiftLeft(f),s,r.num),r.num.dAddOffset(31-r.num.mod(t).byteValue(),0),n=0,++r.pqState):r.pqState===1?r.num.bitLength()>l?r.pqState=0:r.num.isProbablePrime(YG(r.num.bitLength()))?++r.pqState:r.num.dAddOffset(HG[n++%8],0):r.pqState===2?r.pqState=r.num.subtract(ir.ONE).gcd(r.e).compareTo(ir.ONE)===0?3:0:r.pqState===3&&(r.pqState=0,r.p===null?r.p=r.num:r.q=r.num,r.p!==null&&r.q!==null&&++r.state,r.num=null)}else if(r.state===1)r.p.compareTo(r.q)<0&&(r.num=r.p,r.p=r.q,r.q=r.num),++r.state;else if(r.state===2)r.p1=r.p.subtract(ir.ONE),r.q1=r.q.subtract(ir.ONE),r.phi=r.p1.multiply(r.q1),++r.state;else if(r.state===3)r.phi.gcd(r.e).compareTo(ir.ONE)===0?++r.state:(r.p=null,r.q=null,r.state=0);else if(r.state===4)r.n=r.p.multiply(r.q),r.n.bitLength()===r.bits?++r.state:(r.q=null,r.state=0);else if(r.state===5){var h=r.e.modInverse(r.phi);r.keys={privateKey:Vt.rsa.setPrivateKey(r.n,r.e,h,r.p,r.q,h.mod(r.p1),h.mod(r.q1),r.q.modInverse(r.p)),publicKey:Vt.rsa.setPublicKey(r.n,r.e)}}a=+new Date,u+=a-i,i=a}return r.keys!==null};Vt.rsa.generateKeyPair=function(r,e,t,n){if(arguments.length===1?typeof r=="object"?(t=r,r=void 0):typeof r=="function"&&(n=r,r=void 0):arguments.length===2?typeof r=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(t=e,e=void 0):(t=r,n=e,r=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof t=="function"&&(n=t,t=void 0):(n=t,t=e,e=void 0)),t=t||{},r===void 0&&(r=t.bits||2048),e===void 0&&(e=t.e||65537),!vt.options.usePureJavaScript&&!t.prng&&r>=256&&r<=16384&&(e===65537||e===3)){if(n){if(_O("generateKeyPair"))return cx.generateKeyPair("rsa",{modulusLength:r,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(u,l,f){if(u)return n(u);n(null,{privateKey:Vt.privateKeyFromPem(f),publicKey:Vt.publicKeyFromPem(l)})});if(RO("generateKey")&&RO("exportKey"))return hi.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:OO(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(u){return hi.globalScope.crypto.subtle.exportKey("pkcs8",u.privateKey)}).then(void 0,function(u){n(u)}).then(function(u){if(u){var l=Vt.privateKeyFromAsn1(pe.fromDer(vt.util.createBuffer(u)));n(null,{privateKey:l,publicKey:Vt.setRsaPublicKey(l.n,l.e)})}});if(PO("generateKey")&&PO("exportKey")){var s=hi.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:OO(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);s.oncomplete=function(u){var l=u.target.result,f=hi.globalScope.msCrypto.subtle.exportKey("pkcs8",l.privateKey);f.oncomplete=function(h){var m=h.target.result,g=Vt.privateKeyFromAsn1(pe.fromDer(vt.util.createBuffer(m)));n(null,{privateKey:g,publicKey:Vt.setRsaPublicKey(g.n,g.e)})},f.onerror=function(h){n(h)}},s.onerror=function(u){n(u)};return}}else if(_O("generateKeyPairSync")){var i=cx.generateKeyPairSync("rsa",{modulusLength:r,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Vt.privateKeyFromPem(i.privateKey),publicKey:Vt.publicKeyFromPem(i.publicKey)}}}var a=Vt.rsa.createKeyPairGenerationState(r,e,t);if(!n)return Vt.rsa.stepKeyPairGenerationState(a,0),a.keys;zG(a,t,n)};Vt.setRsaPublicKey=Vt.rsa.setPublicKey=function(r,e){var t={n:r,e};return t.encrypt=function(n,s,i){if(typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSAES-PKCS1-V1_5"),s==="RSAES-PKCS1-V1_5")s={encode:o(function(u,l,f){return LO(u,l,2).getBytes()},"encode")};else if(s==="RSA-OAEP"||s==="RSAES-OAEP")s={encode:o(function(u,l){return vt.pkcs1.encode_rsa_oaep(l,u,i)},"encode")};else if(["RAW","NONE","NULL",null].indexOf(s)!==-1)s={encode:o(function(u){return u},"encode")};else if(typeof s=="string")throw new Error('Unsupported encryption scheme: "'+s+'".');var a=s.encode(n,t,!0);return Vt.rsa.encrypt(a,t,!0)},t.verify=function(n,s,i,a){typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSASSA-PKCS1-V1_5"),a===void 0&&(a={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in a||(a._parseAllDigestBytes=!0),i==="RSASSA-PKCS1-V1_5"?i={verify:o(function(l,f){f=qw(f,t,!0);var h=pe.fromDer(f,{parseAllBytes:a._parseAllDigestBytes}),m={},g=[];if(!pe.validate(h,WG,m,g)){var w=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw w.errors=g,w}var y=pe.derToOid(m.algorithmIdentifier);if(!(y===vt.oids.md2||y===vt.oids.md5||y===vt.oids.sha1||y===vt.oids.sha224||y===vt.oids.sha256||y===vt.oids.sha384||y===vt.oids.sha512||y===vt.oids["sha512-224"]||y===vt.oids["sha512-256"])){var w=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw w.oid=y,w}if((y===vt.oids.md2||y===vt.oids.md5)&&!("parameters"in m))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return l===m.digest},"verify")}:(i==="NONE"||i==="NULL"||i===null)&&(i={verify:o(function(l,f){return f=qw(f,t,!0),l===f},"verify")});var u=Vt.rsa.decrypt(s,t,!0,!1);return i.verify(n,u,t.n.bitLength())},t};Vt.setRsaPrivateKey=Vt.rsa.setPrivateKey=function(r,e,t,n,s,i,a,u){var l={n:r,e,d:t,p:n,q:s,dP:i,dQ:a,qInv:u};return l.decrypt=function(f,h,m){typeof h=="string"?h=h.toUpperCase():h===void 0&&(h="RSAES-PKCS1-V1_5");var g=Vt.rsa.decrypt(f,l,!1,!1);if(h==="RSAES-PKCS1-V1_5")h={decode:qw};else if(h==="RSA-OAEP"||h==="RSAES-OAEP")h={decode:o(function(w,y){return vt.pkcs1.decode_rsa_oaep(y,w,m)},"decode")};else if(["RAW","NONE","NULL",null].indexOf(h)!==-1)h={decode:o(function(w){return w},"decode")};else throw new Error('Unsupported encryption scheme: "'+h+'".');return h.decode(g,l,!1)},l.sign=function(f,h){var m=!1;typeof h=="string"&&(h=h.toUpperCase()),h===void 0||h==="RSASSA-PKCS1-V1_5"?(h={encode:JG},m=1):(h==="NONE"||h==="NULL"||h===null)&&(h={encode:o(function(){return f},"encode")},m=1);var g=h.encode(f,l.n.bitLength());return Vt.rsa.encrypt(g,l,m)},l};Vt.wrapRsaPrivateKey=function(r){return pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,pe.integerToDer(0).getBytes()),pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.OID,!1,pe.oidToDer(Vt.oids.rsaEncryption).getBytes()),pe.create(pe.Class.UNIVERSAL,pe.Type.NULL,!1,"")]),pe.create(pe.Class.UNIVERSAL,pe.Type.OCTETSTRING,!1,pe.toDer(r).getBytes())])};Vt.privateKeyFromAsn1=function(r){var e={},t=[];if(pe.validate(r,KG,e,t)&&(r=pe.fromDer(vt.util.createBuffer(e.privateKey))),e={},t=[],!pe.validate(r,$G,e,t)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=t,n}var s,i,a,u,l,f,h,m;return s=vt.util.createBuffer(e.privateKeyModulus).toHex(),i=vt.util.createBuffer(e.privateKeyPublicExponent).toHex(),a=vt.util.createBuffer(e.privateKeyPrivateExponent).toHex(),u=vt.util.createBuffer(e.privateKeyPrime1).toHex(),l=vt.util.createBuffer(e.privateKeyPrime2).toHex(),f=vt.util.createBuffer(e.privateKeyExponent1).toHex(),h=vt.util.createBuffer(e.privateKeyExponent2).toHex(),m=vt.util.createBuffer(e.privateKeyCoefficient).toHex(),Vt.setRsaPrivateKey(new ir(s,16),new ir(i,16),new ir(a,16),new ir(u,16),new ir(l,16),new ir(f,16),new ir(h,16),new ir(m,16))};Vt.privateKeyToAsn1=Vt.privateKeyToRSAPrivateKey=function(r){return pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,pe.integerToDer(0).getBytes()),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.n)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.e)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.d)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.p)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.q)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.dP)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.dQ)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.qInv))])};Vt.publicKeyFromAsn1=function(r){var e={},t=[];if(pe.validate(r,GG,e,t)){var n=pe.derToOid(e.publicKeyOid);if(n!==Vt.oids.rsaEncryption){var s=new Error("Cannot read public key. Unknown OID.");throw s.oid=n,s}r=e.rsaPublicKey}if(t=[],!pe.validate(r,XG,e,t)){var s=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw s.errors=t,s}var i=vt.util.createBuffer(e.publicKeyModulus).toHex(),a=vt.util.createBuffer(e.publicKeyExponent).toHex();return Vt.setRsaPublicKey(new ir(i,16),new ir(a,16))};Vt.publicKeyToAsn1=Vt.publicKeyToSubjectPublicKeyInfo=function(r){return pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.OID,!1,pe.oidToDer(Vt.oids.rsaEncryption).getBytes()),pe.create(pe.Class.UNIVERSAL,pe.Type.NULL,!1,"")]),pe.create(pe.Class.UNIVERSAL,pe.Type.BITSTRING,!1,[Vt.publicKeyToRSAPublicKey(r)])])};Vt.publicKeyToRSAPublicKey=function(r){return pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.n)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.e))])};function LO(r,e,t){var n=vt.util.createBuffer(),s=Math.ceil(e.n.bitLength()/8);if(r.length>s-11){var i=new Error("Message is too long for PKCS#1 v1.5 padding.");throw i.length=r.length,i.max=s-11,i}n.putByte(0),n.putByte(t);var a=s-3-r.length,u;if(t===0||t===1){u=t===0?0:255;for(var l=0;l<a;++l)n.putByte(u)}else for(;a>0;){for(var f=0,h=vt.random.getBytes(a),l=0;l<a;++l)u=h.charCodeAt(l),u===0?++f:n.putByte(u);a=f}return n.putByte(0),n.putBytes(r),n}o(LO,"_encodePkcs1_v1_5");function qw(r,e,t,n){var s=Math.ceil(e.n.bitLength()/8),i=vt.util.createBuffer(r),a=i.getByte(),u=i.getByte();if(a!==0||t&&u!==0&&u!==1||!t&&u!=2||t&&u===0&&typeof n>"u")throw new Error("Encryption block is invalid.");var l=0;if(u===0){l=s-3-n;for(var f=0;f<l;++f)if(i.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(u===1)for(l=0;i.length()>1;){if(i.getByte()!==255){--i.read;break}++l}else if(u===2)for(l=0;i.length()>1;){if(i.getByte()===0){--i.read;break}++l}var h=i.getByte();if(h!==0||l!==s-3-i.length())throw new Error("Encryption block is invalid.");return i.getBytes()}o(qw,"_decodePkcs1_v1_5");function zG(r,e,t){typeof e=="function"&&(t=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),s();function s(){i(r.pBits,function(u,l){if(u)return t(u);if(r.p=l,r.q!==null)return a(u,r.q);i(r.qBits,a)})}o(s,"generate");function i(u,l){vt.prime.generateProbablePrime(u,n,l)}o(i,"getPrime");function a(u,l){if(u)return t(u);if(r.q=l,r.p.compareTo(r.q)<0){var f=r.p;r.p=r.q,r.q=f}if(r.p.subtract(ir.ONE).gcd(r.e).compareTo(ir.ONE)!==0){r.p=null,s();return}if(r.q.subtract(ir.ONE).gcd(r.e).compareTo(ir.ONE)!==0){r.q=null,i(r.qBits,a);return}if(r.p1=r.p.subtract(ir.ONE),r.q1=r.q.subtract(ir.ONE),r.phi=r.p1.multiply(r.q1),r.phi.gcd(r.e).compareTo(ir.ONE)!==0){r.p=r.q=null,s();return}if(r.n=r.p.multiply(r.q),r.n.bitLength()!==r.bits){r.q=null,i(r.qBits,a);return}var h=r.e.modInverse(r.phi);r.keys={privateKey:Vt.rsa.setPrivateKey(r.n,r.e,h,r.p,r.q,h.mod(r.p1),h.mod(r.q1),r.q.modInverse(r.p)),publicKey:Vt.rsa.setPublicKey(r.n,r.e)},t(null,r.keys)}o(a,"finish")}o(zG,"_generateKeyPair");function Ea(r){var e=r.toString(16);e[0]>="8"&&(e="00"+e);var t=vt.util.hexToBytes(e);return t.length>1&&(t.charCodeAt(0)===0&&(t.charCodeAt(1)&128)===0||t.charCodeAt(0)===255&&(t.charCodeAt(1)&128)===128)?t.substr(1):t}o(Ea,"_bnToBytes");function YG(r){return r<=100?27:r<=150?18:r<=200?15:r<=250?12:r<=300?9:r<=350?8:r<=400?7:r<=500?6:r<=600?5:r<=800?4:r<=1250?3:2}o(YG,"_getMillerRabinTests");function _O(r){return vt.util.isNodejs&&typeof cx[r]=="function"}o(_O,"_detectNodeCrypto");function RO(r){return typeof hi.globalScope<"u"&&typeof hi.globalScope.crypto=="object"&&typeof hi.globalScope.crypto.subtle=="object"&&typeof hi.globalScope.crypto.subtle[r]=="function"}o(RO,"_detectSubtleCrypto");function PO(r){return typeof hi.globalScope<"u"&&typeof hi.globalScope.msCrypto=="object"&&typeof hi.globalScope.msCrypto.subtle=="object"&&typeof hi.globalScope.msCrypto.subtle[r]=="function"}o(PO,"_detectSubtleMsCrypto");function OO(r){for(var e=vt.util.hexToBytes(r.toString(16)),t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}o(OO,"_intToUint8Array")});var fx=ye((_ce,qO)=>{"use strict";var st=$t();vu();Fi();Em();da();wu();Vw();hc();ci();rx();bm();ur();typeof UO>"u"&&(UO=st.jsbn.BigInteger);var UO,Ee=st.asn1,Ft=st.pki=st.pki||{};qO.exports=Ft.pbe=st.pbe=st.pbe||{};var mc=Ft.oids,QG={name:"EncryptedPrivateKeyInfo",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},ZG={name:"PBES2Algorithms",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},eW={name:"pkcs-12PbeParams",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.INTEGER,constructed:!1,capture:"iterations"}]};Ft.encryptPrivateKeyInfo=function(r,e,t){t=t||{},t.saltSize=t.saltSize||8,t.count=t.count||2048,t.algorithm=t.algorithm||"aes128",t.prfAlgorithm=t.prfAlgorithm||"sha1";var n=st.random.getBytesSync(t.saltSize),s=t.count,i=Ee.integerToDer(s),a,u,l;if(t.algorithm.indexOf("aes")===0||t.algorithm==="des"){var f,h,m;switch(t.algorithm){case"aes128":a=16,f=16,h=mc["aes128-CBC"],m=st.aes.createEncryptionCipher;break;case"aes192":a=24,f=16,h=mc["aes192-CBC"],m=st.aes.createEncryptionCipher;break;case"aes256":a=32,f=16,h=mc["aes256-CBC"],m=st.aes.createEncryptionCipher;break;case"des":a=8,f=8,h=mc.desCBC,m=st.des.createEncryptionCipher;break;default:var g=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw g.algorithm=t.algorithm,g}var w="hmacWith"+t.prfAlgorithm.toUpperCase(),y=FO(w),S=st.pkcs5.pbkdf2(e,n,s,a,y),E=st.random.getBytesSync(f),b=m(S);b.start(E),b.update(Ee.toDer(r)),b.finish(),l=b.output.getBytes();var T=tW(n,i,a,w);u=Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OID,!1,Ee.oidToDer(mc.pkcs5PBES2).getBytes()),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OID,!1,Ee.oidToDer(mc.pkcs5PBKDF2).getBytes()),T]),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OID,!1,Ee.oidToDer(h).getBytes()),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OCTETSTRING,!1,E)])])])}else if(t.algorithm==="3des"){a=24;var A=new st.util.ByteBuffer(n),S=Ft.pbe.generatePkcs12Key(e,A,1,s,a),E=Ft.pbe.generatePkcs12Key(e,A,2,s,a),b=st.des.createEncryptionCipher(S);b.start(E),b.update(Ee.toDer(r)),b.finish(),l=b.output.getBytes(),u=Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OID,!1,Ee.oidToDer(mc["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OCTETSTRING,!1,n),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.INTEGER,!1,i.getBytes())])])}else{var g=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw g.algorithm=t.algorithm,g}var C=Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[u,Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OCTETSTRING,!1,l)]);return C};Ft.decryptPrivateKeyInfo=function(r,e){var t=null,n={},s=[];if(!Ee.validate(r,QG,n,s)){var i=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=s,i}var a=Ee.derToOid(n.encryptionOid),u=Ft.pbe.getCipher(a,n.encryptionParams,e),l=st.util.createBuffer(n.encryptedData);return u.update(l),u.finish()&&(t=Ee.fromDer(u.output)),t};Ft.encryptedPrivateKeyToPem=function(r,e){var t={type:"ENCRYPTED PRIVATE KEY",body:Ee.toDer(r).getBytes()};return st.pem.encode(t,{maxline:e})};Ft.encryptedPrivateKeyFromPem=function(r){var e=st.pem.decode(r)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var t=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw t.headerType=e.type,t}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return Ee.fromDer(e.body)};Ft.encryptRsaPrivateKey=function(r,e,t){if(t=t||{},!t.legacy){var n=Ft.wrapRsaPrivateKey(Ft.privateKeyToAsn1(r));return n=Ft.encryptPrivateKeyInfo(n,e,t),Ft.encryptedPrivateKeyToPem(n)}var s,i,a,u;switch(t.algorithm){case"aes128":s="AES-128-CBC",a=16,i=st.random.getBytesSync(16),u=st.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",a=24,i=st.random.getBytesSync(16),u=st.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",a=32,i=st.random.getBytesSync(16),u=st.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",a=24,i=st.random.getBytesSync(8),u=st.des.createEncryptionCipher;break;case"des":s="DES-CBC",a=8,i=st.random.getBytesSync(8),u=st.des.createEncryptionCipher;break;default:var l=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+t.algorithm+'".');throw l.algorithm=t.algorithm,l}var f=st.pbe.opensslDeriveBytes(e,i.substr(0,8),a),h=u(f);h.start(i),h.update(Ee.toDer(Ft.privateKeyToAsn1(r))),h.finish();var m={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:s,parameters:st.util.bytesToHex(i).toUpperCase()},body:h.output.getBytes()};return st.pem.encode(m)};Ft.decryptRsaPrivateKey=function(r,e){var t=null,n=st.pem.decode(r)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var s=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw s.headerType=s,s}if(n.procType&&n.procType.type==="ENCRYPTED"){var i,a;switch(n.dekInfo.algorithm){case"DES-CBC":i=8,a=st.des.createDecryptionCipher;break;case"DES-EDE3-CBC":i=24,a=st.des.createDecryptionCipher;break;case"AES-128-CBC":i=16,a=st.aes.createDecryptionCipher;break;case"AES-192-CBC":i=24,a=st.aes.createDecryptionCipher;break;case"AES-256-CBC":i=32,a=st.aes.createDecryptionCipher;break;case"RC2-40-CBC":i=5,a=o(function(m){return st.rc2.createDecryptionCipher(m,40)},"cipherFn");break;case"RC2-64-CBC":i=8,a=o(function(m){return st.rc2.createDecryptionCipher(m,64)},"cipherFn");break;case"RC2-128-CBC":i=16,a=o(function(m){return st.rc2.createDecryptionCipher(m,128)},"cipherFn");break;default:var s=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw s.algorithm=n.dekInfo.algorithm,s}var u=st.util.hexToBytes(n.dekInfo.parameters),l=st.pbe.opensslDeriveBytes(e,u.substr(0,8),i),f=a(l);if(f.start(u),f.update(st.util.createBuffer(n.body)),f.finish())t=f.output.getBytes();else return t}else t=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?t=Ft.decryptPrivateKeyInfo(Ee.fromDer(t),e):t=Ee.fromDer(t),t!==null&&(t=Ft.privateKeyFromAsn1(t)),t};Ft.pbe.generatePkcs12Key=function(r,e,t,n,s,i){var a,u;if(typeof i>"u"||i===null){if(!("sha1"in st.md))throw new Error('"sha1" hash algorithm unavailable.');i=st.md.sha1.create()}var l=i.digestLength,f=i.blockLength,h=new st.util.ByteBuffer,m=new st.util.ByteBuffer;if(r!=null){for(u=0;u<r.length;u++)m.putInt16(r.charCodeAt(u));m.putInt16(0)}var g=m.length(),w=e.length(),y=new st.util.ByteBuffer;y.fillWithByte(t,f);var S=f*Math.ceil(w/f),E=new st.util.ByteBuffer;for(u=0;u<S;u++)E.putByte(e.at(u%w));var b=f*Math.ceil(g/f),T=new st.util.ByteBuffer;for(u=0;u<b;u++)T.putByte(m.at(u%g));var A=E;A.putBuffer(T);for(var C=Math.ceil(s/l),x=1;x<=C;x++){var B=new st.util.ByteBuffer;B.putBytes(y.bytes()),B.putBytes(A.bytes());for(var F=0;F<n;F++)i.start(),i.update(B.getBytes()),B=i.digest();var R=new st.util.ByteBuffer;for(u=0;u<f;u++)R.putByte(B.at(u%l));var H=Math.ceil(w/f)+Math.ceil(g/f),q=new st.util.ByteBuffer;for(a=0;a<H;a++){var K=new st.util.ByteBuffer(A.getBytes(f)),G=511;for(u=R.length()-1;u>=0;u--)G=G>>8,G+=R.at(u)+K.at(u),K.setAt(u,G&255);q.putBuffer(K)}A=q,h.putBuffer(B)}return h.truncate(h.length()-s),h};Ft.pbe.getCipher=function(r,e,t){switch(r){case Ft.oids.pkcs5PBES2:return Ft.pbe.getCipherForPBES2(r,e,t);case Ft.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case Ft.oids["pbewithSHAAnd40BitRC2-CBC"]:return Ft.pbe.getCipherForPKCS12PBE(r,e,t);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=r,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};Ft.pbe.getCipherForPBES2=function(r,e,t){var n={},s=[];if(!Ee.validate(e,ZG,n,s)){var i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=s,i}if(r=Ee.derToOid(n.kdfOid),r!==Ft.oids.pkcs5PBKDF2){var i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw i.oid=r,i.supportedOids=["pkcs5PBKDF2"],i}if(r=Ee.derToOid(n.encOid),r!==Ft.oids["aes128-CBC"]&&r!==Ft.oids["aes192-CBC"]&&r!==Ft.oids["aes256-CBC"]&&r!==Ft.oids["des-EDE3-CBC"]&&r!==Ft.oids.desCBC){var i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw i.oid=r,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i}var a=n.kdfSalt,u=st.util.createBuffer(n.kdfIterationCount);u=u.getInt(u.length()<<3);var l,f;switch(Ft.oids[r]){case"aes128-CBC":l=16,f=st.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,f=st.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,f=st.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,f=st.des.createDecryptionCipher;break;case"desCBC":l=8,f=st.des.createDecryptionCipher;break}var h=jO(n.prfOid),m=st.pkcs5.pbkdf2(t,a,u,l,h),g=n.encIv,w=f(m);return w.start(g),w};Ft.pbe.getCipherForPKCS12PBE=function(r,e,t){var n={},s=[];if(!Ee.validate(e,eW,n,s)){var i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=s,i}var a=st.util.createBuffer(n.salt),u=st.util.createBuffer(n.iterations);u=u.getInt(u.length()<<3);var l,f,h;switch(r){case Ft.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:l=24,f=8,h=st.des.startDecrypting;break;case Ft.oids["pbewithSHAAnd40BitRC2-CBC"]:l=5,f=8,h=o(function(S,E){var b=st.rc2.createDecryptionCipher(S,40);return b.start(E,null),b},"cipherFn");break;default:var i=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw i.oid=r,i}var m=jO(n.prfOid),g=Ft.pbe.generatePkcs12Key(t,a,1,u,l,m);m.start();var w=Ft.pbe.generatePkcs12Key(t,a,2,u,f,m);return h(g,w)};Ft.pbe.opensslDeriveBytes=function(r,e,t,n){if(typeof n>"u"||n===null){if(!("md5"in st.md))throw new Error('"md5" hash algorithm unavailable.');n=st.md.md5.create()}e===null&&(e="");for(var s=[MO(n,r+e)],i=16,a=1;i<t;++a,i+=16)s.push(MO(n,s[a-1]+r+e));return s.join("").substr(0,t)};function MO(r,e){return r.start().update(e).digest().getBytes()}o(MO,"hash");function jO(r){var e;if(!r)e="hmacWithSHA1";else if(e=Ft.oids[Ee.derToOid(r)],!e){var t=new Error("Unsupported PRF OID.");throw t.oid=r,t.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],t}return FO(e)}o(jO,"prfOidToMessageDigest");function FO(r){var e=st.md;switch(r){case"hmacWithSHA224":e=st.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":r=r.substr(8).toLowerCase();break;default:var t=new Error("Unsupported PRF algorithm.");throw t.algorithm=r,t.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],t}if(!e||!(r in e))throw new Error("Unknown hash algorithm: "+r);return e[r].create()}o(FO,"prfAlgorithmToMessageDigest");function tW(r,e,t,n){var s=Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OCTETSTRING,!1,r),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.INTEGER,!1,e.getBytes())]);return n!=="hmacWithSHA1"&&s.value.push(Ee.create(Ee.Class.UNIVERSAL,Ee.Type.INTEGER,!1,st.util.hexToBytes(t.toString(16))),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OID,!1,Ee.oidToDer(Ft.oids[n]).getBytes()),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.NULL,!1,"")])),s}o(tW,"createPbkdf2Params")});var hx=ye((Pce,$O)=>{"use strict";var Gh=$t();Fi();ur();var tt=Gh.asn1,Wh=$O.exports=Gh.pkcs7asn1=Gh.pkcs7asn1||{};Gh.pkcs7=Gh.pkcs7||{};Gh.pkcs7.asn1=Wh;var HO={name:"ContentInfo",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:tt.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Wh.contentInfoValidator=HO;var KO={name:"EncryptedContentInfo",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:tt.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:tt.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Wh.envelopedDataValidator={name:"EnvelopedData",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(KO)};Wh.encryptedDataValidator={name:"EncryptedData",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"version"}].concat(KO)};var rW={name:"SignerInfo",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:tt.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:tt.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:tt.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Wh.signedDataValidator={name:"SignedData",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},HO,{name:"SignedData.Certificates",tagClass:tt.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:tt.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SET,capture:"signerInfos",optional:!0,value:[rW]}]};Wh.recipientInfoValidator={name:"RecipientInfo",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:tt.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var px=ye((Oce,XO)=>{"use strict";var gc=$t();ur();gc.mgf=gc.mgf||{};var nW=XO.exports=gc.mgf.mgf1=gc.mgf1=gc.mgf1||{};nW.create=function(r){var e={generate:o(function(t,n){for(var s=new gc.util.ByteBuffer,i=Math.ceil(n/r.digestLength),a=0;a<i;a++){var u=new gc.util.ByteBuffer;u.putInt32(a),r.start(),r.update(t+u.getBytes()),s.putBuffer(r.digest())}return s.truncate(s.length()-n),s.getBytes()},"generate")};return e}});var WO=ye((Lce,GO)=>{"use strict";var Hw=$t();px();GO.exports=Hw.mgf=Hw.mgf||{};Hw.mgf.mgf1=Hw.mgf1});var Kw=ye((Vce,JO)=>{"use strict";var yc=$t();ci();ur();var sW=JO.exports=yc.pss=yc.pss||{};sW.create=function(r){arguments.length===3&&(r={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e=r.md,t=r.mgf,n=e.digestLength,s=r.salt||null;typeof s=="string"&&(s=yc.util.createBuffer(s));var i;if("saltLength"in r)i=r.saltLength;else if(s!==null)i=s.length();else throw new Error("Salt length not specified or specific salt not given.");if(s!==null&&s.length()!==i)throw new Error("Given salt length does not match length of given salt.");var a=r.prng||yc.random,u={};return u.encode=function(l,f){var h,m=f-1,g=Math.ceil(m/8),w=l.digest().getBytes();if(g<n+i+2)throw new Error("Message is too long to encrypt.");var y;s===null?y=a.getBytesSync(i):y=s.bytes();var S=new yc.util.ByteBuffer;S.fillWithByte(0,8),S.putBytes(w),S.putBytes(y),e.start(),e.update(S.getBytes());var E=e.digest().getBytes(),b=new yc.util.ByteBuffer;b.fillWithByte(0,g-i-n-2),b.putByte(1),b.putBytes(y);var T=b.getBytes(),A=g-n-1,C=t.generate(E,A),x="";for(h=0;h<A;h++)x+=String.fromCharCode(T.charCodeAt(h)^C.charCodeAt(h));var B=65280>>8*g-m&255;return x=String.fromCharCode(x.charCodeAt(0)&~B)+x.substr(1),x+E+"\xBC"},u.verify=function(l,f,h){var m,g=h-1,w=Math.ceil(g/8);if(f=f.substr(-w),w<n+i+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(f.charCodeAt(w-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var y=w-n-1,S=f.substr(0,y),E=f.substr(y,n),b=65280>>8*w-g&255;if((S.charCodeAt(0)&b)!==0)throw new Error("Bits beyond keysize not zero as expected.");var T=t.generate(E,y),A="";for(m=0;m<y;m++)A+=String.fromCharCode(S.charCodeAt(m)^T.charCodeAt(m));A=String.fromCharCode(A.charCodeAt(0)&~b)+A.substr(1);var C=w-n-i-2;for(m=0;m<C;m++)if(A.charCodeAt(m)!==0)throw new Error("Leftmost octets not zero as expected");if(A.charCodeAt(C)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var x=A.substr(-i),B=new yc.util.ByteBuffer;B.fillWithByte(0,8),B.putBytes(l),B.putBytes(x),e.start(),e.update(B.getBytes());var F=e.digest().getBytes();return E===F},u}});var Gw=ye((Uce,e3)=>{"use strict";var wt=$t();vu();Fi();Em();da();WO();wu();hc();Kw();bm();ur();var k=wt.asn1,$e=e3.exports=wt.pki=wt.pki||{},ar=$e.oids,Jr={};Jr.CN=ar.commonName;Jr.commonName="CN";Jr.C=ar.countryName;Jr.countryName="C";Jr.L=ar.localityName;Jr.localityName="L";Jr.ST=ar.stateOrProvinceName;Jr.stateOrProvinceName="ST";Jr.O=ar.organizationName;Jr.organizationName="O";Jr.OU=ar.organizationalUnitName;Jr.organizationalUnitName="OU";Jr.E=ar.emailAddress;Jr.emailAddress="E";var YO=wt.pki.rsa.publicKeyValidator,iW={name:"Certificate",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:k.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:k.Class.UNIVERSAL,type:k.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:k.Class.UNIVERSAL,type:k.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:k.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:k.Class.UNIVERSAL,type:k.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:k.Class.UNIVERSAL,type:k.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:k.Class.UNIVERSAL,type:k.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:k.Class.UNIVERSAL,type:k.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},YO,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:k.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:k.Class.UNIVERSAL,type:k.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:k.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:k.Class.UNIVERSAL,type:k.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:k.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:k.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:k.Class.UNIVERSAL,type:k.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},aW={name:"rsapss",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:k.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:k.Class.UNIVERSAL,type:k.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:k.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:k.Class.UNIVERSAL,type:k.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:k.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:k.Class.UNIVERSAL,type:k.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:k.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:k.Class.UNIVERSAL,type:k.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},oW={name:"CertificationRequestInfo",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:k.Class.UNIVERSAL,type:k.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},YO,{name:"CertificationRequestInfo.attributes",tagClass:k.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:k.Class.UNIVERSAL,type:k.Type.SET,constructed:!0}]}]}]},uW={name:"CertificationRequest",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[oW,{name:"CertificationRequest.signatureAlgorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:k.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:k.Class.UNIVERSAL,type:k.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};$e.RDNAttributesAsArray=function(r,e){for(var t=[],n,s,i,a=0;a<r.value.length;++a){n=r.value[a];for(var u=0;u<n.value.length;++u)i={},s=n.value[u],i.type=k.derToOid(s.value[0].value),i.value=s.value[1].value,i.valueTagClass=s.value[1].type,i.type in ar&&(i.name=ar[i.type],i.name in Jr&&(i.shortName=Jr[i.name])),e&&(e.update(i.type),e.update(i.value)),t.push(i)}return t};$e.CRIAttributesAsArray=function(r){for(var e=[],t=0;t<r.length;++t)for(var n=r[t],s=k.derToOid(n.value[0].value),i=n.value[1].value,a=0;a<i.length;++a){var u={};if(u.type=s,u.value=i[a].value,u.valueTagClass=i[a].type,u.type in ar&&(u.name=ar[u.type],u.name in Jr&&(u.shortName=Jr[u.name])),u.type===ar.extensionRequest){u.extensions=[];for(var l=0;l<u.value.length;++l)u.extensions.push($e.certificateExtensionFromAsn1(u.value[l]))}e.push(u)}return e};function Au(r,e){typeof e=="string"&&(e={shortName:e});for(var t=null,n,s=0;t===null&&s<r.attributes.length;++s)n=r.attributes[s],(e.type&&e.type===n.type||e.name&&e.name===n.name||e.shortName&&e.shortName===n.shortName)&&(t=n);return t}o(Au,"_getAttribute");var $w=o(function(r,e,t){var n={};if(r!==ar["RSASSA-PSS"])return n;t&&(n={hash:{algorithmOid:ar.sha1},mgf:{algorithmOid:ar.mgf1,hash:{algorithmOid:ar.sha1}},saltLength:20});var s={},i=[];if(!k.validate(e,aW,s,i)){var a=new Error("Cannot read RSASSA-PSS parameter block.");throw a.errors=i,a}return s.hashOid!==void 0&&(n.hash=n.hash||{},n.hash.algorithmOid=k.derToOid(s.hashOid)),s.maskGenOid!==void 0&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=k.derToOid(s.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=k.derToOid(s.maskGenHashOid)),s.saltLength!==void 0&&(n.saltLength=s.saltLength.charCodeAt(0)),n},"_readSignatureParameters"),Xw=o(function(r){switch(ar[r.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return wt.md.sha1.create();case"md5WithRSAEncryption":return wt.md.md5.create();case"sha256WithRSAEncryption":return wt.md.sha256.create();case"sha384WithRSAEncryption":return wt.md.sha384.create();case"sha512WithRSAEncryption":return wt.md.sha512.create();case"RSASSA-PSS":return wt.md.sha256.create();default:var e=new Error("Could not compute "+r.type+" digest. Unknown signature OID.");throw e.signatureOid=r.signatureOid,e}},"_createSignatureDigest"),QO=o(function(r){var e=r.certificate,t;switch(e.signatureOid){case ar.sha1WithRSAEncryption:case ar.sha1WithRSASignature:break;case ar["RSASSA-PSS"]:var n,s;if(n=ar[e.signatureParameters.mgf.hash.algorithmOid],n===void 0||wt.md[n]===void 0){var i=new Error("Unsupported MGF hash function.");throw i.oid=e.signatureParameters.mgf.hash.algorithmOid,i.name=n,i}if(s=ar[e.signatureParameters.mgf.algorithmOid],s===void 0||wt.mgf[s]===void 0){var i=new Error("Unsupported MGF function.");throw i.oid=e.signatureParameters.mgf.algorithmOid,i.name=s,i}if(s=wt.mgf[s].create(wt.md[n].create()),n=ar[e.signatureParameters.hash.algorithmOid],n===void 0||wt.md[n]===void 0){var i=new Error("Unsupported RSASSA-PSS hash function.");throw i.oid=e.signatureParameters.hash.algorithmOid,i.name=n,i}t=wt.pss.create(wt.md[n].create(),s,e.signatureParameters.saltLength);break}return e.publicKey.verify(r.md.digest().getBytes(),r.signature,t)},"_verifySignature");$e.certificateFromPem=function(r,e,t){var n=wt.pem.decode(r)[0];if(n.type!=="CERTIFICATE"&&n.type!=="X509 CERTIFICATE"&&n.type!=="TRUSTED CERTIFICATE"){var s=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw s.headerType=n.type,s}if(n.procType&&n.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var i=k.fromDer(n.body,t);return $e.certificateFromAsn1(i,e)};$e.certificateToPem=function(r,e){var t={type:"CERTIFICATE",body:k.toDer($e.certificateToAsn1(r)).getBytes()};return wt.pem.encode(t,{maxline:e})};$e.publicKeyFromPem=function(r){var e=wt.pem.decode(r)[0];if(e.type!=="PUBLIC KEY"&&e.type!=="RSA PUBLIC KEY"){var t=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw t.headerType=e.type,t}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var n=k.fromDer(e.body);return $e.publicKeyFromAsn1(n)};$e.publicKeyToPem=function(r,e){var t={type:"PUBLIC KEY",body:k.toDer($e.publicKeyToAsn1(r)).getBytes()};return wt.pem.encode(t,{maxline:e})};$e.publicKeyToRSAPublicKeyPem=function(r,e){var t={type:"RSA PUBLIC KEY",body:k.toDer($e.publicKeyToRSAPublicKey(r)).getBytes()};return wt.pem.encode(t,{maxline:e})};$e.getPublicKeyFingerprint=function(r,e){e=e||{};var t=e.md||wt.md.sha1.create(),n=e.type||"RSAPublicKey",s;switch(n){case"RSAPublicKey":s=k.toDer($e.publicKeyToRSAPublicKey(r)).getBytes();break;case"SubjectPublicKeyInfo":s=k.toDer($e.publicKeyToAsn1(r)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+e.type+'".')}t.start(),t.update(s);var i=t.digest();if(e.encoding==="hex"){var a=i.toHex();return e.delimiter?a.match(/.{2}/g).join(e.delimiter):a}else{if(e.encoding==="binary")return i.getBytes();if(e.encoding)throw new Error('Unknown encoding "'+e.encoding+'".')}return i};$e.certificationRequestFromPem=function(r,e,t){var n=wt.pem.decode(r)[0];if(n.type!=="CERTIFICATE REQUEST"){var s=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw s.headerType=n.type,s}if(n.procType&&n.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var i=k.fromDer(n.body,t);return $e.certificationRequestFromAsn1(i,e)};$e.certificationRequestToPem=function(r,e){var t={type:"CERTIFICATE REQUEST",body:k.toDer($e.certificationRequestToAsn1(r)).getBytes()};return wt.pem.encode(t,{maxline:e})};$e.createCertificate=function(){var r={};return r.version=2,r.serialNumber="00",r.signatureOid=null,r.signature=null,r.siginfo={},r.siginfo.algorithmOid=null,r.validity={},r.validity.notBefore=new Date,r.validity.notAfter=new Date,r.issuer={},r.issuer.getField=function(e){return Au(r.issuer,e)},r.issuer.addField=function(e){pi([e]),r.issuer.attributes.push(e)},r.issuer.attributes=[],r.issuer.hash=null,r.subject={},r.subject.getField=function(e){return Au(r.subject,e)},r.subject.addField=function(e){pi([e]),r.subject.attributes.push(e)},r.subject.attributes=[],r.subject.hash=null,r.extensions=[],r.publicKey=null,r.md=null,r.setSubject=function(e,t){pi(e),r.subject.attributes=e,delete r.subject.uniqueId,t&&(r.subject.uniqueId=t),r.subject.hash=null},r.setIssuer=function(e,t){pi(e),r.issuer.attributes=e,delete r.issuer.uniqueId,t&&(r.issuer.uniqueId=t),r.issuer.hash=null},r.setExtensions=function(e){for(var t=0;t<e.length;++t)ZO(e[t],{cert:r});r.extensions=e},r.getExtension=function(e){typeof e=="string"&&(e={name:e});for(var t=null,n,s=0;t===null&&s<r.extensions.length;++s)n=r.extensions[s],(e.id&&n.id===e.id||e.name&&n.name===e.name)&&(t=n);return t},r.sign=function(e,t){r.md=t||wt.md.sha1.create();var n=ar[r.md.algorithm+"WithRSAEncryption"];if(!n){var s=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw s.algorithm=r.md.algorithm,s}r.signatureOid=r.siginfo.algorithmOid=n,r.tbsCertificate=$e.getTBSCertificate(r);var i=k.toDer(r.tbsCertificate);r.md.update(i.getBytes()),r.signature=e.sign(r.md)},r.verify=function(e){var t=!1;if(!r.issued(e)){var n=e.issuer,s=r.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=s.attributes,i.actualIssuer=n.attributes,i}var a=e.md;if(a===null){a=Xw({signatureOid:e.signatureOid,type:"certificate"});var u=e.tbsCertificate||$e.getTBSCertificate(e),l=k.toDer(u);a.update(l.getBytes())}return a!==null&&(t=QO({certificate:r,md:a,signature:e.signature})),t},r.isIssuer=function(e){var t=!1,n=r.issuer,s=e.subject;if(n.hash&&s.hash)t=n.hash===s.hash;else if(n.attributes.length===s.attributes.length){t=!0;for(var i,a,u=0;t&&u<n.attributes.length;++u)i=n.attributes[u],a=s.attributes[u],(i.type!==a.type||i.value!==a.value)&&(t=!1)}return t},r.issued=function(e){return e.isIssuer(r)},r.generateSubjectKeyIdentifier=function(){return $e.getPublicKeyFingerprint(r.publicKey,{type:"RSAPublicKey"})},r.verifySubjectKeyIdentifier=function(){for(var e=ar.subjectKeyIdentifier,t=0;t<r.extensions.length;++t){var n=r.extensions[t];if(n.id===e){var s=r.generateSubjectKeyIdentifier().getBytes();return wt.util.hexToBytes(n.subjectKeyIdentifier)===s}}return!1},r};$e.certificateFromAsn1=function(r,e){var t={},n=[];if(!k.validate(r,iW,t,n)){var s=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw s.errors=n,s}var i=k.derToOid(t.publicKeyOid);if(i!==$e.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var a=$e.createCertificate();a.version=t.certVersion?t.certVersion.charCodeAt(0):0;var u=wt.util.createBuffer(t.certSerialNumber);a.serialNumber=u.toHex(),a.signatureOid=wt.asn1.derToOid(t.certSignatureOid),a.signatureParameters=$w(a.signatureOid,t.certSignatureParams,!0),a.siginfo.algorithmOid=wt.asn1.derToOid(t.certinfoSignatureOid),a.siginfo.parameters=$w(a.siginfo.algorithmOid,t.certinfoSignatureParams,!1),a.signature=t.certSignature;var l=[];if(t.certValidity1UTCTime!==void 0&&l.push(k.utcTimeToDate(t.certValidity1UTCTime)),t.certValidity2GeneralizedTime!==void 0&&l.push(k.generalizedTimeToDate(t.certValidity2GeneralizedTime)),t.certValidity3UTCTime!==void 0&&l.push(k.utcTimeToDate(t.certValidity3UTCTime)),t.certValidity4GeneralizedTime!==void 0&&l.push(k.generalizedTimeToDate(t.certValidity4GeneralizedTime)),l.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(l.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(a.validity.notBefore=l[0],a.validity.notAfter=l[1],a.tbsCertificate=t.tbsCertificate,e){a.md=Xw({signatureOid:a.signatureOid,type:"certificate"});var f=k.toDer(a.tbsCertificate);a.md.update(f.getBytes())}var h=wt.md.sha1.create(),m=k.toDer(t.certIssuer);h.update(m.getBytes()),a.issuer.getField=function(y){return Au(a.issuer,y)},a.issuer.addField=function(y){pi([y]),a.issuer.attributes.push(y)},a.issuer.attributes=$e.RDNAttributesAsArray(t.certIssuer),t.certIssuerUniqueId&&(a.issuer.uniqueId=t.certIssuerUniqueId),a.issuer.hash=h.digest().toHex();var g=wt.md.sha1.create(),w=k.toDer(t.certSubject);return g.update(w.getBytes()),a.subject.getField=function(y){return Au(a.subject,y)},a.subject.addField=function(y){pi([y]),a.subject.attributes.push(y)},a.subject.attributes=$e.RDNAttributesAsArray(t.certSubject),t.certSubjectUniqueId&&(a.subject.uniqueId=t.certSubjectUniqueId),a.subject.hash=g.digest().toHex(),t.certExtensions?a.extensions=$e.certificateExtensionsFromAsn1(t.certExtensions):a.extensions=[],a.publicKey=$e.publicKeyFromAsn1(t.subjectPublicKeyInfo),a};$e.certificateExtensionsFromAsn1=function(r){for(var e=[],t=0;t<r.value.length;++t)for(var n=r.value[t],s=0;s<n.value.length;++s)e.push($e.certificateExtensionFromAsn1(n.value[s]));return e};$e.certificateExtensionFromAsn1=function(r){var e={};if(e.id=k.derToOid(r.value[0].value),e.critical=!1,r.value[1].type===k.Type.BOOLEAN?(e.critical=r.value[1].value.charCodeAt(0)!==0,e.value=r.value[2].value):e.value=r.value[1].value,e.id in ar){if(e.name=ar[e.id],e.name==="keyUsage"){var t=k.fromDer(e.value),n=0,s=0;t.value.length>1&&(n=t.value.charCodeAt(1),s=t.value.length>2?t.value.charCodeAt(2):0),e.digitalSignature=(n&128)===128,e.nonRepudiation=(n&64)===64,e.keyEncipherment=(n&32)===32,e.dataEncipherment=(n&16)===16,e.keyAgreement=(n&8)===8,e.keyCertSign=(n&4)===4,e.cRLSign=(n&2)===2,e.encipherOnly=(n&1)===1,e.decipherOnly=(s&128)===128}else if(e.name==="basicConstraints"){var t=k.fromDer(e.value);t.value.length>0&&t.value[0].type===k.Type.BOOLEAN?e.cA=t.value[0].value.charCodeAt(0)!==0:e.cA=!1;var i=null;t.value.length>0&&t.value[0].type===k.Type.INTEGER?i=t.value[0].value:t.value.length>1&&(i=t.value[1].value),i!==null&&(e.pathLenConstraint=k.derToInteger(i))}else if(e.name==="extKeyUsage")for(var t=k.fromDer(e.value),a=0;a<t.value.length;++a){var u=k.derToOid(t.value[a].value);u in ar?e[ar[u]]=!0:e[u]=!0}else if(e.name==="nsCertType"){var t=k.fromDer(e.value),n=0;t.value.length>1&&(n=t.value.charCodeAt(1)),e.client=(n&128)===128,e.server=(n&64)===64,e.email=(n&32)===32,e.objsign=(n&16)===16,e.reserved=(n&8)===8,e.sslCA=(n&4)===4,e.emailCA=(n&2)===2,e.objCA=(n&1)===1}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.altNames=[];for(var l,t=k.fromDer(e.value),f=0;f<t.value.length;++f){l=t.value[f];var h={type:l.type,value:l.value};switch(e.altNames.push(h),l.type){case 1:case 2:case 6:break;case 7:h.ip=wt.util.bytesToIP(l.value);break;case 8:h.oid=k.derToOid(l.value);break;default:}}}else if(e.name==="subjectKeyIdentifier"){var t=k.fromDer(e.value);e.subjectKeyIdentifier=wt.util.bytesToHex(t.value)}}return e};$e.certificationRequestFromAsn1=function(r,e){var t={},n=[];if(!k.validate(r,uW,t,n)){var s=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw s.errors=n,s}var i=k.derToOid(t.publicKeyOid);if(i!==$e.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var a=$e.createCertificationRequest();if(a.version=t.csrVersion?t.csrVersion.charCodeAt(0):0,a.signatureOid=wt.asn1.derToOid(t.csrSignatureOid),a.signatureParameters=$w(a.signatureOid,t.csrSignatureParams,!0),a.siginfo.algorithmOid=wt.asn1.derToOid(t.csrSignatureOid),a.siginfo.parameters=$w(a.siginfo.algorithmOid,t.csrSignatureParams,!1),a.signature=t.csrSignature,a.certificationRequestInfo=t.certificationRequestInfo,e){a.md=Xw({signatureOid:a.signatureOid,type:"certification request"});var u=k.toDer(a.certificationRequestInfo);a.md.update(u.getBytes())}var l=wt.md.sha1.create();return a.subject.getField=function(f){return Au(a.subject,f)},a.subject.addField=function(f){pi([f]),a.subject.attributes.push(f)},a.subject.attributes=$e.RDNAttributesAsArray(t.certificationRequestInfoSubject,l),a.subject.hash=l.digest().toHex(),a.publicKey=$e.publicKeyFromAsn1(t.subjectPublicKeyInfo),a.getAttribute=function(f){return Au(a,f)},a.addAttribute=function(f){pi([f]),a.attributes.push(f)},a.attributes=$e.CRIAttributesAsArray(t.certificationRequestInfoAttributes||[]),a};$e.createCertificationRequest=function(){var r={};return r.version=0,r.signatureOid=null,r.signature=null,r.siginfo={},r.siginfo.algorithmOid=null,r.subject={},r.subject.getField=function(e){return Au(r.subject,e)},r.subject.addField=function(e){pi([e]),r.subject.attributes.push(e)},r.subject.attributes=[],r.subject.hash=null,r.publicKey=null,r.attributes=[],r.getAttribute=function(e){return Au(r,e)},r.addAttribute=function(e){pi([e]),r.attributes.push(e)},r.md=null,r.setSubject=function(e){pi(e),r.subject.attributes=e,r.subject.hash=null},r.setAttributes=function(e){pi(e),r.attributes=e},r.sign=function(e,t){r.md=t||wt.md.sha1.create();var n=ar[r.md.algorithm+"WithRSAEncryption"];if(!n){var s=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw s.algorithm=r.md.algorithm,s}r.signatureOid=r.siginfo.algorithmOid=n,r.certificationRequestInfo=$e.getCertificationRequestInfo(r);var i=k.toDer(r.certificationRequestInfo);r.md.update(i.getBytes()),r.signature=e.sign(r.md)},r.verify=function(){var e=!1,t=r.md;if(t===null){t=Xw({signatureOid:r.signatureOid,type:"certification request"});var n=r.certificationRequestInfo||$e.getCertificationRequestInfo(r),s=k.toDer(n);t.update(s.getBytes())}return t!==null&&(e=QO({certificate:r,md:t,signature:r.signature})),e},r};function Jh(r){for(var e=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]),t,n,s=r.attributes,i=0;i<s.length;++i){t=s[i];var a=t.value,u=k.Type.PRINTABLESTRING;"valueTagClass"in t&&(u=t.valueTagClass,u===k.Type.UTF8&&(a=wt.util.encodeUtf8(a))),n=k.create(k.Class.UNIVERSAL,k.Type.SET,!0,[k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(t.type).getBytes()),k.create(k.Class.UNIVERSAL,u,!1,a)])]),e.value.push(n)}return e}o(Jh,"_dnToAsn1");function pi(r){for(var e,t=0;t<r.length;++t){if(e=r[t],typeof e.name>"u"&&(e.type&&e.type in $e.oids?e.name=$e.oids[e.type]:e.shortName&&e.shortName in Jr&&(e.name=$e.oids[Jr[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in $e.oids)e.type=$e.oids[e.name];else{var n=new Error("Attribute type not specified.");throw n.attribute=e,n}if(typeof e.shortName>"u"&&e.name&&e.name in Jr&&(e.shortName=Jr[e.name]),e.type===ar.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=k.Type.SEQUENCE,!e.value&&e.extensions)){e.value=[];for(var s=0;s<e.extensions.length;++s)e.value.push($e.certificateExtensionToAsn1(ZO(e.extensions[s])))}if(typeof e.value>"u"){var n=new Error("Attribute value not specified.");throw n.attribute=e,n}}}o(pi,"_fillMissingFields");function ZO(r,e){if(e=e||{},typeof r.name>"u"&&r.id&&r.id in $e.oids&&(r.name=$e.oids[r.id]),typeof r.id>"u")if(r.name&&r.name in $e.oids)r.id=$e.oids[r.name];else{var t=new Error("Extension ID not specified.");throw t.extension=r,t}if(typeof r.value<"u")return r;if(r.name==="keyUsage"){var n=0,s=0,i=0;r.digitalSignature&&(s|=128,n=7),r.nonRepudiation&&(s|=64,n=6),r.keyEncipherment&&(s|=32,n=5),r.dataEncipherment&&(s|=16,n=4),r.keyAgreement&&(s|=8,n=3),r.keyCertSign&&(s|=4,n=2),r.cRLSign&&(s|=2,n=1),r.encipherOnly&&(s|=1,n=0),r.decipherOnly&&(i|=128,n=7);var a=String.fromCharCode(n);i!==0?a+=String.fromCharCode(s)+String.fromCharCode(i):s!==0&&(a+=String.fromCharCode(s)),r.value=k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,a)}else if(r.name==="basicConstraints")r.value=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]),r.cA&&r.value.value.push(k.create(k.Class.UNIVERSAL,k.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in r&&r.value.value.push(k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,k.integerToDer(r.pathLenConstraint).getBytes()));else if(r.name==="extKeyUsage"){r.value=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);var u=r.value.value;for(var l in r)r[l]===!0&&(l in ar?u.push(k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(ar[l]).getBytes())):l.indexOf(".")!==-1&&u.push(k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(l).getBytes())))}else if(r.name==="nsCertType"){var n=0,s=0;r.client&&(s|=128,n=7),r.server&&(s|=64,n=6),r.email&&(s|=32,n=5),r.objsign&&(s|=16,n=4),r.reserved&&(s|=8,n=3),r.sslCA&&(s|=4,n=2),r.emailCA&&(s|=2,n=1),r.objCA&&(s|=1,n=0);var a=String.fromCharCode(n);s!==0&&(a+=String.fromCharCode(s)),r.value=k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,a)}else if(r.name==="subjectAltName"||r.name==="issuerAltName"){r.value=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);for(var f,h=0;h<r.altNames.length;++h){f=r.altNames[h];var a=f.value;if(f.type===7&&f.ip){if(a=wt.util.bytesFromIP(f.ip),a===null){var t=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw t.extension=r,t}}else f.type===8&&(f.oid?a=k.oidToDer(k.oidToDer(f.oid)):a=k.oidToDer(a));r.value.value.push(k.create(k.Class.CONTEXT_SPECIFIC,f.type,!1,a))}}else if(r.name==="nsComment"&&e.cert){if(!/^[\x00-\x7F]*$/.test(r.comment)||r.comment.length<1||r.comment.length>128)throw new Error('Invalid "nsComment" content.');r.value=k.create(k.Class.UNIVERSAL,k.Type.IA5STRING,!1,r.comment)}else if(r.name==="subjectKeyIdentifier"&&e.cert){var m=e.cert.generateSubjectKeyIdentifier();r.subjectKeyIdentifier=m.toHex(),r.value=k.create(k.Class.UNIVERSAL,k.Type.OCTETSTRING,!1,m.getBytes())}else if(r.name==="authorityKeyIdentifier"&&e.cert){r.value=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);var u=r.value.value;if(r.keyIdentifier){var g=r.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():r.keyIdentifier;u.push(k.create(k.Class.CONTEXT_SPECIFIC,0,!1,g))}if(r.authorityCertIssuer){var w=[k.create(k.Class.CONTEXT_SPECIFIC,4,!0,[Jh(r.authorityCertIssuer===!0?e.cert.issuer:r.authorityCertIssuer)])];u.push(k.create(k.Class.CONTEXT_SPECIFIC,1,!0,w))}if(r.serialNumber){var y=wt.util.hexToBytes(r.serialNumber===!0?e.cert.serialNumber:r.serialNumber);u.push(k.create(k.Class.CONTEXT_SPECIFIC,2,!1,y))}}else if(r.name==="cRLDistributionPoints"){r.value=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);for(var u=r.value.value,S=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]),E=k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[]),f,h=0;h<r.altNames.length;++h){f=r.altNames[h];var a=f.value;if(f.type===7&&f.ip){if(a=wt.util.bytesFromIP(f.ip),a===null){var t=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw t.extension=r,t}}else f.type===8&&(f.oid?a=k.oidToDer(k.oidToDer(f.oid)):a=k.oidToDer(a));E.value.push(k.create(k.Class.CONTEXT_SPECIFIC,f.type,!1,a))}S.value.push(k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[E])),u.push(S)}if(typeof r.value>"u"){var t=new Error("Extension value not specified.");throw t.extension=r,t}return r}o(ZO,"_fillMissingExtensionFields");function dx(r,e){switch(r){case ar["RSASSA-PSS"]:var t=[];return e.hash.algorithmOid!==void 0&&t.push(k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(e.hash.algorithmOid).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&t.push(k.create(k.Class.CONTEXT_SPECIFIC,1,!0,[k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(e.mgf.algorithmOid).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(e.mgf.hash.algorithmOid).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&t.push(k.create(k.Class.CONTEXT_SPECIFIC,2,!0,[k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,k.integerToDer(e.saltLength).getBytes())])),k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,t);default:return k.create(k.Class.UNIVERSAL,k.Type.NULL,!1,"")}}o(dx,"_signatureParametersToAsn1");function lW(r){var e=k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[]);if(r.attributes.length===0)return e;for(var t=r.attributes,n=0;n<t.length;++n){var s=t[n],i=s.value,a=k.Type.UTF8;"valueTagClass"in s&&(a=s.valueTagClass),a===k.Type.UTF8&&(i=wt.util.encodeUtf8(i));var u=!1;"valueConstructed"in s&&(u=s.valueConstructed);var l=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(s.type).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.SET,!0,[k.create(k.Class.UNIVERSAL,a,u,i)])]);e.value.push(l)}return e}o(lW,"_CRIAttributesToAsn1");var cW=new Date("1950-01-01T00:00:00Z"),fW=new Date("2050-01-01T00:00:00Z");function zO(r){return r>=cW&&r<fW?k.create(k.Class.UNIVERSAL,k.Type.UTCTIME,!1,k.dateToUtcTime(r)):k.create(k.Class.UNIVERSAL,k.Type.GENERALIZEDTIME,!1,k.dateToGeneralizedTime(r))}o(zO,"_dateToAsn1");$e.getTBSCertificate=function(r){var e=zO(r.validity.notBefore),t=zO(r.validity.notAfter),n=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,k.integerToDer(r.version).getBytes())]),k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,wt.util.hexToBytes(r.serialNumber)),k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(r.siginfo.algorithmOid).getBytes()),dx(r.siginfo.algorithmOid,r.siginfo.parameters)]),Jh(r.issuer),k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[e,t]),Jh(r.subject),$e.publicKeyToAsn1(r.publicKey)]);return r.issuer.uniqueId&&n.value.push(k.create(k.Class.CONTEXT_SPECIFIC,1,!0,[k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,"\0"+r.issuer.uniqueId)])),r.subject.uniqueId&&n.value.push(k.create(k.Class.CONTEXT_SPECIFIC,2,!0,[k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,"\0"+r.subject.uniqueId)])),r.extensions.length>0&&n.value.push($e.certificateExtensionsToAsn1(r.extensions)),n};$e.getCertificationRequestInfo=function(r){var e=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,k.integerToDer(r.version).getBytes()),Jh(r.subject),$e.publicKeyToAsn1(r.publicKey),lW(r)]);return e};$e.distinguishedNameToAsn1=function(r){return Jh(r)};$e.certificateToAsn1=function(r){var e=r.tbsCertificate||$e.getTBSCertificate(r);return k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[e,k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(r.signatureOid).getBytes()),dx(r.signatureOid,r.signatureParameters)]),k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,"\0"+r.signature)])};$e.certificateExtensionsToAsn1=function(r){var e=k.create(k.Class.CONTEXT_SPECIFIC,3,!0,[]),t=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);e.value.push(t);for(var n=0;n<r.length;++n)t.value.push($e.certificateExtensionToAsn1(r[n]));return e};$e.certificateExtensionToAsn1=function(r){var e=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);e.value.push(k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(r.id).getBytes())),r.critical&&e.value.push(k.create(k.Class.UNIVERSAL,k.Type.BOOLEAN,!1,"\xFF"));var t=r.value;return typeof r.value!="string"&&(t=k.toDer(t).getBytes()),e.value.push(k.create(k.Class.UNIVERSAL,k.Type.OCTETSTRING,!1,t)),e};$e.certificationRequestToAsn1=function(r){var e=r.certificationRequestInfo||$e.getCertificationRequestInfo(r);return k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[e,k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(r.signatureOid).getBytes()),dx(r.signatureOid,r.signatureParameters)]),k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,"\0"+r.signature)])};$e.createCaStore=function(r){var e={certs:{}};e.getIssuer=function(a){var u=t(a.issuer);return u},e.addCertificate=function(a){if(typeof a=="string"&&(a=wt.pki.certificateFromPem(a)),n(a.subject),!e.hasCertificate(a))if(a.subject.hash in e.certs){var u=e.certs[a.subject.hash];wt.util.isArray(u)||(u=[u]),u.push(a),e.certs[a.subject.hash]=u}else e.certs[a.subject.hash]=a},e.hasCertificate=function(a){typeof a=="string"&&(a=wt.pki.certificateFromPem(a));var u=t(a.subject);if(!u)return!1;wt.util.isArray(u)||(u=[u]);for(var l=k.toDer($e.certificateToAsn1(a)).getBytes(),f=0;f<u.length;++f){var h=k.toDer($e.certificateToAsn1(u[f])).getBytes();if(l===h)return!0}return!1},e.listAllCertificates=function(){var a=[];for(var u in e.certs)if(e.certs.hasOwnProperty(u)){var l=e.certs[u];if(!wt.util.isArray(l))a.push(l);else for(var f=0;f<l.length;++f)a.push(l[f])}return a},e.removeCertificate=function(a){var u;if(typeof a=="string"&&(a=wt.pki.certificateFromPem(a)),n(a.subject),!e.hasCertificate(a))return null;var l=t(a.subject);if(!wt.util.isArray(l))return u=e.certs[a.subject.hash],delete e.certs[a.subject.hash],u;for(var f=k.toDer($e.certificateToAsn1(a)).getBytes(),h=0;h<l.length;++h){var m=k.toDer($e.certificateToAsn1(l[h])).getBytes();f===m&&(u=l[h],l.splice(h,1))}return l.length===0&&delete e.certs[a.subject.hash],u};function t(a){return n(a),e.certs[a.hash]||null}o(t,"getBySubject");function n(a){if(!a.hash){var u=wt.md.sha1.create();a.attributes=$e.RDNAttributesAsArray(Jh(a),u),a.hash=u.digest().toHex()}}if(o(n,"ensureSubjectHasHash"),r)for(var s=0;s<r.length;++s){var i=r[s];e.addCertificate(i)}return e};$e.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"};$e.verifyCertificateChain=function(r,e,t){typeof t=="function"&&(t={verify:t}),t=t||{},e=e.slice(0);var n=e.slice(0),s=t.validityCheckDate;typeof s>"u"&&(s=new Date);var i=!0,a=null,u=0;do{var l=e.shift(),f=null,h=!1;if(s&&(s<l.validity.notBefore||s>l.validity.notAfter)&&(a={message:"Certificate is not valid yet or has expired.",error:$e.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:s}),a===null){if(f=e[0]||r.getIssuer(l),f===null&&l.isIssuer(l)&&(h=!0,f=l),f){var m=f;wt.util.isArray(m)||(m=[m]);for(var g=!1;!g&&m.length>0;){f=m.shift();try{g=f.verify(l)}catch{}}g||(a={message:"Certificate signature is invalid.",error:$e.certificateError.bad_certificate})}a===null&&(!f||h)&&!r.hasCertificate(l)&&(a={message:"Certificate is not trusted.",error:$e.certificateError.unknown_ca})}if(a===null&&f&&!l.isIssuer(f)&&(a={message:"Certificate issuer is invalid.",error:$e.certificateError.bad_certificate}),a===null)for(var w={keyUsage:!0,basicConstraints:!0},y=0;a===null&&y<l.extensions.length;++y){var S=l.extensions[y];S.critical&&!(S.name in w)&&(a={message:"Certificate has an unsupported critical extension.",error:$e.certificateError.unsupported_certificate})}if(a===null&&(!i||e.length===0&&(!f||h))){var E=l.getExtension("basicConstraints"),b=l.getExtension("keyUsage");if(b!==null&&(!b.keyCertSign||E===null)&&(a={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:$e.certificateError.bad_certificate}),a===null&&E!==null&&!E.cA&&(a={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:$e.certificateError.bad_certificate}),a===null&&b!==null&&"pathLenConstraint"in E){var T=u-1;T>E.pathLenConstraint&&(a={message:"Certificate basicConstraints pathLenConstraint violated.",error:$e.certificateError.bad_certificate})}}var A=a===null?!0:a.error,C=t.verify?t.verify(A,u,n):A;if(C===!0)a=null;else throw A===!0&&(a={message:"The application rejected the certificate.",error:$e.certificateError.bad_certificate}),(C||C===0)&&(typeof C=="object"&&!wt.util.isArray(C)?(C.message&&(a.message=C.message),C.error&&(a.error=C.error)):typeof C=="string"&&(a.error=C)),a;i=!1,++u}while(e.length>0);return!0}});var gx=ye((jce,r3)=>{"use strict";var Br=$t();Fi();qh();wu();hx();fx();ci();bm();Xh();ur();Gw();var Y=Br.asn1,Yt=Br.pki,Nm=r3.exports=Br.pkcs12=Br.pkcs12||{},t3={name:"ContentInfo",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Y.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},hW={name:"PFX",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Y.Class.UNIVERSAL,type:Y.Type.INTEGER,constructed:!1,capture:"version"},t3,{name:"PFX.macData",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:Y.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Y.Class.UNIVERSAL,type:Y.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},pW={name:"SafeBag",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Y.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},dW={name:"Attribute",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SET,constructed:!0,capture:"values"}]},mW={name:"CertBag",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Y.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Y.Class.UNIVERSAL,type:Y.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function xm(r,e,t,n){for(var s=[],i=0;i<r.length;i++)for(var a=0;a<r[i].safeBags.length;a++){var u=r[i].safeBags[a];if(!(n!==void 0&&u.type!==n)){if(e===null){s.push(u);continue}u.attributes[e]!==void 0&&u.attributes[e].indexOf(t)>=0&&s.push(u)}}return s}o(xm,"_getBagsByAttribute");Nm.pkcs12FromAsn1=function(r,e,t){typeof e=="string"?(t=e,e=!0):e===void 0&&(e=!0);var n={},s=[];if(!Y.validate(r,hW,n,s)){var i=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw i.errors=i,i}var a={version:n.version.charCodeAt(0),safeContents:[],getBags:o(function(E){var b={},T;return"localKeyId"in E?T=E.localKeyId:"localKeyIdHex"in E&&(T=Br.util.hexToBytes(E.localKeyIdHex)),T===void 0&&!("friendlyName"in E)&&"bagType"in E&&(b[E.bagType]=xm(a.safeContents,null,null,E.bagType)),T!==void 0&&(b.localKeyId=xm(a.safeContents,"localKeyId",T,E.bagType)),"friendlyName"in E&&(b.friendlyName=xm(a.safeContents,"friendlyName",E.friendlyName,E.bagType)),b},"getBags"),getBagsByFriendlyName:o(function(E,b){return xm(a.safeContents,"friendlyName",E,b)},"getBagsByFriendlyName"),getBagsByLocalKeyId:o(function(E,b){return xm(a.safeContents,"localKeyId",E,b)},"getBagsByLocalKeyId")};if(n.version.charCodeAt(0)!==3){var i=new Error("PKCS#12 PFX of version other than 3 not supported.");throw i.version=n.version.charCodeAt(0),i}if(Y.derToOid(n.contentType)!==Yt.oids.data){var i=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw i.oid=Y.derToOid(n.contentType),i}var u=n.content.value[0];if(u.tagClass!==Y.Class.UNIVERSAL||u.type!==Y.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(u=mx(u),n.mac){var l=null,f=0,h=Y.derToOid(n.macAlgorithm);switch(h){case Yt.oids.sha1:l=Br.md.sha1.create(),f=20;break;case Yt.oids.sha256:l=Br.md.sha256.create(),f=32;break;case Yt.oids.sha384:l=Br.md.sha384.create(),f=48;break;case Yt.oids.sha512:l=Br.md.sha512.create(),f=64;break;case Yt.oids.md5:l=Br.md.md5.create(),f=16;break}if(l===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+h);var m=new Br.util.ByteBuffer(n.macSalt),g="macIterations"in n?parseInt(Br.util.bytesToHex(n.macIterations),16):1,w=Nm.generateKey(t,m,3,g,f,l),y=Br.hmac.create();y.start(l,w),y.update(u.value);var S=y.getMac();if(S.getBytes()!==n.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return gW(a,u.value,e,t),a};function mx(r){if(r.composed||r.constructed){for(var e=Br.util.createBuffer(),t=0;t<r.value.length;++t)e.putBytes(r.value[t].value);r.composed=r.constructed=!1,r.value=e.getBytes()}return r}o(mx,"_decodePkcs7Data");function gW(r,e,t,n){if(e=Y.fromDer(e,t),e.tagClass!==Y.Class.UNIVERSAL||e.type!==Y.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var s=0;s<e.value.length;s++){var i=e.value[s],a={},u=[];if(!Y.validate(i,t3,a,u)){var l=new Error("Cannot read ContentInfo.");throw l.errors=u,l}var f={encrypted:!1},h=null,m=a.content.value[0];switch(Y.derToOid(a.contentType)){case Yt.oids.data:if(m.tagClass!==Y.Class.UNIVERSAL||m.type!==Y.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");h=mx(m).value;break;case Yt.oids.encryptedData:h=yW(m,n),f.encrypted=!0;break;default:var l=new Error("Unsupported PKCS#12 contentType.");throw l.contentType=Y.derToOid(a.contentType),l}f.safeBags=vW(h,t,n),r.safeContents.push(f)}}o(gW,"_decodeAuthenticatedSafe");function yW(r,e){var t={},n=[];if(!Y.validate(r,Br.pkcs7.asn1.encryptedDataValidator,t,n)){var s=new Error("Cannot read EncryptedContentInfo.");throw s.errors=n,s}var i=Y.derToOid(t.contentType);if(i!==Yt.oids.data){var s=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw s.oid=i,s}i=Y.derToOid(t.encAlgorithm);var a=Yt.pbe.getCipher(i,t.encParameter,e),u=mx(t.encryptedContentAsn1),l=Br.util.createBuffer(u.value);if(a.update(l),!a.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return a.output.getBytes()}o(yW,"_decryptSafeContents");function vW(r,e,t){if(!e&&r.length===0)return[];if(r=Y.fromDer(r,e),r.tagClass!==Y.Class.UNIVERSAL||r.type!==Y.Type.SEQUENCE||r.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var n=[],s=0;s<r.value.length;s++){var i=r.value[s],a={},u=[];if(!Y.validate(i,pW,a,u)){var l=new Error("Cannot read SafeBag.");throw l.errors=u,l}var f={type:Y.derToOid(a.bagId),attributes:wW(a.bagAttributes)};n.push(f);var h,m,g=a.bagValue.value[0];switch(f.type){case Yt.oids.pkcs8ShroudedKeyBag:if(g=Yt.decryptPrivateKeyInfo(g,t),g===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case Yt.oids.keyBag:try{f.key=Yt.privateKeyFromAsn1(g)}catch{f.key=null,f.asn1=g}continue;case Yt.oids.certBag:h=mW,m=o(function(){if(Y.derToOid(a.certId)!==Yt.oids.x509Certificate){var y=new Error("Unsupported certificate type, only X.509 supported.");throw y.oid=Y.derToOid(a.certId),y}var S=Y.fromDer(a.cert,e);try{f.cert=Yt.certificateFromAsn1(S,!0)}catch{f.cert=null,f.asn1=S}},"decoder");break;default:var l=new Error("Unsupported PKCS#12 SafeBag type.");throw l.oid=f.type,l}if(h!==void 0&&!Y.validate(g,h,a,u)){var l=new Error("Cannot read PKCS#12 "+h.name);throw l.errors=u,l}m()}return n}o(vW,"_decodeSafeContents");function wW(r){var e={};if(r!==void 0)for(var t=0;t<r.length;++t){var n={},s=[];if(!Y.validate(r[t],dW,n,s)){var i=new Error("Cannot read PKCS#12 BagAttribute.");throw i.errors=s,i}var a=Y.derToOid(n.oid);if(Yt.oids[a]!==void 0){e[Yt.oids[a]]=[];for(var u=0;u<n.values.length;++u)e[Yt.oids[a]].push(n.values[u].value)}}return e}o(wW,"_decodeBagAttributes");Nm.toPkcs12Asn1=function(r,e,t,n){n=n||{},n.saltSize=n.saltSize||8,n.count=n.count||2048,n.algorithm=n.algorithm||n.encAlgorithm||"aes128","useMac"in n||(n.useMac=!0),"localKeyId"in n||(n.localKeyId=null),"generateLocalKeyId"in n||(n.generateLocalKeyId=!0);var s=n.localKeyId,i;if(s!==null)s=Br.util.hexToBytes(s);else if(n.generateLocalKeyId)if(e){var a=Br.util.isArray(e)?e[0]:e;typeof a=="string"&&(a=Yt.certificateFromPem(a));var u=Br.md.sha1.create();u.update(Y.toDer(Yt.certificateToAsn1(a)).getBytes()),s=u.digest().getBytes()}else s=Br.random.getBytes(20);var l=[];s!==null&&l.push(Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.localKeyId).getBytes()),Y.create(Y.Class.UNIVERSAL,Y.Type.SET,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,s)])])),"friendlyName"in n&&l.push(Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.friendlyName).getBytes()),Y.create(Y.Class.UNIVERSAL,Y.Type.SET,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.BMPSTRING,!1,n.friendlyName)])])),l.length>0&&(i=Y.create(Y.Class.UNIVERSAL,Y.Type.SET,!0,l));var f=[],h=[];e!==null&&(Br.util.isArray(e)?h=e:h=[e]);for(var m=[],g=0;g<h.length;++g){e=h[g],typeof e=="string"&&(e=Yt.certificateFromPem(e));var w=g===0?i:void 0,y=Yt.certificateToAsn1(e),S=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.certBag).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.x509Certificate).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,Y.toDer(y).getBytes())])])]),w]);m.push(S)}if(m.length>0){var E=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,m),b=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.data).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,Y.toDer(E).getBytes())])]);f.push(b)}var T=null;if(r!==null){var A=Yt.wrapRsaPrivateKey(Yt.privateKeyToAsn1(r));t===null?T=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.keyBag).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[A]),i]):T=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.pkcs8ShroudedKeyBag).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Yt.encryptPrivateKeyInfo(A,t,n)]),i]);var C=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[T]),x=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.data).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,Y.toDer(C).getBytes())])]);f.push(x)}var B=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,f),F;if(n.useMac){var u=Br.md.sha1.create(),R=new Br.util.ByteBuffer(Br.random.getBytes(n.saltSize)),H=n.count,r=Nm.generateKey(t,R,3,H,20),q=Br.hmac.create();q.start(u,r),q.update(Y.toDer(B).getBytes());var K=q.getMac();F=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.sha1).getBytes()),Y.create(Y.Class.UNIVERSAL,Y.Type.NULL,!1,"")]),Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,K.getBytes())]),Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,R.getBytes()),Y.create(Y.Class.UNIVERSAL,Y.Type.INTEGER,!1,Y.integerToDer(H).getBytes())])}return Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.INTEGER,!1,Y.integerToDer(3).getBytes()),Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.data).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,Y.toDer(B).getBytes())])]),F])};Nm.generateKey=Br.pbe.generatePkcs12Key});var vx=ye((qce,n3)=>{"use strict";var Cu=$t();Fi();wu();fx();hc();Vw();gx();Kw();bm();ur();Gw();var yx=Cu.asn1,zh=n3.exports=Cu.pki=Cu.pki||{};zh.pemToDer=function(r){var e=Cu.pem.decode(r)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Cu.util.createBuffer(e.body)};zh.privateKeyFromPem=function(r){var e=Cu.pem.decode(r)[0];if(e.type!=="PRIVATE KEY"&&e.type!=="RSA PRIVATE KEY"){var t=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw t.headerType=e.type,t}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var n=yx.fromDer(e.body);return zh.privateKeyFromAsn1(n)};zh.privateKeyToPem=function(r,e){var t={type:"RSA PRIVATE KEY",body:yx.toDer(zh.privateKeyToAsn1(r)).getBytes()};return Cu.pem.encode(t,{maxline:e})};zh.privateKeyInfoToPem=function(r,e){var t={type:"PRIVATE KEY",body:yx.toDer(r).getBytes()};return Cu.pem.encode(t,{maxline:e})}});var bx=ye((Hce,f3)=>{"use strict";var ke=$t();Fi();qh();Pw();hc();vx();ci();Xh();ur();var Yw=o(function(r,e,t,n){var s=ke.util.createBuffer(),i=r.length>>1,a=i+(r.length&1),u=r.substr(0,a),l=r.substr(i,a),f=ke.util.createBuffer(),h=ke.hmac.create();t=e+t;var m=Math.ceil(n/16),g=Math.ceil(n/20);h.start("MD5",u);var w=ke.util.createBuffer();f.putBytes(t);for(var y=0;y<m;++y)h.start(null,null),h.update(f.getBytes()),f.putBuffer(h.digest()),h.start(null,null),h.update(f.bytes()+t),w.putBuffer(h.digest());h.start("SHA1",l);var S=ke.util.createBuffer();f.clear(),f.putBytes(t);for(var y=0;y<g;++y)h.start(null,null),h.update(f.getBytes()),f.putBuffer(h.digest()),h.start(null,null),h.update(f.bytes()+t),S.putBuffer(h.digest());return s.putBytes(ke.util.xorBytes(w.getBytes(),S.getBytes(),n)),s},"prf_TLS1"),SW=o(function(r,e,t){var n=ke.hmac.create();n.start("SHA1",r);var s=ke.util.createBuffer();return s.putInt32(e[0]),s.putInt32(e[1]),s.putByte(t.type),s.putByte(t.version.major),s.putByte(t.version.minor),s.putInt16(t.length),s.putBytes(t.fragment.bytes()),n.update(s.getBytes()),n.digest().getBytes()},"hmac_sha1"),EW=o(function(r,e,t){var n=!1;try{var s=r.deflate(e.fragment.getBytes());e.fragment=ke.util.createBuffer(s),e.length=s.length,n=!0}catch{}return n},"deflate"),AW=o(function(r,e,t){var n=!1;try{var s=r.inflate(e.fragment.getBytes());e.fragment=ke.util.createBuffer(s),e.length=s.length,n=!0}catch{}return n},"inflate"),$s=o(function(r,e){var t=0;switch(e){case 1:t=r.getByte();break;case 2:t=r.getInt16();break;case 3:t=r.getInt24();break;case 4:t=r.getInt32();break}return ke.util.createBuffer(r.getBytes(t))},"readVector"),di=o(function(r,e,t){r.putInt(t.length(),e<<3),r.putBuffer(t)},"writeVector"),U={};U.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};U.SupportedVersions=[U.Versions.TLS_1_1,U.Versions.TLS_1_0];U.Version=U.SupportedVersions[0];U.MaxFragment=15360;U.ConnectionEnd={server:0,client:1};U.PRFAlgorithm={tls_prf_sha256:0};U.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};U.CipherType={stream:0,block:1,aead:2};U.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};U.CompressionMethod={none:0,deflate:1};U.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};U.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};U.Alert={};U.Alert.Level={warning:1,fatal:2};U.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};U.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};U.CipherSuites={};U.getCipherSuite=function(r){var e=null;for(var t in U.CipherSuites){var n=U.CipherSuites[t];if(n.id[0]===r.charCodeAt(0)&&n.id[1]===r.charCodeAt(1)){e=n;break}}return e};U.handleUnexpected=function(r,e){var t=!r.open&&r.entity===U.ConnectionEnd.client;t||r.error(r,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.unexpected_message}})};U.handleHelloRequest=function(r,e,t){!r.handshaking&&r.handshakes>0&&(U.queue(r,U.createAlert(r,{level:U.Alert.Level.warning,description:U.Alert.Description.no_renegotiation})),U.flush(r)),r.process()};U.parseHelloMessage=function(r,e,t){var n=null,s=r.entity===U.ConnectionEnd.client;if(t<38)r.error(r,{message:s?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}});else{var i=e.fragment,a=i.length();if(n={version:{major:i.getByte(),minor:i.getByte()},random:ke.util.createBuffer(i.getBytes(32)),session_id:$s(i,1),extensions:[]},s?(n.cipher_suite=i.getBytes(2),n.compression_method=i.getByte()):(n.cipher_suites=$s(i,2),n.compression_methods=$s(i,1)),a=t-(a-i.length()),a>0){for(var u=$s(i,2);u.length()>0;)n.extensions.push({type:[u.getByte(),u.getByte()],data:$s(u,2)});if(!s)for(var l=0;l<n.extensions.length;++l){var f=n.extensions[l];if(f.type[0]===0&&f.type[1]===0)for(var h=$s(f.data,2);h.length()>0;){var m=h.getByte();if(m!==0)break;r.session.extensions.server_name.serverNameList.push($s(h,2).getBytes())}}}if(r.session.version&&(n.version.major!==r.session.version.major||n.version.minor!==r.session.version.minor))return r.error(r,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.protocol_version}});if(s)r.session.cipherSuite=U.getCipherSuite(n.cipher_suite);else for(var g=ke.util.createBuffer(n.cipher_suites.bytes());g.length()>0&&(r.session.cipherSuite=U.getCipherSuite(g.getBytes(2)),r.session.cipherSuite===null););if(r.session.cipherSuite===null)return r.error(r,{message:"No cipher suites in common.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.handshake_failure},cipherSuite:ke.util.bytesToHex(n.cipher_suite)});s?r.session.compressionMethod=n.compression_method:r.session.compressionMethod=U.CompressionMethod.none}return n};U.createSecurityParameters=function(r,e){var t=r.entity===U.ConnectionEnd.client,n=e.random.bytes(),s=t?r.session.sp.client_random:n,i=t?n:U.createRandom().getBytes();r.session.sp={entity:r.entity,prf_algorithm:U.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:r.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:s,server_random:i}};U.handleServerHello=function(r,e,t){var n=U.parseHelloMessage(r,e,t);if(!r.fail){if(n.version.minor<=r.version.minor)r.version.minor=n.version.minor;else return r.error(r,{message:"Incompatible TLS version.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.protocol_version}});r.session.version=r.version;var s=n.session_id.bytes();s.length>0&&s===r.session.id?(r.expect=a3,r.session.resuming=!0,r.session.sp.server_random=n.random.bytes()):(r.expect=bW,r.session.resuming=!1,U.createSecurityParameters(r,n)),r.session.id=s,r.process()}};U.handleClientHello=function(r,e,t){var n=U.parseHelloMessage(r,e,t);if(!r.fail){var s=n.session_id.bytes(),i=null;if(r.sessionCache&&(i=r.sessionCache.getSession(s),i===null?s="":(i.version.major!==n.version.major||i.version.minor>n.version.minor)&&(i=null,s="")),s.length===0&&(s=ke.random.getBytes(32)),r.session.id=s,r.session.clientHelloVersion=n.version,r.session.sp={},i)r.version=r.session.version=i.version,r.session.sp=i.sp;else{for(var a,u=1;u<U.SupportedVersions.length&&(a=U.SupportedVersions[u],!(a.minor<=n.version.minor));++u);r.version={major:a.major,minor:a.minor},r.session.version=r.version}i!==null?(r.expect=Ax,r.session.resuming=!0,r.session.sp.client_random=n.random.bytes()):(r.expect=r.verifyClient!==!1?_W:Ex,r.session.resuming=!1,U.createSecurityParameters(r,n)),r.open=!0,U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createServerHello(r)})),r.session.resuming?(U.queue(r,U.createRecord(r,{type:U.ContentType.change_cipher_spec,data:U.createChangeCipherSpec()})),r.state.pending=U.createConnectionState(r),r.state.current.write=r.state.pending.write,U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createFinished(r)}))):(U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createCertificate(r)})),r.fail||(U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createServerKeyExchange(r)})),r.verifyClient!==!1&&U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createCertificateRequest(r)})),U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createServerHelloDone(r)})))),U.flush(r),r.process()}};U.handleCertificate=function(r,e,t){if(t<3)return r.error(r,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}});var n=e.fragment,s={certificate_list:$s(n,3)},i,a,u=[];try{for(;s.certificate_list.length()>0;)i=$s(s.certificate_list,3),a=ke.asn1.fromDer(i),i=ke.pki.certificateFromAsn1(a,!0),u.push(i)}catch(f){return r.error(r,{message:"Could not parse certificate list.",cause:f,send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.bad_certificate}})}var l=r.entity===U.ConnectionEnd.client;(l||r.verifyClient===!0)&&u.length===0?r.error(r,{message:l?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}}):u.length===0?r.expect=l?s3:Ex:(l?r.session.serverCertificate=u[0]:r.session.clientCertificate=u[0],U.verifyCertificateChain(r,u)&&(r.expect=l?s3:Ex)),r.process()};U.handleServerKeyExchange=function(r,e,t){if(t>0)return r.error(r,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.unsupported_certificate}});r.expect=xW,r.process()};U.handleClientKeyExchange=function(r,e,t){if(t<48)return r.error(r,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.unsupported_certificate}});var n=e.fragment,s={enc_pre_master_secret:$s(n,2).getBytes()},i=null;if(r.getPrivateKey)try{i=r.getPrivateKey(r,r.session.serverCertificate),i=ke.pki.privateKeyFromPem(i)}catch(l){r.error(r,{message:"Could not get private key.",cause:l,send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}})}if(i===null)return r.error(r,{message:"No private key set.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}});try{var a=r.session.sp;a.pre_master_secret=i.decrypt(s.enc_pre_master_secret);var u=r.session.clientHelloVersion;if(u.major!==a.pre_master_secret.charCodeAt(0)||u.minor!==a.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{a.pre_master_secret=ke.random.getBytes(48)}r.expect=Ax,r.session.clientCertificate!==null&&(r.expect=RW),r.process()};U.handleCertificateRequest=function(r,e,t){if(t<3)return r.error(r,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}});var n=e.fragment,s={certificate_types:$s(n,1),certificate_authorities:$s(n,2)};r.session.certificateRequest=s,r.expect=NW,r.process()};U.handleCertificateVerify=function(r,e,t){if(t<2)return r.error(r,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var s=n.bytes();n.read+=4;var i={signature:$s(n,2).getBytes()},a=ke.util.createBuffer();a.putBuffer(r.session.md5.digest()),a.putBuffer(r.session.sha1.digest()),a=a.getBytes();try{var u=r.session.clientCertificate;if(!u.publicKey.verify(a,i.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");r.session.md5.update(s),r.session.sha1.update(s)}catch{return r.error(r,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.handshake_failure}})}r.expect=Ax,r.process()};U.handleServerHelloDone=function(r,e,t){if(t>0)return r.error(r,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.record_overflow}});if(r.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.insufficient_security}},s=0,i=r.verify(r,n.alert.description,s,[]);if(i!==!0)return(i||i===0)&&(typeof i=="object"&&!ke.util.isArray(i)?(i.message&&(n.message=i.message),i.alert&&(n.alert.description=i.alert)):typeof i=="number"&&(n.alert.description=i)),r.error(r,n)}r.session.certificateRequest!==null&&(e=U.createRecord(r,{type:U.ContentType.handshake,data:U.createCertificate(r)}),U.queue(r,e)),e=U.createRecord(r,{type:U.ContentType.handshake,data:U.createClientKeyExchange(r)}),U.queue(r,e),r.expect=BW;var a=o(function(u,l){u.session.certificateRequest!==null&&u.session.clientCertificate!==null&&U.queue(u,U.createRecord(u,{type:U.ContentType.handshake,data:U.createCertificateVerify(u,l)})),U.queue(u,U.createRecord(u,{type:U.ContentType.change_cipher_spec,data:U.createChangeCipherSpec()})),u.state.pending=U.createConnectionState(u),u.state.current.write=u.state.pending.write,U.queue(u,U.createRecord(u,{type:U.ContentType.handshake,data:U.createFinished(u)})),u.expect=a3,U.flush(u),u.process()},"callback");if(r.session.certificateRequest===null||r.session.clientCertificate===null)return a(r,null);U.getClientSignature(r,a)};U.handleChangeCipherSpec=function(r,e){if(e.fragment.getByte()!==1)return r.error(r,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}});var t=r.entity===U.ConnectionEnd.client;(r.session.resuming&&t||!r.session.resuming&&!t)&&(r.state.pending=U.createConnectionState(r)),r.state.current.read=r.state.pending.read,(!r.session.resuming&&t||r.session.resuming&&!t)&&(r.state.pending=null),r.expect=t?TW:PW,r.process()};U.handleFinished=function(r,e,t){var n=e.fragment;n.read-=4;var s=n.bytes();n.read+=4;var i=e.fragment.getBytes();n=ke.util.createBuffer(),n.putBuffer(r.session.md5.digest()),n.putBuffer(r.session.sha1.digest());var a=r.entity===U.ConnectionEnd.client,u=a?"server finished":"client finished",l=r.session.sp,f=12,h=Yw;if(n=h(l.master_secret,u,n.getBytes(),f),n.getBytes()!==i)return r.error(r,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.decrypt_error}});r.session.md5.update(s),r.session.sha1.update(s),(r.session.resuming&&a||!r.session.resuming&&!a)&&(U.queue(r,U.createRecord(r,{type:U.ContentType.change_cipher_spec,data:U.createChangeCipherSpec()})),r.state.current.write=r.state.pending.write,r.state.pending=null,U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createFinished(r)}))),r.expect=a?IW:OW,r.handshaking=!1,++r.handshakes,r.peerCertificate=a?r.session.serverCertificate:r.session.clientCertificate,U.flush(r),r.isConnected=!0,r.connected(r),r.process()};U.handleAlert=function(r,e){var t=e.fragment,n={level:t.getByte(),description:t.getByte()},s;switch(n.description){case U.Alert.Description.close_notify:s="Connection closed.";break;case U.Alert.Description.unexpected_message:s="Unexpected message.";break;case U.Alert.Description.bad_record_mac:s="Bad record MAC.";break;case U.Alert.Description.decryption_failed:s="Decryption failed.";break;case U.Alert.Description.record_overflow:s="Record overflow.";break;case U.Alert.Description.decompression_failure:s="Decompression failed.";break;case U.Alert.Description.handshake_failure:s="Handshake failure.";break;case U.Alert.Description.bad_certificate:s="Bad certificate.";break;case U.Alert.Description.unsupported_certificate:s="Unsupported certificate.";break;case U.Alert.Description.certificate_revoked:s="Certificate revoked.";break;case U.Alert.Description.certificate_expired:s="Certificate expired.";break;case U.Alert.Description.certificate_unknown:s="Certificate unknown.";break;case U.Alert.Description.illegal_parameter:s="Illegal parameter.";break;case U.Alert.Description.unknown_ca:s="Unknown certificate authority.";break;case U.Alert.Description.access_denied:s="Access denied.";break;case U.Alert.Description.decode_error:s="Decode error.";break;case U.Alert.Description.decrypt_error:s="Decrypt error.";break;case U.Alert.Description.export_restriction:s="Export restriction.";break;case U.Alert.Description.protocol_version:s="Unsupported protocol version.";break;case U.Alert.Description.insufficient_security:s="Insufficient security.";break;case U.Alert.Description.internal_error:s="Internal error.";break;case U.Alert.Description.user_canceled:s="User canceled.";break;case U.Alert.Description.no_renegotiation:s="Renegotiation not supported.";break;default:s="Unknown error.";break}if(n.description===U.Alert.Description.close_notify)return r.close();r.error(r,{message:s,send:!1,origin:r.entity===U.ConnectionEnd.client?"server":"client",alert:n}),r.process()};U.handleHandshake=function(r,e){var t=e.fragment,n=t.getByte(),s=t.getInt24();if(s>t.length())return r.fragmented=e,e.fragment=ke.util.createBuffer(),t.read-=4,r.process();r.fragmented=null,t.read-=4;var i=t.bytes(s+4);t.read+=4,n in zw[r.entity][r.expect]?(r.entity===U.ConnectionEnd.server&&!r.open&&!r.fail&&(r.handshaking=!0,r.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:ke.md.md5.create(),sha1:ke.md.sha1.create()}),n!==U.HandshakeType.hello_request&&n!==U.HandshakeType.certificate_verify&&n!==U.HandshakeType.finished&&(r.session.md5.update(i),r.session.sha1.update(i)),zw[r.entity][r.expect][n](r,e,s)):U.handleUnexpected(r,e)};U.handleApplicationData=function(r,e){r.data.putBuffer(e.fragment),r.dataReady(r),r.process()};U.handleHeartbeat=function(r,e){var t=e.fragment,n=t.getByte(),s=t.getInt16(),i=t.getBytes(s);if(n===U.HeartbeatMessageType.heartbeat_request){if(r.handshaking||s>i.length)return r.process();U.queue(r,U.createRecord(r,{type:U.ContentType.heartbeat,data:U.createHeartbeat(U.HeartbeatMessageType.heartbeat_response,i)})),U.flush(r)}else if(n===U.HeartbeatMessageType.heartbeat_response){if(i!==r.expectedHeartbeatPayload)return r.process();r.heartbeatReceived&&r.heartbeatReceived(r,ke.util.createBuffer(i))}r.process()};var CW=0,bW=1,s3=2,xW=3,NW=4,a3=5,TW=6,IW=7,BW=8,DW=0,_W=1,Ex=2,RW=3,Ax=4,PW=5,OW=6,V=U.handleUnexpected,o3=U.handleChangeCipherSpec,On=U.handleAlert,cs=U.handleHandshake,u3=U.handleApplicationData,kn=U.handleHeartbeat,Cx=[];Cx[U.ConnectionEnd.client]=[[V,On,cs,V,kn],[V,On,cs,V,kn],[V,On,cs,V,kn],[V,On,cs,V,kn],[V,On,cs,V,kn],[o3,On,V,V,kn],[V,On,cs,V,kn],[V,On,cs,u3,kn],[V,On,cs,V,kn]];Cx[U.ConnectionEnd.server]=[[V,On,cs,V,kn],[V,On,cs,V,kn],[V,On,cs,V,kn],[V,On,cs,V,kn],[o3,On,V,V,kn],[V,On,cs,V,kn],[V,On,cs,u3,kn],[V,On,cs,V,kn]];var bu=U.handleHelloRequest,kW=U.handleServerHello,l3=U.handleCertificate,i3=U.handleServerKeyExchange,wx=U.handleCertificateRequest,Ww=U.handleServerHelloDone,c3=U.handleFinished,zw=[];zw[U.ConnectionEnd.client]=[[V,V,kW,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V],[bu,V,V,V,V,V,V,V,V,V,V,l3,i3,wx,Ww,V,V,V,V,V,V],[bu,V,V,V,V,V,V,V,V,V,V,V,i3,wx,Ww,V,V,V,V,V,V],[bu,V,V,V,V,V,V,V,V,V,V,V,V,wx,Ww,V,V,V,V,V,V],[bu,V,V,V,V,V,V,V,V,V,V,V,V,V,Ww,V,V,V,V,V,V],[bu,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V],[bu,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,c3],[bu,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V],[bu,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V]];var LW=U.handleClientHello,VW=U.handleClientKeyExchange,UW=U.handleCertificateVerify;zw[U.ConnectionEnd.server]=[[V,LW,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,l3,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,VW,V,V,V,V],[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,UW,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,c3],[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]];U.generateKeys=function(r,e){var t=Yw,n=e.client_random+e.server_random;r.session.resuming||(e.master_secret=t(e.pre_master_secret,"master secret",n,48).bytes(),e.pre_master_secret=null),n=e.server_random+e.client_random;var s=2*e.mac_key_length+2*e.enc_key_length,i=r.version.major===U.Versions.TLS_1_0.major&&r.version.minor===U.Versions.TLS_1_0.minor;i&&(s+=2*e.fixed_iv_length);var a=t(e.master_secret,"key expansion",n,s),u={client_write_MAC_key:a.getBytes(e.mac_key_length),server_write_MAC_key:a.getBytes(e.mac_key_length),client_write_key:a.getBytes(e.enc_key_length),server_write_key:a.getBytes(e.enc_key_length)};return i&&(u.client_write_IV=a.getBytes(e.fixed_iv_length),u.server_write_IV=a.getBytes(e.fixed_iv_length)),u};U.createConnectionState=function(r){var e=r.entity===U.ConnectionEnd.client,t=o(function(){var i={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:o(function(a){return!0},"cipherFunction"),compressionState:null,compressFunction:o(function(a){return!0},"compressFunction"),updateSequenceNumber:o(function(){i.sequenceNumber[1]===4294967295?(i.sequenceNumber[1]=0,++i.sequenceNumber[0]):++i.sequenceNumber[1]},"updateSequenceNumber")};return i},"createMode"),n={read:t(),write:t()};if(n.read.update=function(i,a){return n.read.cipherFunction(a,n.read)?n.read.compressFunction(i,a,n.read)||i.error(i,{message:"Could not decompress record.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.decompression_failure}}):i.error(i,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.bad_record_mac}}),!i.fail},n.write.update=function(i,a){return n.write.compressFunction(i,a,n.write)?n.write.cipherFunction(a,n.write)||i.error(i,{message:"Could not encrypt record.",send:!1,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}}):i.error(i,{message:"Could not compress record.",send:!1,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}}),!i.fail},r.session){var s=r.session.sp;switch(r.session.cipherSuite.initSecurityParameters(s),s.keys=U.generateKeys(r,s),n.read.macKey=e?s.keys.server_write_MAC_key:s.keys.client_write_MAC_key,n.write.macKey=e?s.keys.client_write_MAC_key:s.keys.server_write_MAC_key,r.session.cipherSuite.initConnectionState(n,r,s),s.compression_algorithm){case U.CompressionMethod.none:break;case U.CompressionMethod.deflate:n.read.compressFunction=AW,n.write.compressFunction=EW;break;default:throw new Error("Unsupported compression algorithm.")}}return n};U.createRandom=function(){var r=new Date,e=+r+r.getTimezoneOffset()*6e4,t=ke.util.createBuffer();return t.putInt32(e),t.putBytes(ke.random.getBytes(28)),t};U.createRecord=function(r,e){if(!e.data)return null;var t={type:e.type,version:{major:r.version.major,minor:r.version.minor},length:e.data.length(),fragment:e.data};return t};U.createAlert=function(r,e){var t=ke.util.createBuffer();return t.putByte(e.level),t.putByte(e.description),U.createRecord(r,{type:U.ContentType.alert,data:t})};U.createClientHello=function(r){r.session.clientHelloVersion={major:r.version.major,minor:r.version.minor};for(var e=ke.util.createBuffer(),t=0;t<r.cipherSuites.length;++t){var n=r.cipherSuites[t];e.putByte(n.id[0]),e.putByte(n.id[1])}var s=e.length(),i=ke.util.createBuffer();i.putByte(U.CompressionMethod.none);var a=i.length(),u=ke.util.createBuffer();if(r.virtualHost){var l=ke.util.createBuffer();l.putByte(0),l.putByte(0);var f=ke.util.createBuffer();f.putByte(0),di(f,2,ke.util.createBuffer(r.virtualHost));var h=ke.util.createBuffer();di(h,2,f),di(l,2,h),u.putBuffer(l)}var m=u.length();m>0&&(m+=2);var g=r.session.id,w=g.length+1+2+4+28+2+s+1+a+m,y=ke.util.createBuffer();return y.putByte(U.HandshakeType.client_hello),y.putInt24(w),y.putByte(r.version.major),y.putByte(r.version.minor),y.putBytes(r.session.sp.client_random),di(y,1,ke.util.createBuffer(g)),di(y,2,e),di(y,1,i),m>0&&di(y,2,u),y};U.createServerHello=function(r){var e=r.session.id,t=e.length+1+2+4+28+2+1,n=ke.util.createBuffer();return n.putByte(U.HandshakeType.server_hello),n.putInt24(t),n.putByte(r.version.major),n.putByte(r.version.minor),n.putBytes(r.session.sp.server_random),di(n,1,ke.util.createBuffer(e)),n.putByte(r.session.cipherSuite.id[0]),n.putByte(r.session.cipherSuite.id[1]),n.putByte(r.session.compressionMethod),n};U.createCertificate=function(r){var e=r.entity===U.ConnectionEnd.client,t=null;if(r.getCertificate){var n;e?n=r.session.certificateRequest:n=r.session.extensions.server_name.serverNameList,t=r.getCertificate(r,n)}var s=ke.util.createBuffer();if(t!==null)try{ke.util.isArray(t)||(t=[t]);for(var i=null,a=0;a<t.length;++a){var u=ke.pem.decode(t[a])[0];if(u.type!=="CERTIFICATE"&&u.type!=="X509 CERTIFICATE"&&u.type!=="TRUSTED CERTIFICATE"){var l=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw l.headerType=u.type,l}if(u.procType&&u.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var f=ke.util.createBuffer(u.body);i===null&&(i=ke.asn1.fromDer(f.bytes(),!1));var h=ke.util.createBuffer();di(h,3,f),s.putBuffer(h)}t=ke.pki.certificateFromAsn1(i),e?r.session.clientCertificate=t:r.session.serverCertificate=t}catch(w){return r.error(r,{message:"Could not send certificate list.",cause:w,send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.bad_certificate}})}var m=3+s.length(),g=ke.util.createBuffer();return g.putByte(U.HandshakeType.certificate),g.putInt24(m),di(g,3,s),g};U.createClientKeyExchange=function(r){var e=ke.util.createBuffer();e.putByte(r.session.clientHelloVersion.major),e.putByte(r.session.clientHelloVersion.minor),e.putBytes(ke.random.getBytes(46));var t=r.session.sp;t.pre_master_secret=e.getBytes();var n=r.session.serverCertificate.publicKey;e=n.encrypt(t.pre_master_secret);var s=e.length+2,i=ke.util.createBuffer();return i.putByte(U.HandshakeType.client_key_exchange),i.putInt24(s),i.putInt16(e.length),i.putBytes(e),i};U.createServerKeyExchange=function(r){var e=0,t=ke.util.createBuffer();return e>0&&(t.putByte(U.HandshakeType.server_key_exchange),t.putInt24(e)),t};U.getClientSignature=function(r,e){var t=ke.util.createBuffer();t.putBuffer(r.session.md5.digest()),t.putBuffer(r.session.sha1.digest()),t=t.getBytes(),r.getSignature=r.getSignature||function(n,s,i){var a=null;if(n.getPrivateKey)try{a=n.getPrivateKey(n,n.session.clientCertificate),a=ke.pki.privateKeyFromPem(a)}catch(u){n.error(n,{message:"Could not get private key.",cause:u,send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}})}a===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}}):s=a.sign(s,null),i(n,s)},r.getSignature(r,t,e)};U.createCertificateVerify=function(r,e){var t=e.length+2,n=ke.util.createBuffer();return n.putByte(U.HandshakeType.certificate_verify),n.putInt24(t),n.putInt16(e.length),n.putBytes(e),n};U.createCertificateRequest=function(r){var e=ke.util.createBuffer();e.putByte(1);var t=ke.util.createBuffer();for(var n in r.caStore.certs){var s=r.caStore.certs[n],i=ke.pki.distinguishedNameToAsn1(s.subject),a=ke.asn1.toDer(i);t.putInt16(a.length()),t.putBuffer(a)}var u=1+e.length()+2+t.length(),l=ke.util.createBuffer();return l.putByte(U.HandshakeType.certificate_request),l.putInt24(u),di(l,1,e),di(l,2,t),l};U.createServerHelloDone=function(r){var e=ke.util.createBuffer();return e.putByte(U.HandshakeType.server_hello_done),e.putInt24(0),e};U.createChangeCipherSpec=function(){var r=ke.util.createBuffer();return r.putByte(1),r};U.createFinished=function(r){var e=ke.util.createBuffer();e.putBuffer(r.session.md5.digest()),e.putBuffer(r.session.sha1.digest());var t=r.entity===U.ConnectionEnd.client,n=r.session.sp,s=12,i=Yw,a=t?"client finished":"server finished";e=i(n.master_secret,a,e.getBytes(),s);var u=ke.util.createBuffer();return u.putByte(U.HandshakeType.finished),u.putInt24(e.length()),u.putBuffer(e),u};U.createHeartbeat=function(r,e,t){typeof t>"u"&&(t=e.length);var n=ke.util.createBuffer();n.putByte(r),n.putInt16(t),n.putBytes(e);var s=n.length(),i=Math.max(16,s-t-3);return n.putBytes(ke.random.getBytes(i)),n};U.queue=function(r,e){if(e&&!(e.fragment.length()===0&&(e.type===U.ContentType.handshake||e.type===U.ContentType.alert||e.type===U.ContentType.change_cipher_spec))){if(e.type===U.ContentType.handshake){var t=e.fragment.bytes();r.session.md5.update(t),r.session.sha1.update(t),t=null}var n;if(e.fragment.length()<=U.MaxFragment)n=[e];else{n=[];for(var s=e.fragment.bytes();s.length>U.MaxFragment;)n.push(U.createRecord(r,{type:e.type,data:ke.util.createBuffer(s.slice(0,U.MaxFragment))})),s=s.slice(U.MaxFragment);s.length>0&&n.push(U.createRecord(r,{type:e.type,data:ke.util.createBuffer(s)}))}for(var i=0;i<n.length&&!r.fail;++i){var a=n[i],u=r.state.current.write;u.update(r,a)&&r.records.push(a)}}};U.flush=function(r){for(var e=0;e<r.records.length;++e){var t=r.records[e];r.tlsData.putByte(t.type),r.tlsData.putByte(t.version.major),r.tlsData.putByte(t.version.minor),r.tlsData.putInt16(t.fragment.length()),r.tlsData.putBuffer(r.records[e].fragment)}return r.records=[],r.tlsDataReady(r)};var Sx=o(function(r){switch(r){case!0:return!0;case ke.pki.certificateError.bad_certificate:return U.Alert.Description.bad_certificate;case ke.pki.certificateError.unsupported_certificate:return U.Alert.Description.unsupported_certificate;case ke.pki.certificateError.certificate_revoked:return U.Alert.Description.certificate_revoked;case ke.pki.certificateError.certificate_expired:return U.Alert.Description.certificate_expired;case ke.pki.certificateError.certificate_unknown:return U.Alert.Description.certificate_unknown;case ke.pki.certificateError.unknown_ca:return U.Alert.Description.unknown_ca;default:return U.Alert.Description.bad_certificate}},"_certErrorToAlertDesc"),MW=o(function(r){switch(r){case!0:return!0;case U.Alert.Description.bad_certificate:return ke.pki.certificateError.bad_certificate;case U.Alert.Description.unsupported_certificate:return ke.pki.certificateError.unsupported_certificate;case U.Alert.Description.certificate_revoked:return ke.pki.certificateError.certificate_revoked;case U.Alert.Description.certificate_expired:return ke.pki.certificateError.certificate_expired;case U.Alert.Description.certificate_unknown:return ke.pki.certificateError.certificate_unknown;case U.Alert.Description.unknown_ca:return ke.pki.certificateError.unknown_ca;default:return ke.pki.certificateError.bad_certificate}},"_alertDescToCertError");U.verifyCertificateChain=function(r,e){try{var t={};for(var n in r.verifyOptions)t[n]=r.verifyOptions[n];t.verify=function(i,a,u){var l=Sx(i),f=r.verify(r,i,a,u);if(f!==!0){if(typeof f=="object"&&!ke.util.isArray(f)){var h=new Error("The application rejected the certificate.");throw h.send=!0,h.alert={level:U.Alert.Level.fatal,description:U.Alert.Description.bad_certificate},f.message&&(h.message=f.message),f.alert&&(h.alert.description=f.alert),h}f!==i&&(f=MW(f))}return f},ke.pki.verifyCertificateChain(r.caStore,e,t)}catch(i){var s=i;(typeof s!="object"||ke.util.isArray(s))&&(s={send:!0,alert:{level:U.Alert.Level.fatal,description:Sx(i)}}),"send"in s||(s.send=!0),"alert"in s||(s.alert={level:U.Alert.Level.fatal,description:Sx(s.error)}),r.error(r,s)}return!r.fail};U.createSessionCache=function(r,e){var t=null;if(r&&r.getSession&&r.setSession&&r.order)t=r;else{t={},t.cache=r||{},t.capacity=Math.max(e||100,1),t.order=[];for(var n in r)t.order.length<=e?t.order.push(n):delete r[n];t.getSession=function(s){var i=null,a=null;if(s?a=ke.util.bytesToHex(s):t.order.length>0&&(a=t.order[0]),a!==null&&a in t.cache){i=t.cache[a],delete t.cache[a];for(var u in t.order)if(t.order[u]===a){t.order.splice(u,1);break}}return i},t.setSession=function(s,i){if(t.order.length===t.capacity){var a=t.order.shift();delete t.cache[a]}var a=ke.util.bytesToHex(s);t.order.push(a),t.cache[a]=i}}return t};U.createConnection=function(r){var e=null;r.caStore?ke.util.isArray(r.caStore)?e=ke.pki.createCaStore(r.caStore):e=r.caStore:e=ke.pki.createCaStore();var t=r.cipherSuites||null;if(t===null){t=[];for(var n in U.CipherSuites)t.push(U.CipherSuites[n])}var s=r.server?U.ConnectionEnd.server:U.ConnectionEnd.client,i=r.sessionCache?U.createSessionCache(r.sessionCache):null,a={version:{major:U.Version.major,minor:U.Version.minor},entity:s,sessionId:r.sessionId,caStore:e,sessionCache:i,cipherSuites:t,connected:r.connected,virtualHost:r.virtualHost||null,verifyClient:r.verifyClient||!1,verify:r.verify||function(h,m,g,w){return m},verifyOptions:r.verifyOptions||{},getCertificate:r.getCertificate||null,getPrivateKey:r.getPrivateKey||null,getSignature:r.getSignature||null,input:ke.util.createBuffer(),tlsData:ke.util.createBuffer(),data:ke.util.createBuffer(),tlsDataReady:r.tlsDataReady,dataReady:r.dataReady,heartbeatReceived:r.heartbeatReceived,closed:r.closed,error:o(function(h,m){m.origin=m.origin||(h.entity===U.ConnectionEnd.client?"client":"server"),m.send&&(U.queue(h,U.createAlert(h,m.alert)),U.flush(h));var g=m.fatal!==!1;g&&(h.fail=!0),r.error(h,m),g&&h.close(!1)},"error"),deflate:r.deflate||null,inflate:r.inflate||null};a.reset=function(h){a.version={major:U.Version.major,minor:U.Version.minor},a.record=null,a.session=null,a.peerCertificate=null,a.state={pending:null,current:null},a.expect=a.entity===U.ConnectionEnd.client?CW:DW,a.fragmented=null,a.records=[],a.open=!1,a.handshakes=0,a.handshaking=!1,a.isConnected=!1,a.fail=!(h||typeof h>"u"),a.input.clear(),a.tlsData.clear(),a.data.clear(),a.state.current=U.createConnectionState(a)},a.reset();var u=o(function(h,m){var g=m.type-U.ContentType.change_cipher_spec,w=Cx[h.entity][h.expect];g in w?w[g](h,m):U.handleUnexpected(h,m)},"_update"),l=o(function(h){var m=0,g=h.input,w=g.length();if(w<5)m=5-w;else{h.record={type:g.getByte(),version:{major:g.getByte(),minor:g.getByte()},length:g.getInt16(),fragment:ke.util.createBuffer(),ready:!1};var y=h.record.version.major===h.version.major;y&&h.session&&h.session.version&&(y=h.record.version.minor===h.version.minor),y||h.error(h,{message:"Incompatible TLS version.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.protocol_version}})}return m},"_readRecordHeader"),f=o(function(h){var m=0,g=h.input,w=g.length();if(w<h.record.length)m=h.record.length-w;else{h.record.fragment.putBytes(g.getBytes(h.record.length)),g.compact();var y=h.state.current.read;y.update(h,h.record)&&(h.fragmented!==null&&(h.fragmented.type===h.record.type?(h.fragmented.fragment.putBuffer(h.record.fragment),h.record=h.fragmented):h.error(h,{message:"Invalid fragmented record.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.unexpected_message}})),h.record.ready=!0)}return m},"_readRecord");return a.handshake=function(h){if(a.entity!==U.ConnectionEnd.client)a.error(a,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(a.handshaking)a.error(a,{message:"Handshake already in progress.",fatal:!1});else{a.fail&&!a.open&&a.handshakes===0&&(a.fail=!1),a.handshaking=!0,h=h||"";var m=null;h.length>0&&(a.sessionCache&&(m=a.sessionCache.getSession(h)),m===null&&(h="")),h.length===0&&a.sessionCache&&(m=a.sessionCache.getSession(),m!==null&&(h=m.id)),a.session={id:h,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:ke.md.md5.create(),sha1:ke.md.sha1.create()},m&&(a.version=m.version,a.session.sp=m.sp),a.session.sp.client_random=U.createRandom().getBytes(),a.open=!0,U.queue(a,U.createRecord(a,{type:U.ContentType.handshake,data:U.createClientHello(a)})),U.flush(a)}},a.process=function(h){var m=0;return h&&a.input.putBytes(h),a.fail||(a.record!==null&&a.record.ready&&a.record.fragment.isEmpty()&&(a.record=null),a.record===null&&(m=l(a)),!a.fail&&a.record!==null&&!a.record.ready&&(m=f(a)),!a.fail&&a.record!==null&&a.record.ready&&u(a,a.record)),m},a.prepare=function(h){return U.queue(a,U.createRecord(a,{type:U.ContentType.application_data,data:ke.util.createBuffer(h)})),U.flush(a)},a.prepareHeartbeatRequest=function(h,m){return h instanceof ke.util.ByteBuffer&&(h=h.bytes()),typeof m>"u"&&(m=h.length),a.expectedHeartbeatPayload=h,U.queue(a,U.createRecord(a,{type:U.ContentType.heartbeat,data:U.createHeartbeat(U.HeartbeatMessageType.heartbeat_request,h,m)})),U.flush(a)},a.close=function(h){if(!a.fail&&a.sessionCache&&a.session){var m={id:a.session.id,version:a.session.version,sp:a.session.sp};m.sp.keys=null,a.sessionCache.setSession(m.id,m)}a.open&&(a.open=!1,a.input.clear(),(a.isConnected||a.handshaking)&&(a.isConnected=a.handshaking=!1,U.queue(a,U.createAlert(a,{level:U.Alert.Level.warning,description:U.Alert.Description.close_notify})),U.flush(a)),a.closed(a)),a.reset(h)},a};f3.exports=ke.tls=ke.tls||{};for(Jw in U)typeof U[Jw]!="function"&&(ke.tls[Jw]=U[Jw]);var Jw;ke.tls.prf_tls1=Yw;ke.tls.hmac_sha1=SW;ke.tls.createSessionCache=U.createSessionCache;ke.tls.createConnection=U.createConnection});var d3=ye(($ce,p3)=>{"use strict";var xu=$t();vu();bx();var mi=p3.exports=xu.tls;mi.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:o(function(r){r.bulk_cipher_algorithm=mi.BulkCipherAlgorithm.aes,r.cipher_type=mi.CipherType.block,r.enc_key_length=16,r.block_length=16,r.fixed_iv_length=16,r.record_iv_length=16,r.mac_algorithm=mi.MACAlgorithm.hmac_sha1,r.mac_length=20,r.mac_key_length=20},"initSecurityParameters"),initConnectionState:h3};mi.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:o(function(r){r.bulk_cipher_algorithm=mi.BulkCipherAlgorithm.aes,r.cipher_type=mi.CipherType.block,r.enc_key_length=32,r.block_length=16,r.fixed_iv_length=16,r.record_iv_length=16,r.mac_algorithm=mi.MACAlgorithm.hmac_sha1,r.mac_length=20,r.mac_key_length=20},"initSecurityParameters"),initConnectionState:h3};function h3(r,e,t){var n=e.entity===xu.tls.ConnectionEnd.client;r.read.cipherState={init:!1,cipher:xu.cipher.createDecipher("AES-CBC",n?t.keys.server_write_key:t.keys.client_write_key),iv:n?t.keys.server_write_IV:t.keys.client_write_IV},r.write.cipherState={init:!1,cipher:xu.cipher.createCipher("AES-CBC",n?t.keys.client_write_key:t.keys.server_write_key),iv:n?t.keys.client_write_IV:t.keys.server_write_IV},r.read.cipherFunction=HW,r.write.cipherFunction=jW,r.read.macLength=r.write.macLength=t.mac_length,r.read.macFunction=r.write.macFunction=mi.hmac_sha1}o(h3,"initConnectionState");function jW(r,e){var t=!1,n=e.macFunction(e.macKey,e.sequenceNumber,r);r.fragment.putBytes(n),e.updateSequenceNumber();var s;r.version.minor===mi.Versions.TLS_1_0.minor?s=e.cipherState.init?null:e.cipherState.iv:s=xu.random.getBytesSync(16),e.cipherState.init=!0;var i=e.cipherState.cipher;return i.start({iv:s}),r.version.minor>=mi.Versions.TLS_1_1.minor&&i.output.putBytes(s),i.update(r.fragment),i.finish(FW)&&(r.fragment=i.output,r.length=r.fragment.length(),t=!0),t}o(jW,"encrypt_aes_cbc_sha1");function FW(r,e,t){if(!t){var n=r-e.length()%r;e.fillWithByte(n-1,n)}return!0}o(FW,"encrypt_aes_cbc_sha1_padding");function qW(r,e,t){var n=!0;if(t){for(var s=e.length(),i=e.last(),a=s-1-i;a<s-1;++a)n=n&&e.at(a)==i;n&&e.truncate(i+1)}return n}o(qW,"decrypt_aes_cbc_sha1_padding");function HW(r,e){var t=!1,n;r.version.minor===mi.Versions.TLS_1_0.minor?n=e.cipherState.init?null:e.cipherState.iv:n=r.fragment.getBytes(16),e.cipherState.init=!0;var s=e.cipherState.cipher;s.start({iv:n}),s.update(r.fragment),t=s.finish(qW);var i=e.macLength,a=xu.random.getBytesSync(i),u=s.output.length();u>=i?(r.fragment=s.output.getBytes(u-i),a=s.output.getBytes(i)):r.fragment=s.output.getBytes(),r.fragment=xu.util.createBuffer(r.fragment),r.length=r.fragment.length();var l=e.macFunction(e.macKey,e.sequenceNumber,r);return e.updateSequenceNumber(),t=KW(e.macKey,a,l)&&t,t}o(HW,"decrypt_aes_cbc_sha1");function KW(r,e,t){var n=xu.hmac.create();return n.start("SHA1",r),n.update(e),e=n.digest().getBytes(),n.start(null,null),n.update(t),t=n.digest().getBytes(),e===t}o(KW,"compareMacs")});var Tx=ye((Gce,v3)=>{"use strict";var Vr=$t();da();ur();var Tm=v3.exports=Vr.sha512=Vr.sha512||{};Vr.md.sha512=Vr.md.algorithms.sha512=Tm;var g3=Vr.sha384=Vr.sha512.sha384=Vr.sha512.sha384||{};g3.create=function(){return Tm.create("SHA-384")};Vr.md.sha384=Vr.md.algorithms.sha384=g3;Vr.sha512.sha256=Vr.sha512.sha256||{create:o(function(){return Tm.create("SHA-512/256")},"create")};Vr.md["sha512/256"]=Vr.md.algorithms["sha512/256"]=Vr.sha512.sha256;Vr.sha512.sha224=Vr.sha512.sha224||{create:o(function(){return Tm.create("SHA-512/224")},"create")};Vr.md["sha512/224"]=Vr.md.algorithms["sha512/224"]=Vr.sha512.sha224;Tm.create=function(r){if(y3||$W(),typeof r>"u"&&(r="SHA-512"),!(r in vc))throw new Error("Invalid SHA-512 algorithm: "+r);for(var e=vc[r],t=null,n=Vr.util.createBuffer(),s=new Array(80),i=0;i<80;++i)s[i]=new Array(2);var a=64;switch(r){case"SHA-384":a=48;break;case"SHA-512/256":a=32;break;case"SHA-512/224":a=28;break}var u={algorithm:r.replace("-","").toLowerCase(),blockLength:128,digestLength:a,messageLength:0,fullMessageLength:null,messageLengthSize:16};return u.start=function(){u.messageLength=0,u.fullMessageLength=u.messageLength128=[];for(var l=u.messageLengthSize/4,f=0;f<l;++f)u.fullMessageLength.push(0);n=Vr.util.createBuffer(),t=new Array(e.length);for(var f=0;f<e.length;++f)t[f]=e[f].slice(0);return u},u.start(),u.update=function(l,f){f==="utf8"&&(l=Vr.util.encodeUtf8(l));var h=l.length;u.messageLength+=h,h=[h/4294967296>>>0,h>>>0];for(var m=u.fullMessageLength.length-1;m>=0;--m)u.fullMessageLength[m]+=h[1],h[1]=h[0]+(u.fullMessageLength[m]/4294967296>>>0),u.fullMessageLength[m]=u.fullMessageLength[m]>>>0,h[0]=h[1]/4294967296>>>0;return n.putBytes(l),m3(t,s,n),(n.read>2048||n.length()===0)&&n.compact(),u},u.digest=function(){var l=Vr.util.createBuffer();l.putBytes(n.bytes());var f=u.fullMessageLength[u.fullMessageLength.length-1]+u.messageLengthSize,h=f&u.blockLength-1;l.putBytes(xx.substr(0,u.blockLength-h));for(var m,g,w=u.fullMessageLength[0]*8,y=0;y<u.fullMessageLength.length-1;++y)m=u.fullMessageLength[y+1]*8,g=m/4294967296>>>0,w+=g,l.putInt32(w>>>0),w=m>>>0;l.putInt32(w);for(var S=new Array(t.length),y=0;y<t.length;++y)S[y]=t[y].slice(0);m3(S,s,l);var E=Vr.util.createBuffer(),b;r==="SHA-512"?b=S.length:r==="SHA-384"?b=S.length-2:b=S.length-4;for(var y=0;y<b;++y)E.putInt32(S[y][0]),(y!==b-1||r!=="SHA-512/224")&&E.putInt32(S[y][1]);return E},u};var xx=null,y3=!1,Nx=null,vc=null;function $W(){xx="\x80",xx+=Vr.util.fillString("\0",128),Nx=[[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]],vc={},vc["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],vc["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],vc["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],vc["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],y3=!0}o($W,"_init");function m3(r,e,t){for(var n,s,i,a,u,l,f,h,m,g,w,y,S,E,b,T,A,C,x,B,F,R,H,q,K,G,he,le,oe,Z,fe,Se,Ke,be,we,Me=t.length();Me>=128;){for(oe=0;oe<16;++oe)e[oe][0]=t.getInt32()>>>0,e[oe][1]=t.getInt32()>>>0;for(;oe<80;++oe)Se=e[oe-2],Z=Se[0],fe=Se[1],n=((Z>>>19|fe<<13)^(fe>>>29|Z<<3)^Z>>>6)>>>0,s=((Z<<13|fe>>>19)^(fe<<3|Z>>>29)^(Z<<26|fe>>>6))>>>0,be=e[oe-15],Z=be[0],fe=be[1],i=((Z>>>1|fe<<31)^(Z>>>8|fe<<24)^Z>>>7)>>>0,a=((Z<<31|fe>>>1)^(Z<<24|fe>>>8)^(Z<<25|fe>>>7))>>>0,Ke=e[oe-7],we=e[oe-16],fe=s+Ke[1]+a+we[1],e[oe][0]=n+Ke[0]+i+we[0]+(fe/4294967296>>>0)>>>0,e[oe][1]=fe>>>0;for(S=r[0][0],E=r[0][1],b=r[1][0],T=r[1][1],A=r[2][0],C=r[2][1],x=r[3][0],B=r[3][1],F=r[4][0],R=r[4][1],H=r[5][0],q=r[5][1],K=r[6][0],G=r[6][1],he=r[7][0],le=r[7][1],oe=0;oe<80;++oe)f=((F>>>14|R<<18)^(F>>>18|R<<14)^(R>>>9|F<<23))>>>0,h=((F<<18|R>>>14)^(F<<14|R>>>18)^(R<<23|F>>>9))>>>0,m=(K^F&(H^K))>>>0,g=(G^R&(q^G))>>>0,u=((S>>>28|E<<4)^(E>>>2|S<<30)^(E>>>7|S<<25))>>>0,l=((S<<4|E>>>28)^(E<<30|S>>>2)^(E<<25|S>>>7))>>>0,w=(S&b|A&(S^b))>>>0,y=(E&T|C&(E^T))>>>0,fe=le+h+g+Nx[oe][1]+e[oe][1],n=he+f+m+Nx[oe][0]+e[oe][0]+(fe/4294967296>>>0)>>>0,s=fe>>>0,fe=l+y,i=u+w+(fe/4294967296>>>0)>>>0,a=fe>>>0,he=K,le=G,K=H,G=q,H=F,q=R,fe=B+s,F=x+n+(fe/4294967296>>>0)>>>0,R=fe>>>0,x=A,B=C,A=b,C=T,b=S,T=E,fe=s+a,S=n+i+(fe/4294967296>>>0)>>>0,E=fe>>>0;fe=r[0][1]+E,r[0][0]=r[0][0]+S+(fe/4294967296>>>0)>>>0,r[0][1]=fe>>>0,fe=r[1][1]+T,r[1][0]=r[1][0]+b+(fe/4294967296>>>0)>>>0,r[1][1]=fe>>>0,fe=r[2][1]+C,r[2][0]=r[2][0]+A+(fe/4294967296>>>0)>>>0,r[2][1]=fe>>>0,fe=r[3][1]+B,r[3][0]=r[3][0]+x+(fe/4294967296>>>0)>>>0,r[3][1]=fe>>>0,fe=r[4][1]+R,r[4][0]=r[4][0]+F+(fe/4294967296>>>0)>>>0,r[4][1]=fe>>>0,fe=r[5][1]+q,r[5][0]=r[5][0]+H+(fe/4294967296>>>0)>>>0,r[5][1]=fe>>>0,fe=r[6][1]+G,r[6][0]=r[6][0]+K+(fe/4294967296>>>0)>>>0,r[6][1]=fe>>>0,fe=r[7][1]+le,r[7][0]=r[7][0]+he+(fe/4294967296>>>0)>>>0,r[7][1]=fe>>>0,Me-=128}}o(m3,"_update")});var w3=ye(Ix=>{"use strict";var XW=$t();Fi();var xn=XW.asn1;Ix.privateKeyValidator={name:"PrivateKeyInfo",tagClass:xn.Class.UNIVERSAL,type:xn.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:xn.Class.UNIVERSAL,type:xn.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:xn.Class.UNIVERSAL,type:xn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:xn.Class.UNIVERSAL,type:xn.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:xn.Class.UNIVERSAL,type:xn.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Ix.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:xn.Class.UNIVERSAL,type:xn.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:xn.Class.UNIVERSAL,type:xn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:xn.Class.UNIVERSAL,type:xn.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:xn.Class.UNIVERSAL,type:xn.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var R3=ye((zce,_3)=>{"use strict";var Ln=$t();Cm();ci();Tx();ur();var x3=w3(),GW=x3.publicKeyValidator,WW=x3.privateKeyValidator;typeof S3>"u"&&(S3=Ln.jsbn.BigInteger);var S3,_x=Ln.util.ByteBuffer,As=typeof Buffer>"u"?Uint8Array:Buffer;Ln.pki=Ln.pki||{};_3.exports=Ln.pki.ed25519=Ln.ed25519=Ln.ed25519||{};var Qt=Ln.ed25519;Qt.constants={};Qt.constants.PUBLIC_KEY_BYTE_LENGTH=32;Qt.constants.PRIVATE_KEY_BYTE_LENGTH=64;Qt.constants.SEED_BYTE_LENGTH=32;Qt.constants.SIGN_BYTE_LENGTH=64;Qt.constants.HASH_BYTE_LENGTH=64;Qt.generateKeyPair=function(r){r=r||{};var e=r.seed;if(e===void 0)e=Ln.random.getBytesSync(Qt.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==Qt.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Qt.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(e instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');e=mo({message:e,encoding:"binary"});for(var t=new As(Qt.constants.PUBLIC_KEY_BYTE_LENGTH),n=new As(Qt.constants.PRIVATE_KEY_BYTE_LENGTH),s=0;s<32;++s)n[s]=e[s];return QW(t,n),{publicKey:t,privateKey:n}};Qt.privateKeyFromAsn1=function(r){var e={},t=[],n=Ln.asn1.validate(r,WW,e,t);if(!n){var s=new Error("Invalid Key.");throw s.errors=t,s}var i=Ln.asn1.derToOid(e.privateKeyOid),a=Ln.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var u=e.privateKey,l=mo({message:Ln.asn1.fromDer(u).value,encoding:"binary"});return{privateKeyBytes:l}};Qt.publicKeyFromAsn1=function(r){var e={},t=[],n=Ln.asn1.validate(r,GW,e,t);if(!n){var s=new Error("Invalid Key.");throw s.errors=t,s}var i=Ln.asn1.derToOid(e.publicKeyOid),a=Ln.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var u=e.ed25519PublicKey;if(u.length!==Qt.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return mo({message:u,encoding:"binary"})};Qt.publicKeyFromPrivateKey=function(r){r=r||{};var e=mo({message:r.privateKey,encoding:"binary"});if(e.length!==Qt.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Qt.constants.PRIVATE_KEY_BYTE_LENGTH);for(var t=new As(Qt.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<t.length;++n)t[n]=e[32+n];return t};Qt.sign=function(r){r=r||{};var e=mo(r),t=mo({message:r.privateKey,encoding:"binary"});if(t.length===Qt.constants.SEED_BYTE_LENGTH){var n=Qt.generateKeyPair({seed:t});t=n.privateKey}else if(t.length!==Qt.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Qt.constants.SEED_BYTE_LENGTH+" or "+Qt.constants.PRIVATE_KEY_BYTE_LENGTH);var s=new As(Qt.constants.SIGN_BYTE_LENGTH+e.length);ZW(s,e,e.length,t);for(var i=new As(Qt.constants.SIGN_BYTE_LENGTH),a=0;a<i.length;++a)i[a]=s[a];return i};Qt.verify=function(r){r=r||{};var e=mo(r);if(r.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var t=mo({message:r.signature,encoding:"binary"});if(t.length!==Qt.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+Qt.constants.SIGN_BYTE_LENGTH);var n=mo({message:r.publicKey,encoding:"binary"});if(n.length!==Qt.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+Qt.constants.PUBLIC_KEY_BYTE_LENGTH);var s=new As(Qt.constants.SIGN_BYTE_LENGTH+e.length),i=new As(Qt.constants.SIGN_BYTE_LENGTH+e.length),a;for(a=0;a<Qt.constants.SIGN_BYTE_LENGTH;++a)s[a]=t[a];for(a=0;a<e.length;++a)s[a+Qt.constants.SIGN_BYTE_LENGTH]=e[a];return eJ(i,s,s.length,n)>=0};function mo(r){var e=r.message;if(e instanceof Uint8Array||e instanceof As)return e;var t=r.encoding;if(e===void 0)if(r.md)e=r.md.digest().getBytes(),t="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof e=="string"&&!t)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof e=="string"){if(typeof Buffer<"u")return Buffer.from(e,t);e=new _x(e,t)}else if(!(e instanceof _x))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new As(e.length()),s=0;s<n.length;++s)n[s]=e.at(s);return n}o(mo,"messageToNativeBuffer");var Rx=Nt(),Qw=Nt([1]),JW=Nt([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),zW=Nt([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),E3=Nt([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),A3=Nt([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Bx=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]),YW=Nt([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Im(r,e){var t=Ln.md.sha512.create(),n=new _x(r);t.update(n.getBytes(e),"binary");var s=t.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(s,"binary");for(var i=new As(Qt.constants.HASH_BYTE_LENGTH),a=0;a<64;++a)i[a]=s.charCodeAt(a);return i}o(Im,"sha512");function QW(r,e){var t=[Nt(),Nt(),Nt(),Nt()],n,s=Im(e,32);for(s[0]&=248,s[31]&=127,s[31]|=64,Lx(t,s),kx(r,t),n=0;n<32;++n)e[n+32]=r[n];return 0}o(QW,"crypto_sign_keypair");function ZW(r,e,t,n){var s,i,a=new Float64Array(64),u=[Nt(),Nt(),Nt(),Nt()],l=Im(n,32);l[0]&=248,l[31]&=127,l[31]|=64;var f=t+64;for(s=0;s<t;++s)r[64+s]=e[s];for(s=0;s<32;++s)r[32+s]=l[32+s];var h=Im(r.subarray(32),t+32);for(Px(h),Lx(u,h),kx(r,u),s=32;s<64;++s)r[s]=n[s];var m=Im(r,t+64);for(Px(m),s=32;s<64;++s)a[s]=0;for(s=0;s<32;++s)a[s]=h[s];for(s=0;s<32;++s)for(i=0;i<32;i++)a[s+i]+=m[s]*l[i];return N3(r.subarray(32),a),f}o(ZW,"crypto_sign");function eJ(r,e,t,n){var s,i,a=new As(32),u=[Nt(),Nt(),Nt(),Nt()],l=[Nt(),Nt(),Nt(),Nt()];if(i=-1,t<64||tJ(l,n))return-1;for(s=0;s<t;++s)r[s]=e[s];for(s=0;s<32;++s)r[s+32]=n[s];var f=Im(r,t);if(Px(f),B3(u,l,f),Lx(l,e.subarray(32)),Ox(u,l),kx(a,u),t-=64,T3(e,0,a,0)){for(s=0;s<t;++s)r[s]=0;return-1}for(s=0;s<t;++s)r[s]=e[s+64];return i=t,i}o(eJ,"crypto_sign_open");function N3(r,e){var t,n,s,i;for(n=63;n>=32;--n){for(t=0,s=n-32,i=n-12;s<i;++s)e[s]+=t-16*e[n]*Bx[s-(n-32)],t=e[s]+128>>8,e[s]-=t*256;e[s]+=t,e[n]=0}for(t=0,s=0;s<32;++s)e[s]+=t-(e[31]>>4)*Bx[s],t=e[s]>>8,e[s]&=255;for(s=0;s<32;++s)e[s]-=t*Bx[s];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,r[n]=e[n]&255}o(N3,"modL");function Px(r){for(var e=new Float64Array(64),t=0;t<64;++t)e[t]=r[t],r[t]=0;N3(r,e)}o(Px,"reduce");function Ox(r,e){var t=Nt(),n=Nt(),s=Nt(),i=Nt(),a=Nt(),u=Nt(),l=Nt(),f=Nt(),h=Nt();Qh(t,r[1],r[0]),Qh(h,e[1],e[0]),xr(t,t,h),Yh(n,r[0],r[1]),Yh(h,e[0],e[1]),xr(n,n,h),xr(s,r[3],e[3]),xr(s,s,zW),xr(i,r[2],e[2]),Yh(i,i,i),Qh(a,n,t),Qh(u,i,s),Yh(l,i,s),Yh(f,n,t),xr(r[0],a,u),xr(r[1],f,l),xr(r[2],l,u),xr(r[3],a,f)}o(Ox,"add");function C3(r,e,t){for(var n=0;n<4;++n)D3(r[n],e[n],t)}o(C3,"cswap");function kx(r,e){var t=Nt(),n=Nt(),s=Nt();iJ(s,e[2]),xr(t,e[0],s),xr(n,e[1],s),Zw(r,n),r[31]^=I3(t)<<7}o(kx,"pack");function Zw(r,e){var t,n,s,i=Nt(),a=Nt();for(t=0;t<16;++t)a[t]=e[t];for(Dx(a),Dx(a),Dx(a),n=0;n<2;++n){for(i[0]=a[0]-65517,t=1;t<15;++t)i[t]=a[t]-65535-(i[t-1]>>16&1),i[t-1]&=65535;i[15]=a[15]-32767-(i[14]>>16&1),s=i[15]>>16&1,i[14]&=65535,D3(a,i,1-s)}for(t=0;t<16;t++)r[2*t]=a[t]&255,r[2*t+1]=a[t]>>8}o(Zw,"pack25519");function tJ(r,e){var t=Nt(),n=Nt(),s=Nt(),i=Nt(),a=Nt(),u=Nt(),l=Nt();return Nu(r[2],Qw),rJ(r[1],e),wc(s,r[1]),xr(i,s,JW),Qh(s,s,r[2]),Yh(i,r[2],i),wc(a,i),wc(u,a),xr(l,u,a),xr(t,l,s),xr(t,t,i),nJ(t,t),xr(t,t,s),xr(t,t,i),xr(t,t,i),xr(r[0],t,i),wc(n,r[0]),xr(n,n,i),b3(n,s)&&xr(r[0],r[0],YW),wc(n,r[0]),xr(n,n,i),b3(n,s)?-1:(I3(r[0])===e[31]>>7&&Qh(r[0],Rx,r[0]),xr(r[3],r[0],r[1]),0)}o(tJ,"unpackneg");function rJ(r,e){var t;for(t=0;t<16;++t)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(rJ,"unpack25519");function nJ(r,e){var t=Nt(),n;for(n=0;n<16;++n)t[n]=e[n];for(n=250;n>=0;--n)wc(t,t),n!==1&&xr(t,t,e);for(n=0;n<16;++n)r[n]=t[n]}o(nJ,"pow2523");function b3(r,e){var t=new As(32),n=new As(32);return Zw(t,r),Zw(n,e),T3(t,0,n,0)}o(b3,"neq25519");function T3(r,e,t,n){return sJ(r,e,t,n,32)}o(T3,"crypto_verify_32");function sJ(r,e,t,n,s){var i,a=0;for(i=0;i<s;++i)a|=r[e+i]^t[n+i];return(1&a-1>>>8)-1}o(sJ,"vn");function I3(r){var e=new As(32);return Zw(e,r),e[0]&1}o(I3,"par25519");function B3(r,e,t){var n,s;for(Nu(r[0],Rx),Nu(r[1],Qw),Nu(r[2],Qw),Nu(r[3],Rx),s=255;s>=0;--s)n=t[s/8|0]>>(s&7)&1,C3(r,e,n),Ox(e,r),Ox(r,r),C3(r,e,n)}o(B3,"scalarmult");function Lx(r,e){var t=[Nt(),Nt(),Nt(),Nt()];Nu(t[0],E3),Nu(t[1],A3),Nu(t[2],Qw),xr(t[3],E3,A3),B3(r,t,e)}o(Lx,"scalarbase");function Nu(r,e){var t;for(t=0;t<16;t++)r[t]=e[t]|0}o(Nu,"set25519");function iJ(r,e){var t=Nt(),n;for(n=0;n<16;++n)t[n]=e[n];for(n=253;n>=0;--n)wc(t,t),n!==2&&n!==4&&xr(t,t,e);for(n=0;n<16;++n)r[n]=t[n]}o(iJ,"inv25519");function Dx(r){var e,t,n=1;for(e=0;e<16;++e)t=r[e]+n+65535,n=Math.floor(t/65536),r[e]=t-n*65536;r[0]+=n-1+37*(n-1)}o(Dx,"car25519");function D3(r,e,t){for(var n,s=~(t-1),i=0;i<16;++i)n=s&(r[i]^e[i]),r[i]^=n,e[i]^=n}o(D3,"sel25519");function Nt(r){var e,t=new Float64Array(16);if(r)for(e=0;e<r.length;++e)t[e]=r[e];return t}o(Nt,"gf");function Yh(r,e,t){for(var n=0;n<16;++n)r[n]=e[n]+t[n]}o(Yh,"A");function Qh(r,e,t){for(var n=0;n<16;++n)r[n]=e[n]-t[n]}o(Qh,"Z");function wc(r,e){xr(r,e,e)}o(wc,"S");function xr(r,e,t){var n,s,i=0,a=0,u=0,l=0,f=0,h=0,m=0,g=0,w=0,y=0,S=0,E=0,b=0,T=0,A=0,C=0,x=0,B=0,F=0,R=0,H=0,q=0,K=0,G=0,he=0,le=0,oe=0,Z=0,fe=0,Se=0,Ke=0,be=t[0],we=t[1],Me=t[2],Je=t[3],Ye=t[4],lt=t[5],O=t[6],_=t[7],ne=t[8],J=t[9],Xe=t[10],Re=t[11],xe=t[12],ct=t[13],rr=t[14],je=t[15];n=e[0],i+=n*be,a+=n*we,u+=n*Me,l+=n*Je,f+=n*Ye,h+=n*lt,m+=n*O,g+=n*_,w+=n*ne,y+=n*J,S+=n*Xe,E+=n*Re,b+=n*xe,T+=n*ct,A+=n*rr,C+=n*je,n=e[1],a+=n*be,u+=n*we,l+=n*Me,f+=n*Je,h+=n*Ye,m+=n*lt,g+=n*O,w+=n*_,y+=n*ne,S+=n*J,E+=n*Xe,b+=n*Re,T+=n*xe,A+=n*ct,C+=n*rr,x+=n*je,n=e[2],u+=n*be,l+=n*we,f+=n*Me,h+=n*Je,m+=n*Ye,g+=n*lt,w+=n*O,y+=n*_,S+=n*ne,E+=n*J,b+=n*Xe,T+=n*Re,A+=n*xe,C+=n*ct,x+=n*rr,B+=n*je,n=e[3],l+=n*be,f+=n*we,h+=n*Me,m+=n*Je,g+=n*Ye,w+=n*lt,y+=n*O,S+=n*_,E+=n*ne,b+=n*J,T+=n*Xe,A+=n*Re,C+=n*xe,x+=n*ct,B+=n*rr,F+=n*je,n=e[4],f+=n*be,h+=n*we,m+=n*Me,g+=n*Je,w+=n*Ye,y+=n*lt,S+=n*O,E+=n*_,b+=n*ne,T+=n*J,A+=n*Xe,C+=n*Re,x+=n*xe,B+=n*ct,F+=n*rr,R+=n*je,n=e[5],h+=n*be,m+=n*we,g+=n*Me,w+=n*Je,y+=n*Ye,S+=n*lt,E+=n*O,b+=n*_,T+=n*ne,A+=n*J,C+=n*Xe,x+=n*Re,B+=n*xe,F+=n*ct,R+=n*rr,H+=n*je,n=e[6],m+=n*be,g+=n*we,w+=n*Me,y+=n*Je,S+=n*Ye,E+=n*lt,b+=n*O,T+=n*_,A+=n*ne,C+=n*J,x+=n*Xe,B+=n*Re,F+=n*xe,R+=n*ct,H+=n*rr,q+=n*je,n=e[7],g+=n*be,w+=n*we,y+=n*Me,S+=n*Je,E+=n*Ye,b+=n*lt,T+=n*O,A+=n*_,C+=n*ne,x+=n*J,B+=n*Xe,F+=n*Re,R+=n*xe,H+=n*ct,q+=n*rr,K+=n*je,n=e[8],w+=n*be,y+=n*we,S+=n*Me,E+=n*Je,b+=n*Ye,T+=n*lt,A+=n*O,C+=n*_,x+=n*ne,B+=n*J,F+=n*Xe,R+=n*Re,H+=n*xe,q+=n*ct,K+=n*rr,G+=n*je,n=e[9],y+=n*be,S+=n*we,E+=n*Me,b+=n*Je,T+=n*Ye,A+=n*lt,C+=n*O,x+=n*_,B+=n*ne,F+=n*J,R+=n*Xe,H+=n*Re,q+=n*xe,K+=n*ct,G+=n*rr,he+=n*je,n=e[10],S+=n*be,E+=n*we,b+=n*Me,T+=n*Je,A+=n*Ye,C+=n*lt,x+=n*O,B+=n*_,F+=n*ne,R+=n*J,H+=n*Xe,q+=n*Re,K+=n*xe,G+=n*ct,he+=n*rr,le+=n*je,n=e[11],E+=n*be,b+=n*we,T+=n*Me,A+=n*Je,C+=n*Ye,x+=n*lt,B+=n*O,F+=n*_,R+=n*ne,H+=n*J,q+=n*Xe,K+=n*Re,G+=n*xe,he+=n*ct,le+=n*rr,oe+=n*je,n=e[12],b+=n*be,T+=n*we,A+=n*Me,C+=n*Je,x+=n*Ye,B+=n*lt,F+=n*O,R+=n*_,H+=n*ne,q+=n*J,K+=n*Xe,G+=n*Re,he+=n*xe,le+=n*ct,oe+=n*rr,Z+=n*je,n=e[13],T+=n*be,A+=n*we,C+=n*Me,x+=n*Je,B+=n*Ye,F+=n*lt,R+=n*O,H+=n*_,q+=n*ne,K+=n*J,G+=n*Xe,he+=n*Re,le+=n*xe,oe+=n*ct,Z+=n*rr,fe+=n*je,n=e[14],A+=n*be,C+=n*we,x+=n*Me,B+=n*Je,F+=n*Ye,R+=n*lt,H+=n*O,q+=n*_,K+=n*ne,G+=n*J,he+=n*Xe,le+=n*Re,oe+=n*xe,Z+=n*ct,fe+=n*rr,Se+=n*je,n=e[15],C+=n*be,x+=n*we,B+=n*Me,F+=n*Je,R+=n*Ye,H+=n*lt,q+=n*O,K+=n*_,G+=n*ne,he+=n*J,le+=n*Xe,oe+=n*Re,Z+=n*xe,fe+=n*ct,Se+=n*rr,Ke+=n*je,i+=38*x,a+=38*B,u+=38*F,l+=38*R,f+=38*H,h+=38*q,m+=38*K,g+=38*G,w+=38*he,y+=38*le,S+=38*oe,E+=38*Z,b+=38*fe,T+=38*Se,A+=38*Ke,s=1,n=i+s+65535,s=Math.floor(n/65536),i=n-s*65536,n=a+s+65535,s=Math.floor(n/65536),a=n-s*65536,n=u+s+65535,s=Math.floor(n/65536),u=n-s*65536,n=l+s+65535,s=Math.floor(n/65536),l=n-s*65536,n=f+s+65535,s=Math.floor(n/65536),f=n-s*65536,n=h+s+65535,s=Math.floor(n/65536),h=n-s*65536,n=m+s+65535,s=Math.floor(n/65536),m=n-s*65536,n=g+s+65535,s=Math.floor(n/65536),g=n-s*65536,n=w+s+65535,s=Math.floor(n/65536),w=n-s*65536,n=y+s+65535,s=Math.floor(n/65536),y=n-s*65536,n=S+s+65535,s=Math.floor(n/65536),S=n-s*65536,n=E+s+65535,s=Math.floor(n/65536),E=n-s*65536,n=b+s+65535,s=Math.floor(n/65536),b=n-s*65536,n=T+s+65535,s=Math.floor(n/65536),T=n-s*65536,n=A+s+65535,s=Math.floor(n/65536),A=n-s*65536,n=C+s+65535,s=Math.floor(n/65536),C=n-s*65536,i+=s-1+37*(s-1),s=1,n=i+s+65535,s=Math.floor(n/65536),i=n-s*65536,n=a+s+65535,s=Math.floor(n/65536),a=n-s*65536,n=u+s+65535,s=Math.floor(n/65536),u=n-s*65536,n=l+s+65535,s=Math.floor(n/65536),l=n-s*65536,n=f+s+65535,s=Math.floor(n/65536),f=n-s*65536,n=h+s+65535,s=Math.floor(n/65536),h=n-s*65536,n=m+s+65535,s=Math.floor(n/65536),m=n-s*65536,n=g+s+65535,s=Math.floor(n/65536),g=n-s*65536,n=w+s+65535,s=Math.floor(n/65536),w=n-s*65536,n=y+s+65535,s=Math.floor(n/65536),y=n-s*65536,n=S+s+65535,s=Math.floor(n/65536),S=n-s*65536,n=E+s+65535,s=Math.floor(n/65536),E=n-s*65536,n=b+s+65535,s=Math.floor(n/65536),b=n-s*65536,n=T+s+65535,s=Math.floor(n/65536),T=n-s*65536,n=A+s+65535,s=Math.floor(n/65536),A=n-s*65536,n=C+s+65535,s=Math.floor(n/65536),C=n-s*65536,i+=s-1+37*(s-1),r[0]=i,r[1]=a,r[2]=u,r[3]=l,r[4]=f,r[5]=h,r[6]=m,r[7]=g,r[8]=w,r[9]=y,r[10]=S,r[11]=E,r[12]=b,r[13]=T,r[14]=A,r[15]=C}o(xr,"M")});var L3=ye((Qce,k3)=>{"use strict";var Xs=$t();ur();ci();Cm();k3.exports=Xs.kem=Xs.kem||{};var P3=Xs.jsbn.BigInteger;Xs.kem.rsa={};Xs.kem.rsa.create=function(r,e){e=e||{};var t=e.prng||Xs.random,n={};return n.encrypt=function(s,i){var a=Math.ceil(s.n.bitLength()/8),u;do u=new P3(Xs.util.bytesToHex(t.getBytesSync(a)),16).mod(s.n);while(u.compareTo(P3.ONE)<=0);u=Xs.util.hexToBytes(u.toString(16));var l=a-u.length;l>0&&(u=Xs.util.fillString("\0",l)+u);var f=s.encrypt(u,"NONE"),h=r.generate(u,i);return{encapsulation:f,key:h}},n.decrypt=function(s,i,a){var u=s.decrypt(i,"NONE");return r.generate(u,a)},n};Xs.kem.kdf1=function(r,e){O3(this,r,0,e||r.digestLength)};Xs.kem.kdf2=function(r,e){O3(this,r,1,e||r.digestLength)};function O3(r,e,t,n){r.generate=function(s,i){for(var a=new Xs.util.ByteBuffer,u=Math.ceil(i/n)+t,l=new Xs.util.ByteBuffer,f=t;f<u;++f){l.putInt32(f),e.start(),e.update(s+l.getBytes());var h=e.digest();a.putBytes(h.getBytes(n))}return a.truncate(a.length()-i),a.getBytes()}}o(O3,"_createKDF")});var j3=ye((efe,M3)=>{"use strict";var tr=$t();ur();M3.exports=tr.log=tr.log||{};tr.log.levels=["none","error","warning","info","debug","verbose","max"];var eS={},Mx=[],Dm=null;tr.log.LEVEL_LOCKED=2;tr.log.NO_LEVEL_CHECK=4;tr.log.INTERPOLATE=8;for(Aa=0;Aa<tr.log.levels.length;++Aa)Vx=tr.log.levels[Aa],eS[Vx]={index:Aa,name:Vx.toUpperCase()};var Vx,Aa;tr.log.logMessage=function(r){for(var e=eS[r.level].index,t=0;t<Mx.length;++t){var n=Mx[t];if(n.flags&tr.log.NO_LEVEL_CHECK)n.f(r);else{var s=eS[n.level].index;e<=s&&n.f(n,r)}}};tr.log.prepareStandard=function(r){"standard"in r||(r.standard=eS[r.level].name+" ["+r.category+"] "+r.message)};tr.log.prepareFull=function(r){if(!("full"in r)){var e=[r.message];e=e.concat([]),r.full=tr.util.format.apply(this,e)}};tr.log.prepareStandardFull=function(r){"standardFull"in r||(tr.log.prepareStandard(r),r.standardFull=r.standard)};for(Ux=["error","warning","info","debug","verbose"],Aa=0;Aa<Ux.length;++Aa)(function(e){tr.log[e]=function(t,n){var s=Array.prototype.slice.call(arguments).slice(2),i={timestamp:new Date,level:e,category:t,message:n,arguments:s};tr.log.logMessage(i)}})(Ux[Aa]);var Ux,Aa;tr.log.makeLogger=function(r){var e={flags:0,f:r};return tr.log.setLevel(e,"none"),e};tr.log.setLevel=function(r,e){var t=!1;if(r&&!(r.flags&tr.log.LEVEL_LOCKED))for(var n=0;n<tr.log.levels.length;++n){var s=tr.log.levels[n];if(e==s){r.level=e,t=!0;break}}return t};tr.log.lock=function(r,e){typeof e>"u"||e?r.flags|=tr.log.LEVEL_LOCKED:r.flags&=~tr.log.LEVEL_LOCKED};tr.log.addLogger=function(r){Mx.push(r)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(V3={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},_m=o(function(r,e){tr.log.prepareStandard(e);var t=V3[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),t.apply(console,n)},"f"),Zh=tr.log.makeLogger(_m)):(_m=o(function(e,t){tr.log.prepareStandardFull(t),console.log(t.standardFull)},"f"),Zh=tr.log.makeLogger(_m)),tr.log.setLevel(Zh,"debug"),tr.log.addLogger(Zh),Dm=Zh):console={log:o(function(){},"log")};var Zh,V3,_m;Dm!==null&&typeof window<"u"&&window.location&&(Bm=new URL(window.location.href).searchParams,Bm.has("console.level")&&tr.log.setLevel(Dm,Bm.get("console.level").slice(-1)[0]),Bm.has("console.lock")&&(U3=Bm.get("console.lock").slice(-1)[0],U3=="true"&&tr.log.lock(Dm)));var Bm,U3;tr.log.consoleLogger=Dm});var q3=ye((rfe,F3)=>{"use strict";F3.exports=da();Pw();Xh();Qb();Tx()});var $3=ye((nfe,K3)=>{"use strict";var We=$t();vu();Fi();Em();wu();hc();hx();ci();ur();Gw();var ee=We.asn1,fs=K3.exports=We.pkcs7=We.pkcs7||{};fs.messageFromPem=function(r){var e=We.pem.decode(r)[0];if(e.type!=="PKCS7"){var t=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw t.headerType=e.type,t}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var n=ee.fromDer(e.body);return fs.messageFromAsn1(n)};fs.messageToPem=function(r,e){var t={type:"PKCS7",body:ee.toDer(r.toAsn1()).getBytes()};return We.pem.encode(t,{maxline:e})};fs.messageFromAsn1=function(r){var e={},t=[];if(!ee.validate(r,fs.asn1.contentInfoValidator,e,t)){var n=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw n.errors=t,n}var s=ee.derToOid(e.contentType),i;switch(s){case We.pki.oids.envelopedData:i=fs.createEnvelopedData();break;case We.pki.oids.encryptedData:i=fs.createEncryptedData();break;case We.pki.oids.signedData:i=fs.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+s+" is not (yet) supported.")}return i.fromAsn1(e.content.value[0]),i};fs.createSignedData=function(){var r=null;return r={type:We.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:o(function(n){if(Fx(r,n,fs.asn1.signedDataValidator),r.certificates=[],r.crls=[],r.digestAlgorithmIdentifiers=[],r.contentInfo=null,r.signerInfos=[],r.rawCapture.certificates)for(var s=r.rawCapture.certificates.value,i=0;i<s.length;++i)r.certificates.push(We.pki.certificateFromAsn1(s[i]))},"fromAsn1"),toAsn1:o(function(){r.contentInfo||r.sign();for(var n=[],s=0;s<r.certificates.length;++s)n.push(We.pki.certificateToAsn1(r.certificates[s]));var i=[],a=ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,ee.integerToDer(r.version).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SET,!0,r.digestAlgorithmIdentifiers),r.contentInfo])]);return n.length>0&&a.value[0].value.push(ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,n)),i.length>0&&a.value[0].value.push(ee.create(ee.Class.CONTEXT_SPECIFIC,1,!0,i)),a.value[0].value.push(ee.create(ee.Class.UNIVERSAL,ee.Type.SET,!0,r.signerInfos)),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.type).getBytes()),a])},"toAsn1"),addSigner:o(function(n){var s=n.issuer,i=n.serialNumber;if(n.certificate){var a=n.certificate;typeof a=="string"&&(a=We.pki.certificateFromPem(a)),s=a.issuer.attributes,i=a.serialNumber}var u=n.key;if(!u)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof u=="string"&&(u=We.pki.privateKeyFromPem(u));var l=n.digestAlgorithm||We.pki.oids.sha1;switch(l){case We.pki.oids.sha1:case We.pki.oids.sha256:case We.pki.oids.sha384:case We.pki.oids.sha512:case We.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+l)}var f=n.authenticatedAttributes||[];if(f.length>0){for(var h=!1,m=!1,g=0;g<f.length;++g){var w=f[g];if(!h&&w.type===We.pki.oids.contentType){if(h=!0,m)break;continue}if(!m&&w.type===We.pki.oids.messageDigest){if(m=!0,h)break;continue}}if(!h||!m)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}r.signers.push({key:u,version:1,issuer:s,serialNumber:i,digestAlgorithm:l,signatureAlgorithm:We.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:f,unauthenticatedAttributes:[]})},"addSigner"),sign:o(function(n){if(n=n||{},(typeof r.content!="object"||r.contentInfo===null)&&(r.contentInfo=ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(We.pki.oids.data).getBytes())]),"content"in r)){var s;r.content instanceof We.util.ByteBuffer?s=r.content.bytes():typeof r.content=="string"&&(s=We.util.encodeUtf8(r.content)),n.detached?r.detachedContent=ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,s):r.contentInfo.value.push(ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,s)]))}if(r.signers.length!==0){var i=e();t(i)}},"sign"),verify:o(function(){throw new Error("PKCS#7 signature verification not yet implemented.")},"verify"),addCertificate:o(function(n){typeof n=="string"&&(n=We.pki.certificateFromPem(n)),r.certificates.push(n)},"addCertificate"),addCertificateRevokationList:o(function(n){throw new Error("PKCS#7 CRL support not yet implemented.")},"addCertificateRevokationList")},r;function e(){for(var n={},s=0;s<r.signers.length;++s){var i=r.signers[s],a=i.digestAlgorithm;a in n||(n[a]=We.md[We.pki.oids[a]].create()),i.authenticatedAttributes.length===0?i.md=n[a]:i.md=We.md[We.pki.oids[a]].create()}r.digestAlgorithmIdentifiers=[];for(var a in n)r.digestAlgorithmIdentifiers.push(ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(a).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.NULL,!1,"")]));return n}o(e,"addDigestAlgorithmIds");function t(n){var s;if(r.detachedContent?s=r.detachedContent:(s=r.contentInfo.value[1],s=s.value[0]),!s)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var i=ee.derToOid(r.contentInfo.value[0].value),a=ee.toDer(s);a.getByte(),ee.getBerValueLength(a),a=a.getBytes();for(var u in n)n[u].start().update(a);for(var l=new Date,f=0;f<r.signers.length;++f){var h=r.signers[f];if(h.authenticatedAttributes.length===0){if(i!==We.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{h.authenticatedAttributesAsn1=ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var m=ee.create(ee.Class.UNIVERSAL,ee.Type.SET,!0,[]),g=0;g<h.authenticatedAttributes.length;++g){var w=h.authenticatedAttributes[g];w.type===We.pki.oids.messageDigest?w.value=n[h.digestAlgorithm].digest():w.type===We.pki.oids.signingTime&&(w.value||(w.value=l)),m.value.push(jx(w)),h.authenticatedAttributesAsn1.value.push(jx(w))}a=ee.toDer(m).getBytes(),h.md.start().update(a)}h.signature=h.key.sign(h.md,"RSASSA-PKCS1-V1_5")}r.signerInfos=fJ(r.signers)}o(t,"addSignerInfos")};fs.createEncryptedData=function(){var r=null;return r={type:We.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:We.pki.oids["aes256-CBC"]},fromAsn1:o(function(e){Fx(r,e,fs.asn1.encryptedDataValidator)},"fromAsn1"),decrypt:o(function(e){e!==void 0&&(r.encryptedContent.key=e),H3(r)},"decrypt")},r};fs.createEnvelopedData=function(){var r=null;return r={type:We.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:We.pki.oids["aes256-CBC"]},fromAsn1:o(function(e){var t=Fx(r,e,fs.asn1.envelopedDataValidator);r.recipients=uJ(t.recipientInfos.value)},"fromAsn1"),toAsn1:o(function(){return ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.type).getBytes()),ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,ee.integerToDer(r.version).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SET,!0,lJ(r.recipients)),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,hJ(r.encryptedContent))])])])},"toAsn1"),findRecipient:o(function(e){for(var t=e.issuer.attributes,n=0;n<r.recipients.length;++n){var s=r.recipients[n],i=s.issuer;if(s.serialNumber===e.serialNumber&&i.length===t.length){for(var a=!0,u=0;u<t.length;++u)if(i[u].type!==t[u].type||i[u].value!==t[u].value){a=!1;break}if(a)return s}}return null},"findRecipient"),decrypt:o(function(e,t){if(r.encryptedContent.key===void 0&&e!==void 0&&t!==void 0)switch(e.encryptedContent.algorithm){case We.pki.oids.rsaEncryption:case We.pki.oids.desCBC:var n=t.decrypt(e.encryptedContent.content);r.encryptedContent.key=We.util.createBuffer(n);break;default:throw new Error("Unsupported asymmetric cipher, OID "+e.encryptedContent.algorithm)}H3(r)},"decrypt"),addRecipient:o(function(e){r.recipients.push({version:0,issuer:e.issuer.attributes,serialNumber:e.serialNumber,encryptedContent:{algorithm:We.pki.oids.rsaEncryption,key:e.publicKey}})},"addRecipient"),encrypt:o(function(e,t){if(r.encryptedContent.content===void 0){t=t||r.encryptedContent.algorithm,e=e||r.encryptedContent.key;var n,s,i;switch(t){case We.pki.oids["aes128-CBC"]:n=16,s=16,i=We.aes.createEncryptionCipher;break;case We.pki.oids["aes192-CBC"]:n=24,s=16,i=We.aes.createEncryptionCipher;break;case We.pki.oids["aes256-CBC"]:n=32,s=16,i=We.aes.createEncryptionCipher;break;case We.pki.oids["des-EDE3-CBC"]:n=24,s=8,i=We.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+t)}if(e===void 0)e=We.util.createBuffer(We.random.getBytes(n));else if(e.length()!=n)throw new Error("Symmetric key has wrong length; got "+e.length()+" bytes, expected "+n+".");r.encryptedContent.algorithm=t,r.encryptedContent.key=e,r.encryptedContent.parameter=We.util.createBuffer(We.random.getBytes(s));var a=i(e);if(a.start(r.encryptedContent.parameter.copy()),a.update(r.content),!a.finish())throw new Error("Symmetric encryption failed.");r.encryptedContent.content=a.output}for(var u=0;u<r.recipients.length;++u){var l=r.recipients[u];if(l.encryptedContent.content===void 0)switch(l.encryptedContent.algorithm){case We.pki.oids.rsaEncryption:l.encryptedContent.content=l.encryptedContent.key.encrypt(r.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+l.encryptedContent.algorithm)}}},"encrypt")},r};function aJ(r){var e={},t=[];if(!ee.validate(r,fs.asn1.recipientInfoValidator,e,t)){var n=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw n.errors=t,n}return{version:e.version.charCodeAt(0),issuer:We.pki.RDNAttributesAsArray(e.issuer),serialNumber:We.util.createBuffer(e.serial).toHex(),encryptedContent:{algorithm:ee.derToOid(e.encAlgorithm),parameter:e.encParameter?e.encParameter.value:void 0,content:e.encKey}}}o(aJ,"_recipientFromAsn1");function oJ(r){return ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,ee.integerToDer(r.version).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[We.pki.distinguishedNameToAsn1({attributes:r.issuer}),ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,We.util.hexToBytes(r.serialNumber))]),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.encryptedContent.algorithm).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.NULL,!1,"")]),ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,r.encryptedContent.content)])}o(oJ,"_recipientToAsn1");function uJ(r){for(var e=[],t=0;t<r.length;++t)e.push(aJ(r[t]));return e}o(uJ,"_recipientsFromAsn1");function lJ(r){for(var e=[],t=0;t<r.length;++t)e.push(oJ(r[t]));return e}o(lJ,"_recipientsToAsn1");function cJ(r){var e=ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,ee.integerToDer(r.version).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[We.pki.distinguishedNameToAsn1({attributes:r.issuer}),ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,We.util.hexToBytes(r.serialNumber))]),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.digestAlgorithm).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.NULL,!1,"")])]);if(r.authenticatedAttributesAsn1&&e.value.push(r.authenticatedAttributesAsn1),e.value.push(ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.signatureAlgorithm).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.NULL,!1,"")])),e.value.push(ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,r.signature)),r.unauthenticatedAttributes.length>0){for(var t=ee.create(ee.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n<r.unauthenticatedAttributes.length;++n){var s=r.unauthenticatedAttributes[n];t.values.push(jx(s))}e.value.push(t)}return e}o(cJ,"_signerToAsn1");function fJ(r){for(var e=[],t=0;t<r.length;++t)e.push(cJ(r[t]));return e}o(fJ,"_signersToAsn1");function jx(r){var e;if(r.type===We.pki.oids.contentType)e=ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.value).getBytes());else if(r.type===We.pki.oids.messageDigest)e=ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,r.value.bytes());else if(r.type===We.pki.oids.signingTime){var t=new Date("1950-01-01T00:00:00Z"),n=new Date("2050-01-01T00:00:00Z"),s=r.value;if(typeof s=="string"){var i=Date.parse(s);isNaN(i)?s.length===13?s=ee.utcTimeToDate(s):s=ee.generalizedTimeToDate(s):s=new Date(i)}s>=t&&s<n?e=ee.create(ee.Class.UNIVERSAL,ee.Type.UTCTIME,!1,ee.dateToUtcTime(s)):e=ee.create(ee.Class.UNIVERSAL,ee.Type.GENERALIZEDTIME,!1,ee.dateToGeneralizedTime(s))}return ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.type).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SET,!0,[e])])}o(jx,"_attributeToAsn1");function hJ(r){return[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(We.pki.oids.data).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.algorithm).getBytes()),r.parameter?ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,r.parameter.getBytes()):void 0]),ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,r.content.getBytes())])]}o(hJ,"_encryptedContentToAsn1");function Fx(r,e,t){var n={},s=[];if(!ee.validate(e,t,n,s)){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 a=ee.derToOid(n.contentType);if(a!==We.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(n.encryptedContent){var u="";if(We.util.isArray(n.encryptedContent))for(var l=0;l<n.encryptedContent.length;++l){if(n.encryptedContent[l].type!==ee.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");u+=n.encryptedContent[l].value}else u=n.encryptedContent;r.encryptedContent={algorithm:ee.derToOid(n.encAlgorithm),parameter:We.util.createBuffer(n.encParameter.value),content:We.util.createBuffer(u)}}if(n.content){var u="";if(We.util.isArray(n.content))for(var l=0;l<n.content.length;++l){if(n.content[l].type!==ee.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");u+=n.content[l].value}else u=n.content;r.content=We.util.createBuffer(u)}return r.version=n.version.charCodeAt(0),r.rawCapture=n,n}o(Fx,"_fromAsn1");function H3(r){if(r.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(r.content===void 0){var e;switch(r.encryptedContent.algorithm){case We.pki.oids["aes128-CBC"]:case We.pki.oids["aes192-CBC"]:case We.pki.oids["aes256-CBC"]:e=We.aes.createDecryptionCipher(r.encryptedContent.key);break;case We.pki.oids.desCBC:case We.pki.oids["des-EDE3-CBC"]:e=We.des.createDecryptionCipher(r.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+r.encryptedContent.algorithm)}if(e.start(r.encryptedContent.parameter),e.update(r.encryptedContent.content),!e.finish())throw new Error("Symmetric decryption failed.");r.content=e.output}}o(H3,"_decryptContent")});var G3=ye((ife,X3)=>{"use strict";var un=$t();vu();qh();Pw();Xh();ur();var rS=X3.exports=un.ssh=un.ssh||{};rS.privateKeyToPutty=function(r,e,t){t=t||"",e=e||"";var n="ssh-rsa",s=e===""?"none":"aes256-cbc",i="PuTTY-User-Key-File-2: "+n+`\r
15
- `;i+="Encryption: "+s+`\r
16
- `,i+="Comment: "+t+`\r
17
- `;var a=un.util.createBuffer();ep(a,n),Ca(a,r.e),Ca(a,r.n);var u=un.util.encode64(a.bytes(),64),l=Math.floor(u.length/66)+1;i+="Public-Lines: "+l+`\r
18
- `,i+=u;var f=un.util.createBuffer();Ca(f,r.d),Ca(f,r.p),Ca(f,r.q),Ca(f,r.qInv);var h;if(!e)h=un.util.encode64(f.bytes(),64);else{var m=f.length()+16-1;m-=m%16;var g=tS(f.bytes());g.truncate(g.length()-m+f.length()),f.putBuffer(g);var w=un.util.createBuffer();w.putBuffer(tS("\0\0\0\0",e)),w.putBuffer(tS("\0\0\0",e));var y=un.aes.createEncryptionCipher(w.truncate(8),"CBC");y.start(un.util.createBuffer().fillWithByte(0,16)),y.update(f.copy()),y.finish();var S=y.output;S.truncate(16),h=un.util.encode64(S.bytes(),64)}l=Math.floor(h.length/66)+1,i+=`\r
19
- Private-Lines: `+l+`\r
20
- `,i+=h;var E=tS("putty-private-key-file-mac-key",e),b=un.util.createBuffer();ep(b,n),ep(b,s),ep(b,t),b.putInt32(a.length()),b.putBuffer(a),b.putInt32(f.length()),b.putBuffer(f);var T=un.hmac.create();return T.start("sha1",E),T.update(b.bytes()),i+=`\r
21
- Private-MAC: `+T.digest().toHex()+`\r
22
- `,i};rS.publicKeyToOpenSSH=function(r,e){var t="ssh-rsa";e=e||"";var n=un.util.createBuffer();return ep(n,t),Ca(n,r.e),Ca(n,r.n),t+" "+un.util.encode64(n.bytes())+" "+e};rS.privateKeyToOpenSSH=function(r,e){return e?un.pki.encryptRsaPrivateKey(r,e,{legacy:!0,algorithm:"aes128"}):un.pki.privateKeyToPem(r)};rS.getPublicKeyFingerprint=function(r,e){e=e||{};var t=e.md||un.md.md5.create(),n="ssh-rsa",s=un.util.createBuffer();ep(s,n),Ca(s,r.e),Ca(s,r.n),t.start(),t.update(s.getBytes());var i=t.digest();if(e.encoding==="hex"){var a=i.toHex();return e.delimiter?a.match(/.{2}/g).join(e.delimiter):a}else{if(e.encoding==="binary")return i.getBytes();if(e.encoding)throw new Error('Unknown encoding "'+e.encoding+'".')}return i};function Ca(r,e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var n=un.util.hexToBytes(t);r.putInt32(n.length),r.putBytes(n)}o(Ca,"_addBigIntegerToBuffer");function ep(r,e){r.putInt32(e.length),r.putString(e)}o(ep,"_addStringToBuffer");function tS(){for(var r=un.md.sha1.create(),e=arguments.length,t=0;t<e;++t)r.update(arguments[t]);return r.digest()}o(tS,"_sha1")});var J3=ye((ofe,W3)=>{"use strict";W3.exports=$t();vu();d3();Fi();Nw();Em();R3();qh();L3();j3();q3();px();Vw();hc();ox();gx();$3();vx();lx();Zb();Kw();ci();rx();G3();bx();ur()});var e4=ye((Efe,Z3)=>{"use strict";var{PassThrough:yJ}=gt("stream");Z3.exports=r=>{r={...r};let{array:e}=r,{encoding:t}=r,n=t==="buffer",s=!1;e?s=!(t||n):t=t||"utf8",n&&(t=null);let i=new yJ({objectMode:s});t&&i.setEncoding(t);let a=0,u=[];return i.on("data",l=>{u.push(l),s?a=u.length:a+=l.length}),i.getBufferedValue=()=>e?u:n?Buffer.concat(u,a):u.join(""),i.getBufferedLength=()=>a,i}});var r4=ye((Cfe,Rm)=>{"use strict";var{constants:vJ}=gt("buffer"),wJ=gt("stream"),{promisify:SJ}=gt("util"),EJ=e4(),AJ=SJ(wJ.pipeline),t4=class extends Error{static{o(this,"MaxBufferError")}constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Kx(r,e){if(!r)throw new Error("Expected a stream");e={maxBuffer:1/0,...e};let{maxBuffer:t}=e,n=EJ(e);return await new Promise((s,i)=>{let a=o(u=>{u&&n.getBufferedLength()<=vJ.MAX_LENGTH&&(u.bufferedData=n.getBufferedValue()),i(u)},"rejectPromise");(async()=>{try{await AJ(r,n),s()}catch(u){a(u)}})(),n.on("data",()=>{n.getBufferedLength()>t&&a(new t4)})}),n.getBufferedValue()}o(Kx,"getStream");Rm.exports=Kx;Rm.exports.buffer=(r,e)=>Kx(r,{...e,encoding:"buffer"});Rm.exports.array=(r,e)=>Kx(r,{...e,array:!0});Rm.exports.MaxBufferError=t4});var go=ye((rp,Pm)=>{"use strict";(function(){var r,e="4.17.21",t=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",i="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",u=500,l="__lodash_placeholder__",f=1,h=2,m=4,g=1,w=2,y=1,S=2,E=4,b=8,T=16,A=32,C=64,x=128,B=256,F=512,R=30,H="...",q=800,K=16,G=1,he=2,le=3,oe=1/0,Z=9007199254740991,fe=17976931348623157e292,Se=NaN,Ke=4294967295,be=Ke-1,we=Ke>>>1,Me=[["ary",x],["bind",y],["bindKey",S],["curry",b],["curryRight",T],["flip",F],["partial",A],["partialRight",C],["rearg",B]],Je="[object Arguments]",Ye="[object Array]",lt="[object AsyncFunction]",O="[object Boolean]",_="[object Date]",ne="[object DOMException]",J="[object Error]",Xe="[object Function]",Re="[object GeneratorFunction]",xe="[object Map]",ct="[object Number]",rr="[object Null]",je="[object Object]",nr="[object Promise]",Ls="[object Proxy]",Ge="[object RegExp]",Ur="[object Set]",on="[object String]",$n="[object Symbol]",ms="[object Undefined]",ns="[object WeakMap]",pt="[object WeakSet]",Ze="[object ArrayBuffer]",Dn="[object DataView]",ss="[object Float32Array]",aa="[object Float64Array]",oa="[object Int8Array]",Rt="[object Int16Array]",yh="[object Int32Array]",vh="[object Uint8Array]",tc="[object Uint8ClampedArray]",Y0="[object Uint16Array]",Vs="[object Uint32Array]",d=/\b__p \+= '';/g,I=/\b(__p \+=) '' \+/g,$=/(__e\(.*?\)|\b__t\)) \+\n'';/g,te=/&(?:amp|lt|gt|quot|#39);/g,ie=/[&<>"']/g,X=RegExp(te.source),nt=RegExp(ie.source),kt=/<%-([\s\S]+?)%>/g,Wt=/<%([\s\S]+?)%>/g,et=/<%=([\s\S]+?)%>/g,Dt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_n=/^\w*$/,ti=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,or=/[\\^$.*+?()[\]{}|]/g,ua=RegExp(or.source),Q0=/^\s+/,bv=/\s/,p2=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,d2=/\{\n\/\* \[wrapped with (.+)\] \*/,m2=/,? & /,g2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,qe=/[()=,{}\[\]\/\s]/,Zt=/\\(\\)?/g,Xn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Oi=/\w*$/,y2=/^[-+]0x[0-9a-f]+$/i,cM=/^0b[01]+$/i,fM=/^\[object .+?Constructor\]$/,hM=/^0o[0-7]+$/i,pM=/^(?:0|[1-9]\d*)$/,dM=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xv=/($^)/,mM=/['\n\r\u2028\u2029\\]/g,Nv="\\ud800-\\udfff",gM="\\u0300-\\u036f",yM="\\ufe20-\\ufe2f",vM="\\u20d0-\\u20ff",lD=gM+yM+vM,cD="\\u2700-\\u27bf",fD="a-z\\xdf-\\xf6\\xf8-\\xff",wM="\\xac\\xb1\\xd7\\xf7",SM="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",EM="\\u2000-\\u206f",AM=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",hD="A-Z\\xc0-\\xd6\\xd8-\\xde",pD="\\ufe0e\\ufe0f",dD=wM+SM+EM+AM,v2="['\u2019]",CM="["+Nv+"]",mD="["+dD+"]",Tv="["+lD+"]",gD="\\d+",bM="["+cD+"]",yD="["+fD+"]",vD="[^"+Nv+dD+gD+cD+fD+hD+"]",w2="\\ud83c[\\udffb-\\udfff]",xM="(?:"+Tv+"|"+w2+")",wD="[^"+Nv+"]",S2="(?:\\ud83c[\\udde6-\\uddff]){2}",E2="[\\ud800-\\udbff][\\udc00-\\udfff]",wh="["+hD+"]",SD="\\u200d",ED="(?:"+yD+"|"+vD+")",NM="(?:"+wh+"|"+vD+")",AD="(?:"+v2+"(?:d|ll|m|re|s|t|ve))?",CD="(?:"+v2+"(?:D|LL|M|RE|S|T|VE))?",bD=xM+"?",xD="["+pD+"]?",TM="(?:"+SD+"(?:"+[wD,S2,E2].join("|")+")"+xD+bD+")*",IM="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",BM="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ND=xD+bD+TM,DM="(?:"+[bM,S2,E2].join("|")+")"+ND,_M="(?:"+[wD+Tv+"?",Tv,S2,E2,CM].join("|")+")",RM=RegExp(v2,"g"),PM=RegExp(Tv,"g"),A2=RegExp(w2+"(?="+w2+")|"+_M+ND,"g"),OM=RegExp([wh+"?"+yD+"+"+AD+"(?="+[mD,wh,"$"].join("|")+")",NM+"+"+CD+"(?="+[mD,wh+ED,"$"].join("|")+")",wh+"?"+ED+"+"+AD,wh+"+"+CD,BM,IM,gD,DM].join("|"),"g"),kM=RegExp("["+SD+Nv+lD+pD+"]"),LM=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,VM=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],UM=-1,kr={};kr[ss]=kr[aa]=kr[oa]=kr[Rt]=kr[yh]=kr[vh]=kr[tc]=kr[Y0]=kr[Vs]=!0,kr[Je]=kr[Ye]=kr[Ze]=kr[O]=kr[Dn]=kr[_]=kr[J]=kr[Xe]=kr[xe]=kr[ct]=kr[je]=kr[Ge]=kr[Ur]=kr[on]=kr[ns]=!1;var Tr={};Tr[Je]=Tr[Ye]=Tr[Ze]=Tr[Dn]=Tr[O]=Tr[_]=Tr[ss]=Tr[aa]=Tr[oa]=Tr[Rt]=Tr[yh]=Tr[xe]=Tr[ct]=Tr[je]=Tr[Ge]=Tr[Ur]=Tr[on]=Tr[$n]=Tr[vh]=Tr[tc]=Tr[Y0]=Tr[Vs]=!0,Tr[J]=Tr[Xe]=Tr[ns]=!1;var MM={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},jM={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},FM={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},qM={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},HM=parseFloat,KM=parseInt,TD=typeof global=="object"&&global&&global.Object===Object&&global,$M=typeof self=="object"&&self&&self.Object===Object&&self,Sn=TD||$M||Function("return this")(),C2=typeof rp=="object"&&rp&&!rp.nodeType&&rp,rc=C2&&typeof Pm=="object"&&Pm&&!Pm.nodeType&&Pm,ID=rc&&rc.exports===C2,b2=ID&&TD.process,ri=(function(){try{var se=rc&&rc.require&&rc.require("util").types;return se||b2&&b2.binding&&b2.binding("util")}catch{}})(),BD=ri&&ri.isArrayBuffer,DD=ri&&ri.isDate,_D=ri&&ri.isMap,RD=ri&&ri.isRegExp,PD=ri&&ri.isSet,OD=ri&&ri.isTypedArray;function Us(se,Ce,ve){switch(ve.length){case 0:return se.call(Ce);case 1:return se.call(Ce,ve[0]);case 2:return se.call(Ce,ve[0],ve[1]);case 3:return se.call(Ce,ve[0],ve[1],ve[2])}return se.apply(Ce,ve)}o(Us,"apply");function XM(se,Ce,ve,ut){for(var Pt=-1,mr=se==null?0:se.length;++Pt<mr;){var dn=se[Pt];Ce(ut,dn,ve(dn),se)}return ut}o(XM,"arrayAggregator");function ni(se,Ce){for(var ve=-1,ut=se==null?0:se.length;++ve<ut&&Ce(se[ve],ve,se)!==!1;);return se}o(ni,"arrayEach");function GM(se,Ce){for(var ve=se==null?0:se.length;ve--&&Ce(se[ve],ve,se)!==!1;);return se}o(GM,"arrayEachRight");function kD(se,Ce){for(var ve=-1,ut=se==null?0:se.length;++ve<ut;)if(!Ce(se[ve],ve,se))return!1;return!0}o(kD,"arrayEvery");function ru(se,Ce){for(var ve=-1,ut=se==null?0:se.length,Pt=0,mr=[];++ve<ut;){var dn=se[ve];Ce(dn,ve,se)&&(mr[Pt++]=dn)}return mr}o(ru,"arrayFilter");function Iv(se,Ce){var ve=se==null?0:se.length;return!!ve&&Sh(se,Ce,0)>-1}o(Iv,"arrayIncludes");function x2(se,Ce,ve){for(var ut=-1,Pt=se==null?0:se.length;++ut<Pt;)if(ve(Ce,se[ut]))return!0;return!1}o(x2,"arrayIncludesWith");function Mr(se,Ce){for(var ve=-1,ut=se==null?0:se.length,Pt=Array(ut);++ve<ut;)Pt[ve]=Ce(se[ve],ve,se);return Pt}o(Mr,"arrayMap");function nu(se,Ce){for(var ve=-1,ut=Ce.length,Pt=se.length;++ve<ut;)se[Pt+ve]=Ce[ve];return se}o(nu,"arrayPush");function N2(se,Ce,ve,ut){var Pt=-1,mr=se==null?0:se.length;for(ut&&mr&&(ve=se[++Pt]);++Pt<mr;)ve=Ce(ve,se[Pt],Pt,se);return ve}o(N2,"arrayReduce");function WM(se,Ce,ve,ut){var Pt=se==null?0:se.length;for(ut&&Pt&&(ve=se[--Pt]);Pt--;)ve=Ce(ve,se[Pt],Pt,se);return ve}o(WM,"arrayReduceRight");function T2(se,Ce){for(var ve=-1,ut=se==null?0:se.length;++ve<ut;)if(Ce(se[ve],ve,se))return!0;return!1}o(T2,"arraySome");var JM=I2("length");function zM(se){return se.split("")}o(zM,"asciiToArray");function YM(se){return se.match(g2)||[]}o(YM,"asciiWords");function LD(se,Ce,ve){var ut;return ve(se,function(Pt,mr,dn){if(Ce(Pt,mr,dn))return ut=mr,!1}),ut}o(LD,"baseFindKey");function Bv(se,Ce,ve,ut){for(var Pt=se.length,mr=ve+(ut?1:-1);ut?mr--:++mr<Pt;)if(Ce(se[mr],mr,se))return mr;return-1}o(Bv,"baseFindIndex");function Sh(se,Ce,ve){return Ce===Ce?lj(se,Ce,ve):Bv(se,VD,ve)}o(Sh,"baseIndexOf");function QM(se,Ce,ve,ut){for(var Pt=ve-1,mr=se.length;++Pt<mr;)if(ut(se[Pt],Ce))return Pt;return-1}o(QM,"baseIndexOfWith");function VD(se){return se!==se}o(VD,"baseIsNaN");function UD(se,Ce){var ve=se==null?0:se.length;return ve?D2(se,Ce)/ve:Se}o(UD,"baseMean");function I2(se){return function(Ce){return Ce==null?r:Ce[se]}}o(I2,"baseProperty");function B2(se){return function(Ce){return se==null?r:se[Ce]}}o(B2,"basePropertyOf");function MD(se,Ce,ve,ut,Pt){return Pt(se,function(mr,dn,Cr){ve=ut?(ut=!1,mr):Ce(ve,mr,dn,Cr)}),ve}o(MD,"baseReduce");function ZM(se,Ce){var ve=se.length;for(se.sort(Ce);ve--;)se[ve]=se[ve].value;return se}o(ZM,"baseSortBy");function D2(se,Ce){for(var ve,ut=-1,Pt=se.length;++ut<Pt;){var mr=Ce(se[ut]);mr!==r&&(ve=ve===r?mr:ve+mr)}return ve}o(D2,"baseSum");function _2(se,Ce){for(var ve=-1,ut=Array(se);++ve<se;)ut[ve]=Ce(ve);return ut}o(_2,"baseTimes");function ej(se,Ce){return Mr(Ce,function(ve){return[ve,se[ve]]})}o(ej,"baseToPairs");function jD(se){return se&&se.slice(0,KD(se)+1).replace(Q0,"")}o(jD,"baseTrim");function Ms(se){return function(Ce){return se(Ce)}}o(Ms,"baseUnary");function R2(se,Ce){return Mr(Ce,function(ve){return se[ve]})}o(R2,"baseValues");function Z0(se,Ce){return se.has(Ce)}o(Z0,"cacheHas");function FD(se,Ce){for(var ve=-1,ut=se.length;++ve<ut&&Sh(Ce,se[ve],0)>-1;);return ve}o(FD,"charsStartIndex");function qD(se,Ce){for(var ve=se.length;ve--&&Sh(Ce,se[ve],0)>-1;);return ve}o(qD,"charsEndIndex");function tj(se,Ce){for(var ve=se.length,ut=0;ve--;)se[ve]===Ce&&++ut;return ut}o(tj,"countHolders");var rj=B2(MM),nj=B2(jM);function sj(se){return"\\"+qM[se]}o(sj,"escapeStringChar");function ij(se,Ce){return se==null?r:se[Ce]}o(ij,"getValue");function Eh(se){return kM.test(se)}o(Eh,"hasUnicode");function aj(se){return LM.test(se)}o(aj,"hasUnicodeWord");function oj(se){for(var Ce,ve=[];!(Ce=se.next()).done;)ve.push(Ce.value);return ve}o(oj,"iteratorToArray");function P2(se){var Ce=-1,ve=Array(se.size);return se.forEach(function(ut,Pt){ve[++Ce]=[Pt,ut]}),ve}o(P2,"mapToArray");function HD(se,Ce){return function(ve){return se(Ce(ve))}}o(HD,"overArg");function su(se,Ce){for(var ve=-1,ut=se.length,Pt=0,mr=[];++ve<ut;){var dn=se[ve];(dn===Ce||dn===l)&&(se[ve]=l,mr[Pt++]=ve)}return mr}o(su,"replaceHolders");function Dv(se){var Ce=-1,ve=Array(se.size);return se.forEach(function(ut){ve[++Ce]=ut}),ve}o(Dv,"setToArray");function uj(se){var Ce=-1,ve=Array(se.size);return se.forEach(function(ut){ve[++Ce]=[ut,ut]}),ve}o(uj,"setToPairs");function lj(se,Ce,ve){for(var ut=ve-1,Pt=se.length;++ut<Pt;)if(se[ut]===Ce)return ut;return-1}o(lj,"strictIndexOf");function cj(se,Ce,ve){for(var ut=ve+1;ut--;)if(se[ut]===Ce)return ut;return ut}o(cj,"strictLastIndexOf");function Ah(se){return Eh(se)?hj(se):JM(se)}o(Ah,"stringSize");function ki(se){return Eh(se)?pj(se):zM(se)}o(ki,"stringToArray");function KD(se){for(var Ce=se.length;Ce--&&bv.test(se.charAt(Ce)););return Ce}o(KD,"trimmedEndIndex");var fj=B2(FM);function hj(se){for(var Ce=A2.lastIndex=0;A2.test(se);)++Ce;return Ce}o(hj,"unicodeSize");function pj(se){return se.match(A2)||[]}o(pj,"unicodeToArray");function dj(se){return se.match(OM)||[]}o(dj,"unicodeWords");var mj=o(function se(Ce){Ce=Ce==null?Sn:iu.defaults(Sn.Object(),Ce,iu.pick(Sn,VM));var ve=Ce.Array,ut=Ce.Date,Pt=Ce.Error,mr=Ce.Function,dn=Ce.Math,Cr=Ce.Object,O2=Ce.RegExp,gj=Ce.String,si=Ce.TypeError,_v=ve.prototype,yj=mr.prototype,Ch=Cr.prototype,Rv=Ce["__core-js_shared__"],Pv=yj.toString,wr=Ch.hasOwnProperty,vj=0,$D=(function(){var c=/[^.]+$/.exec(Rv&&Rv.keys&&Rv.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""})(),Ov=Ch.toString,wj=Pv.call(Cr),Sj=Sn._,Ej=O2("^"+Pv.call(wr).replace(or,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kv=ID?Ce.Buffer:r,au=Ce.Symbol,Lv=Ce.Uint8Array,XD=kv?kv.allocUnsafe:r,Vv=HD(Cr.getPrototypeOf,Cr),GD=Cr.create,WD=Ch.propertyIsEnumerable,Uv=_v.splice,JD=au?au.isConcatSpreadable:r,em=au?au.iterator:r,nc=au?au.toStringTag:r,Mv=(function(){try{var c=uc(Cr,"defineProperty");return c({},"",{}),c}catch{}})(),Aj=Ce.clearTimeout!==Sn.clearTimeout&&Ce.clearTimeout,Cj=ut&&ut.now!==Sn.Date.now&&ut.now,bj=Ce.setTimeout!==Sn.setTimeout&&Ce.setTimeout,jv=dn.ceil,Fv=dn.floor,k2=Cr.getOwnPropertySymbols,xj=kv?kv.isBuffer:r,zD=Ce.isFinite,Nj=_v.join,Tj=HD(Cr.keys,Cr),mn=dn.max,Gn=dn.min,Ij=ut.now,Bj=Ce.parseInt,YD=dn.random,Dj=_v.reverse,L2=uc(Ce,"DataView"),tm=uc(Ce,"Map"),V2=uc(Ce,"Promise"),bh=uc(Ce,"Set"),rm=uc(Ce,"WeakMap"),nm=uc(Cr,"create"),qv=rm&&new rm,xh={},_j=lc(L2),Rj=lc(tm),Pj=lc(V2),Oj=lc(bh),kj=lc(rm),Hv=au?au.prototype:r,sm=Hv?Hv.valueOf:r,QD=Hv?Hv.toString:r;function M(c){if(Wr(c)&&!Lt(c)&&!(c instanceof er)){if(c instanceof ii)return c;if(wr.call(c,"__wrapped__"))return Z_(c)}return new ii(c)}o(M,"lodash");var Nh=(function(){function c(){}return o(c,"object"),function(p){if(!qr(p))return{};if(GD)return GD(p);c.prototype=p;var v=new c;return c.prototype=r,v}})();function Kv(){}o(Kv,"baseLodash");function ii(c,p){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=r}o(ii,"LodashWrapper"),M.templateSettings={escape:kt,evaluate:Wt,interpolate:et,variable:"",imports:{_:M}},M.prototype=Kv.prototype,M.prototype.constructor=M,ii.prototype=Nh(Kv.prototype),ii.prototype.constructor=ii;function er(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ke,this.__views__=[]}o(er,"LazyWrapper");function Lj(){var c=new er(this.__wrapped__);return c.__actions__=gs(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=gs(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=gs(this.__views__),c}o(Lj,"lazyClone");function Vj(){if(this.__filtered__){var c=new er(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}o(Vj,"lazyReverse");function Uj(){var c=this.__wrapped__.value(),p=this.__dir__,v=Lt(c),N=p<0,P=v?c.length:0,j=zF(0,P,this.__views__),z=j.start,Q=j.end,ue=Q-z,Ne=N?Q:z-1,De=this.__iteratees__,Le=De.length,ze=0,ht=Gn(ue,this.__takeCount__);if(!v||!N&&P==ue&&ht==ue)return A_(c,this.__actions__);var bt=[];e:for(;ue--&&ze<ht;){Ne+=p;for(var Kt=-1,xt=c[Ne];++Kt<Le;){var Jt=De[Kt],sr=Jt.iteratee,qs=Jt.type,os=sr(xt);if(qs==he)xt=os;else if(!os){if(qs==G)continue e;break e}}bt[ze++]=xt}return bt}o(Uj,"lazyValue"),er.prototype=Nh(Kv.prototype),er.prototype.constructor=er;function sc(c){var p=-1,v=c==null?0:c.length;for(this.clear();++p<v;){var N=c[p];this.set(N[0],N[1])}}o(sc,"Hash");function Mj(){this.__data__=nm?nm(null):{},this.size=0}o(Mj,"hashClear");function jj(c){var p=this.has(c)&&delete this.__data__[c];return this.size-=p?1:0,p}o(jj,"hashDelete");function Fj(c){var p=this.__data__;if(nm){var v=p[c];return v===a?r:v}return wr.call(p,c)?p[c]:r}o(Fj,"hashGet");function qj(c){var p=this.__data__;return nm?p[c]!==r:wr.call(p,c)}o(qj,"hashHas");function Hj(c,p){var v=this.__data__;return this.size+=this.has(c)?0:1,v[c]=nm&&p===r?a:p,this}o(Hj,"hashSet"),sc.prototype.clear=Mj,sc.prototype.delete=jj,sc.prototype.get=Fj,sc.prototype.has=qj,sc.prototype.set=Hj;function eo(c){var p=-1,v=c==null?0:c.length;for(this.clear();++p<v;){var N=c[p];this.set(N[0],N[1])}}o(eo,"ListCache");function Kj(){this.__data__=[],this.size=0}o(Kj,"listCacheClear");function $j(c){var p=this.__data__,v=$v(p,c);if(v<0)return!1;var N=p.length-1;return v==N?p.pop():Uv.call(p,v,1),--this.size,!0}o($j,"listCacheDelete");function Xj(c){var p=this.__data__,v=$v(p,c);return v<0?r:p[v][1]}o(Xj,"listCacheGet");function Gj(c){return $v(this.__data__,c)>-1}o(Gj,"listCacheHas");function Wj(c,p){var v=this.__data__,N=$v(v,c);return N<0?(++this.size,v.push([c,p])):v[N][1]=p,this}o(Wj,"listCacheSet"),eo.prototype.clear=Kj,eo.prototype.delete=$j,eo.prototype.get=Xj,eo.prototype.has=Gj,eo.prototype.set=Wj;function to(c){var p=-1,v=c==null?0:c.length;for(this.clear();++p<v;){var N=c[p];this.set(N[0],N[1])}}o(to,"MapCache");function Jj(){this.size=0,this.__data__={hash:new sc,map:new(tm||eo),string:new sc}}o(Jj,"mapCacheClear");function zj(c){var p=nw(this,c).delete(c);return this.size-=p?1:0,p}o(zj,"mapCacheDelete");function Yj(c){return nw(this,c).get(c)}o(Yj,"mapCacheGet");function Qj(c){return nw(this,c).has(c)}o(Qj,"mapCacheHas");function Zj(c,p){var v=nw(this,c),N=v.size;return v.set(c,p),this.size+=v.size==N?0:1,this}o(Zj,"mapCacheSet"),to.prototype.clear=Jj,to.prototype.delete=zj,to.prototype.get=Yj,to.prototype.has=Qj,to.prototype.set=Zj;function ic(c){var p=-1,v=c==null?0:c.length;for(this.__data__=new to;++p<v;)this.add(c[p])}o(ic,"SetCache");function eF(c){return this.__data__.set(c,a),this}o(eF,"setCacheAdd");function tF(c){return this.__data__.has(c)}o(tF,"setCacheHas"),ic.prototype.add=ic.prototype.push=eF,ic.prototype.has=tF;function Li(c){var p=this.__data__=new eo(c);this.size=p.size}o(Li,"Stack");function rF(){this.__data__=new eo,this.size=0}o(rF,"stackClear");function nF(c){var p=this.__data__,v=p.delete(c);return this.size=p.size,v}o(nF,"stackDelete");function sF(c){return this.__data__.get(c)}o(sF,"stackGet");function iF(c){return this.__data__.has(c)}o(iF,"stackHas");function aF(c,p){var v=this.__data__;if(v instanceof eo){var N=v.__data__;if(!tm||N.length<t-1)return N.push([c,p]),this.size=++v.size,this;v=this.__data__=new to(N)}return v.set(c,p),this.size=v.size,this}o(aF,"stackSet"),Li.prototype.clear=rF,Li.prototype.delete=nF,Li.prototype.get=sF,Li.prototype.has=iF,Li.prototype.set=aF;function ZD(c,p){var v=Lt(c),N=!v&&cc(c),P=!v&&!N&&fu(c),j=!v&&!N&&!P&&Dh(c),z=v||N||P||j,Q=z?_2(c.length,gj):[],ue=Q.length;for(var Ne in c)(p||wr.call(c,Ne))&&!(z&&(Ne=="length"||P&&(Ne=="offset"||Ne=="parent")||j&&(Ne=="buffer"||Ne=="byteLength"||Ne=="byteOffset")||io(Ne,ue)))&&Q.push(Ne);return Q}o(ZD,"arrayLikeKeys");function e_(c){var p=c.length;return p?c[W2(0,p-1)]:r}o(e_,"arraySample");function oF(c,p){return sw(gs(c),ac(p,0,c.length))}o(oF,"arraySampleSize");function uF(c){return sw(gs(c))}o(uF,"arrayShuffle");function U2(c,p,v){(v!==r&&!Vi(c[p],v)||v===r&&!(p in c))&&ro(c,p,v)}o(U2,"assignMergeValue");function im(c,p,v){var N=c[p];(!(wr.call(c,p)&&Vi(N,v))||v===r&&!(p in c))&&ro(c,p,v)}o(im,"assignValue");function $v(c,p){for(var v=c.length;v--;)if(Vi(c[v][0],p))return v;return-1}o($v,"assocIndexOf");function lF(c,p,v,N){return ou(c,function(P,j,z){p(N,P,v(P),z)}),N}o(lF,"baseAggregator");function t_(c,p){return c&&ca(p,En(p),c)}o(t_,"baseAssign");function cF(c,p){return c&&ca(p,vs(p),c)}o(cF,"baseAssignIn");function ro(c,p,v){p=="__proto__"&&Mv?Mv(c,p,{configurable:!0,enumerable:!0,value:v,writable:!0}):c[p]=v}o(ro,"baseAssignValue");function M2(c,p){for(var v=-1,N=p.length,P=ve(N),j=c==null;++v<N;)P[v]=j?r:wb(c,p[v]);return P}o(M2,"baseAt");function ac(c,p,v){return c===c&&(v!==r&&(c=c<=v?c:v),p!==r&&(c=c>=p?c:p)),c}o(ac,"baseClamp");function ai(c,p,v,N,P,j){var z,Q=p&f,ue=p&h,Ne=p&m;if(v&&(z=P?v(c,N,P,j):v(c)),z!==r)return z;if(!qr(c))return c;var De=Lt(c);if(De){if(z=QF(c),!Q)return gs(c,z)}else{var Le=Wn(c),ze=Le==Xe||Le==Re;if(fu(c))return x_(c,Q);if(Le==je||Le==Je||ze&&!P){if(z=ue||ze?{}:K_(c),!Q)return ue?FF(c,cF(z,c)):jF(c,t_(z,c))}else{if(!Tr[Le])return P?c:{};z=ZF(c,Le,Q)}}j||(j=new Li);var ht=j.get(c);if(ht)return ht;j.set(c,z),wR(c)?c.forEach(function(xt){z.add(ai(xt,p,v,xt,c,j))}):yR(c)&&c.forEach(function(xt,Jt){z.set(Jt,ai(xt,p,v,Jt,c,j))});var bt=Ne?ue?ib:sb:ue?vs:En,Kt=De?r:bt(c);return ni(Kt||c,function(xt,Jt){Kt&&(Jt=xt,xt=c[Jt]),im(z,Jt,ai(xt,p,v,Jt,c,j))}),z}o(ai,"baseClone");function fF(c){var p=En(c);return function(v){return r_(v,c,p)}}o(fF,"baseConforms");function r_(c,p,v){var N=v.length;if(c==null)return!N;for(c=Cr(c);N--;){var P=v[N],j=p[P],z=c[P];if(z===r&&!(P in c)||!j(z))return!1}return!0}o(r_,"baseConformsTo");function n_(c,p,v){if(typeof c!="function")throw new si(s);return hm(function(){c.apply(r,v)},p)}o(n_,"baseDelay");function am(c,p,v,N){var P=-1,j=Iv,z=!0,Q=c.length,ue=[],Ne=p.length;if(!Q)return ue;v&&(p=Mr(p,Ms(v))),N?(j=x2,z=!1):p.length>=t&&(j=Z0,z=!1,p=new ic(p));e:for(;++P<Q;){var De=c[P],Le=v==null?De:v(De);if(De=N||De!==0?De:0,z&&Le===Le){for(var ze=Ne;ze--;)if(p[ze]===Le)continue e;ue.push(De)}else j(p,Le,N)||ue.push(De)}return ue}o(am,"baseDifference");var ou=D_(la),s_=D_(F2,!0);function hF(c,p){var v=!0;return ou(c,function(N,P,j){return v=!!p(N,P,j),v}),v}o(hF,"baseEvery");function Xv(c,p,v){for(var N=-1,P=c.length;++N<P;){var j=c[N],z=p(j);if(z!=null&&(Q===r?z===z&&!Fs(z):v(z,Q)))var Q=z,ue=j}return ue}o(Xv,"baseExtremum");function pF(c,p,v,N){var P=c.length;for(v=jt(v),v<0&&(v=-v>P?0:P+v),N=N===r||N>P?P:jt(N),N<0&&(N+=P),N=v>N?0:ER(N);v<N;)c[v++]=p;return c}o(pF,"baseFill");function i_(c,p){var v=[];return ou(c,function(N,P,j){p(N,P,j)&&v.push(N)}),v}o(i_,"baseFilter");function Rn(c,p,v,N,P){var j=-1,z=c.length;for(v||(v=t9),P||(P=[]);++j<z;){var Q=c[j];p>0&&v(Q)?p>1?Rn(Q,p-1,v,N,P):nu(P,Q):N||(P[P.length]=Q)}return P}o(Rn,"baseFlatten");var j2=__(),a_=__(!0);function la(c,p){return c&&j2(c,p,En)}o(la,"baseForOwn");function F2(c,p){return c&&a_(c,p,En)}o(F2,"baseForOwnRight");function Gv(c,p){return ru(p,function(v){return ao(c[v])})}o(Gv,"baseFunctions");function oc(c,p){p=lu(p,c);for(var v=0,N=p.length;c!=null&&v<N;)c=c[fa(p[v++])];return v&&v==N?c:r}o(oc,"baseGet");function o_(c,p,v){var N=p(c);return Lt(c)?N:nu(N,v(c))}o(o_,"baseGetAllKeys");function is(c){return c==null?c===r?ms:rr:nc&&nc in Cr(c)?JF(c):u9(c)}o(is,"baseGetTag");function q2(c,p){return c>p}o(q2,"baseGt");function dF(c,p){return c!=null&&wr.call(c,p)}o(dF,"baseHas");function mF(c,p){return c!=null&&p in Cr(c)}o(mF,"baseHasIn");function gF(c,p,v){return c>=Gn(p,v)&&c<mn(p,v)}o(gF,"baseInRange");function H2(c,p,v){for(var N=v?x2:Iv,P=c[0].length,j=c.length,z=j,Q=ve(j),ue=1/0,Ne=[];z--;){var De=c[z];z&&p&&(De=Mr(De,Ms(p))),ue=Gn(De.length,ue),Q[z]=!v&&(p||P>=120&&De.length>=120)?new ic(z&&De):r}De=c[0];var Le=-1,ze=Q[0];e:for(;++Le<P&&Ne.length<ue;){var ht=De[Le],bt=p?p(ht):ht;if(ht=v||ht!==0?ht:0,!(ze?Z0(ze,bt):N(Ne,bt,v))){for(z=j;--z;){var Kt=Q[z];if(!(Kt?Z0(Kt,bt):N(c[z],bt,v)))continue e}ze&&ze.push(bt),Ne.push(ht)}}return Ne}o(H2,"baseIntersection");function yF(c,p,v,N){return la(c,function(P,j,z){p(N,v(P),j,z)}),N}o(yF,"baseInverter");function om(c,p,v){p=lu(p,c),c=W_(c,p);var N=c==null?c:c[fa(ui(p))];return N==null?r:Us(N,c,v)}o(om,"baseInvoke");function u_(c){return Wr(c)&&is(c)==Je}o(u_,"baseIsArguments");function vF(c){return Wr(c)&&is(c)==Ze}o(vF,"baseIsArrayBuffer");function wF(c){return Wr(c)&&is(c)==_}o(wF,"baseIsDate");function um(c,p,v,N,P){return c===p?!0:c==null||p==null||!Wr(c)&&!Wr(p)?c!==c&&p!==p:SF(c,p,v,N,um,P)}o(um,"baseIsEqual");function SF(c,p,v,N,P,j){var z=Lt(c),Q=Lt(p),ue=z?Ye:Wn(c),Ne=Q?Ye:Wn(p);ue=ue==Je?je:ue,Ne=Ne==Je?je:Ne;var De=ue==je,Le=Ne==je,ze=ue==Ne;if(ze&&fu(c)){if(!fu(p))return!1;z=!0,De=!1}if(ze&&!De)return j||(j=new Li),z||Dh(c)?F_(c,p,v,N,P,j):GF(c,p,ue,v,N,P,j);if(!(v&g)){var ht=De&&wr.call(c,"__wrapped__"),bt=Le&&wr.call(p,"__wrapped__");if(ht||bt){var Kt=ht?c.value():c,xt=bt?p.value():p;return j||(j=new Li),P(Kt,xt,v,N,j)}}return ze?(j||(j=new Li),WF(c,p,v,N,P,j)):!1}o(SF,"baseIsEqualDeep");function EF(c){return Wr(c)&&Wn(c)==xe}o(EF,"baseIsMap");function K2(c,p,v,N){var P=v.length,j=P,z=!N;if(c==null)return!j;for(c=Cr(c);P--;){var Q=v[P];if(z&&Q[2]?Q[1]!==c[Q[0]]:!(Q[0]in c))return!1}for(;++P<j;){Q=v[P];var ue=Q[0],Ne=c[ue],De=Q[1];if(z&&Q[2]){if(Ne===r&&!(ue in c))return!1}else{var Le=new Li;if(N)var ze=N(Ne,De,ue,c,p,Le);if(!(ze===r?um(De,Ne,g|w,N,Le):ze))return!1}}return!0}o(K2,"baseIsMatch");function l_(c){if(!qr(c)||n9(c))return!1;var p=ao(c)?Ej:fM;return p.test(lc(c))}o(l_,"baseIsNative");function AF(c){return Wr(c)&&is(c)==Ge}o(AF,"baseIsRegExp");function CF(c){return Wr(c)&&Wn(c)==Ur}o(CF,"baseIsSet");function bF(c){return Wr(c)&&cw(c.length)&&!!kr[is(c)]}o(bF,"baseIsTypedArray");function c_(c){return typeof c=="function"?c:c==null?ws:typeof c=="object"?Lt(c)?p_(c[0],c[1]):h_(c):RR(c)}o(c_,"baseIteratee");function $2(c){if(!fm(c))return Tj(c);var p=[];for(var v in Cr(c))wr.call(c,v)&&v!="constructor"&&p.push(v);return p}o($2,"baseKeys");function xF(c){if(!qr(c))return o9(c);var p=fm(c),v=[];for(var N in c)N=="constructor"&&(p||!wr.call(c,N))||v.push(N);return v}o(xF,"baseKeysIn");function X2(c,p){return c<p}o(X2,"baseLt");function f_(c,p){var v=-1,N=ys(c)?ve(c.length):[];return ou(c,function(P,j,z){N[++v]=p(P,j,z)}),N}o(f_,"baseMap");function h_(c){var p=ob(c);return p.length==1&&p[0][2]?X_(p[0][0],p[0][1]):function(v){return v===c||K2(v,c,p)}}o(h_,"baseMatches");function p_(c,p){return lb(c)&&$_(p)?X_(fa(c),p):function(v){var N=wb(v,c);return N===r&&N===p?Sb(v,c):um(p,N,g|w)}}o(p_,"baseMatchesProperty");function Wv(c,p,v,N,P){c!==p&&j2(p,function(j,z){if(P||(P=new Li),qr(j))NF(c,p,z,v,Wv,N,P);else{var Q=N?N(fb(c,z),j,z+"",c,p,P):r;Q===r&&(Q=j),U2(c,z,Q)}},vs)}o(Wv,"baseMerge");function NF(c,p,v,N,P,j,z){var Q=fb(c,v),ue=fb(p,v),Ne=z.get(ue);if(Ne){U2(c,v,Ne);return}var De=j?j(Q,ue,v+"",c,p,z):r,Le=De===r;if(Le){var ze=Lt(ue),ht=!ze&&fu(ue),bt=!ze&&!ht&&Dh(ue);De=ue,ze||ht||bt?Lt(Q)?De=Q:en(Q)?De=gs(Q):ht?(Le=!1,De=x_(ue,!0)):bt?(Le=!1,De=N_(ue,!0)):De=[]:pm(ue)||cc(ue)?(De=Q,cc(Q)?De=AR(Q):(!qr(Q)||ao(Q))&&(De=K_(ue))):Le=!1}Le&&(z.set(ue,De),P(De,ue,N,j,z),z.delete(ue)),U2(c,v,De)}o(NF,"baseMergeDeep");function d_(c,p){var v=c.length;if(v)return p+=p<0?v:0,io(p,v)?c[p]:r}o(d_,"baseNth");function m_(c,p,v){p.length?p=Mr(p,function(j){return Lt(j)?function(z){return oc(z,j.length===1?j[0]:j)}:j}):p=[ws];var N=-1;p=Mr(p,Ms(Et()));var P=f_(c,function(j,z,Q){var ue=Mr(p,function(Ne){return Ne(j)});return{criteria:ue,index:++N,value:j}});return ZM(P,function(j,z){return MF(j,z,v)})}o(m_,"baseOrderBy");function TF(c,p){return g_(c,p,function(v,N){return Sb(c,N)})}o(TF,"basePick");function g_(c,p,v){for(var N=-1,P=p.length,j={};++N<P;){var z=p[N],Q=oc(c,z);v(Q,z)&&lm(j,lu(z,c),Q)}return j}o(g_,"basePickBy");function IF(c){return function(p){return oc(p,c)}}o(IF,"basePropertyDeep");function G2(c,p,v,N){var P=N?QM:Sh,j=-1,z=p.length,Q=c;for(c===p&&(p=gs(p)),v&&(Q=Mr(c,Ms(v)));++j<z;)for(var ue=0,Ne=p[j],De=v?v(Ne):Ne;(ue=P(Q,De,ue,N))>-1;)Q!==c&&Uv.call(Q,ue,1),Uv.call(c,ue,1);return c}o(G2,"basePullAll");function y_(c,p){for(var v=c?p.length:0,N=v-1;v--;){var P=p[v];if(v==N||P!==j){var j=P;io(P)?Uv.call(c,P,1):Y2(c,P)}}return c}o(y_,"basePullAt");function W2(c,p){return c+Fv(YD()*(p-c+1))}o(W2,"baseRandom");function BF(c,p,v,N){for(var P=-1,j=mn(jv((p-c)/(v||1)),0),z=ve(j);j--;)z[N?j:++P]=c,c+=v;return z}o(BF,"baseRange");function J2(c,p){var v="";if(!c||p<1||p>Z)return v;do p%2&&(v+=c),p=Fv(p/2),p&&(c+=c);while(p);return v}o(J2,"baseRepeat");function Gt(c,p){return hb(G_(c,p,ws),c+"")}o(Gt,"baseRest");function DF(c){return e_(_h(c))}o(DF,"baseSample");function _F(c,p){var v=_h(c);return sw(v,ac(p,0,v.length))}o(_F,"baseSampleSize");function lm(c,p,v,N){if(!qr(c))return c;p=lu(p,c);for(var P=-1,j=p.length,z=j-1,Q=c;Q!=null&&++P<j;){var ue=fa(p[P]),Ne=v;if(ue==="__proto__"||ue==="constructor"||ue==="prototype")return c;if(P!=z){var De=Q[ue];Ne=N?N(De,ue,Q):r,Ne===r&&(Ne=qr(De)?De:io(p[P+1])?[]:{})}im(Q,ue,Ne),Q=Q[ue]}return c}o(lm,"baseSet");var v_=qv?function(c,p){return qv.set(c,p),c}:ws,RF=Mv?function(c,p){return Mv(c,"toString",{configurable:!0,enumerable:!1,value:Ab(p),writable:!0})}:ws;function PF(c){return sw(_h(c))}o(PF,"baseShuffle");function oi(c,p,v){var N=-1,P=c.length;p<0&&(p=-p>P?0:P+p),v=v>P?P:v,v<0&&(v+=P),P=p>v?0:v-p>>>0,p>>>=0;for(var j=ve(P);++N<P;)j[N]=c[N+p];return j}o(oi,"baseSlice");function OF(c,p){var v;return ou(c,function(N,P,j){return v=p(N,P,j),!v}),!!v}o(OF,"baseSome");function Jv(c,p,v){var N=0,P=c==null?N:c.length;if(typeof p=="number"&&p===p&&P<=we){for(;N<P;){var j=N+P>>>1,z=c[j];z!==null&&!Fs(z)&&(v?z<=p:z<p)?N=j+1:P=j}return P}return z2(c,p,ws,v)}o(Jv,"baseSortedIndex");function z2(c,p,v,N){var P=0,j=c==null?0:c.length;if(j===0)return 0;p=v(p);for(var z=p!==p,Q=p===null,ue=Fs(p),Ne=p===r;P<j;){var De=Fv((P+j)/2),Le=v(c[De]),ze=Le!==r,ht=Le===null,bt=Le===Le,Kt=Fs(Le);if(z)var xt=N||bt;else Ne?xt=bt&&(N||ze):Q?xt=bt&&ze&&(N||!ht):ue?xt=bt&&ze&&!ht&&(N||!Kt):ht||Kt?xt=!1:xt=N?Le<=p:Le<p;xt?P=De+1:j=De}return Gn(j,be)}o(z2,"baseSortedIndexBy");function w_(c,p){for(var v=-1,N=c.length,P=0,j=[];++v<N;){var z=c[v],Q=p?p(z):z;if(!v||!Vi(Q,ue)){var ue=Q;j[P++]=z===0?0:z}}return j}o(w_,"baseSortedUniq");function S_(c){return typeof c=="number"?c:Fs(c)?Se:+c}o(S_,"baseToNumber");function js(c){if(typeof c=="string")return c;if(Lt(c))return Mr(c,js)+"";if(Fs(c))return QD?QD.call(c):"";var p=c+"";return p=="0"&&1/c==-oe?"-0":p}o(js,"baseToString");function uu(c,p,v){var N=-1,P=Iv,j=c.length,z=!0,Q=[],ue=Q;if(v)z=!1,P=x2;else if(j>=t){var Ne=p?null:$F(c);if(Ne)return Dv(Ne);z=!1,P=Z0,ue=new ic}else ue=p?[]:Q;e:for(;++N<j;){var De=c[N],Le=p?p(De):De;if(De=v||De!==0?De:0,z&&Le===Le){for(var ze=ue.length;ze--;)if(ue[ze]===Le)continue e;p&&ue.push(Le),Q.push(De)}else P(ue,Le,v)||(ue!==Q&&ue.push(Le),Q.push(De))}return Q}o(uu,"baseUniq");function Y2(c,p){return p=lu(p,c),c=W_(c,p),c==null||delete c[fa(ui(p))]}o(Y2,"baseUnset");function E_(c,p,v,N){return lm(c,p,v(oc(c,p)),N)}o(E_,"baseUpdate");function zv(c,p,v,N){for(var P=c.length,j=N?P:-1;(N?j--:++j<P)&&p(c[j],j,c););return v?oi(c,N?0:j,N?j+1:P):oi(c,N?j+1:0,N?P:j)}o(zv,"baseWhile");function A_(c,p){var v=c;return v instanceof er&&(v=v.value()),N2(p,function(N,P){return P.func.apply(P.thisArg,nu([N],P.args))},v)}o(A_,"baseWrapperValue");function Q2(c,p,v){var N=c.length;if(N<2)return N?uu(c[0]):[];for(var P=-1,j=ve(N);++P<N;)for(var z=c[P],Q=-1;++Q<N;)Q!=P&&(j[P]=am(j[P]||z,c[Q],p,v));return uu(Rn(j,1),p,v)}o(Q2,"baseXor");function C_(c,p,v){for(var N=-1,P=c.length,j=p.length,z={};++N<P;){var Q=N<j?p[N]:r;v(z,c[N],Q)}return z}o(C_,"baseZipObject");function Z2(c){return en(c)?c:[]}o(Z2,"castArrayLikeObject");function eb(c){return typeof c=="function"?c:ws}o(eb,"castFunction");function lu(c,p){return Lt(c)?c:lb(c,p)?[c]:Q_(gr(c))}o(lu,"castPath");var kF=Gt;function cu(c,p,v){var N=c.length;return v=v===r?N:v,!p&&v>=N?c:oi(c,p,v)}o(cu,"castSlice");var b_=Aj||function(c){return Sn.clearTimeout(c)};function x_(c,p){if(p)return c.slice();var v=c.length,N=XD?XD(v):new c.constructor(v);return c.copy(N),N}o(x_,"cloneBuffer");function tb(c){var p=new c.constructor(c.byteLength);return new Lv(p).set(new Lv(c)),p}o(tb,"cloneArrayBuffer");function LF(c,p){var v=p?tb(c.buffer):c.buffer;return new c.constructor(v,c.byteOffset,c.byteLength)}o(LF,"cloneDataView");function VF(c){var p=new c.constructor(c.source,Oi.exec(c));return p.lastIndex=c.lastIndex,p}o(VF,"cloneRegExp");function UF(c){return sm?Cr(sm.call(c)):{}}o(UF,"cloneSymbol");function N_(c,p){var v=p?tb(c.buffer):c.buffer;return new c.constructor(v,c.byteOffset,c.length)}o(N_,"cloneTypedArray");function T_(c,p){if(c!==p){var v=c!==r,N=c===null,P=c===c,j=Fs(c),z=p!==r,Q=p===null,ue=p===p,Ne=Fs(p);if(!Q&&!Ne&&!j&&c>p||j&&z&&ue&&!Q&&!Ne||N&&z&&ue||!v&&ue||!P)return 1;if(!N&&!j&&!Ne&&c<p||Ne&&v&&P&&!N&&!j||Q&&v&&P||!z&&P||!ue)return-1}return 0}o(T_,"compareAscending");function MF(c,p,v){for(var N=-1,P=c.criteria,j=p.criteria,z=P.length,Q=v.length;++N<z;){var ue=T_(P[N],j[N]);if(ue){if(N>=Q)return ue;var Ne=v[N];return ue*(Ne=="desc"?-1:1)}}return c.index-p.index}o(MF,"compareMultiple");function I_(c,p,v,N){for(var P=-1,j=c.length,z=v.length,Q=-1,ue=p.length,Ne=mn(j-z,0),De=ve(ue+Ne),Le=!N;++Q<ue;)De[Q]=p[Q];for(;++P<z;)(Le||P<j)&&(De[v[P]]=c[P]);for(;Ne--;)De[Q++]=c[P++];return De}o(I_,"composeArgs");function B_(c,p,v,N){for(var P=-1,j=c.length,z=-1,Q=v.length,ue=-1,Ne=p.length,De=mn(j-Q,0),Le=ve(De+Ne),ze=!N;++P<De;)Le[P]=c[P];for(var ht=P;++ue<Ne;)Le[ht+ue]=p[ue];for(;++z<Q;)(ze||P<j)&&(Le[ht+v[z]]=c[P++]);return Le}o(B_,"composeArgsRight");function gs(c,p){var v=-1,N=c.length;for(p||(p=ve(N));++v<N;)p[v]=c[v];return p}o(gs,"copyArray");function ca(c,p,v,N){var P=!v;v||(v={});for(var j=-1,z=p.length;++j<z;){var Q=p[j],ue=N?N(v[Q],c[Q],Q,v,c):r;ue===r&&(ue=c[Q]),P?ro(v,Q,ue):im(v,Q,ue)}return v}o(ca,"copyObject");function jF(c,p){return ca(c,ub(c),p)}o(jF,"copySymbols");function FF(c,p){return ca(c,q_(c),p)}o(FF,"copySymbolsIn");function Yv(c,p){return function(v,N){var P=Lt(v)?XM:lF,j=p?p():{};return P(v,c,Et(N,2),j)}}o(Yv,"createAggregator");function Th(c){return Gt(function(p,v){var N=-1,P=v.length,j=P>1?v[P-1]:r,z=P>2?v[2]:r;for(j=c.length>3&&typeof j=="function"?(P--,j):r,z&&as(v[0],v[1],z)&&(j=P<3?r:j,P=1),p=Cr(p);++N<P;){var Q=v[N];Q&&c(p,Q,N,j)}return p})}o(Th,"createAssigner");function D_(c,p){return function(v,N){if(v==null)return v;if(!ys(v))return c(v,N);for(var P=v.length,j=p?P:-1,z=Cr(v);(p?j--:++j<P)&&N(z[j],j,z)!==!1;);return v}}o(D_,"createBaseEach");function __(c){return function(p,v,N){for(var P=-1,j=Cr(p),z=N(p),Q=z.length;Q--;){var ue=z[c?Q:++P];if(v(j[ue],ue,j)===!1)break}return p}}o(__,"createBaseFor");function qF(c,p,v){var N=p&y,P=cm(c);function j(){var z=this&&this!==Sn&&this instanceof j?P:c;return z.apply(N?v:this,arguments)}return o(j,"wrapper"),j}o(qF,"createBind");function R_(c){return function(p){p=gr(p);var v=Eh(p)?ki(p):r,N=v?v[0]:p.charAt(0),P=v?cu(v,1).join(""):p.slice(1);return N[c]()+P}}o(R_,"createCaseFirst");function Ih(c){return function(p){return N2(DR(BR(p).replace(RM,"")),c,"")}}o(Ih,"createCompounder");function cm(c){return function(){var p=arguments;switch(p.length){case 0:return new c;case 1:return new c(p[0]);case 2:return new c(p[0],p[1]);case 3:return new c(p[0],p[1],p[2]);case 4:return new c(p[0],p[1],p[2],p[3]);case 5:return new c(p[0],p[1],p[2],p[3],p[4]);case 6:return new c(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new c(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var v=Nh(c.prototype),N=c.apply(v,p);return qr(N)?N:v}}o(cm,"createCtor");function HF(c,p,v){var N=cm(c);function P(){for(var j=arguments.length,z=ve(j),Q=j,ue=Bh(P);Q--;)z[Q]=arguments[Q];var Ne=j<3&&z[0]!==ue&&z[j-1]!==ue?[]:su(z,ue);if(j-=Ne.length,j<v)return V_(c,p,Qv,P.placeholder,r,z,Ne,r,r,v-j);var De=this&&this!==Sn&&this instanceof P?N:c;return Us(De,this,z)}return o(P,"wrapper"),P}o(HF,"createCurry");function P_(c){return function(p,v,N){var P=Cr(p);if(!ys(p)){var j=Et(v,3);p=En(p),v=o(function(Q){return j(P[Q],Q,P)},"predicate")}var z=c(p,v,N);return z>-1?P[j?p[z]:z]:r}}o(P_,"createFind");function O_(c){return so(function(p){var v=p.length,N=v,P=ii.prototype.thru;for(c&&p.reverse();N--;){var j=p[N];if(typeof j!="function")throw new si(s);if(P&&!z&&rw(j)=="wrapper")var z=new ii([],!0)}for(N=z?N:v;++N<v;){j=p[N];var Q=rw(j),ue=Q=="wrapper"?ab(j):r;ue&&cb(ue[0])&&ue[1]==(x|b|A|B)&&!ue[4].length&&ue[9]==1?z=z[rw(ue[0])].apply(z,ue[3]):z=j.length==1&&cb(j)?z[Q]():z.thru(j)}return function(){var Ne=arguments,De=Ne[0];if(z&&Ne.length==1&&Lt(De))return z.plant(De).value();for(var Le=0,ze=v?p[Le].apply(this,Ne):De;++Le<v;)ze=p[Le].call(this,ze);return ze}})}o(O_,"createFlow");function Qv(c,p,v,N,P,j,z,Q,ue,Ne){var De=p&x,Le=p&y,ze=p&S,ht=p&(b|T),bt=p&F,Kt=ze?r:cm(c);function xt(){for(var Jt=arguments.length,sr=ve(Jt),qs=Jt;qs--;)sr[qs]=arguments[qs];if(ht)var os=Bh(xt),Hs=tj(sr,os);if(N&&(sr=I_(sr,N,P,ht)),j&&(sr=B_(sr,j,z,ht)),Jt-=Hs,ht&&Jt<Ne){var tn=su(sr,os);return V_(c,p,Qv,xt.placeholder,v,sr,tn,Q,ue,Ne-Jt)}var Ui=Le?v:this,uo=ze?Ui[c]:c;return Jt=sr.length,Q?sr=l9(sr,Q):bt&&Jt>1&&sr.reverse(),De&&ue<Jt&&(sr.length=ue),this&&this!==Sn&&this instanceof xt&&(uo=Kt||cm(uo)),uo.apply(Ui,sr)}return o(xt,"wrapper"),xt}o(Qv,"createHybrid");function k_(c,p){return function(v,N){return yF(v,c,p(N),{})}}o(k_,"createInverter");function Zv(c,p){return function(v,N){var P;if(v===r&&N===r)return p;if(v!==r&&(P=v),N!==r){if(P===r)return N;typeof v=="string"||typeof N=="string"?(v=js(v),N=js(N)):(v=S_(v),N=S_(N)),P=c(v,N)}return P}}o(Zv,"createMathOperation");function rb(c){return so(function(p){return p=Mr(p,Ms(Et())),Gt(function(v){var N=this;return c(p,function(P){return Us(P,N,v)})})})}o(rb,"createOver");function ew(c,p){p=p===r?" ":js(p);var v=p.length;if(v<2)return v?J2(p,c):p;var N=J2(p,jv(c/Ah(p)));return Eh(p)?cu(ki(N),0,c).join(""):N.slice(0,c)}o(ew,"createPadding");function KF(c,p,v,N){var P=p&y,j=cm(c);function z(){for(var Q=-1,ue=arguments.length,Ne=-1,De=N.length,Le=ve(De+ue),ze=this&&this!==Sn&&this instanceof z?j:c;++Ne<De;)Le[Ne]=N[Ne];for(;ue--;)Le[Ne++]=arguments[++Q];return Us(ze,P?v:this,Le)}return o(z,"wrapper"),z}o(KF,"createPartial");function L_(c){return function(p,v,N){return N&&typeof N!="number"&&as(p,v,N)&&(v=N=r),p=oo(p),v===r?(v=p,p=0):v=oo(v),N=N===r?p<v?1:-1:oo(N),BF(p,v,N,c)}}o(L_,"createRange");function tw(c){return function(p,v){return typeof p=="string"&&typeof v=="string"||(p=li(p),v=li(v)),c(p,v)}}o(tw,"createRelationalOperation");function V_(c,p,v,N,P,j,z,Q,ue,Ne){var De=p&b,Le=De?z:r,ze=De?r:z,ht=De?j:r,bt=De?r:j;p|=De?A:C,p&=~(De?C:A),p&E||(p&=~(y|S));var Kt=[c,p,P,ht,Le,bt,ze,Q,ue,Ne],xt=v.apply(r,Kt);return cb(c)&&J_(xt,Kt),xt.placeholder=N,z_(xt,c,p)}o(V_,"createRecurry");function nb(c){var p=dn[c];return function(v,N){if(v=li(v),N=N==null?0:Gn(jt(N),292),N&&zD(v)){var P=(gr(v)+"e").split("e"),j=p(P[0]+"e"+(+P[1]+N));return P=(gr(j)+"e").split("e"),+(P[0]+"e"+(+P[1]-N))}return p(v)}}o(nb,"createRound");var $F=bh&&1/Dv(new bh([,-0]))[1]==oe?function(c){return new bh(c)}:xb;function U_(c){return function(p){var v=Wn(p);return v==xe?P2(p):v==Ur?uj(p):ej(p,c(p))}}o(U_,"createToPairs");function no(c,p,v,N,P,j,z,Q){var ue=p&S;if(!ue&&typeof c!="function")throw new si(s);var Ne=N?N.length:0;if(Ne||(p&=~(A|C),N=P=r),z=z===r?z:mn(jt(z),0),Q=Q===r?Q:jt(Q),Ne-=P?P.length:0,p&C){var De=N,Le=P;N=P=r}var ze=ue?r:ab(c),ht=[c,p,v,N,P,De,Le,j,z,Q];if(ze&&a9(ht,ze),c=ht[0],p=ht[1],v=ht[2],N=ht[3],P=ht[4],Q=ht[9]=ht[9]===r?ue?0:c.length:mn(ht[9]-Ne,0),!Q&&p&(b|T)&&(p&=~(b|T)),!p||p==y)var bt=qF(c,p,v);else p==b||p==T?bt=HF(c,p,Q):(p==A||p==(y|A))&&!P.length?bt=KF(c,p,v,N):bt=Qv.apply(r,ht);var Kt=ze?v_:J_;return z_(Kt(bt,ht),c,p)}o(no,"createWrap");function M_(c,p,v,N){return c===r||Vi(c,Ch[v])&&!wr.call(N,v)?p:c}o(M_,"customDefaultsAssignIn");function j_(c,p,v,N,P,j){return qr(c)&&qr(p)&&(j.set(p,c),Wv(c,p,r,j_,j),j.delete(p)),c}o(j_,"customDefaultsMerge");function XF(c){return pm(c)?r:c}o(XF,"customOmitClone");function F_(c,p,v,N,P,j){var z=v&g,Q=c.length,ue=p.length;if(Q!=ue&&!(z&&ue>Q))return!1;var Ne=j.get(c),De=j.get(p);if(Ne&&De)return Ne==p&&De==c;var Le=-1,ze=!0,ht=v&w?new ic:r;for(j.set(c,p),j.set(p,c);++Le<Q;){var bt=c[Le],Kt=p[Le];if(N)var xt=z?N(Kt,bt,Le,p,c,j):N(bt,Kt,Le,c,p,j);if(xt!==r){if(xt)continue;ze=!1;break}if(ht){if(!T2(p,function(Jt,sr){if(!Z0(ht,sr)&&(bt===Jt||P(bt,Jt,v,N,j)))return ht.push(sr)})){ze=!1;break}}else if(!(bt===Kt||P(bt,Kt,v,N,j))){ze=!1;break}}return j.delete(c),j.delete(p),ze}o(F_,"equalArrays");function GF(c,p,v,N,P,j,z){switch(v){case Dn:if(c.byteLength!=p.byteLength||c.byteOffset!=p.byteOffset)return!1;c=c.buffer,p=p.buffer;case Ze:return!(c.byteLength!=p.byteLength||!j(new Lv(c),new Lv(p)));case O:case _:case ct:return Vi(+c,+p);case J:return c.name==p.name&&c.message==p.message;case Ge:case on:return c==p+"";case xe:var Q=P2;case Ur:var ue=N&g;if(Q||(Q=Dv),c.size!=p.size&&!ue)return!1;var Ne=z.get(c);if(Ne)return Ne==p;N|=w,z.set(c,p);var De=F_(Q(c),Q(p),N,P,j,z);return z.delete(c),De;case $n:if(sm)return sm.call(c)==sm.call(p)}return!1}o(GF,"equalByTag");function WF(c,p,v,N,P,j){var z=v&g,Q=sb(c),ue=Q.length,Ne=sb(p),De=Ne.length;if(ue!=De&&!z)return!1;for(var Le=ue;Le--;){var ze=Q[Le];if(!(z?ze in p:wr.call(p,ze)))return!1}var ht=j.get(c),bt=j.get(p);if(ht&&bt)return ht==p&&bt==c;var Kt=!0;j.set(c,p),j.set(p,c);for(var xt=z;++Le<ue;){ze=Q[Le];var Jt=c[ze],sr=p[ze];if(N)var qs=z?N(sr,Jt,ze,p,c,j):N(Jt,sr,ze,c,p,j);if(!(qs===r?Jt===sr||P(Jt,sr,v,N,j):qs)){Kt=!1;break}xt||(xt=ze=="constructor")}if(Kt&&!xt){var os=c.constructor,Hs=p.constructor;os!=Hs&&"constructor"in c&&"constructor"in p&&!(typeof os=="function"&&os instanceof os&&typeof Hs=="function"&&Hs instanceof Hs)&&(Kt=!1)}return j.delete(c),j.delete(p),Kt}o(WF,"equalObjects");function so(c){return hb(G_(c,r,rR),c+"")}o(so,"flatRest");function sb(c){return o_(c,En,ub)}o(sb,"getAllKeys");function ib(c){return o_(c,vs,q_)}o(ib,"getAllKeysIn");var ab=qv?function(c){return qv.get(c)}:xb;function rw(c){for(var p=c.name+"",v=xh[p],N=wr.call(xh,p)?v.length:0;N--;){var P=v[N],j=P.func;if(j==null||j==c)return P.name}return p}o(rw,"getFuncName");function Bh(c){var p=wr.call(M,"placeholder")?M:c;return p.placeholder}o(Bh,"getHolder");function Et(){var c=M.iteratee||Cb;return c=c===Cb?c_:c,arguments.length?c(arguments[0],arguments[1]):c}o(Et,"getIteratee");function nw(c,p){var v=c.__data__;return r9(p)?v[typeof p=="string"?"string":"hash"]:v.map}o(nw,"getMapData");function ob(c){for(var p=En(c),v=p.length;v--;){var N=p[v],P=c[N];p[v]=[N,P,$_(P)]}return p}o(ob,"getMatchData");function uc(c,p){var v=ij(c,p);return l_(v)?v:r}o(uc,"getNative");function JF(c){var p=wr.call(c,nc),v=c[nc];try{c[nc]=r;var N=!0}catch{}var P=Ov.call(c);return N&&(p?c[nc]=v:delete c[nc]),P}o(JF,"getRawTag");var ub=k2?function(c){return c==null?[]:(c=Cr(c),ru(k2(c),function(p){return WD.call(c,p)}))}:Nb,q_=k2?function(c){for(var p=[];c;)nu(p,ub(c)),c=Vv(c);return p}:Nb,Wn=is;(L2&&Wn(new L2(new ArrayBuffer(1)))!=Dn||tm&&Wn(new tm)!=xe||V2&&Wn(V2.resolve())!=nr||bh&&Wn(new bh)!=Ur||rm&&Wn(new rm)!=ns)&&(Wn=o(function(c){var p=is(c),v=p==je?c.constructor:r,N=v?lc(v):"";if(N)switch(N){case _j:return Dn;case Rj:return xe;case Pj:return nr;case Oj:return Ur;case kj:return ns}return p},"getTag"));function zF(c,p,v){for(var N=-1,P=v.length;++N<P;){var j=v[N],z=j.size;switch(j.type){case"drop":c+=z;break;case"dropRight":p-=z;break;case"take":p=Gn(p,c+z);break;case"takeRight":c=mn(c,p-z);break}}return{start:c,end:p}}o(zF,"getView");function YF(c){var p=c.match(d2);return p?p[1].split(m2):[]}o(YF,"getWrapDetails");function H_(c,p,v){p=lu(p,c);for(var N=-1,P=p.length,j=!1;++N<P;){var z=fa(p[N]);if(!(j=c!=null&&v(c,z)))break;c=c[z]}return j||++N!=P?j:(P=c==null?0:c.length,!!P&&cw(P)&&io(z,P)&&(Lt(c)||cc(c)))}o(H_,"hasPath");function QF(c){var p=c.length,v=new c.constructor(p);return p&&typeof c[0]=="string"&&wr.call(c,"index")&&(v.index=c.index,v.input=c.input),v}o(QF,"initCloneArray");function K_(c){return typeof c.constructor=="function"&&!fm(c)?Nh(Vv(c)):{}}o(K_,"initCloneObject");function ZF(c,p,v){var N=c.constructor;switch(p){case Ze:return tb(c);case O:case _:return new N(+c);case Dn:return LF(c,v);case ss:case aa:case oa:case Rt:case yh:case vh:case tc:case Y0:case Vs:return N_(c,v);case xe:return new N;case ct:case on:return new N(c);case Ge:return VF(c);case Ur:return new N;case $n:return UF(c)}}o(ZF,"initCloneByTag");function e9(c,p){var v=p.length;if(!v)return c;var N=v-1;return p[N]=(v>1?"& ":"")+p[N],p=p.join(v>2?", ":" "),c.replace(p2,`{
23
- /* [wrapped with `+p+`] */
24
- `)}o(e9,"insertWrapDetails");function t9(c){return Lt(c)||cc(c)||!!(JD&&c&&c[JD])}o(t9,"isFlattenable");function io(c,p){var v=typeof c;return p=p??Z,!!p&&(v=="number"||v!="symbol"&&pM.test(c))&&c>-1&&c%1==0&&c<p}o(io,"isIndex");function as(c,p,v){if(!qr(v))return!1;var N=typeof p;return(N=="number"?ys(v)&&io(p,v.length):N=="string"&&p in v)?Vi(v[p],c):!1}o(as,"isIterateeCall");function lb(c,p){if(Lt(c))return!1;var v=typeof c;return v=="number"||v=="symbol"||v=="boolean"||c==null||Fs(c)?!0:_n.test(c)||!Dt.test(c)||p!=null&&c in Cr(p)}o(lb,"isKey");function r9(c){var p=typeof c;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?c!=="__proto__":c===null}o(r9,"isKeyable");function cb(c){var p=rw(c),v=M[p];if(typeof v!="function"||!(p in er.prototype))return!1;if(c===v)return!0;var N=ab(v);return!!N&&c===N[0]}o(cb,"isLaziable");function n9(c){return!!$D&&$D in c}o(n9,"isMasked");var s9=Rv?ao:Tb;function fm(c){var p=c&&c.constructor,v=typeof p=="function"&&p.prototype||Ch;return c===v}o(fm,"isPrototype");function $_(c){return c===c&&!qr(c)}o($_,"isStrictComparable");function X_(c,p){return function(v){return v==null?!1:v[c]===p&&(p!==r||c in Cr(v))}}o(X_,"matchesStrictComparable");function i9(c){var p=uw(c,function(N){return v.size===u&&v.clear(),N}),v=p.cache;return p}o(i9,"memoizeCapped");function a9(c,p){var v=c[1],N=p[1],P=v|N,j=P<(y|S|x),z=N==x&&v==b||N==x&&v==B&&c[7].length<=p[8]||N==(x|B)&&p[7].length<=p[8]&&v==b;if(!(j||z))return c;N&y&&(c[2]=p[2],P|=v&y?0:E);var Q=p[3];if(Q){var ue=c[3];c[3]=ue?I_(ue,Q,p[4]):Q,c[4]=ue?su(c[3],l):p[4]}return Q=p[5],Q&&(ue=c[5],c[5]=ue?B_(ue,Q,p[6]):Q,c[6]=ue?su(c[5],l):p[6]),Q=p[7],Q&&(c[7]=Q),N&x&&(c[8]=c[8]==null?p[8]:Gn(c[8],p[8])),c[9]==null&&(c[9]=p[9]),c[0]=p[0],c[1]=P,c}o(a9,"mergeData");function o9(c){var p=[];if(c!=null)for(var v in Cr(c))p.push(v);return p}o(o9,"nativeKeysIn");function u9(c){return Ov.call(c)}o(u9,"objectToString");function G_(c,p,v){return p=mn(p===r?c.length-1:p,0),function(){for(var N=arguments,P=-1,j=mn(N.length-p,0),z=ve(j);++P<j;)z[P]=N[p+P];P=-1;for(var Q=ve(p+1);++P<p;)Q[P]=N[P];return Q[p]=v(z),Us(c,this,Q)}}o(G_,"overRest");function W_(c,p){return p.length<2?c:oc(c,oi(p,0,-1))}o(W_,"parent");function l9(c,p){for(var v=c.length,N=Gn(p.length,v),P=gs(c);N--;){var j=p[N];c[N]=io(j,v)?P[j]:r}return c}o(l9,"reorder");function fb(c,p){if(!(p==="constructor"&&typeof c[p]=="function")&&p!="__proto__")return c[p]}o(fb,"safeGet");var J_=Y_(v_),hm=bj||function(c,p){return Sn.setTimeout(c,p)},hb=Y_(RF);function z_(c,p,v){var N=p+"";return hb(c,e9(N,c9(YF(N),v)))}o(z_,"setWrapToString");function Y_(c){var p=0,v=0;return function(){var N=Ij(),P=K-(N-v);if(v=N,P>0){if(++p>=q)return arguments[0]}else p=0;return c.apply(r,arguments)}}o(Y_,"shortOut");function sw(c,p){var v=-1,N=c.length,P=N-1;for(p=p===r?N:p;++v<p;){var j=W2(v,P),z=c[j];c[j]=c[v],c[v]=z}return c.length=p,c}o(sw,"shuffleSelf");var Q_=i9(function(c){var p=[];return c.charCodeAt(0)===46&&p.push(""),c.replace(ti,function(v,N,P,j){p.push(P?j.replace(Zt,"$1"):N||v)}),p});function fa(c){if(typeof c=="string"||Fs(c))return c;var p=c+"";return p=="0"&&1/c==-oe?"-0":p}o(fa,"toKey");function lc(c){if(c!=null){try{return Pv.call(c)}catch{}try{return c+""}catch{}}return""}o(lc,"toSource");function c9(c,p){return ni(Me,function(v){var N="_."+v[0];p&v[1]&&!Iv(c,N)&&c.push(N)}),c.sort()}o(c9,"updateWrapDetails");function Z_(c){if(c instanceof er)return c.clone();var p=new ii(c.__wrapped__,c.__chain__);return p.__actions__=gs(c.__actions__),p.__index__=c.__index__,p.__values__=c.__values__,p}o(Z_,"wrapperClone");function f9(c,p,v){(v?as(c,p,v):p===r)?p=1:p=mn(jt(p),0);var N=c==null?0:c.length;if(!N||p<1)return[];for(var P=0,j=0,z=ve(jv(N/p));P<N;)z[j++]=oi(c,P,P+=p);return z}o(f9,"chunk");function h9(c){for(var p=-1,v=c==null?0:c.length,N=0,P=[];++p<v;){var j=c[p];j&&(P[N++]=j)}return P}o(h9,"compact");function p9(){var c=arguments.length;if(!c)return[];for(var p=ve(c-1),v=arguments[0],N=c;N--;)p[N-1]=arguments[N];return nu(Lt(v)?gs(v):[v],Rn(p,1))}o(p9,"concat");var d9=Gt(function(c,p){return en(c)?am(c,Rn(p,1,en,!0)):[]}),m9=Gt(function(c,p){var v=ui(p);return en(v)&&(v=r),en(c)?am(c,Rn(p,1,en,!0),Et(v,2)):[]}),g9=Gt(function(c,p){var v=ui(p);return en(v)&&(v=r),en(c)?am(c,Rn(p,1,en,!0),r,v):[]});function y9(c,p,v){var N=c==null?0:c.length;return N?(p=v||p===r?1:jt(p),oi(c,p<0?0:p,N)):[]}o(y9,"drop");function v9(c,p,v){var N=c==null?0:c.length;return N?(p=v||p===r?1:jt(p),p=N-p,oi(c,0,p<0?0:p)):[]}o(v9,"dropRight");function w9(c,p){return c&&c.length?zv(c,Et(p,3),!0,!0):[]}o(w9,"dropRightWhile");function S9(c,p){return c&&c.length?zv(c,Et(p,3),!0):[]}o(S9,"dropWhile");function E9(c,p,v,N){var P=c==null?0:c.length;return P?(v&&typeof v!="number"&&as(c,p,v)&&(v=0,N=P),pF(c,p,v,N)):[]}o(E9,"fill");function eR(c,p,v){var N=c==null?0:c.length;if(!N)return-1;var P=v==null?0:jt(v);return P<0&&(P=mn(N+P,0)),Bv(c,Et(p,3),P)}o(eR,"findIndex");function tR(c,p,v){var N=c==null?0:c.length;if(!N)return-1;var P=N-1;return v!==r&&(P=jt(v),P=v<0?mn(N+P,0):Gn(P,N-1)),Bv(c,Et(p,3),P,!0)}o(tR,"findLastIndex");function rR(c){var p=c==null?0:c.length;return p?Rn(c,1):[]}o(rR,"flatten");function A9(c){var p=c==null?0:c.length;return p?Rn(c,oe):[]}o(A9,"flattenDeep");function C9(c,p){var v=c==null?0:c.length;return v?(p=p===r?1:jt(p),Rn(c,p)):[]}o(C9,"flattenDepth");function b9(c){for(var p=-1,v=c==null?0:c.length,N={};++p<v;){var P=c[p];N[P[0]]=P[1]}return N}o(b9,"fromPairs");function nR(c){return c&&c.length?c[0]:r}o(nR,"head");function x9(c,p,v){var N=c==null?0:c.length;if(!N)return-1;var P=v==null?0:jt(v);return P<0&&(P=mn(N+P,0)),Sh(c,p,P)}o(x9,"indexOf");function N9(c){var p=c==null?0:c.length;return p?oi(c,0,-1):[]}o(N9,"initial");var T9=Gt(function(c){var p=Mr(c,Z2);return p.length&&p[0]===c[0]?H2(p):[]}),I9=Gt(function(c){var p=ui(c),v=Mr(c,Z2);return p===ui(v)?p=r:v.pop(),v.length&&v[0]===c[0]?H2(v,Et(p,2)):[]}),B9=Gt(function(c){var p=ui(c),v=Mr(c,Z2);return p=typeof p=="function"?p:r,p&&v.pop(),v.length&&v[0]===c[0]?H2(v,r,p):[]});function D9(c,p){return c==null?"":Nj.call(c,p)}o(D9,"join");function ui(c){var p=c==null?0:c.length;return p?c[p-1]:r}o(ui,"last");function _9(c,p,v){var N=c==null?0:c.length;if(!N)return-1;var P=N;return v!==r&&(P=jt(v),P=P<0?mn(N+P,0):Gn(P,N-1)),p===p?cj(c,p,P):Bv(c,VD,P,!0)}o(_9,"lastIndexOf");function R9(c,p){return c&&c.length?d_(c,jt(p)):r}o(R9,"nth");var P9=Gt(sR);function sR(c,p){return c&&c.length&&p&&p.length?G2(c,p):c}o(sR,"pullAll");function O9(c,p,v){return c&&c.length&&p&&p.length?G2(c,p,Et(v,2)):c}o(O9,"pullAllBy");function k9(c,p,v){return c&&c.length&&p&&p.length?G2(c,p,r,v):c}o(k9,"pullAllWith");var L9=so(function(c,p){var v=c==null?0:c.length,N=M2(c,p);return y_(c,Mr(p,function(P){return io(P,v)?+P:P}).sort(T_)),N});function V9(c,p){var v=[];if(!(c&&c.length))return v;var N=-1,P=[],j=c.length;for(p=Et(p,3);++N<j;){var z=c[N];p(z,N,c)&&(v.push(z),P.push(N))}return y_(c,P),v}o(V9,"remove");function pb(c){return c==null?c:Dj.call(c)}o(pb,"reverse");function U9(c,p,v){var N=c==null?0:c.length;return N?(v&&typeof v!="number"&&as(c,p,v)?(p=0,v=N):(p=p==null?0:jt(p),v=v===r?N:jt(v)),oi(c,p,v)):[]}o(U9,"slice");function M9(c,p){return Jv(c,p)}o(M9,"sortedIndex");function j9(c,p,v){return z2(c,p,Et(v,2))}o(j9,"sortedIndexBy");function F9(c,p){var v=c==null?0:c.length;if(v){var N=Jv(c,p);if(N<v&&Vi(c[N],p))return N}return-1}o(F9,"sortedIndexOf");function q9(c,p){return Jv(c,p,!0)}o(q9,"sortedLastIndex");function H9(c,p,v){return z2(c,p,Et(v,2),!0)}o(H9,"sortedLastIndexBy");function K9(c,p){var v=c==null?0:c.length;if(v){var N=Jv(c,p,!0)-1;if(Vi(c[N],p))return N}return-1}o(K9,"sortedLastIndexOf");function $9(c){return c&&c.length?w_(c):[]}o($9,"sortedUniq");function X9(c,p){return c&&c.length?w_(c,Et(p,2)):[]}o(X9,"sortedUniqBy");function G9(c){var p=c==null?0:c.length;return p?oi(c,1,p):[]}o(G9,"tail");function W9(c,p,v){return c&&c.length?(p=v||p===r?1:jt(p),oi(c,0,p<0?0:p)):[]}o(W9,"take");function J9(c,p,v){var N=c==null?0:c.length;return N?(p=v||p===r?1:jt(p),p=N-p,oi(c,p<0?0:p,N)):[]}o(J9,"takeRight");function z9(c,p){return c&&c.length?zv(c,Et(p,3),!1,!0):[]}o(z9,"takeRightWhile");function Y9(c,p){return c&&c.length?zv(c,Et(p,3)):[]}o(Y9,"takeWhile");var Q9=Gt(function(c){return uu(Rn(c,1,en,!0))}),Z9=Gt(function(c){var p=ui(c);return en(p)&&(p=r),uu(Rn(c,1,en,!0),Et(p,2))}),eq=Gt(function(c){var p=ui(c);return p=typeof p=="function"?p:r,uu(Rn(c,1,en,!0),r,p)});function tq(c){return c&&c.length?uu(c):[]}o(tq,"uniq");function rq(c,p){return c&&c.length?uu(c,Et(p,2)):[]}o(rq,"uniqBy");function nq(c,p){return p=typeof p=="function"?p:r,c&&c.length?uu(c,r,p):[]}o(nq,"uniqWith");function db(c){if(!(c&&c.length))return[];var p=0;return c=ru(c,function(v){if(en(v))return p=mn(v.length,p),!0}),_2(p,function(v){return Mr(c,I2(v))})}o(db,"unzip");function iR(c,p){if(!(c&&c.length))return[];var v=db(c);return p==null?v:Mr(v,function(N){return Us(p,r,N)})}o(iR,"unzipWith");var sq=Gt(function(c,p){return en(c)?am(c,p):[]}),iq=Gt(function(c){return Q2(ru(c,en))}),aq=Gt(function(c){var p=ui(c);return en(p)&&(p=r),Q2(ru(c,en),Et(p,2))}),oq=Gt(function(c){var p=ui(c);return p=typeof p=="function"?p:r,Q2(ru(c,en),r,p)}),uq=Gt(db);function lq(c,p){return C_(c||[],p||[],im)}o(lq,"zipObject");function cq(c,p){return C_(c||[],p||[],lm)}o(cq,"zipObjectDeep");var fq=Gt(function(c){var p=c.length,v=p>1?c[p-1]:r;return v=typeof v=="function"?(c.pop(),v):r,iR(c,v)});function aR(c){var p=M(c);return p.__chain__=!0,p}o(aR,"chain");function hq(c,p){return p(c),c}o(hq,"tap");function iw(c,p){return p(c)}o(iw,"thru");var pq=so(function(c){var p=c.length,v=p?c[0]:0,N=this.__wrapped__,P=o(function(j){return M2(j,c)},"interceptor");return p>1||this.__actions__.length||!(N instanceof er)||!io(v)?this.thru(P):(N=N.slice(v,+v+(p?1:0)),N.__actions__.push({func:iw,args:[P],thisArg:r}),new ii(N,this.__chain__).thru(function(j){return p&&!j.length&&j.push(r),j}))});function dq(){return aR(this)}o(dq,"wrapperChain");function mq(){return new ii(this.value(),this.__chain__)}o(mq,"wrapperCommit");function gq(){this.__values__===r&&(this.__values__=SR(this.value()));var c=this.__index__>=this.__values__.length,p=c?r:this.__values__[this.__index__++];return{done:c,value:p}}o(gq,"wrapperNext");function yq(){return this}o(yq,"wrapperToIterator");function vq(c){for(var p,v=this;v instanceof Kv;){var N=Z_(v);N.__index__=0,N.__values__=r,p?P.__wrapped__=N:p=N;var P=N;v=v.__wrapped__}return P.__wrapped__=c,p}o(vq,"wrapperPlant");function wq(){var c=this.__wrapped__;if(c instanceof er){var p=c;return this.__actions__.length&&(p=new er(this)),p=p.reverse(),p.__actions__.push({func:iw,args:[pb],thisArg:r}),new ii(p,this.__chain__)}return this.thru(pb)}o(wq,"wrapperReverse");function Sq(){return A_(this.__wrapped__,this.__actions__)}o(Sq,"wrapperValue");var Eq=Yv(function(c,p,v){wr.call(c,v)?++c[v]:ro(c,v,1)});function Aq(c,p,v){var N=Lt(c)?kD:hF;return v&&as(c,p,v)&&(p=r),N(c,Et(p,3))}o(Aq,"every");function Cq(c,p){var v=Lt(c)?ru:i_;return v(c,Et(p,3))}o(Cq,"filter");var bq=P_(eR),xq=P_(tR);function Nq(c,p){return Rn(aw(c,p),1)}o(Nq,"flatMap");function Tq(c,p){return Rn(aw(c,p),oe)}o(Tq,"flatMapDeep");function Iq(c,p,v){return v=v===r?1:jt(v),Rn(aw(c,p),v)}o(Iq,"flatMapDepth");function oR(c,p){var v=Lt(c)?ni:ou;return v(c,Et(p,3))}o(oR,"forEach");function uR(c,p){var v=Lt(c)?GM:s_;return v(c,Et(p,3))}o(uR,"forEachRight");var Bq=Yv(function(c,p,v){wr.call(c,v)?c[v].push(p):ro(c,v,[p])});function Dq(c,p,v,N){c=ys(c)?c:_h(c),v=v&&!N?jt(v):0;var P=c.length;return v<0&&(v=mn(P+v,0)),fw(c)?v<=P&&c.indexOf(p,v)>-1:!!P&&Sh(c,p,v)>-1}o(Dq,"includes");var _q=Gt(function(c,p,v){var N=-1,P=typeof p=="function",j=ys(c)?ve(c.length):[];return ou(c,function(z){j[++N]=P?Us(p,z,v):om(z,p,v)}),j}),Rq=Yv(function(c,p,v){ro(c,v,p)});function aw(c,p){var v=Lt(c)?Mr:f_;return v(c,Et(p,3))}o(aw,"map");function Pq(c,p,v,N){return c==null?[]:(Lt(p)||(p=p==null?[]:[p]),v=N?r:v,Lt(v)||(v=v==null?[]:[v]),m_(c,p,v))}o(Pq,"orderBy");var Oq=Yv(function(c,p,v){c[v?0:1].push(p)},function(){return[[],[]]});function kq(c,p,v){var N=Lt(c)?N2:MD,P=arguments.length<3;return N(c,Et(p,4),v,P,ou)}o(kq,"reduce");function Lq(c,p,v){var N=Lt(c)?WM:MD,P=arguments.length<3;return N(c,Et(p,4),v,P,s_)}o(Lq,"reduceRight");function Vq(c,p){var v=Lt(c)?ru:i_;return v(c,lw(Et(p,3)))}o(Vq,"reject");function Uq(c){var p=Lt(c)?e_:DF;return p(c)}o(Uq,"sample");function Mq(c,p,v){(v?as(c,p,v):p===r)?p=1:p=jt(p);var N=Lt(c)?oF:_F;return N(c,p)}o(Mq,"sampleSize");function jq(c){var p=Lt(c)?uF:PF;return p(c)}o(jq,"shuffle");function Fq(c){if(c==null)return 0;if(ys(c))return fw(c)?Ah(c):c.length;var p=Wn(c);return p==xe||p==Ur?c.size:$2(c).length}o(Fq,"size");function qq(c,p,v){var N=Lt(c)?T2:OF;return v&&as(c,p,v)&&(p=r),N(c,Et(p,3))}o(qq,"some");var Hq=Gt(function(c,p){if(c==null)return[];var v=p.length;return v>1&&as(c,p[0],p[1])?p=[]:v>2&&as(p[0],p[1],p[2])&&(p=[p[0]]),m_(c,Rn(p,1),[])}),ow=Cj||function(){return Sn.Date.now()};function Kq(c,p){if(typeof p!="function")throw new si(s);return c=jt(c),function(){if(--c<1)return p.apply(this,arguments)}}o(Kq,"after");function lR(c,p,v){return p=v?r:p,p=c&&p==null?c.length:p,no(c,x,r,r,r,r,p)}o(lR,"ary");function cR(c,p){var v;if(typeof p!="function")throw new si(s);return c=jt(c),function(){return--c>0&&(v=p.apply(this,arguments)),c<=1&&(p=r),v}}o(cR,"before");var mb=Gt(function(c,p,v){var N=y;if(v.length){var P=su(v,Bh(mb));N|=A}return no(c,N,p,v,P)}),fR=Gt(function(c,p,v){var N=y|S;if(v.length){var P=su(v,Bh(fR));N|=A}return no(p,N,c,v,P)});function hR(c,p,v){p=v?r:p;var N=no(c,b,r,r,r,r,r,p);return N.placeholder=hR.placeholder,N}o(hR,"curry");function pR(c,p,v){p=v?r:p;var N=no(c,T,r,r,r,r,r,p);return N.placeholder=pR.placeholder,N}o(pR,"curryRight");function dR(c,p,v){var N,P,j,z,Q,ue,Ne=0,De=!1,Le=!1,ze=!0;if(typeof c!="function")throw new si(s);p=li(p)||0,qr(v)&&(De=!!v.leading,Le="maxWait"in v,j=Le?mn(li(v.maxWait)||0,p):j,ze="trailing"in v?!!v.trailing:ze);function ht(tn){var Ui=N,uo=P;return N=P=r,Ne=tn,z=c.apply(uo,Ui),z}o(ht,"invokeFunc");function bt(tn){return Ne=tn,Q=hm(Jt,p),De?ht(tn):z}o(bt,"leadingEdge");function Kt(tn){var Ui=tn-ue,uo=tn-Ne,PR=p-Ui;return Le?Gn(PR,j-uo):PR}o(Kt,"remainingWait");function xt(tn){var Ui=tn-ue,uo=tn-Ne;return ue===r||Ui>=p||Ui<0||Le&&uo>=j}o(xt,"shouldInvoke");function Jt(){var tn=ow();if(xt(tn))return sr(tn);Q=hm(Jt,Kt(tn))}o(Jt,"timerExpired");function sr(tn){return Q=r,ze&&N?ht(tn):(N=P=r,z)}o(sr,"trailingEdge");function qs(){Q!==r&&b_(Q),Ne=0,N=ue=P=Q=r}o(qs,"cancel");function os(){return Q===r?z:sr(ow())}o(os,"flush");function Hs(){var tn=ow(),Ui=xt(tn);if(N=arguments,P=this,ue=tn,Ui){if(Q===r)return bt(ue);if(Le)return b_(Q),Q=hm(Jt,p),ht(ue)}return Q===r&&(Q=hm(Jt,p)),z}return o(Hs,"debounced"),Hs.cancel=qs,Hs.flush=os,Hs}o(dR,"debounce");var $q=Gt(function(c,p){return n_(c,1,p)}),Xq=Gt(function(c,p,v){return n_(c,li(p)||0,v)});function Gq(c){return no(c,F)}o(Gq,"flip");function uw(c,p){if(typeof c!="function"||p!=null&&typeof p!="function")throw new si(s);var v=o(function(){var N=arguments,P=p?p.apply(this,N):N[0],j=v.cache;if(j.has(P))return j.get(P);var z=c.apply(this,N);return v.cache=j.set(P,z)||j,z},"memoized");return v.cache=new(uw.Cache||to),v}o(uw,"memoize"),uw.Cache=to;function lw(c){if(typeof c!="function")throw new si(s);return function(){var p=arguments;switch(p.length){case 0:return!c.call(this);case 1:return!c.call(this,p[0]);case 2:return!c.call(this,p[0],p[1]);case 3:return!c.call(this,p[0],p[1],p[2])}return!c.apply(this,p)}}o(lw,"negate");function Wq(c){return cR(2,c)}o(Wq,"once");var Jq=kF(function(c,p){p=p.length==1&&Lt(p[0])?Mr(p[0],Ms(Et())):Mr(Rn(p,1),Ms(Et()));var v=p.length;return Gt(function(N){for(var P=-1,j=Gn(N.length,v);++P<j;)N[P]=p[P].call(this,N[P]);return Us(c,this,N)})}),gb=Gt(function(c,p){var v=su(p,Bh(gb));return no(c,A,r,p,v)}),mR=Gt(function(c,p){var v=su(p,Bh(mR));return no(c,C,r,p,v)}),zq=so(function(c,p){return no(c,B,r,r,r,p)});function Yq(c,p){if(typeof c!="function")throw new si(s);return p=p===r?p:jt(p),Gt(c,p)}o(Yq,"rest");function Qq(c,p){if(typeof c!="function")throw new si(s);return p=p==null?0:mn(jt(p),0),Gt(function(v){var N=v[p],P=cu(v,0,p);return N&&nu(P,N),Us(c,this,P)})}o(Qq,"spread");function Zq(c,p,v){var N=!0,P=!0;if(typeof c!="function")throw new si(s);return qr(v)&&(N="leading"in v?!!v.leading:N,P="trailing"in v?!!v.trailing:P),dR(c,p,{leading:N,maxWait:p,trailing:P})}o(Zq,"throttle");function e7(c){return lR(c,1)}o(e7,"unary");function t7(c,p){return gb(eb(p),c)}o(t7,"wrap");function r7(){if(!arguments.length)return[];var c=arguments[0];return Lt(c)?c:[c]}o(r7,"castArray");function n7(c){return ai(c,m)}o(n7,"clone");function s7(c,p){return p=typeof p=="function"?p:r,ai(c,m,p)}o(s7,"cloneWith");function i7(c){return ai(c,f|m)}o(i7,"cloneDeep");function a7(c,p){return p=typeof p=="function"?p:r,ai(c,f|m,p)}o(a7,"cloneDeepWith");function o7(c,p){return p==null||r_(c,p,En(p))}o(o7,"conformsTo");function Vi(c,p){return c===p||c!==c&&p!==p}o(Vi,"eq");var u7=tw(q2),l7=tw(function(c,p){return c>=p}),cc=u_((function(){return arguments})())?u_:function(c){return Wr(c)&&wr.call(c,"callee")&&!WD.call(c,"callee")},Lt=ve.isArray,c7=BD?Ms(BD):vF;function ys(c){return c!=null&&cw(c.length)&&!ao(c)}o(ys,"isArrayLike");function en(c){return Wr(c)&&ys(c)}o(en,"isArrayLikeObject");function f7(c){return c===!0||c===!1||Wr(c)&&is(c)==O}o(f7,"isBoolean");var fu=xj||Tb,h7=DD?Ms(DD):wF;function p7(c){return Wr(c)&&c.nodeType===1&&!pm(c)}o(p7,"isElement");function d7(c){if(c==null)return!0;if(ys(c)&&(Lt(c)||typeof c=="string"||typeof c.splice=="function"||fu(c)||Dh(c)||cc(c)))return!c.length;var p=Wn(c);if(p==xe||p==Ur)return!c.size;if(fm(c))return!$2(c).length;for(var v in c)if(wr.call(c,v))return!1;return!0}o(d7,"isEmpty");function m7(c,p){return um(c,p)}o(m7,"isEqual");function g7(c,p,v){v=typeof v=="function"?v:r;var N=v?v(c,p):r;return N===r?um(c,p,r,v):!!N}o(g7,"isEqualWith");function yb(c){if(!Wr(c))return!1;var p=is(c);return p==J||p==ne||typeof c.message=="string"&&typeof c.name=="string"&&!pm(c)}o(yb,"isError");function y7(c){return typeof c=="number"&&zD(c)}o(y7,"isFinite");function ao(c){if(!qr(c))return!1;var p=is(c);return p==Xe||p==Re||p==lt||p==Ls}o(ao,"isFunction");function gR(c){return typeof c=="number"&&c==jt(c)}o(gR,"isInteger");function cw(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=Z}o(cw,"isLength");function qr(c){var p=typeof c;return c!=null&&(p=="object"||p=="function")}o(qr,"isObject");function Wr(c){return c!=null&&typeof c=="object"}o(Wr,"isObjectLike");var yR=_D?Ms(_D):EF;function v7(c,p){return c===p||K2(c,p,ob(p))}o(v7,"isMatch");function w7(c,p,v){return v=typeof v=="function"?v:r,K2(c,p,ob(p),v)}o(w7,"isMatchWith");function S7(c){return vR(c)&&c!=+c}o(S7,"isNaN");function E7(c){if(s9(c))throw new Pt(n);return l_(c)}o(E7,"isNative");function A7(c){return c===null}o(A7,"isNull");function C7(c){return c==null}o(C7,"isNil");function vR(c){return typeof c=="number"||Wr(c)&&is(c)==ct}o(vR,"isNumber");function pm(c){if(!Wr(c)||is(c)!=je)return!1;var p=Vv(c);if(p===null)return!0;var v=wr.call(p,"constructor")&&p.constructor;return typeof v=="function"&&v instanceof v&&Pv.call(v)==wj}o(pm,"isPlainObject");var vb=RD?Ms(RD):AF;function b7(c){return gR(c)&&c>=-Z&&c<=Z}o(b7,"isSafeInteger");var wR=PD?Ms(PD):CF;function fw(c){return typeof c=="string"||!Lt(c)&&Wr(c)&&is(c)==on}o(fw,"isString");function Fs(c){return typeof c=="symbol"||Wr(c)&&is(c)==$n}o(Fs,"isSymbol");var Dh=OD?Ms(OD):bF;function x7(c){return c===r}o(x7,"isUndefined");function N7(c){return Wr(c)&&Wn(c)==ns}o(N7,"isWeakMap");function T7(c){return Wr(c)&&is(c)==pt}o(T7,"isWeakSet");var I7=tw(X2),B7=tw(function(c,p){return c<=p});function SR(c){if(!c)return[];if(ys(c))return fw(c)?ki(c):gs(c);if(em&&c[em])return oj(c[em]());var p=Wn(c),v=p==xe?P2:p==Ur?Dv:_h;return v(c)}o(SR,"toArray");function oo(c){if(!c)return c===0?c:0;if(c=li(c),c===oe||c===-oe){var p=c<0?-1:1;return p*fe}return c===c?c:0}o(oo,"toFinite");function jt(c){var p=oo(c),v=p%1;return p===p?v?p-v:p:0}o(jt,"toInteger");function ER(c){return c?ac(jt(c),0,Ke):0}o(ER,"toLength");function li(c){if(typeof c=="number")return c;if(Fs(c))return Se;if(qr(c)){var p=typeof c.valueOf=="function"?c.valueOf():c;c=qr(p)?p+"":p}if(typeof c!="string")return c===0?c:+c;c=jD(c);var v=cM.test(c);return v||hM.test(c)?KM(c.slice(2),v?2:8):y2.test(c)?Se:+c}o(li,"toNumber");function AR(c){return ca(c,vs(c))}o(AR,"toPlainObject");function D7(c){return c?ac(jt(c),-Z,Z):c===0?c:0}o(D7,"toSafeInteger");function gr(c){return c==null?"":js(c)}o(gr,"toString");var _7=Th(function(c,p){if(fm(p)||ys(p)){ca(p,En(p),c);return}for(var v in p)wr.call(p,v)&&im(c,v,p[v])}),CR=Th(function(c,p){ca(p,vs(p),c)}),hw=Th(function(c,p,v,N){ca(p,vs(p),c,N)}),R7=Th(function(c,p,v,N){ca(p,En(p),c,N)}),P7=so(M2);function O7(c,p){var v=Nh(c);return p==null?v:t_(v,p)}o(O7,"create");var k7=Gt(function(c,p){c=Cr(c);var v=-1,N=p.length,P=N>2?p[2]:r;for(P&&as(p[0],p[1],P)&&(N=1);++v<N;)for(var j=p[v],z=vs(j),Q=-1,ue=z.length;++Q<ue;){var Ne=z[Q],De=c[Ne];(De===r||Vi(De,Ch[Ne])&&!wr.call(c,Ne))&&(c[Ne]=j[Ne])}return c}),L7=Gt(function(c){return c.push(r,j_),Us(bR,r,c)});function V7(c,p){return LD(c,Et(p,3),la)}o(V7,"findKey");function U7(c,p){return LD(c,Et(p,3),F2)}o(U7,"findLastKey");function M7(c,p){return c==null?c:j2(c,Et(p,3),vs)}o(M7,"forIn");function j7(c,p){return c==null?c:a_(c,Et(p,3),vs)}o(j7,"forInRight");function F7(c,p){return c&&la(c,Et(p,3))}o(F7,"forOwn");function q7(c,p){return c&&F2(c,Et(p,3))}o(q7,"forOwnRight");function H7(c){return c==null?[]:Gv(c,En(c))}o(H7,"functions");function K7(c){return c==null?[]:Gv(c,vs(c))}o(K7,"functionsIn");function wb(c,p,v){var N=c==null?r:oc(c,p);return N===r?v:N}o(wb,"get");function $7(c,p){return c!=null&&H_(c,p,dF)}o($7,"has");function Sb(c,p){return c!=null&&H_(c,p,mF)}o(Sb,"hasIn");var X7=k_(function(c,p,v){p!=null&&typeof p.toString!="function"&&(p=Ov.call(p)),c[p]=v},Ab(ws)),G7=k_(function(c,p,v){p!=null&&typeof p.toString!="function"&&(p=Ov.call(p)),wr.call(c,p)?c[p].push(v):c[p]=[v]},Et),W7=Gt(om);function En(c){return ys(c)?ZD(c):$2(c)}o(En,"keys");function vs(c){return ys(c)?ZD(c,!0):xF(c)}o(vs,"keysIn");function J7(c,p){var v={};return p=Et(p,3),la(c,function(N,P,j){ro(v,p(N,P,j),N)}),v}o(J7,"mapKeys");function z7(c,p){var v={};return p=Et(p,3),la(c,function(N,P,j){ro(v,P,p(N,P,j))}),v}o(z7,"mapValues");var Y7=Th(function(c,p,v){Wv(c,p,v)}),bR=Th(function(c,p,v,N){Wv(c,p,v,N)}),Q7=so(function(c,p){var v={};if(c==null)return v;var N=!1;p=Mr(p,function(j){return j=lu(j,c),N||(N=j.length>1),j}),ca(c,ib(c),v),N&&(v=ai(v,f|h|m,XF));for(var P=p.length;P--;)Y2(v,p[P]);return v});function Z7(c,p){return xR(c,lw(Et(p)))}o(Z7,"omitBy");var eH=so(function(c,p){return c==null?{}:TF(c,p)});function xR(c,p){if(c==null)return{};var v=Mr(ib(c),function(N){return[N]});return p=Et(p),g_(c,v,function(N,P){return p(N,P[0])})}o(xR,"pickBy");function tH(c,p,v){p=lu(p,c);var N=-1,P=p.length;for(P||(P=1,c=r);++N<P;){var j=c==null?r:c[fa(p[N])];j===r&&(N=P,j=v),c=ao(j)?j.call(c):j}return c}o(tH,"result");function rH(c,p,v){return c==null?c:lm(c,p,v)}o(rH,"set");function nH(c,p,v,N){return N=typeof N=="function"?N:r,c==null?c:lm(c,p,v,N)}o(nH,"setWith");var NR=U_(En),TR=U_(vs);function sH(c,p,v){var N=Lt(c),P=N||fu(c)||Dh(c);if(p=Et(p,4),v==null){var j=c&&c.constructor;P?v=N?new j:[]:qr(c)?v=ao(j)?Nh(Vv(c)):{}:v={}}return(P?ni:la)(c,function(z,Q,ue){return p(v,z,Q,ue)}),v}o(sH,"transform");function iH(c,p){return c==null?!0:Y2(c,p)}o(iH,"unset");function aH(c,p,v){return c==null?c:E_(c,p,eb(v))}o(aH,"update");function oH(c,p,v,N){return N=typeof N=="function"?N:r,c==null?c:E_(c,p,eb(v),N)}o(oH,"updateWith");function _h(c){return c==null?[]:R2(c,En(c))}o(_h,"values");function uH(c){return c==null?[]:R2(c,vs(c))}o(uH,"valuesIn");function lH(c,p,v){return v===r&&(v=p,p=r),v!==r&&(v=li(v),v=v===v?v:0),p!==r&&(p=li(p),p=p===p?p:0),ac(li(c),p,v)}o(lH,"clamp");function cH(c,p,v){return p=oo(p),v===r?(v=p,p=0):v=oo(v),c=li(c),gF(c,p,v)}o(cH,"inRange");function fH(c,p,v){if(v&&typeof v!="boolean"&&as(c,p,v)&&(p=v=r),v===r&&(typeof p=="boolean"?(v=p,p=r):typeof c=="boolean"&&(v=c,c=r)),c===r&&p===r?(c=0,p=1):(c=oo(c),p===r?(p=c,c=0):p=oo(p)),c>p){var N=c;c=p,p=N}if(v||c%1||p%1){var P=YD();return Gn(c+P*(p-c+HM("1e-"+((P+"").length-1))),p)}return W2(c,p)}o(fH,"random");var hH=Ih(function(c,p,v){return p=p.toLowerCase(),c+(v?IR(p):p)});function IR(c){return Eb(gr(c).toLowerCase())}o(IR,"capitalize");function BR(c){return c=gr(c),c&&c.replace(dM,rj).replace(PM,"")}o(BR,"deburr");function pH(c,p,v){c=gr(c),p=js(p);var N=c.length;v=v===r?N:ac(jt(v),0,N);var P=v;return v-=p.length,v>=0&&c.slice(v,P)==p}o(pH,"endsWith");function dH(c){return c=gr(c),c&&nt.test(c)?c.replace(ie,nj):c}o(dH,"escape");function mH(c){return c=gr(c),c&&ua.test(c)?c.replace(or,"\\$&"):c}o(mH,"escapeRegExp");var gH=Ih(function(c,p,v){return c+(v?"-":"")+p.toLowerCase()}),yH=Ih(function(c,p,v){return c+(v?" ":"")+p.toLowerCase()}),vH=R_("toLowerCase");function wH(c,p,v){c=gr(c),p=jt(p);var N=p?Ah(c):0;if(!p||N>=p)return c;var P=(p-N)/2;return ew(Fv(P),v)+c+ew(jv(P),v)}o(wH,"pad");function SH(c,p,v){c=gr(c),p=jt(p);var N=p?Ah(c):0;return p&&N<p?c+ew(p-N,v):c}o(SH,"padEnd");function EH(c,p,v){c=gr(c),p=jt(p);var N=p?Ah(c):0;return p&&N<p?ew(p-N,v)+c:c}o(EH,"padStart");function AH(c,p,v){return v||p==null?p=0:p&&(p=+p),Bj(gr(c).replace(Q0,""),p||0)}o(AH,"parseInt1");function CH(c,p,v){return(v?as(c,p,v):p===r)?p=1:p=jt(p),J2(gr(c),p)}o(CH,"repeat");function bH(){var c=arguments,p=gr(c[0]);return c.length<3?p:p.replace(c[1],c[2])}o(bH,"replace");var xH=Ih(function(c,p,v){return c+(v?"_":"")+p.toLowerCase()});function NH(c,p,v){return v&&typeof v!="number"&&as(c,p,v)&&(p=v=r),v=v===r?Ke:v>>>0,v?(c=gr(c),c&&(typeof p=="string"||p!=null&&!vb(p))&&(p=js(p),!p&&Eh(c))?cu(ki(c),0,v):c.split(p,v)):[]}o(NH,"split");var TH=Ih(function(c,p,v){return c+(v?" ":"")+Eb(p)});function IH(c,p,v){return c=gr(c),v=v==null?0:ac(jt(v),0,c.length),p=js(p),c.slice(v,v+p.length)==p}o(IH,"startsWith");function BH(c,p,v){var N=M.templateSettings;v&&as(c,p,v)&&(p=r),c=gr(c),p=hw({},p,N,M_);var P=hw({},p.imports,N.imports,M_),j=En(P),z=R2(P,j),Q,ue,Ne=0,De=p.interpolate||xv,Le="__p += '",ze=O2((p.escape||xv).source+"|"+De.source+"|"+(De===et?Xn:xv).source+"|"+(p.evaluate||xv).source+"|$","g"),ht="//# sourceURL="+(wr.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++UM+"]")+`
25
- `;c.replace(ze,function(xt,Jt,sr,qs,os,Hs){return sr||(sr=qs),Le+=c.slice(Ne,Hs).replace(mM,sj),Jt&&(Q=!0,Le+=`' +
26
- __e(`+Jt+`) +
27
- '`),os&&(ue=!0,Le+=`';
28
- `+os+`;
29
- __p += '`),sr&&(Le+=`' +
30
- ((__t = (`+sr+`)) == null ? '' : __t) +
31
- '`),Ne=Hs+xt.length,xt}),Le+=`';
32
- `;var bt=wr.call(p,"variable")&&p.variable;if(!bt)Le=`with (obj) {
33
- `+Le+`
34
- }
35
- `;else if(qe.test(bt))throw new Pt(i);Le=(ue?Le.replace(d,""):Le).replace(I,"$1").replace($,"$1;"),Le="function("+(bt||"obj")+`) {
36
- `+(bt?"":`obj || (obj = {});
37
- `)+"var __t, __p = ''"+(Q?", __e = _.escape":"")+(ue?`, __j = Array.prototype.join;
38
- function print() { __p += __j.call(arguments, '') }
39
- `:`;
40
- `)+Le+`return __p
41
- }`;var Kt=_R(function(){return mr(j,ht+"return "+Le).apply(r,z)});if(Kt.source=Le,yb(Kt))throw Kt;return Kt}o(BH,"template");function DH(c){return gr(c).toLowerCase()}o(DH,"toLower");function _H(c){return gr(c).toUpperCase()}o(_H,"toUpper");function RH(c,p,v){if(c=gr(c),c&&(v||p===r))return jD(c);if(!c||!(p=js(p)))return c;var N=ki(c),P=ki(p),j=FD(N,P),z=qD(N,P)+1;return cu(N,j,z).join("")}o(RH,"trim");function PH(c,p,v){if(c=gr(c),c&&(v||p===r))return c.slice(0,KD(c)+1);if(!c||!(p=js(p)))return c;var N=ki(c),P=qD(N,ki(p))+1;return cu(N,0,P).join("")}o(PH,"trimEnd");function OH(c,p,v){if(c=gr(c),c&&(v||p===r))return c.replace(Q0,"");if(!c||!(p=js(p)))return c;var N=ki(c),P=FD(N,ki(p));return cu(N,P).join("")}o(OH,"trimStart");function kH(c,p){var v=R,N=H;if(qr(p)){var P="separator"in p?p.separator:P;v="length"in p?jt(p.length):v,N="omission"in p?js(p.omission):N}c=gr(c);var j=c.length;if(Eh(c)){var z=ki(c);j=z.length}if(v>=j)return c;var Q=v-Ah(N);if(Q<1)return N;var ue=z?cu(z,0,Q).join(""):c.slice(0,Q);if(P===r)return ue+N;if(z&&(Q+=ue.length-Q),vb(P)){if(c.slice(Q).search(P)){var Ne,De=ue;for(P.global||(P=O2(P.source,gr(Oi.exec(P))+"g")),P.lastIndex=0;Ne=P.exec(De);)var Le=Ne.index;ue=ue.slice(0,Le===r?Q:Le)}}else if(c.indexOf(js(P),Q)!=Q){var ze=ue.lastIndexOf(P);ze>-1&&(ue=ue.slice(0,ze))}return ue+N}o(kH,"truncate");function LH(c){return c=gr(c),c&&X.test(c)?c.replace(te,fj):c}o(LH,"unescape");var VH=Ih(function(c,p,v){return c+(v?" ":"")+p.toUpperCase()}),Eb=R_("toUpperCase");function DR(c,p,v){return c=gr(c),p=v?r:p,p===r?aj(c)?dj(c):YM(c):c.match(p)||[]}o(DR,"words");var _R=Gt(function(c,p){try{return Us(c,r,p)}catch(v){return yb(v)?v:new Pt(v)}}),UH=so(function(c,p){return ni(p,function(v){v=fa(v),ro(c,v,mb(c[v],c))}),c});function MH(c){var p=c==null?0:c.length,v=Et();return c=p?Mr(c,function(N){if(typeof N[1]!="function")throw new si(s);return[v(N[0]),N[1]]}):[],Gt(function(N){for(var P=-1;++P<p;){var j=c[P];if(Us(j[0],this,N))return Us(j[1],this,N)}})}o(MH,"cond");function jH(c){return fF(ai(c,f))}o(jH,"conforms");function Ab(c){return function(){return c}}o(Ab,"constant");function FH(c,p){return c==null||c!==c?p:c}o(FH,"defaultTo");var qH=O_(),HH=O_(!0);function ws(c){return c}o(ws,"identity");function Cb(c){return c_(typeof c=="function"?c:ai(c,f))}o(Cb,"iteratee");function KH(c){return h_(ai(c,f))}o(KH,"matches");function $H(c,p){return p_(c,ai(p,f))}o($H,"matchesProperty");var XH=Gt(function(c,p){return function(v){return om(v,c,p)}}),GH=Gt(function(c,p){return function(v){return om(c,v,p)}});function bb(c,p,v){var N=En(p),P=Gv(p,N);v==null&&!(qr(p)&&(P.length||!N.length))&&(v=p,p=c,c=this,P=Gv(p,En(p)));var j=!(qr(v)&&"chain"in v)||!!v.chain,z=ao(c);return ni(P,function(Q){var ue=p[Q];c[Q]=ue,z&&(c.prototype[Q]=function(){var Ne=this.__chain__;if(j||Ne){var De=c(this.__wrapped__),Le=De.__actions__=gs(this.__actions__);return Le.push({func:ue,args:arguments,thisArg:c}),De.__chain__=Ne,De}return ue.apply(c,nu([this.value()],arguments))})}),c}o(bb,"mixin");function WH(){return Sn._===this&&(Sn._=Sj),this}o(WH,"noConflict");function xb(){}o(xb,"noop");function JH(c){return c=jt(c),Gt(function(p){return d_(p,c)})}o(JH,"nthArg");var zH=rb(Mr),YH=rb(kD),QH=rb(T2);function RR(c){return lb(c)?I2(fa(c)):IF(c)}o(RR,"property");function ZH(c){return function(p){return c==null?r:oc(c,p)}}o(ZH,"propertyOf");var eK=L_(),tK=L_(!0);function Nb(){return[]}o(Nb,"stubArray");function Tb(){return!1}o(Tb,"stubFalse");function rK(){return{}}o(rK,"stubObject");function nK(){return""}o(nK,"stubString");function sK(){return!0}o(sK,"stubTrue");function iK(c,p){if(c=jt(c),c<1||c>Z)return[];var v=Ke,N=Gn(c,Ke);p=Et(p),c-=Ke;for(var P=_2(N,p);++v<c;)p(v);return P}o(iK,"times");function aK(c){return Lt(c)?Mr(c,fa):Fs(c)?[c]:gs(Q_(gr(c)))}o(aK,"toPath");function oK(c){var p=++vj;return gr(c)+p}o(oK,"uniqueId");var uK=Zv(function(c,p){return c+p},0),lK=nb("ceil"),cK=Zv(function(c,p){return c/p},1),fK=nb("floor");function hK(c){return c&&c.length?Xv(c,ws,q2):r}o(hK,"max");function pK(c,p){return c&&c.length?Xv(c,Et(p,2),q2):r}o(pK,"maxBy");function dK(c){return UD(c,ws)}o(dK,"mean");function mK(c,p){return UD(c,Et(p,2))}o(mK,"meanBy");function gK(c){return c&&c.length?Xv(c,ws,X2):r}o(gK,"min");function yK(c,p){return c&&c.length?Xv(c,Et(p,2),X2):r}o(yK,"minBy");var vK=Zv(function(c,p){return c*p},1),wK=nb("round"),SK=Zv(function(c,p){return c-p},0);function EK(c){return c&&c.length?D2(c,ws):0}o(EK,"sum");function AK(c,p){return c&&c.length?D2(c,Et(p,2)):0}return o(AK,"sumBy"),M.after=Kq,M.ary=lR,M.assign=_7,M.assignIn=CR,M.assignInWith=hw,M.assignWith=R7,M.at=P7,M.before=cR,M.bind=mb,M.bindAll=UH,M.bindKey=fR,M.castArray=r7,M.chain=aR,M.chunk=f9,M.compact=h9,M.concat=p9,M.cond=MH,M.conforms=jH,M.constant=Ab,M.countBy=Eq,M.create=O7,M.curry=hR,M.curryRight=pR,M.debounce=dR,M.defaults=k7,M.defaultsDeep=L7,M.defer=$q,M.delay=Xq,M.difference=d9,M.differenceBy=m9,M.differenceWith=g9,M.drop=y9,M.dropRight=v9,M.dropRightWhile=w9,M.dropWhile=S9,M.fill=E9,M.filter=Cq,M.flatMap=Nq,M.flatMapDeep=Tq,M.flatMapDepth=Iq,M.flatten=rR,M.flattenDeep=A9,M.flattenDepth=C9,M.flip=Gq,M.flow=qH,M.flowRight=HH,M.fromPairs=b9,M.functions=H7,M.functionsIn=K7,M.groupBy=Bq,M.initial=N9,M.intersection=T9,M.intersectionBy=I9,M.intersectionWith=B9,M.invert=X7,M.invertBy=G7,M.invokeMap=_q,M.iteratee=Cb,M.keyBy=Rq,M.keys=En,M.keysIn=vs,M.map=aw,M.mapKeys=J7,M.mapValues=z7,M.matches=KH,M.matchesProperty=$H,M.memoize=uw,M.merge=Y7,M.mergeWith=bR,M.method=XH,M.methodOf=GH,M.mixin=bb,M.negate=lw,M.nthArg=JH,M.omit=Q7,M.omitBy=Z7,M.once=Wq,M.orderBy=Pq,M.over=zH,M.overArgs=Jq,M.overEvery=YH,M.overSome=QH,M.partial=gb,M.partialRight=mR,M.partition=Oq,M.pick=eH,M.pickBy=xR,M.property=RR,M.propertyOf=ZH,M.pull=P9,M.pullAll=sR,M.pullAllBy=O9,M.pullAllWith=k9,M.pullAt=L9,M.range=eK,M.rangeRight=tK,M.rearg=zq,M.reject=Vq,M.remove=V9,M.rest=Yq,M.reverse=pb,M.sampleSize=Mq,M.set=rH,M.setWith=nH,M.shuffle=jq,M.slice=U9,M.sortBy=Hq,M.sortedUniq=$9,M.sortedUniqBy=X9,M.split=NH,M.spread=Qq,M.tail=G9,M.take=W9,M.takeRight=J9,M.takeRightWhile=z9,M.takeWhile=Y9,M.tap=hq,M.throttle=Zq,M.thru=iw,M.toArray=SR,M.toPairs=NR,M.toPairsIn=TR,M.toPath=aK,M.toPlainObject=AR,M.transform=sH,M.unary=e7,M.union=Q9,M.unionBy=Z9,M.unionWith=eq,M.uniq=tq,M.uniqBy=rq,M.uniqWith=nq,M.unset=iH,M.unzip=db,M.unzipWith=iR,M.update=aH,M.updateWith=oH,M.values=_h,M.valuesIn=uH,M.without=sq,M.words=DR,M.wrap=t7,M.xor=iq,M.xorBy=aq,M.xorWith=oq,M.zip=uq,M.zipObject=lq,M.zipObjectDeep=cq,M.zipWith=fq,M.entries=NR,M.entriesIn=TR,M.extend=CR,M.extendWith=hw,bb(M,M),M.add=uK,M.attempt=_R,M.camelCase=hH,M.capitalize=IR,M.ceil=lK,M.clamp=lH,M.clone=n7,M.cloneDeep=i7,M.cloneDeepWith=a7,M.cloneWith=s7,M.conformsTo=o7,M.deburr=BR,M.defaultTo=FH,M.divide=cK,M.endsWith=pH,M.eq=Vi,M.escape=dH,M.escapeRegExp=mH,M.every=Aq,M.find=bq,M.findIndex=eR,M.findKey=V7,M.findLast=xq,M.findLastIndex=tR,M.findLastKey=U7,M.floor=fK,M.forEach=oR,M.forEachRight=uR,M.forIn=M7,M.forInRight=j7,M.forOwn=F7,M.forOwnRight=q7,M.get=wb,M.gt=u7,M.gte=l7,M.has=$7,M.hasIn=Sb,M.head=nR,M.identity=ws,M.includes=Dq,M.indexOf=x9,M.inRange=cH,M.invoke=W7,M.isArguments=cc,M.isArray=Lt,M.isArrayBuffer=c7,M.isArrayLike=ys,M.isArrayLikeObject=en,M.isBoolean=f7,M.isBuffer=fu,M.isDate=h7,M.isElement=p7,M.isEmpty=d7,M.isEqual=m7,M.isEqualWith=g7,M.isError=yb,M.isFinite=y7,M.isFunction=ao,M.isInteger=gR,M.isLength=cw,M.isMap=yR,M.isMatch=v7,M.isMatchWith=w7,M.isNaN=S7,M.isNative=E7,M.isNil=C7,M.isNull=A7,M.isNumber=vR,M.isObject=qr,M.isObjectLike=Wr,M.isPlainObject=pm,M.isRegExp=vb,M.isSafeInteger=b7,M.isSet=wR,M.isString=fw,M.isSymbol=Fs,M.isTypedArray=Dh,M.isUndefined=x7,M.isWeakMap=N7,M.isWeakSet=T7,M.join=D9,M.kebabCase=gH,M.last=ui,M.lastIndexOf=_9,M.lowerCase=yH,M.lowerFirst=vH,M.lt=I7,M.lte=B7,M.max=hK,M.maxBy=pK,M.mean=dK,M.meanBy=mK,M.min=gK,M.minBy=yK,M.stubArray=Nb,M.stubFalse=Tb,M.stubObject=rK,M.stubString=nK,M.stubTrue=sK,M.multiply=vK,M.nth=R9,M.noConflict=WH,M.noop=xb,M.now=ow,M.pad=wH,M.padEnd=SH,M.padStart=EH,M.parseInt=AH,M.random=fH,M.reduce=kq,M.reduceRight=Lq,M.repeat=CH,M.replace=bH,M.result=tH,M.round=wK,M.runInContext=se,M.sample=Uq,M.size=Fq,M.snakeCase=xH,M.some=qq,M.sortedIndex=M9,M.sortedIndexBy=j9,M.sortedIndexOf=F9,M.sortedLastIndex=q9,M.sortedLastIndexBy=H9,M.sortedLastIndexOf=K9,M.startCase=TH,M.startsWith=IH,M.subtract=SK,M.sum=EK,M.sumBy=AK,M.template=BH,M.times=iK,M.toFinite=oo,M.toInteger=jt,M.toLength=ER,M.toLower=DH,M.toNumber=li,M.toSafeInteger=D7,M.toString=gr,M.toUpper=_H,M.trim=RH,M.trimEnd=PH,M.trimStart=OH,M.truncate=kH,M.unescape=LH,M.uniqueId=oK,M.upperCase=VH,M.upperFirst=Eb,M.each=oR,M.eachRight=uR,M.first=nR,bb(M,(function(){var c={};return la(M,function(p,v){wr.call(M.prototype,v)||(c[v]=p)}),c})(),{chain:!1}),M.VERSION=e,ni(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){M[c].placeholder=M}),ni(["drop","take"],function(c,p){er.prototype[c]=function(v){v=v===r?1:mn(jt(v),0);var N=this.__filtered__&&!p?new er(this):this.clone();return N.__filtered__?N.__takeCount__=Gn(v,N.__takeCount__):N.__views__.push({size:Gn(v,Ke),type:c+(N.__dir__<0?"Right":"")}),N},er.prototype[c+"Right"]=function(v){return this.reverse()[c](v).reverse()}}),ni(["filter","map","takeWhile"],function(c,p){var v=p+1,N=v==G||v==le;er.prototype[c]=function(P){var j=this.clone();return j.__iteratees__.push({iteratee:Et(P,3),type:v}),j.__filtered__=j.__filtered__||N,j}}),ni(["head","last"],function(c,p){var v="take"+(p?"Right":"");er.prototype[c]=function(){return this[v](1).value()[0]}}),ni(["initial","tail"],function(c,p){var v="drop"+(p?"":"Right");er.prototype[c]=function(){return this.__filtered__?new er(this):this[v](1)}}),er.prototype.compact=function(){return this.filter(ws)},er.prototype.find=function(c){return this.filter(c).head()},er.prototype.findLast=function(c){return this.reverse().find(c)},er.prototype.invokeMap=Gt(function(c,p){return typeof c=="function"?new er(this):this.map(function(v){return om(v,c,p)})}),er.prototype.reject=function(c){return this.filter(lw(Et(c)))},er.prototype.slice=function(c,p){c=jt(c);var v=this;return v.__filtered__&&(c>0||p<0)?new er(v):(c<0?v=v.takeRight(-c):c&&(v=v.drop(c)),p!==r&&(p=jt(p),v=p<0?v.dropRight(-p):v.take(p-c)),v)},er.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},er.prototype.toArray=function(){return this.take(Ke)},la(er.prototype,function(c,p){var v=/^(?:filter|find|map|reject)|While$/.test(p),N=/^(?:head|last)$/.test(p),P=M[N?"take"+(p=="last"?"Right":""):p],j=N||/^find/.test(p);P&&(M.prototype[p]=function(){var z=this.__wrapped__,Q=N?[1]:arguments,ue=z instanceof er,Ne=Q[0],De=ue||Lt(z),Le=o(function(Jt){var sr=P.apply(M,nu([Jt],Q));return N&&ze?sr[0]:sr},"interceptor");De&&v&&typeof Ne=="function"&&Ne.length!=1&&(ue=De=!1);var ze=this.__chain__,ht=!!this.__actions__.length,bt=j&&!ze,Kt=ue&&!ht;if(!j&&De){z=Kt?z:new er(this);var xt=c.apply(z,Q);return xt.__actions__.push({func:iw,args:[Le],thisArg:r}),new ii(xt,ze)}return bt&&Kt?c.apply(this,Q):(xt=this.thru(Le),bt?N?xt.value()[0]:xt.value():xt)})}),ni(["pop","push","shift","sort","splice","unshift"],function(c){var p=_v[c],v=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",N=/^(?:pop|shift)$/.test(c);M.prototype[c]=function(){var P=arguments;if(N&&!this.__chain__){var j=this.value();return p.apply(Lt(j)?j:[],P)}return this[v](function(z){return p.apply(Lt(z)?z:[],P)})}}),la(er.prototype,function(c,p){var v=M[p];if(v){var N=v.name+"";wr.call(xh,N)||(xh[N]=[]),xh[N].push({name:p,func:v})}}),xh[Qv(r,S).name]=[{name:"wrapper",func:r}],er.prototype.clone=Lj,er.prototype.reverse=Vj,er.prototype.value=Uj,M.prototype.at=pq,M.prototype.chain=dq,M.prototype.commit=mq,M.prototype.next=gq,M.prototype.plant=vq,M.prototype.reverse=wq,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=Sq,M.prototype.first=M.prototype.head,em&&(M.prototype[em]=yq),M},"runInContext"),iu=mj();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Sn._=iu,define(function(){return iu})):rc?((rc.exports=iu)._=iu,C2._=iu):Sn._=iu}).call(rp)});var pN=ye((Nfe,Y4)=>{"use strict";var CJ=CK(),bJ=gt("crypto"),xJ=gt("url"),NJ=bK(),TJ=gt("http"),IJ=gt("https"),BJ=gt("util"),DJ=xK(),_J=gt("zlib"),x4=gt("stream"),RJ=gt("events");function xa(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}o(xa,"_interopDefaultLegacy");var N4=xa(CJ),PJ=xa(bJ),OJ=xa(xJ),kJ=xa(NJ),LJ=xa(TJ),VJ=xa(IJ),T4=xa(BJ),UJ=xa(DJ),Iu=xa(_J),Tu=xa(x4);function I4(r,e){return o(function(){return r.apply(e,arguments)},"wrap")}o(I4,"bind");var{toString:MJ}=Object.prototype,{getPrototypeOf:aN}=Object,{iterator:pS,toStringTag:B4}=Symbol,dS=(r=>e=>{let t=MJ.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Hi=o(r=>(r=r.toLowerCase(),e=>dS(e)===r),"kindOfTest"),mS=o(r=>e=>typeof e===r,"typeOfTest"),{isArray:up}=Array,sp=mS("undefined");function Lm(r){return r!==null&&!sp(r)&&r.constructor!==null&&!sp(r.constructor)&&Cs(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}o(Lm,"isBuffer");var D4=Hi("ArrayBuffer");function jJ(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&D4(r.buffer),e}o(jJ,"isArrayBufferView");var FJ=mS("string"),Cs=mS("function"),_4=mS("number"),Vm=o(r=>r!==null&&typeof r=="object","isObject"),qJ=o(r=>r===!0||r===!1,"isBoolean"),aS=o(r=>{if(dS(r)!=="object")return!1;let e=aN(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(B4 in r)&&!(pS in r)},"isPlainObject"),HJ=o(r=>{if(!Vm(r)||Lm(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},"isEmptyObject"),KJ=Hi("Date"),$J=Hi("File"),XJ=Hi("Blob"),GJ=Hi("FileList"),WJ=o(r=>Vm(r)&&Cs(r.pipe),"isStream"),JJ=o(r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||Cs(r.append)&&((e=dS(r))==="formdata"||e==="object"&&Cs(r.toString)&&r.toString()==="[object FormData]"))},"isFormData"),zJ=Hi("URLSearchParams"),[YJ,QJ,ZJ,ez]=["ReadableStream","Request","Response","Headers"].map(Hi),tz=o(r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function Um(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,s;if(typeof r!="object"&&(r=[r]),up(r))for(n=0,s=r.length;n<s;n++)e.call(null,r[n],n,r);else{if(Lm(r))return;let i=t?Object.getOwnPropertyNames(r):Object.keys(r),a=i.length,u;for(n=0;n<a;n++)u=i[n],e.call(null,r[u],u,r)}}o(Um,"forEach");function R4(r,e){if(Lm(r))return null;e=e.toLowerCase();let t=Object.keys(r),n=t.length,s;for(;n-- >0;)if(s=t[n],e===s.toLowerCase())return s;return null}o(R4,"findKey");var Ec=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,P4=o(r=>!sp(r)&&r!==Ec,"isContextDefined");function zx(){let{caseless:r,skipUndefined:e}=P4(this)&&this||{},t={},n=o((s,i)=>{let a=r&&R4(t,i)||i;aS(t[a])&&aS(s)?t[a]=zx(t[a],s):aS(s)?t[a]=zx({},s):up(s)?t[a]=s.slice():(!e||!sp(s))&&(t[a]=s)},"assignValue");for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Um(arguments[s],n);return t}o(zx,"merge");var rz=o((r,e,t,{allOwnKeys:n}={})=>(Um(e,(s,i)=>{t&&Cs(s)?r[i]=I4(s,t):r[i]=s},{allOwnKeys:n}),r),"extend"),nz=o(r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),"stripBOM"),sz=o((r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},"inherits"),iz=o((r,e,t,n)=>{let s,i,a,u={};if(e=e||{},r==null)return e;do{for(s=Object.getOwnPropertyNames(r),i=s.length;i-- >0;)a=s[i],(!n||n(a,r,e))&&!u[a]&&(e[a]=r[a],u[a]=!0);r=t!==!1&&aN(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},"toFlatObject"),az=o((r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;let n=r.indexOf(e,t);return n!==-1&&n===t},"endsWith"),oz=o(r=>{if(!r)return null;if(up(r))return r;let e=r.length;if(!_4(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},"toArray"),uz=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&aN(Uint8Array)),lz=o((r,e)=>{let n=(r&&r[pS]).call(r),s;for(;(s=n.next())&&!s.done;){let i=s.value;e.call(r,i[0],i[1])}},"forEachEntry"),cz=o((r,e)=>{let t,n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},"matchAll"),fz=Hi("HTMLFormElement"),hz=o(r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,o(function(t,n,s){return n.toUpperCase()+s},"replacer")),"toCamelCase"),n4=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),pz=Hi("RegExp"),O4=o((r,e)=>{let t=Object.getOwnPropertyDescriptors(r),n={};Um(t,(s,i)=>{let a;(a=e(s,i,r))!==!1&&(n[i]=a||s)}),Object.defineProperties(r,n)},"reduceDescriptors"),dz=o(r=>{O4(r,(e,t)=>{if(Cs(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let n=r[t];if(Cs(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},"freezeMethods"),mz=o((r,e)=>{let t={},n=o(s=>{s.forEach(i=>{t[i]=!0})},"define");return up(r)?n(r):n(String(r).split(e)),t},"toObjectSet"),gz=o(()=>{},"noop"),yz=o((r,e)=>r!=null&&Number.isFinite(r=+r)?r:e,"toFiniteNumber");function vz(r){return!!(r&&Cs(r.append)&&r[B4]==="FormData"&&r[pS])}o(vz,"isSpecCompliantForm");var wz=o(r=>{let e=new Array(10),t=o((n,s)=>{if(Vm(n)){if(e.indexOf(n)>=0)return;if(Lm(n))return n;if(!("toJSON"in n)){e[s]=n;let i=up(n)?[]:{};return Um(n,(a,u)=>{let l=t(a,s+1);!sp(l)&&(i[u]=l)}),e[s]=void 0,i}}return n},"visit");return t(r,0)},"toJSONObject"),Sz=Hi("AsyncFunction"),Ez=o(r=>r&&(Vm(r)||Cs(r))&&Cs(r.then)&&Cs(r.catch),"isThenable"),k4=((r,e)=>r?setImmediate:e?((t,n)=>(Ec.addEventListener("message",({source:s,data:i})=>{s===Ec&&i===t&&n.length&&n.shift()()},!1),s=>{n.push(s),Ec.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Cs(Ec.postMessage)),Az=typeof queueMicrotask<"u"?queueMicrotask.bind(Ec):typeof process<"u"&&process.nextTick||k4,Cz=o(r=>r!=null&&Cs(r[pS]),"isIterable"),ce={isArray:up,isArrayBuffer:D4,isBuffer:Lm,isFormData:JJ,isArrayBufferView:jJ,isString:FJ,isNumber:_4,isBoolean:qJ,isObject:Vm,isPlainObject:aS,isEmptyObject:HJ,isReadableStream:YJ,isRequest:QJ,isResponse:ZJ,isHeaders:ez,isUndefined:sp,isDate:KJ,isFile:$J,isBlob:XJ,isRegExp:pz,isFunction:Cs,isStream:WJ,isURLSearchParams:zJ,isTypedArray:uz,isFileList:GJ,forEach:Um,merge:zx,extend:rz,trim:tz,stripBOM:nz,inherits:sz,toFlatObject:iz,kindOf:dS,kindOfTest:Hi,endsWith:az,toArray:oz,forEachEntry:lz,matchAll:cz,isHTMLForm:fz,hasOwnProperty:n4,hasOwnProp:n4,reduceDescriptors:O4,freezeMethods:dz,toObjectSet:mz,toCamelCase:hz,noop:gz,toFiniteNumber:yz,findKey:R4,global:Ec,isContextDefined:P4,isSpecCompliantForm:vz,toJSONObject:wz,isAsyncFn:Sz,isThenable:Ez,setImmediate:k4,asap:Az,isIterable:Cz};function it(r,e,t,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}o(it,"AxiosError");ce.inherits(it,Error,{toJSON:o(function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ce.toJSONObject(this.config),code:this.code,status:this.status}},"toJSON")});var L4=it.prototype,V4={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{V4[r]={value:r}});Object.defineProperties(it,V4);Object.defineProperty(L4,"isAxiosError",{value:!0});it.from=(r,e,t,n,s,i)=>{let a=Object.create(L4);ce.toFlatObject(r,a,o(function(h){return h!==Error.prototype},"filter"),f=>f!=="isAxiosError");let u=r&&r.message?r.message:"Error",l=e==null&&r?r.code:e;return it.call(a,u,l,t,n,s),r&&a.cause==null&&Object.defineProperty(a,"cause",{value:r,configurable:!0}),a.name=r&&r.name||"Error",i&&Object.assign(a,i),a};function Yx(r){return ce.isPlainObject(r)||ce.isArray(r)}o(Yx,"isVisitable");function U4(r){return ce.endsWith(r,"[]")?r.slice(0,-2):r}o(U4,"removeBrackets");function s4(r,e,t){return r?r.concat(e).map(o(function(s,i){return s=U4(s),!t&&i?"["+s+"]":s},"each")).join(t?".":""):e}o(s4,"renderKey");function bz(r){return ce.isArray(r)&&!r.some(Yx)}o(bz,"isFlatArray");var xz=ce.toFlatObject(ce,{},null,o(function(e){return/^is[A-Z]/.test(e)},"filter"));function gS(r,e,t){if(!ce.isObject(r))throw new TypeError("target must be an object");e=e||new(N4.default||FormData),t=ce.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,o(function(S,E){return!ce.isUndefined(E[S])},"defined"));let n=t.metaTokens,s=t.visitor||h,i=t.dots,a=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(e);if(!ce.isFunction(s))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(ce.isDate(y))return y.toISOString();if(ce.isBoolean(y))return y.toString();if(!l&&ce.isBlob(y))throw new it("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(y)||ce.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}o(f,"convertValue");function h(y,S,E){let b=y;if(y&&!E&&typeof y=="object"){if(ce.endsWith(S,"{}"))S=n?S:S.slice(0,-2),y=JSON.stringify(y);else if(ce.isArray(y)&&bz(y)||(ce.isFileList(y)||ce.endsWith(S,"[]"))&&(b=ce.toArray(y)))return S=U4(S),b.forEach(o(function(A,C){!(ce.isUndefined(A)||A===null)&&e.append(a===!0?s4([S],C,i):a===null?S:S+"[]",f(A))},"each")),!1}return Yx(y)?!0:(e.append(s4(E,S,i),f(y)),!1)}o(h,"defaultVisitor");let m=[],g=Object.assign(xz,{defaultVisitor:h,convertValue:f,isVisitable:Yx});function w(y,S){if(!ce.isUndefined(y)){if(m.indexOf(y)!==-1)throw Error("Circular reference detected in "+S.join("."));m.push(y),ce.forEach(y,o(function(b,T){(!(ce.isUndefined(b)||b===null)&&s.call(e,b,ce.isString(T)?T.trim():T,S,g))===!0&&w(b,S?S.concat(T):[T])},"each")),m.pop()}}if(o(w,"build"),!ce.isObject(r))throw new TypeError("data must be an object");return w(r),e}o(gS,"toFormData");function i4(r){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,o(function(n){return e[n]},"replacer"))}o(i4,"encode$1");function M4(r,e){this._pairs=[],r&&gS(r,this,e)}o(M4,"AxiosURLSearchParams");var j4=M4.prototype;j4.append=o(function(e,t){this._pairs.push([e,t])},"append");j4.toString=o(function(e){let t=e?function(n){return e.call(this,n,i4)}:i4;return this._pairs.map(o(function(s){return t(s[0])+"="+t(s[1])},"each"),"").join("&")},"toString");function Nz(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}o(Nz,"encode");function oN(r,e,t){if(!e)return r;let n=t&&t.encode||Nz;ce.isFunction(t)&&(t={serialize:t});let s=t&&t.serialize,i;if(s?i=s(e,t):i=ce.isURLSearchParams(e)?e.toString():new M4(e,t).toString(n),i){let a=r.indexOf("#");a!==-1&&(r=r.slice(0,a)),r+=(r.indexOf("?")===-1?"?":"&")+i}return r}o(oN,"buildURL");var Qx=class{static{o(this,"InterceptorManager")}constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ce.forEach(this.handlers,o(function(n){n!==null&&e(n)},"forEachHandler"))}},a4=Qx,uN={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Tz=OJ.default.URLSearchParams,$x="abcdefghijklmnopqrstuvwxyz",o4="0123456789",F4={DIGIT:o4,ALPHA:$x,ALPHA_DIGIT:$x+$x.toUpperCase()+o4},Iz=o((r=16,e=F4.ALPHA_DIGIT)=>{let t="",{length:n}=e,s=new Uint32Array(r);PJ.default.randomFillSync(s);for(let i=0;i<r;i++)t+=e[s[i]%n];return t},"generateString"),Bz={isNode:!0,classes:{URLSearchParams:Tz,FormData:N4.default,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:F4,generateString:Iz,protocols:["http","https","file","data"]},lN=typeof window<"u"&&typeof document<"u",Zx=typeof navigator=="object"&&navigator||void 0,Dz=lN&&(!Zx||["ReactNative","NativeScript","NS"].indexOf(Zx.product)<0),_z=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Rz=lN&&window.location.href||"http://localhost",Pz=Object.freeze({__proto__:null,hasBrowserEnv:lN,hasStandardBrowserWebWorkerEnv:_z,hasStandardBrowserEnv:Dz,navigator:Zx,origin:Rz}),zr={...Pz,...Bz};function Oz(r,e){return gS(r,new zr.classes.URLSearchParams,{visitor:o(function(t,n,s,i){return zr.isNode&&ce.isBuffer(t)?(this.append(n,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},"visitor"),...e})}o(Oz,"toURLEncodedForm");function kz(r){return ce.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}o(kz,"parsePropPath");function Lz(r){let e={},t=Object.keys(r),n,s=t.length,i;for(n=0;n<s;n++)i=t[n],e[i]=r[i];return e}o(Lz,"arrayToObject");function q4(r){function e(t,n,s,i){let a=t[i++];if(a==="__proto__")return!0;let u=Number.isFinite(+a),l=i>=t.length;return a=!a&&ce.isArray(s)?s.length:a,l?(ce.hasOwnProp(s,a)?s[a]=[s[a],n]:s[a]=n,!u):((!s[a]||!ce.isObject(s[a]))&&(s[a]=[]),e(t,n,s[a],i)&&ce.isArray(s[a])&&(s[a]=Lz(s[a])),!u)}if(o(e,"buildPath"),ce.isFormData(r)&&ce.isFunction(r.entries)){let t={};return ce.forEachEntry(r,(n,s)=>{e(kz(n),s,t,0)}),t}return null}o(q4,"formDataToJSON");function Vz(r,e,t){if(ce.isString(r))try{return(e||JSON.parse)(r),ce.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}o(Vz,"stringifySafely");var cN={transitional:uN,adapter:["xhr","http","fetch"],transformRequest:[o(function(e,t){let n=t.getContentType()||"",s=n.indexOf("application/json")>-1,i=ce.isObject(e);if(i&&ce.isHTMLForm(e)&&(e=new FormData(e)),ce.isFormData(e))return s?JSON.stringify(q4(e)):e;if(ce.isArrayBuffer(e)||ce.isBuffer(e)||ce.isStream(e)||ce.isFile(e)||ce.isBlob(e)||ce.isReadableStream(e))return e;if(ce.isArrayBufferView(e))return e.buffer;if(ce.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let u;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Oz(e,this.formSerializer).toString();if((u=ce.isFileList(e))||n.indexOf("multipart/form-data")>-1){let l=this.env&&this.env.FormData;return gS(u?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||s?(t.setContentType("application/json",!1),Vz(e)):e},"transformRequest")],transformResponse:[o(function(e){let t=this.transitional||cN.transitional,n=t&&t.forcedJSONParsing,s=this.responseType==="json";if(ce.isResponse(e)||ce.isReadableStream(e))return e;if(e&&ce.isString(e)&&(n&&!this.responseType||s)){let a=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(u){if(a)throw u.name==="SyntaxError"?it.from(u,it.ERR_BAD_RESPONSE,this,null,this.response):u}}return e},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:zr.classes.FormData,Blob:zr.classes.Blob},validateStatus:o(function(e){return e>=200&&e<300},"validateStatus"),headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],r=>{cN.headers[r]={}});var fN=cN,Uz=ce.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"]),Mz=o(r=>{let e={},t,n,s;return r&&r.split(`
42
- `).forEach(o(function(a){s=a.indexOf(":"),t=a.substring(0,s).trim().toLowerCase(),n=a.substring(s+1).trim(),!(!t||e[t]&&Uz[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)},"parser")),e},"parseHeaders"),u4=Symbol("internals");function Om(r){return r&&String(r).trim().toLowerCase()}o(Om,"normalizeHeader");function oS(r){return r===!1||r==null?r:ce.isArray(r)?r.map(oS):String(r)}o(oS,"normalizeValue");function jz(r){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=t.exec(r);)e[n[1]]=n[2];return e}o(jz,"parseTokens");var Fz=o(r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim()),"isValidHeaderName");function Xx(r,e,t,n,s){if(ce.isFunction(n))return n.call(this,e,t);if(s&&(e=t),!!ce.isString(e)){if(ce.isString(n))return e.indexOf(n)!==-1;if(ce.isRegExp(n))return n.test(e)}}o(Xx,"matchHeaderValue");function qz(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}o(qz,"formatHeader");function Hz(r,e){let t=ce.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(r,n+t,{value:o(function(s,i,a){return this[n].call(this,e,s,i,a)},"value"),configurable:!0})})}o(Hz,"buildAccessors");var ip=class{static{o(this,"AxiosHeaders")}constructor(e){e&&this.set(e)}set(e,t,n){let s=this;function i(u,l,f){let h=Om(l);if(!h)throw new Error("header name must be a non-empty string");let m=ce.findKey(s,h);(!m||s[m]===void 0||f===!0||f===void 0&&s[m]!==!1)&&(s[m||l]=oS(u))}o(i,"setHeader");let a=o((u,l)=>ce.forEach(u,(f,h)=>i(f,h,l)),"setHeaders");if(ce.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(ce.isString(e)&&(e=e.trim())&&!Fz(e))a(Mz(e),t);else if(ce.isObject(e)&&ce.isIterable(e)){let u={},l,f;for(let h of e){if(!ce.isArray(h))throw TypeError("Object iterator must return a key-value pair");u[f=h[0]]=(l=u[f])?ce.isArray(l)?[...l,h[1]]:[l,h[1]]:h[1]}a(u,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=Om(e),e){let n=ce.findKey(this,e);if(n){let s=this[n];if(!t)return s;if(t===!0)return jz(s);if(ce.isFunction(t))return t.call(this,s,n);if(ce.isRegExp(t))return t.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Om(e),e){let n=ce.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||Xx(this,this[n],n,t)))}return!1}delete(e,t){let n=this,s=!1;function i(a){if(a=Om(a),a){let u=ce.findKey(n,a);u&&(!t||Xx(n,n[u],u,t))&&(delete n[u],s=!0)}}return o(i,"deleteHeader"),ce.isArray(e)?e.forEach(i):i(e),s}clear(e){let t=Object.keys(this),n=t.length,s=!1;for(;n--;){let i=t[n];(!e||Xx(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){let t=this,n={};return ce.forEach(this,(s,i)=>{let a=ce.findKey(n,i);if(a){t[a]=oS(s),delete t[i];return}let u=e?qz(i):String(i).trim();u!==i&&delete t[i],t[u]=oS(s),n[u]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return ce.forEach(this,(n,s)=>{n!=null&&n!==!1&&(t[s]=e&&ce.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
43
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(s=>n.set(s)),n}static accessor(e){let n=(this[u4]=this[u4]={accessors:{}}).accessors,s=this.prototype;function i(a){let u=Om(a);n[u]||(Hz(s,a),n[u]=!0)}return o(i,"defineAccessor"),ce.isArray(e)?e.forEach(i):i(e),this}};ip.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(ip.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:o(()=>r,"get"),set(n){this[t]=n}}});ce.freezeMethods(ip);var bs=ip;function Gx(r,e){let t=this||fN,n=e||t,s=bs.from(n.headers),i=n.data;return ce.forEach(r,o(function(u){i=u.call(t,i,s.normalize(),e?e.status:void 0)},"transform")),s.normalize(),i}o(Gx,"transformData");function H4(r){return!!(r&&r.__CANCEL__)}o(H4,"isCancel");function Bu(r,e,t){it.call(this,r??"canceled",it.ERR_CANCELED,e,t),this.name="CanceledError"}o(Bu,"CanceledError");ce.inherits(Bu,it,{__CANCEL__:!0});function np(r,e,t){let n=t.config.validateStatus;!t.status||!n||n(t.status)?r(t):e(new it("Request failed with status code "+t.status,[it.ERR_BAD_REQUEST,it.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}o(np,"settle");function Kz(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}o(Kz,"isAbsoluteURL");function $z(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}o($z,"combineURLs");function hN(r,e,t){let n=!Kz(e);return r&&(n||t==!1)?$z(r,e):e}o(hN,"buildFullPath");var cS="1.12.2";function K4(r){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}o(K4,"parseProtocol");var Xz=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Gz(r,e,t){let n=t&&t.Blob||zr.classes.Blob,s=K4(r);if(e===void 0&&n&&(e=!0),s==="data"){r=s.length?r.slice(s.length+1):r;let i=Xz.exec(r);if(!i)throw new it("Invalid URL",it.ERR_INVALID_URL);let a=i[1],u=i[2],l=i[3],f=Buffer.from(decodeURIComponent(l),u?"base64":"utf8");if(e){if(!n)throw new it("Blob is not supported",it.ERR_NOT_SUPPORT);return new n([f],{type:a})}return f}throw new it("Unsupported protocol "+s,it.ERR_NOT_SUPPORT)}o(Gz,"fromDataURI");var Wx=Symbol("internals"),eN=class extends Tu.default.Transform{static{o(this,"AxiosTransformStream")}constructor(e){e=ce.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,s)=>!ce.isUndefined(s[n])),super({readableHighWaterMark:e.chunkSize});let t=this[Wx]={timeWindow:e.timeWindow,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",n=>{n==="progress"&&(t.isCaptured||(t.isCaptured=!0))})}_read(e){let t=this[Wx];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){let s=this[Wx],i=s.maxRate,a=this.readableHighWaterMark,u=s.timeWindow,l=1e3/u,f=i/l,h=s.minChunkSize!==!1?Math.max(s.minChunkSize,f*.01):0,m=o((w,y)=>{let S=Buffer.byteLength(w);s.bytesSeen+=S,s.bytes+=S,s.isCaptured&&this.emit("progress",s.bytesSeen),this.push(w)?process.nextTick(y):s.onReadCallback=()=>{s.onReadCallback=null,process.nextTick(y)}},"pushChunk"),g=o((w,y)=>{let S=Buffer.byteLength(w),E=null,b=a,T,A=0;if(i){let C=Date.now();(!s.ts||(A=C-s.ts)>=u)&&(s.ts=C,T=f-s.bytes,s.bytes=T<0?-T:0,A=0),T=f-s.bytes}if(i){if(T<=0)return setTimeout(()=>{y(null,w)},u-A);T<b&&(b=T)}b&&S>b&&S-b>h&&(E=w.subarray(b),w=w.subarray(0,b)),m(w,E?()=>{process.nextTick(y,null,E)}:y)},"transformChunk");g(e,o(function w(y,S){if(y)return n(y);S?g(S,w):n(null)},"transformNextChunk"))}},l4=eN,{asyncIterator:c4}=Symbol,Wz=o(async function*(r){r.stream?yield*r.stream():r.arrayBuffer?yield await r.arrayBuffer():r[c4]?yield*r[c4]():yield r},"readBlob"),$4=Wz,Jz=zr.ALPHABET.ALPHA_DIGIT+"-_",km=typeof TextEncoder=="function"?new TextEncoder:new T4.default.TextEncoder,Ac=`\r
44
- `,zz=km.encode(Ac),Yz=2,tN=class{static{o(this,"FormDataPart")}constructor(e,t){let{escapeName:n}=this.constructor,s=ce.isString(t),i=`Content-Disposition: form-data; name="${n(e)}"${!s&&t.name?`; filename="${n(t.name)}"`:""}${Ac}`;s?t=km.encode(String(t).replace(/\r?\n|\r\n?/g,Ac)):i+=`Content-Type: ${t.type||"application/octet-stream"}${Ac}`,this.headers=km.encode(i+Ac),this.contentLength=s?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+Yz,this.name=e,this.value=t}async*encode(){yield this.headers;let{value:e}=this;ce.isTypedArray(e)?yield e:yield*$4(e),yield zz}static escapeName(e){return String(e).replace(/[\r\n"]/g,t=>({"\r":"%0D","\n":"%0A",'"':"%22"})[t])}},Qz=o((r,e,t)=>{let{tag:n="form-data-boundary",size:s=25,boundary:i=n+"-"+zr.generateString(s,Jz)}=t||{};if(!ce.isFormData(r))throw TypeError("FormData instance required");if(i.length<1||i.length>70)throw Error("boundary must be 10-70 characters long");let a=km.encode("--"+i+Ac),u=km.encode("--"+i+"--"+Ac),l=u.byteLength,f=Array.from(r.entries()).map(([m,g])=>{let w=new tN(m,g);return l+=w.size,w});l+=a.byteLength*f.length,l=ce.toFiniteNumber(l);let h={"Content-Type":`multipart/form-data; boundary=${i}`};return Number.isFinite(l)&&(h["Content-Length"]=l),e&&e(h),x4.Readable.from((async function*(){for(let m of f)yield a,yield*m.encode();yield u})())},"formDataToStream"),Zz=Qz,rN=class extends Tu.default.Transform{static{o(this,"ZlibHeaderTransformStream")}__transform(e,t,n){this.push(e),n()}_transform(e,t,n){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let s=Buffer.alloc(2);s[0]=120,s[1]=156,this.push(s,t)}this.__transform(e,t,n)}},eY=rN,tY=o((r,e)=>ce.isAsyncFn(r)?function(...t){let n=t.pop();r.apply(this,t).then(s=>{try{e?n(null,...e(s)):n(null,s)}catch(i){n(i)}},n)}:r,"callbackify"),rY=tY;function nY(r,e){r=r||10;let t=new Array(r),n=new Array(r),s=0,i=0,a;return e=e!==void 0?e:1e3,o(function(l){let f=Date.now(),h=n[i];a||(a=f),t[s]=l,n[s]=f;let m=i,g=0;for(;m!==s;)g+=t[m++],m=m%r;if(s=(s+1)%r,s===i&&(i=(i+1)%r),f-a<e)return;let w=h&&f-h;return w?Math.round(g*1e3/w):void 0},"push")}o(nY,"speedometer");function sY(r,e){let t=0,n=1e3/e,s,i,a=o((f,h=Date.now())=>{t=h,s=null,i&&(clearTimeout(i),i=null),r(...f)},"invoke");return[o((...f)=>{let h=Date.now(),m=h-t;m>=n?a(f,h):(s=f,i||(i=setTimeout(()=>{i=null,a(s)},n-m)))},"throttled"),o(()=>s&&a(s),"flush")]}o(sY,"throttle");var ap=o((r,e,t=3)=>{let n=0,s=nY(50,250);return sY(i=>{let a=i.loaded,u=i.lengthComputable?i.total:void 0,l=a-n,f=s(l),h=a<=u;n=a;let m={loaded:a,total:u,progress:u?a/u:void 0,bytes:l,rate:f||void 0,estimated:f&&u&&h?(u-a)/f:void 0,event:i,lengthComputable:u!=null,[e?"download":"upload"]:!0};r(m)},t)},"progressEventReducer"),fS=o((r,e)=>{let t=r!=null;return[n=>e[0]({lengthComputable:t,total:r,loaded:n}),e[1]]},"progressEventDecorator"),hS=o(r=>(...e)=>ce.asap(()=>r(...e)),"asyncDecorator");function iY(r){if(!r||typeof r!="string"||!r.startsWith("data:"))return 0;let e=r.indexOf(",");if(e<0)return 0;let t=r.slice(5,e),n=r.slice(e+1);if(/;base64/i.test(t)){let i=n.length,a=n.length;for(let g=0;g<a;g++)if(n.charCodeAt(g)===37&&g+2<a){let w=n.charCodeAt(g+1),y=n.charCodeAt(g+2);(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102)&&(y>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102)&&(i-=2,g+=2)}let u=0,l=a-1,f=o(g=>g>=2&&n.charCodeAt(g-2)===37&&n.charCodeAt(g-1)===51&&(n.charCodeAt(g)===68||n.charCodeAt(g)===100),"tailIsPct3D");l>=0&&(n.charCodeAt(l)===61?(u++,l--):f(l)&&(u++,l-=3)),u===1&&l>=0&&(n.charCodeAt(l)===61||f(l))&&u++;let m=Math.floor(i/4)*3-(u||0);return m>0?m:0}return Buffer.byteLength(n,"utf8")}o(iY,"estimateDataURLDecodedBytes");var f4={flush:Iu.default.constants.Z_SYNC_FLUSH,finishFlush:Iu.default.constants.Z_SYNC_FLUSH},aY={flush:Iu.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:Iu.default.constants.BROTLI_OPERATION_FLUSH},h4=ce.isFunction(Iu.default.createBrotliDecompress),{http:oY,https:uY}=UJ.default,lY=/https:?/,p4=zr.protocols.map(r=>r+":"),d4=o((r,[e,t])=>(r.on("end",t).on("error",t),e),"flushOnFinish");function cY(r,e){r.beforeRedirects.proxy&&r.beforeRedirects.proxy(r),r.beforeRedirects.config&&r.beforeRedirects.config(r,e)}o(cY,"dispatchBeforeRedirect");function X4(r,e,t){let n=e;if(!n&&n!==!1){let s=kJ.default.getProxyForUrl(t);s&&(n=new URL(s))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){(n.auth.username||n.auth.password)&&(n.auth=(n.auth.username||"")+":"+(n.auth.password||""));let i=Buffer.from(n.auth,"utf8").toString("base64");r.headers["Proxy-Authorization"]="Basic "+i}r.headers.host=r.hostname+(r.port?":"+r.port:"");let s=n.hostname||n.host;r.hostname=s,r.host=s,r.port=n.port,r.path=t,n.protocol&&(r.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`)}r.beforeRedirects.proxy=o(function(i){X4(i,e,i.href)},"beforeRedirect")}o(X4,"setProxy");var fY=typeof process<"u"&&ce.kindOf(process)==="process",hY=o(r=>new Promise((e,t)=>{let n,s,i=o((l,f)=>{s||(s=!0,n&&n(l,f))},"done"),a=o(l=>{i(l),e(l)},"_resolve"),u=o(l=>{i(l,!0),t(l)},"_reject");r(a,u,l=>n=l).catch(u)}),"wrapAsync"),pY=o(({address:r,family:e})=>{if(!ce.isString(r))throw TypeError("address must be a string");return{address:r,family:e||(r.indexOf(".")<0?6:4)}},"resolveFamily"),m4=o((r,e)=>pY(ce.isObject(r)?r:{address:r,family:e}),"buildAddressEntry"),dY=fY&&o(function(e){return hY(o(async function(n,s,i){let{data:a,lookup:u,family:l}=e,{responseType:f,responseEncoding:h}=e,m=e.method.toUpperCase(),g,w=!1,y;if(u){let fe=rY(u,Se=>ce.isArray(Se)?Se:[Se]);u=o((Se,Ke,be)=>{fe(Se,Ke,(we,Me,Je)=>{if(we)return be(we);let Ye=ce.isArray(Me)?Me.map(lt=>m4(lt)):[m4(Me,Je)];Ke.all?be(we,Ye):be(we,Ye[0].address,Ye[0].family)})},"lookup")}let S=new RJ.EventEmitter,E=o(()=>{e.cancelToken&&e.cancelToken.unsubscribe(b),e.signal&&e.signal.removeEventListener("abort",b),S.removeAllListeners()},"onFinished");i((fe,Se)=>{g=!0,Se&&(w=!0,E())});function b(fe){S.emit("abort",!fe||fe.type?new Bu(null,e,y):fe)}o(b,"abort"),S.once("abort",s),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(b),e.signal&&(e.signal.aborted?b():e.signal.addEventListener("abort",b)));let T=hN(e.baseURL,e.url,e.allowAbsoluteUrls),A=new URL(T,zr.hasBrowserEnv?zr.origin:void 0),C=A.protocol||p4[0];if(C==="data:"){if(e.maxContentLength>-1){let Se=String(e.url||T||"");if(iY(Se)>e.maxContentLength)return s(new it("maxContentLength size of "+e.maxContentLength+" exceeded",it.ERR_BAD_RESPONSE,e))}let fe;if(m!=="GET")return np(n,s,{status:405,statusText:"method not allowed",headers:{},config:e});try{fe=Gz(e.url,f==="blob",{Blob:e.env&&e.env.Blob})}catch(Se){throw it.from(Se,it.ERR_BAD_REQUEST,e)}return f==="text"?(fe=fe.toString(h),(!h||h==="utf8")&&(fe=ce.stripBOM(fe))):f==="stream"&&(fe=Tu.default.Readable.from(fe)),np(n,s,{data:fe,status:200,statusText:"OK",headers:new bs,config:e})}if(p4.indexOf(C)===-1)return s(new it("Unsupported protocol "+C,it.ERR_BAD_REQUEST,e));let x=bs.from(e.headers).normalize();x.set("User-Agent","axios/"+cS,!1);let{onUploadProgress:B,onDownloadProgress:F}=e,R=e.maxRate,H,q;if(ce.isSpecCompliantForm(a)){let fe=x.getContentType(/boundary=([-_\w\d]{10,70})/i);a=Zz(a,Se=>{x.set(Se)},{tag:`axios-${cS}-boundary`,boundary:fe&&fe[1]||void 0})}else if(ce.isFormData(a)&&ce.isFunction(a.getHeaders)){if(x.set(a.getHeaders()),!x.hasContentLength())try{let fe=await T4.default.promisify(a.getLength).call(a);Number.isFinite(fe)&&fe>=0&&x.setContentLength(fe)}catch{}}else if(ce.isBlob(a)||ce.isFile(a))a.size&&x.setContentType(a.type||"application/octet-stream"),x.setContentLength(a.size||0),a=Tu.default.Readable.from($4(a));else if(a&&!ce.isStream(a)){if(!Buffer.isBuffer(a))if(ce.isArrayBuffer(a))a=Buffer.from(new Uint8Array(a));else if(ce.isString(a))a=Buffer.from(a,"utf-8");else return s(new it("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",it.ERR_BAD_REQUEST,e));if(x.setContentLength(a.length,!1),e.maxBodyLength>-1&&a.length>e.maxBodyLength)return s(new it("Request body larger than maxBodyLength limit",it.ERR_BAD_REQUEST,e))}let K=ce.toFiniteNumber(x.getContentLength());ce.isArray(R)?(H=R[0],q=R[1]):H=q=R,a&&(B||H)&&(ce.isStream(a)||(a=Tu.default.Readable.from(a,{objectMode:!1})),a=Tu.default.pipeline([a,new l4({maxRate:ce.toFiniteNumber(H)})],ce.noop),B&&a.on("progress",d4(a,fS(K,ap(hS(B),!1,3)))));let G;if(e.auth){let fe=e.auth.username||"",Se=e.auth.password||"";G=fe+":"+Se}if(!G&&A.username){let fe=A.username,Se=A.password;G=fe+":"+Se}G&&x.delete("authorization");let he;try{he=oN(A.pathname+A.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(fe){let Se=new Error(fe.message);return Se.config=e,Se.url=e.url,Se.exists=!0,s(Se)}x.set("Accept-Encoding","gzip, compress, deflate"+(h4?", br":""),!1);let le={path:he,method:m,headers:x.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:G,protocol:C,family:l,beforeRedirect:cY,beforeRedirects:{}};!ce.isUndefined(u)&&(le.lookup=u),e.socketPath?le.socketPath=e.socketPath:(le.hostname=A.hostname.startsWith("[")?A.hostname.slice(1,-1):A.hostname,le.port=A.port,X4(le,e.proxy,C+"//"+A.hostname+(A.port?":"+A.port:"")+le.path));let oe,Z=lY.test(le.protocol);if(le.agent=Z?e.httpsAgent:e.httpAgent,e.transport?oe=e.transport:e.maxRedirects===0?oe=Z?VJ.default:LJ.default:(e.maxRedirects&&(le.maxRedirects=e.maxRedirects),e.beforeRedirect&&(le.beforeRedirects.config=e.beforeRedirect),oe=Z?uY:oY),e.maxBodyLength>-1?le.maxBodyLength=e.maxBodyLength:le.maxBodyLength=1/0,e.insecureHTTPParser&&(le.insecureHTTPParser=e.insecureHTTPParser),y=oe.request(le,o(function(Se){if(y.destroyed)return;let Ke=[Se],be=+Se.headers["content-length"];if(F||q){let lt=new l4({maxRate:ce.toFiniteNumber(q)});F&&lt.on("progress",d4(lt,fS(be,ap(hS(F),!0,3)))),Ke.push(lt)}let we=Se,Me=Se.req||y;if(e.decompress!==!1&&Se.headers["content-encoding"])switch((m==="HEAD"||Se.statusCode===204)&&delete Se.headers["content-encoding"],(Se.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Ke.push(Iu.default.createUnzip(f4)),delete Se.headers["content-encoding"];break;case"deflate":Ke.push(new eY),Ke.push(Iu.default.createUnzip(f4)),delete Se.headers["content-encoding"];break;case"br":h4&&(Ke.push(Iu.default.createBrotliDecompress(aY)),delete Se.headers["content-encoding"])}we=Ke.length>1?Tu.default.pipeline(Ke,ce.noop):Ke[0];let Je=Tu.default.finished(we,()=>{Je(),E()}),Ye={status:Se.statusCode,statusText:Se.statusMessage,headers:new bs(Se.headers),config:e,request:Me};if(f==="stream")Ye.data=we,np(n,s,Ye);else{let lt=[],O=0;we.on("data",o(function(ne){lt.push(ne),O+=ne.length,e.maxContentLength>-1&&O>e.maxContentLength&&(w=!0,we.destroy(),s(new it("maxContentLength size of "+e.maxContentLength+" exceeded",it.ERR_BAD_RESPONSE,e,Me)))},"handleStreamData")),we.on("aborted",o(function(){if(w)return;let ne=new it("stream has been aborted",it.ERR_BAD_RESPONSE,e,Me);we.destroy(ne),s(ne)},"handlerStreamAborted")),we.on("error",o(function(ne){y.destroyed||s(it.from(ne,null,e,Me))},"handleStreamError")),we.on("end",o(function(){try{let ne=lt.length===1?lt[0]:Buffer.concat(lt);f!=="arraybuffer"&&(ne=ne.toString(h),(!h||h==="utf8")&&(ne=ce.stripBOM(ne))),Ye.data=ne}catch(ne){return s(it.from(ne,null,e,Ye.request,Ye))}np(n,s,Ye)},"handleStreamEnd"))}S.once("abort",lt=>{we.destroyed||(we.emit("error",lt),we.destroy())})},"handleResponse")),S.once("abort",fe=>{s(fe),y.destroy(fe)}),y.on("error",o(function(Se){s(it.from(Se,null,e,y))},"handleRequestError")),y.on("socket",o(function(Se){Se.setKeepAlive(!0,1e3*60)},"handleRequestSocket")),e.timeout){let fe=parseInt(e.timeout,10);if(Number.isNaN(fe)){s(new it("error trying to parse `config.timeout` to int",it.ERR_BAD_OPTION_VALUE,e,y));return}y.setTimeout(fe,o(function(){if(g)return;let Ke=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",be=e.transitional||uN;e.timeoutErrorMessage&&(Ke=e.timeoutErrorMessage),s(new it(Ke,be.clarifyTimeoutError?it.ETIMEDOUT:it.ECONNABORTED,e,y)),b()},"handleRequestTimeout"))}if(ce.isStream(a)){let fe=!1,Se=!1;a.on("end",()=>{fe=!0}),a.once("error",Ke=>{Se=!0,y.destroy(Ke)}),a.on("close",()=>{!fe&&!Se&&b(new Bu("Request stream has been aborted",e,y))}),a.pipe(y)}else y.end(a)},"dispatchHttpRequest"))},"httpAdapter"),mY=zr.hasStandardBrowserEnv?((r,e)=>t=>(t=new URL(t,zr.origin),r.protocol===t.protocol&&r.host===t.host&&(e||r.port===t.port)))(new URL(zr.origin),zr.navigator&&/(msie|trident)/i.test(zr.navigator.userAgent)):()=>!0,gY=zr.hasStandardBrowserEnv?{write(r,e,t,n,s,i){let a=[r+"="+encodeURIComponent(e)];ce.isNumber(t)&&a.push("expires="+new Date(t).toGMTString()),ce.isString(n)&&a.push("path="+n),ce.isString(s)&&a.push("domain="+s),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(r){let e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}},g4=o(r=>r instanceof bs?{...r}:r,"headersToObject");function Cc(r,e){e=e||{};let t={};function n(f,h,m,g){return ce.isPlainObject(f)&&ce.isPlainObject(h)?ce.merge.call({caseless:g},f,h):ce.isPlainObject(h)?ce.merge({},h):ce.isArray(h)?h.slice():h}o(n,"getMergedValue");function s(f,h,m,g){if(ce.isUndefined(h)){if(!ce.isUndefined(f))return n(void 0,f,m,g)}else return n(f,h,m,g)}o(s,"mergeDeepProperties");function i(f,h){if(!ce.isUndefined(h))return n(void 0,h)}o(i,"valueFromConfig2");function a(f,h){if(ce.isUndefined(h)){if(!ce.isUndefined(f))return n(void 0,f)}else return n(void 0,h)}o(a,"defaultToConfig2");function u(f,h,m){if(m in e)return n(f,h);if(m in r)return n(void 0,f)}o(u,"mergeDirectKeys");let l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u,headers:o((f,h,m)=>s(g4(f),g4(h),m,!0),"headers")};return ce.forEach(Object.keys({...r,...e}),o(function(h){let m=l[h]||s,g=m(r[h],e[h],h);ce.isUndefined(g)&&m!==u||(t[h]=g)},"computeConfigValue")),t}o(Cc,"mergeConfig");var G4=o(r=>{let e=Cc({},r),{data:t,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:u}=e;if(e.headers=a=bs.from(a),e.url=oN(hN(e.baseURL,e.url,e.allowAbsoluteUrls),r.params,r.paramsSerializer),u&&a.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),ce.isFormData(t)){if(zr.hasStandardBrowserEnv||zr.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(ce.isFunction(t.getHeaders)){let l=t.getHeaders(),f=["content-type","content-length"];Object.entries(l).forEach(([h,m])=>{f.includes(h.toLowerCase())&&a.set(h,m)})}}if(zr.hasStandardBrowserEnv&&(n&&ce.isFunction(n)&&(n=n(e)),n||n!==!1&&mY(e.url))){let l=s&&i&&gY.read(i);l&&a.set(s,l)}return e},"resolveConfig"),yY=typeof XMLHttpRequest<"u",vY=yY&&function(r){return new Promise(o(function(t,n){let s=G4(r),i=s.data,a=bs.from(s.headers).normalize(),{responseType:u,onUploadProgress:l,onDownloadProgress:f}=s,h,m,g,w,y;function S(){w&&w(),y&&y(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}o(S,"done");let E=new XMLHttpRequest;E.open(s.method.toUpperCase(),s.url,!0),E.timeout=s.timeout;function b(){if(!E)return;let A=bs.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),x={data:!u||u==="text"||u==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:A,config:r,request:E};np(o(function(F){t(F),S()},"_resolve"),o(function(F){n(F),S()},"_reject"),x),E=null}o(b,"onloadend"),"onloadend"in E?E.onloadend=b:E.onreadystatechange=o(function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(b)},"handleLoad"),E.onabort=o(function(){E&&(n(new it("Request aborted",it.ECONNABORTED,r,E)),E=null)},"handleAbort"),E.onerror=o(function(C){let x=C&&C.message?C.message:"Network Error",B=new it(x,it.ERR_NETWORK,r,E);B.event=C||null,n(B),E=null},"handleError"),E.ontimeout=o(function(){let C=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded",x=s.transitional||uN;s.timeoutErrorMessage&&(C=s.timeoutErrorMessage),n(new it(C,x.clarifyTimeoutError?it.ETIMEDOUT:it.ECONNABORTED,r,E)),E=null},"handleTimeout"),i===void 0&&a.setContentType(null),"setRequestHeader"in E&&ce.forEach(a.toJSON(),o(function(C,x){E.setRequestHeader(x,C)},"setRequestHeader")),ce.isUndefined(s.withCredentials)||(E.withCredentials=!!s.withCredentials),u&&u!=="json"&&(E.responseType=s.responseType),f&&([g,y]=ap(f,!0),E.addEventListener("progress",g)),l&&E.upload&&([m,w]=ap(l),E.upload.addEventListener("progress",m),E.upload.addEventListener("loadend",w)),(s.cancelToken||s.signal)&&(h=o(A=>{E&&(n(!A||A.type?new Bu(null,r,E):A),E.abort(),E=null)},"onCanceled"),s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));let T=K4(s.url);if(T&&zr.protocols.indexOf(T)===-1){n(new it("Unsupported protocol "+T+":",it.ERR_BAD_REQUEST,r));return}E.send(i||null)},"dispatchXhrRequest"))},wY=o((r,e)=>{let{length:t}=r=r?r.filter(Boolean):[];if(e||t){let n=new AbortController,s,i=o(function(f){if(!s){s=!0,u();let h=f instanceof Error?f:this.reason;n.abort(h instanceof it?h:new Bu(h instanceof Error?h.message:h))}},"onabort"),a=e&&setTimeout(()=>{a=null,i(new it(`timeout ${e} of ms exceeded`,it.ETIMEDOUT))},e),u=o(()=>{r&&(a&&clearTimeout(a),a=null,r.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),r=null)},"unsubscribe");r.forEach(f=>f.addEventListener("abort",i));let{signal:l}=n;return l.unsubscribe=()=>ce.asap(u),l}},"composeSignals"),SY=wY,EY=o(function*(r,e){let t=r.byteLength;if(!e||t<e){yield r;return}let n=0,s;for(;n<t;)s=n+e,yield r.slice(n,s),n=s},"streamChunk"),AY=o(async function*(r,e){for await(let t of CY(r))yield*EY(t,e)},"readBytes"),CY=o(async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}let e=r.getReader();try{for(;;){let{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},"readStream"),y4=o((r,e,t,n)=>{let s=AY(r,e),i=0,a,u=o(l=>{a||(a=!0,n&&n(l))},"_onFinish");return new ReadableStream({async pull(l){try{let{done:f,value:h}=await s.next();if(f){u(),l.close();return}let m=h.byteLength;if(t){let g=i+=m;t(g)}l.enqueue(new Uint8Array(h))}catch(f){throw u(f),f}},cancel(l){return u(l),s.return()}},{highWaterMark:2})},"trackStream"),v4=64*1024,{isFunction:iS}=ce,bY=(({Request:r,Response:e})=>({Request:r,Response:e}))(ce.global),{ReadableStream:w4,TextEncoder:S4}=ce.global,E4=o((r,...e)=>{try{return!!r(...e)}catch{return!1}},"test"),xY=o(r=>{r=ce.merge.call({skipUndefined:!0},bY,r);let{fetch:e,Request:t,Response:n}=r,s=e?iS(e):typeof fetch=="function",i=iS(t),a=iS(n);if(!s)return!1;let u=s&&iS(w4),l=s&&(typeof S4=="function"?(y=>S=>y.encode(S))(new S4):async y=>new Uint8Array(await new t(y).arrayBuffer())),f=i&&u&&E4(()=>{let y=!1,S=new t(zr.origin,{body:new w4,method:"POST",get duplex(){return y=!0,"half"}}).headers.has("Content-Type");return y&&!S}),h=a&&u&&E4(()=>ce.isReadableStream(new n("").body)),m={stream:h&&(y=>y.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!m[y]&&(m[y]=(S,E)=>{let b=S&&S[y];if(b)return b.call(S);throw new it(`Response type '${y}' is not supported`,it.ERR_NOT_SUPPORT,E)})});let g=o(async y=>{if(y==null)return 0;if(ce.isBlob(y))return y.size;if(ce.isSpecCompliantForm(y))return(await new t(zr.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(y)||ce.isArrayBuffer(y))return y.byteLength;if(ce.isURLSearchParams(y)&&(y=y+""),ce.isString(y))return(await l(y)).byteLength},"getBodyLength"),w=o(async(y,S)=>{let E=ce.toFiniteNumber(y.getContentLength());return E??g(S)},"resolveBodyLength");return async y=>{let{url:S,method:E,data:b,signal:T,cancelToken:A,timeout:C,onDownloadProgress:x,onUploadProgress:B,responseType:F,headers:R,withCredentials:H="same-origin",fetchOptions:q}=G4(y),K=e||fetch;F=F?(F+"").toLowerCase():"text";let G=SY([T,A&&A.toAbortSignal()],C),he=null,le=G&&G.unsubscribe&&(()=>{G.unsubscribe()}),oe;try{if(B&&f&&E!=="get"&&E!=="head"&&(oe=await w(R,b))!==0){let we=new t(S,{method:"POST",body:b,duplex:"half"}),Me;if(ce.isFormData(b)&&(Me=we.headers.get("content-type"))&&R.setContentType(Me),we.body){let[Je,Ye]=fS(oe,ap(hS(B)));b=y4(we.body,v4,Je,Ye)}}ce.isString(H)||(H=H?"include":"omit");let Z=i&&"credentials"in t.prototype,fe={...q,signal:G,method:E.toUpperCase(),headers:R.normalize().toJSON(),body:b,duplex:"half",credentials:Z?H:void 0};he=i&&new t(S,fe);let Se=await(i?K(he,q):K(S,fe)),Ke=h&&(F==="stream"||F==="response");if(h&&(x||Ke&&le)){let we={};["status","statusText","headers"].forEach(lt=>{we[lt]=Se[lt]});let Me=ce.toFiniteNumber(Se.headers.get("content-length")),[Je,Ye]=x&&fS(Me,ap(hS(x),!0))||[];Se=new n(y4(Se.body,v4,Je,()=>{Ye&&Ye(),le&&le()}),we)}F=F||"text";let be=await m[ce.findKey(m,F)||"text"](Se,y);return!Ke&&le&&le(),await new Promise((we,Me)=>{np(we,Me,{data:be,headers:bs.from(Se.headers),status:Se.status,statusText:Se.statusText,config:y,request:he})})}catch(Z){throw le&&le(),Z&&Z.name==="TypeError"&&/Load failed|fetch/i.test(Z.message)?Object.assign(new it("Network Error",it.ERR_NETWORK,y,he),{cause:Z.cause||Z}):it.from(Z,Z&&Z.code,y,he)}}},"factory"),NY=new Map,W4=o(r=>{let e=r?r.env:{},{fetch:t,Request:n,Response:s}=e,i=[n,s,t],a=i.length,u=a,l,f,h=NY;for(;u--;)l=i[u],f=h.get(l),f===void 0&&h.set(l,f=u?new Map:xY(e)),h=f;return f},"getFetch");W4();var nN={http:dY,xhr:vY,fetch:{get:W4}};ce.forEach(nN,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});var A4=o(r=>`- ${r}`,"renderReason"),TY=o(r=>ce.isFunction(r)||r===null||r===!1,"isResolvedHandle"),J4={getAdapter:o((r,e)=>{r=ce.isArray(r)?r:[r];let{length:t}=r,n,s,i={};for(let a=0;a<t;a++){n=r[a];let u;if(s=n,!TY(n)&&(s=nN[(u=String(n)).toLowerCase()],s===void 0))throw new it(`Unknown adapter '${u}'`);if(s&&(ce.isFunction(s)||(s=s.get(e))))break;i[u||"#"+a]=s}if(!s){let a=Object.entries(i).map(([l,f])=>`adapter ${l} `+(f===!1?"is not supported by the environment":"is not available in the build")),u=t?a.length>1?`since :
45
- `+a.map(A4).join(`
46
- `):" "+A4(a[0]):"as no adapter specified";throw new it("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s},"getAdapter"),adapters:nN};function Jx(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Bu(null,r)}o(Jx,"throwIfCancellationRequested");function C4(r){return Jx(r),r.headers=bs.from(r.headers),r.data=Gx.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),J4.getAdapter(r.adapter||fN.adapter,r)(r).then(o(function(n){return Jx(r),n.data=Gx.call(r,r.transformResponse,n),n.headers=bs.from(n.headers),n},"onAdapterResolution"),o(function(n){return H4(n)||(Jx(r),n&&n.response&&(n.response.data=Gx.call(r,r.transformResponse,n.response),n.response.headers=bs.from(n.response.headers))),Promise.reject(n)},"onAdapterRejection"))}o(C4,"dispatchRequest");var yS={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{yS[r]=o(function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r},"validator")});var b4={};yS.transitional=o(function(e,t,n){function s(i,a){return"[Axios v"+cS+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return o(s,"formatMessage"),(i,a,u)=>{if(e===!1)throw new it(s(a," has been removed"+(t?" in "+t:"")),it.ERR_DEPRECATED);return t&&!b4[a]&&(b4[a]=!0,console.warn(s(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,a,u):!0}},"transitional");yS.spelling=o(function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)},"spelling");function IY(r,e,t){if(typeof r!="object")throw new it("options must be an object",it.ERR_BAD_OPTION_VALUE);let n=Object.keys(r),s=n.length;for(;s-- >0;){let i=n[s],a=e[i];if(a){let u=r[i],l=u===void 0||a(u,i,r);if(l!==!0)throw new it("option "+i+" must be "+l,it.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new it("Unknown option "+i,it.ERR_BAD_OPTION)}}o(IY,"assertOptions");var uS={assertOptions:IY,validators:yS},ba=uS.validators,op=class{static{o(this,"Axios")}constructor(e){this.defaults=e||{},this.interceptors={request:new a4,response:new a4}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;let i=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
47
- `+i):n.stack=i}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Cc(this.defaults,t);let{transitional:n,paramsSerializer:s,headers:i}=t;n!==void 0&&uS.assertOptions(n,{silentJSONParsing:ba.transitional(ba.boolean),forcedJSONParsing:ba.transitional(ba.boolean),clarifyTimeoutError:ba.transitional(ba.boolean)},!1),s!=null&&(ce.isFunction(s)?t.paramsSerializer={serialize:s}:uS.assertOptions(s,{encode:ba.function,serialize:ba.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),uS.assertOptions(t,{baseUrl:ba.spelling("baseURL"),withXsrfToken:ba.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&ce.merge(i.common,i[t.method]);i&&ce.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),t.headers=bs.concat(a,i);let u=[],l=!0;this.interceptors.request.forEach(o(function(S){typeof S.runWhen=="function"&&S.runWhen(t)===!1||(l=l&&S.synchronous,u.unshift(S.fulfilled,S.rejected))},"unshiftRequestInterceptors"));let f=[];this.interceptors.response.forEach(o(function(S){f.push(S.fulfilled,S.rejected)},"pushResponseInterceptors"));let h,m=0,g;if(!l){let y=[C4.bind(this),void 0];for(y.unshift(...u),y.push(...f),g=y.length,h=Promise.resolve(t);m<g;)h=h.then(y[m++],y[m++]);return h}g=u.length;let w=t;for(;m<g;){let y=u[m++],S=u[m++];try{w=y(w)}catch(E){S.call(this,E);break}}try{h=C4.call(this,w)}catch(y){return Promise.reject(y)}for(m=0,g=f.length;m<g;)h=h.then(f[m++],f[m++]);return h}getUri(e){e=Cc(this.defaults,e);let t=hN(e.baseURL,e.url,e.allowAbsoluteUrls);return oN(t,e.params,e.paramsSerializer)}};ce.forEach(["delete","get","head","options"],o(function(e){op.prototype[e]=function(t,n){return this.request(Cc(n||{},{method:e,url:t,data:(n||{}).data}))}},"forEachMethodNoData"));ce.forEach(["post","put","patch"],o(function(e){function t(n){return o(function(i,a,u){return this.request(Cc(u||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))},"httpMethod")}o(t,"generateHTTPMethod"),op.prototype[e]=t(),op.prototype[e+"Form"]=t(!0)},"forEachMethodWithData"));var lS=op,sN=class r{static{o(this,"CancelToken")}constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(o(function(i){t=i},"promiseExecutor"));let n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i,a=new Promise(u=>{n.subscribe(u),i=u}).then(s);return a.cancel=o(function(){n.unsubscribe(i)},"reject"),a},e(o(function(i,a,u){n.reason||(n.reason=new Bu(i,a,u),t(n.reason))},"cancel"))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=o(n=>{e.abort(n)},"abort");return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new r(o(function(s){e=s},"executor")),cancel:e}}},BY=sN;function DY(r){return o(function(t){return r.apply(null,t)},"wrap")}o(DY,"spread");function _Y(r){return ce.isObject(r)&&r.isAxiosError===!0}o(_Y,"isAxiosError");var iN={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};Object.entries(iN).forEach(([r,e])=>{iN[e]=r});var RY=iN;function z4(r){let e=new lS(r),t=I4(lS.prototype.request,e);return ce.extend(t,lS.prototype,e,{allOwnKeys:!0}),ce.extend(t,e,null,{allOwnKeys:!0}),t.create=o(function(s){return z4(Cc(r,s))},"create"),t}o(z4,"createInstance");var ln=z4(fN);ln.Axios=lS;ln.CanceledError=Bu;ln.CancelToken=BY;ln.isCancel=H4;ln.VERSION=cS;ln.toFormData=gS;ln.AxiosError=it;ln.Cancel=ln.CanceledError;ln.all=o(function(e){return Promise.all(e)},"all");ln.spread=DY;ln.isAxiosError=_Y;ln.mergeConfig=Cc;ln.AxiosHeaders=bs;ln.formToJSON=r=>q4(ce.isHTMLForm(r)?new FormData(r):r);ln.getAdapter=J4.getAdapter;ln.HttpStatusCode=RY;ln.default=ln;Y4.exports=ln});var Q4=ye((Ife,Dr)=>{"use strict";Dr.exports.NTLMFLAG_NEGOTIATE_UNICODE=1;Dr.exports.NTLMFLAG_NEGOTIATE_OEM=2;Dr.exports.NTLMFLAG_REQUEST_TARGET=4;Dr.exports.NTLMFLAG_NEGOTIATE_SIGN=16;Dr.exports.NTLMFLAG_NEGOTIATE_SEAL=32;Dr.exports.NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE=64;Dr.exports.NTLMFLAG_NEGOTIATE_LM_KEY=128;Dr.exports.NTLMFLAG_NEGOTIATE_NETWARE=256;Dr.exports.NTLMFLAG_NEGOTIATE_NTLM_KEY=512;Dr.exports.NTLMFLAG_NEGOTIATE_ANONYMOUS=2048;Dr.exports.NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED=4096;Dr.exports.NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED=8192;Dr.exports.NTLMFLAG_NEGOTIATE_LOCAL_CALL=16384;Dr.exports.NTLMFLAG_NEGOTIATE_ALWAYS_SIGN=32768;Dr.exports.NTLMFLAG_TARGET_TYPE_DOMAIN=65536;Dr.exports.NTLMFLAG_TARGET_TYPE_SERVER=1<<17;Dr.exports.NTLMFLAG_TARGET_TYPE_SHARE=1<<18;Dr.exports.NTLMFLAG_NEGOTIATE_NTLM2_KEY=1<<19;Dr.exports.NTLMFLAG_REQUEST_INIT_RESPONSE=1<<20;Dr.exports.NTLMFLAG_REQUEST_ACCEPT_RESPONSE=1<<21;Dr.exports.NTLMFLAG_REQUEST_NONNT_SESSION_KEY=1<<22;Dr.exports.NTLMFLAG_NEGOTIATE_TARGET_INFO=1<<23;Dr.exports.NTLMFLAG_NEGOTIATE_128=1<<29;Dr.exports.NTLMFLAG_NEGOTIATE_KEY_EXCHANGE=1<<30;Dr.exports.NTLMFLAG_NEGOTIATE_56=1<<31});var dN=ye(gi=>{"use strict";gi.readUInt32BE=o(function(e,t){var n=e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t];return n>>>0},"readUInt32BE");gi.writeUInt32BE=o(function(e,t,n){e[0+n]=t>>>24,e[1+n]=t>>>16&255,e[2+n]=t>>>8&255,e[3+n]=t&255},"writeUInt32BE");gi.ip=o(function(e,t,n,s){for(var i=0,a=0,u=6;u>=0;u-=2){for(var l=0;l<=24;l+=8)i<<=1,i|=t>>>l+u&1;for(var l=0;l<=24;l+=8)i<<=1,i|=e>>>l+u&1}for(var u=6;u>=0;u-=2){for(var l=1;l<=25;l+=8)a<<=1,a|=t>>>l+u&1;for(var l=1;l<=25;l+=8)a<<=1,a|=e>>>l+u&1}n[s+0]=i>>>0,n[s+1]=a>>>0},"ip");gi.rip=o(function(e,t,n,s){for(var i=0,a=0,u=0;u<4;u++)for(var l=24;l>=0;l-=8)i<<=1,i|=t>>>l+u&1,i<<=1,i|=e>>>l+u&1;for(var u=4;u<8;u++)for(var l=24;l>=0;l-=8)a<<=1,a|=t>>>l+u&1,a<<=1,a|=e>>>l+u&1;n[s+0]=i>>>0,n[s+1]=a>>>0},"rip");gi.pc1=o(function(e,t,n,s){for(var i=0,a=0,u=7;u>=5;u--){for(var l=0;l<=24;l+=8)i<<=1,i|=t>>l+u&1;for(var l=0;l<=24;l+=8)i<<=1,i|=e>>l+u&1}for(var l=0;l<=24;l+=8)i<<=1,i|=t>>l+u&1;for(var u=1;u<=3;u++){for(var l=0;l<=24;l+=8)a<<=1,a|=t>>l+u&1;for(var l=0;l<=24;l+=8)a<<=1,a|=e>>l+u&1}for(var l=0;l<=24;l+=8)a<<=1,a|=e>>l+u&1;n[s+0]=i>>>0,n[s+1]=a>>>0},"pc1");gi.r28shl=o(function(e,t){return e<<t&268435455|e>>>28-t},"r28shl");var vS=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];gi.pc2=o(function(e,t,n,s){for(var i=0,a=0,u=vS.length>>>1,l=0;l<u;l++)i<<=1,i|=e>>>vS[l]&1;for(var l=u;l<vS.length;l++)a<<=1,a|=t>>>vS[l]&1;n[s+0]=i>>>0,n[s+1]=a>>>0},"pc2");gi.expand=o(function(e,t,n){var s=0,i=0;s=(e&1)<<5|e>>>27;for(var a=23;a>=15;a-=4)s<<=6,s|=e>>>a&63;for(var a=11;a>=3;a-=4)i|=e>>>a&63,i<<=6;i|=(e&31)<<1|e>>>31,t[n+0]=s>>>0,t[n+1]=i>>>0},"expand");var Z4=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];gi.substitute=o(function(e,t){for(var n=0,s=0;s<4;s++){var i=e>>>18-s*6&63,a=Z4[s*64+i];n<<=4,n|=a}for(var s=0;s<4;s++){var i=t>>>18-s*6&63,a=Z4[256+s*64+i];n<<=4,n|=a}return n>>>0},"substitute");var ek=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];gi.permute=o(function(e){for(var t=0,n=0;n<ek.length;n++)t<<=1,t|=e>>>ek[n]&1;return t>>>0},"permute");gi.padSplit=o(function(e,t,n){for(var s=e.toString(2);s.length<t;)s="0"+s;for(var i=[],a=0;a<t;a+=n)i.push(s.slice(a,a+n));return i.join(" ")},"padSplit")});var Mm=ye((_fe,rk)=>{"use strict";rk.exports=tk;function tk(r,e){if(!r)throw new Error(e||"Assertion failed")}o(tk,"assert");tk.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var wS=ye((Pfe,nk)=>{"use strict";var PY=Mm();function yi(r){this.options=r,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=r.padding!==!1}o(yi,"Cipher");nk.exports=yi;yi.prototype._init=o(function(){},"_init");yi.prototype.update=o(function(e){return e.length===0?[]:this.type==="decrypt"?this._updateDecrypt(e):this._updateEncrypt(e)},"update");yi.prototype._buffer=o(function(e,t){for(var n=Math.min(this.buffer.length-this.bufferOff,e.length-t),s=0;s<n;s++)this.buffer[this.bufferOff+s]=e[t+s];return this.bufferOff+=n,n},"_buffer");yi.prototype._flushBuffer=o(function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},"_flushBuffer");yi.prototype._updateEncrypt=o(function(e){var t=0,n=0,s=(this.bufferOff+e.length)/this.blockSize|0,i=new Array(s*this.blockSize);this.bufferOff!==0&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(n+=this._flushBuffer(i,n)));for(var a=e.length-(e.length-t)%this.blockSize;t<a;t+=this.blockSize)this._update(e,t,i,n),n+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return i},"_updateEncrypt");yi.prototype._updateDecrypt=o(function(e){for(var t=0,n=0,s=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,i=new Array(s*this.blockSize);s>0;s--)t+=this._buffer(e,t),n+=this._flushBuffer(i,n);return t+=this._buffer(e,t),i},"_updateDecrypt");yi.prototype.final=o(function(e){var t;e&&(t=this.update(e));var n;return this.type==="encrypt"?n=this._finalEncrypt():n=this._finalDecrypt(),t?t.concat(n):n},"final");yi.prototype._pad=o(function(e,t){if(t===0)return!1;for(;t<e.length;)e[t++]=0;return!0},"_pad");yi.prototype._finalEncrypt=o(function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},"_finalEncrypt");yi.prototype._unpad=o(function(e){return e},"_unpad");yi.prototype._finalDecrypt=o(function(){PY.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)},"_finalDecrypt")});var sk=ye((kfe,mN)=>{"use strict";typeof Object.create=="function"?mN.exports=o(function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):mN.exports=o(function(e,t){if(t){e.super_=t;var n=o(function(){},"TempCtor");n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},"inherits")});var SS=ye((Vfe,yN)=>{"use strict";try{if(gN=gt("util"),typeof gN.inherits!="function")throw"";yN.exports=gN.inherits}catch{yN.exports=sk()}var gN});var vN=ye((Ufe,ok)=>{"use strict";var ik=Mm(),OY=SS(),yn=dN(),ak=wS();function kY(){this.tmp=new Array(2),this.keys=null}o(kY,"DESState");function Na(r){ak.call(this,r);var e=new kY;this._desState=e,this.deriveKeys(e,r.key)}o(Na,"DES");OY(Na,ak);ok.exports=Na;Na.create=o(function(e){return new Na(e)},"create");var LY=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];Na.prototype.deriveKeys=o(function(e,t){e.keys=new Array(32),ik.equal(t.length,this.blockSize,"Invalid key length");var n=yn.readUInt32BE(t,0),s=yn.readUInt32BE(t,4);yn.pc1(n,s,e.tmp,0),n=e.tmp[0],s=e.tmp[1];for(var i=0;i<e.keys.length;i+=2){var a=LY[i>>>1];n=yn.r28shl(n,a),s=yn.r28shl(s,a),yn.pc2(n,s,e.keys,i)}},"deriveKeys");Na.prototype._update=o(function(e,t,n,s){var i=this._desState,a=yn.readUInt32BE(e,t),u=yn.readUInt32BE(e,t+4);yn.ip(a,u,i.tmp,0),a=i.tmp[0],u=i.tmp[1],this.type==="encrypt"?this._encrypt(i,a,u,i.tmp,0):this._decrypt(i,a,u,i.tmp,0),a=i.tmp[0],u=i.tmp[1],yn.writeUInt32BE(n,a,s),yn.writeUInt32BE(n,u,s+4)},"_update");Na.prototype._pad=o(function(e,t){if(this.padding===!1)return!1;for(var n=e.length-t,s=t;s<e.length;s++)e[s]=n;return!0},"_pad");Na.prototype._unpad=o(function(e){if(this.padding===!1)return e;for(var t=e[e.length-1],n=e.length-t;n<e.length;n++)ik.equal(e[n],t);return e.slice(0,e.length-t)},"_unpad");Na.prototype._encrypt=o(function(e,t,n,s,i){for(var a=t,u=n,l=0;l<e.keys.length;l+=2){var f=e.keys[l],h=e.keys[l+1];yn.expand(u,e.tmp,0),f^=e.tmp[0],h^=e.tmp[1];var m=yn.substitute(f,h),g=yn.permute(m),w=u;u=(a^g)>>>0,a=w}yn.rip(u,a,s,i)},"_encrypt");Na.prototype._decrypt=o(function(e,t,n,s,i){for(var a=n,u=t,l=e.keys.length-2;l>=0;l-=2){var f=e.keys[l],h=e.keys[l+1];yn.expand(a,e.tmp,0),f^=e.tmp[0],h^=e.tmp[1];var m=yn.substitute(f,h),g=yn.permute(m),w=a;a=(u^g)>>>0,u=w}yn.rip(a,u,s,i)},"_decrypt")});var lk=ye(uk=>{"use strict";var VY=Mm(),UY=SS(),ES={};function MY(r){VY.equal(r.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=r[e]}o(MY,"CBCState");function jY(r){function e(i){r.call(this,i),this._cbcInit()}o(e,"CBC"),UY(e,r);for(var t=Object.keys(ES),n=0;n<t.length;n++){var s=t[n];e.prototype[s]=ES[s]}return e.create=o(function(a){return new e(a)},"create"),e}o(jY,"instantiate");uk.instantiate=jY;ES._cbcInit=o(function(){var e=new MY(this.options.iv);this._cbcState=e},"_cbcInit");ES._update=o(function(e,t,n,s){var i=this._cbcState,a=this.constructor.super_.prototype,u=i.iv;if(this.type==="encrypt"){for(var l=0;l<this.blockSize;l++)u[l]^=e[t+l];a._update.call(this,u,0,n,s);for(var l=0;l<this.blockSize;l++)u[l]=n[s+l]}else{a._update.call(this,e,t,n,s);for(var l=0;l<this.blockSize;l++)n[s+l]^=u[l];for(var l=0;l<this.blockSize;l++)u[l]=e[t+l]}},"_update")});var hk=ye((qfe,fk)=>{"use strict";var FY=Mm(),qY=SS(),ck=wS(),Du=vN();function HY(r,e){FY.equal(e.length,24,"Invalid key length");var t=e.slice(0,8),n=e.slice(8,16),s=e.slice(16,24);r==="encrypt"?this.ciphers=[Du.create({type:"encrypt",key:t}),Du.create({type:"decrypt",key:n}),Du.create({type:"encrypt",key:s})]:this.ciphers=[Du.create({type:"decrypt",key:s}),Du.create({type:"encrypt",key:n}),Du.create({type:"decrypt",key:t})]}o(HY,"EDEState");function bc(r){ck.call(this,r);var e=new HY(this.type,this.options.key);this._edeState=e}o(bc,"EDE");qY(bc,ck);fk.exports=bc;bc.create=o(function(e){return new bc(e)},"create");bc.prototype._update=o(function(e,t,n,s){var i=this._edeState;i.ciphers[0]._update(e,t,n,s),i.ciphers[1]._update(n,s,n,s),i.ciphers[2]._update(n,s,n,s)},"_update");bc.prototype._pad=Du.prototype._pad;bc.prototype._unpad=Du.prototype._unpad});var pk=ye(lp=>{"use strict";lp.utils=dN();lp.Cipher=wS();lp.DES=vN();lp.CBC=lk();lp.EDE=hk()});var dk=ye(($fe,AS)=>{"use strict";(function(){"use strict";var r=typeof window=="object"?window:{},e=!r.JS_MD4_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;e&&(r=global);var t=!r.JS_MD4_NO_COMMON_JS&&typeof AS=="object"&&AS.exports,n=typeof define=="function"&&define.amd,s=!r.JS_MD4_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",i="0123456789abcdef".split(""),a=[128,32768,8388608,-2147483648],u=[0,8,16,24],l=["hex","array","digest","buffer","arrayBuffer"],f=[],h;if(s){var m=new ArrayBuffer(68);h=new Uint8Array(m),f=new Uint32Array(m)}var g=o(function(b){return function(T){return new S(!0).update(T)[b]()}},"createOutputMethod"),w=o(function(){var b=g("hex");e&&(b=y(b)),b.create=function(){return new S},b.update=function(C){return b.create().update(C)};for(var T=0;T<l.length;++T){var A=l[T];b[A]=g(A)}return b},"createMethod"),y=o(function(b){var T=gt("crypto"),A=gt("buffer").Buffer,C=o(function(x){if(typeof x=="string")return T.createHash("md4").update(x,"utf8").digest("hex");if(s&&x instanceof ArrayBuffer)x=new Uint8Array(x);else if(x.length===void 0)return b(x);return T.createHash("md4").update(new A(x)).digest("hex")},"nodeMethod");return C},"nodeWrap");function S(b){if(b)f[0]=f[16]=f[1]=f[2]=f[3]=f[4]=f[5]=f[6]=f[7]=f[8]=f[9]=f[10]=f[11]=f[12]=f[13]=f[14]=f[15]=0,this.blocks=f,this.buffer8=h;else if(s){var T=new ArrayBuffer(68);this.buffer8=new Uint8Array(T),this.blocks=new Uint32Array(T)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=0,this.finalized=this.hashed=!1,this.first=!0}o(S,"Md4"),S.prototype.update=function(b){if(!this.finalized){var T=typeof b!="string";T&&s&&b instanceof ArrayBuffer&&(b=new Uint8Array(b));for(var A,C=0,x,B=b.length||0,F=this.blocks,R=this.buffer8;C<B;){if(this.hashed&&(this.hashed=!1,F[0]=F[16],F[16]=F[1]=F[2]=F[3]=F[4]=F[5]=F[6]=F[7]=F[8]=F[9]=F[10]=F[11]=F[12]=F[13]=F[14]=F[15]=0),T)if(s)for(x=this.start;C<B&&x<64;++C)R[x++]=b[C];else for(x=this.start;C<B&&x<64;++C)F[x>>2]|=b[C]<<u[x++&3];else if(s)for(x=this.start;C<B&&x<64;++C)A=b.charCodeAt(C),A<128?R[x++]=A:A<2048?(R[x++]=192|A>>6,R[x++]=128|A&63):A<55296||A>=57344?(R[x++]=224|A>>12,R[x++]=128|A>>6&63,R[x++]=128|A&63):(A=65536+((A&1023)<<10|b.charCodeAt(++C)&1023),R[x++]=240|A>>18,R[x++]=128|A>>12&63,R[x++]=128|A>>6&63,R[x++]=128|A&63);else for(x=this.start;C<B&&x<64;++C)A=b.charCodeAt(C),A<128?F[x>>2]|=A<<u[x++&3]:A<2048?(F[x>>2]|=(192|A>>6)<<u[x++&3],F[x>>2]|=(128|A&63)<<u[x++&3]):A<55296||A>=57344?(F[x>>2]|=(224|A>>12)<<u[x++&3],F[x>>2]|=(128|A>>6&63)<<u[x++&3],F[x>>2]|=(128|A&63)<<u[x++&3]):(A=65536+((A&1023)<<10|b.charCodeAt(++C)&1023),F[x>>2]|=(240|A>>18)<<u[x++&3],F[x>>2]|=(128|A>>12&63)<<u[x++&3],F[x>>2]|=(128|A>>6&63)<<u[x++&3],F[x>>2]|=(128|A&63)<<u[x++&3]);this.lastByteIndex=x,this.bytes+=x-this.start,x>=64?(this.start=x-64,this.hash(),this.hashed=!0):this.start=x}return this}},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var b=this.blocks,T=this.lastByteIndex;b[T>>2]|=a[T&3],T>=56&&(this.hashed||this.hash(),b[0]=b[16],b[16]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=b[9]=b[10]=b[11]=b[12]=b[13]=b[14]=b[15]=0),b[14]=this.bytes<<3,this.hash()}},S.prototype.hash=function(){var b,T,A,C,x,B,F,R,H=this.blocks;this.first?(b=H[0]-1,b=b<<3|b>>>29,C=(b&4023233417|~b&2562383102)+H[1]+271733878,C=C<<7|C>>>25,A=(C&b|~C&4023233417)+H[2]-1732584194,A=A<<11|A>>>21,T=(A&C|~A&b)+H[3]-271733879,T=T<<19|T>>>13):(b=this.h0,T=this.h1,A=this.h2,C=this.h3,b+=(T&A|~T&C)+H[0],b=b<<3|b>>>29,C+=(b&T|~b&A)+H[1],C=C<<7|C>>>25,A+=(C&b|~C&T)+H[2],A=A<<11|A>>>21,T+=(A&C|~A&b)+H[3],T=T<<19|T>>>13),b+=(T&A|~T&C)+H[4],b=b<<3|b>>>29,C+=(b&T|~b&A)+H[5],C=C<<7|C>>>25,A+=(C&b|~C&T)+H[6],A=A<<11|A>>>21,T+=(A&C|~A&b)+H[7],T=T<<19|T>>>13,b+=(T&A|~T&C)+H[8],b=b<<3|b>>>29,C+=(b&T|~b&A)+H[9],C=C<<7|C>>>25,A+=(C&b|~C&T)+H[10],A=A<<11|A>>>21,T+=(A&C|~A&b)+H[11],T=T<<19|T>>>13,b+=(T&A|~T&C)+H[12],b=b<<3|b>>>29,C+=(b&T|~b&A)+H[13],C=C<<7|C>>>25,A+=(C&b|~C&T)+H[14],A=A<<11|A>>>21,T+=(A&C|~A&b)+H[15],T=T<<19|T>>>13,B=T&A,b+=(B|T&C|A&C)+H[0]+1518500249,b=b<<3|b>>>29,x=b&T,C+=(x|b&A|B)+H[4]+1518500249,C=C<<5|C>>>27,R=C&b,A+=(R|C&T|x)+H[8]+1518500249,A=A<<9|A>>>23,F=A&C,T+=(F|A&b|R)+H[12]+1518500249,T=T<<13|T>>>19,B=T&A,b+=(B|T&C|F)+H[1]+1518500249,b=b<<3|b>>>29,x=b&T,C+=(x|b&A|B)+H[5]+1518500249,C=C<<5|C>>>27,R=C&b,A+=(R|C&T|x)+H[9]+1518500249,A=A<<9|A>>>23,F=A&C,T+=(F|A&b|R)+H[13]+1518500249,T=T<<13|T>>>19,B=T&A,b+=(B|T&C|F)+H[2]+1518500249,b=b<<3|b>>>29,x=b&T,C+=(x|b&A|B)+H[6]+1518500249,C=C<<5|C>>>27,R=C&b,A+=(R|C&T|x)+H[10]+1518500249,A=A<<9|A>>>23,F=A&C,T+=(F|A&b|R)+H[14]+1518500249,T=T<<13|T>>>19,B=T&A,b+=(B|T&C|F)+H[3]+1518500249,b=b<<3|b>>>29,x=b&T,C+=(x|b&A|B)+H[7]+1518500249,C=C<<5|C>>>27,R=C&b,A+=(R|C&T|x)+H[11]+1518500249,A=A<<9|A>>>23,T+=(A&C|A&b|R)+H[15]+1518500249,T=T<<13|T>>>19,B=T^A,b+=(B^C)+H[0]+1859775393,b=b<<3|b>>>29,C+=(B^b)+H[8]+1859775393,C=C<<9|C>>>23,R=C^b,A+=(R^T)+H[4]+1859775393,A=A<<11|A>>>21,T+=(R^A)+H[12]+1859775393,T=T<<15|T>>>17,B=T^A,b+=(B^C)+H[2]+1859775393,b=b<<3|b>>>29,C+=(B^b)+H[10]+1859775393,C=C<<9|C>>>23,R=C^b,A+=(R^T)+H[6]+1859775393,A=A<<11|A>>>21,T+=(R^A)+H[14]+1859775393,T=T<<15|T>>>17,B=T^A,b+=(B^C)+H[1]+1859775393,b=b<<3|b>>>29,C+=(B^b)+H[9]+1859775393,C=C<<9|C>>>23,R=C^b,A+=(R^T)+H[5]+1859775393,A=A<<11|A>>>21,T+=(R^A)+H[13]+1859775393,T=T<<15|T>>>17,B=T^A,b+=(B^C)+H[3]+1859775393,b=b<<3|b>>>29,C+=(B^b)+H[11]+1859775393,C=C<<9|C>>>23,R=C^b,A+=(R^T)+H[7]+1859775393,A=A<<11|A>>>21,T+=(R^A)+H[15]+1859775393,T=T<<15|T>>>17,this.first?(this.h0=b+1732584193<<0,this.h1=T-271733879<<0,this.h2=A-1732584194<<0,this.h3=C+271733878<<0,this.first=!1):(this.h0=this.h0+b<<0,this.h1=this.h1+T<<0,this.h2=this.h2+A<<0,this.h3=this.h3+C<<0)},S.prototype.hex=function(){this.finalize();var b=this.h0,T=this.h1,A=this.h2,C=this.h3;return i[b>>4&15]+i[b&15]+i[b>>12&15]+i[b>>8&15]+i[b>>20&15]+i[b>>16&15]+i[b>>28&15]+i[b>>24&15]+i[T>>4&15]+i[T&15]+i[T>>12&15]+i[T>>8&15]+i[T>>20&15]+i[T>>16&15]+i[T>>28&15]+i[T>>24&15]+i[A>>4&15]+i[A&15]+i[A>>12&15]+i[A>>8&15]+i[A>>20&15]+i[A>>16&15]+i[A>>28&15]+i[A>>24&15]+i[C>>4&15]+i[C&15]+i[C>>12&15]+i[C>>8&15]+i[C>>20&15]+i[C>>16&15]+i[C>>28&15]+i[C>>24&15]},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var b=this.h0,T=this.h1,A=this.h2,C=this.h3;return[b&255,b>>8&255,b>>16&255,b>>24&255,T&255,T>>8&255,T>>16&255,T>>24&255,A&255,A>>8&255,A>>16&255,A>>24&255,C&255,C>>8&255,C>>16&255,C>>24&255]},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var b=new ArrayBuffer(16),T=new Uint32Array(b);return T[0]=this.h0,T[1]=this.h1,T[2]=this.h2,T[3]=this.h3,b},S.prototype.buffer=S.prototype.arrayBuffer;var E=w();t?AS.exports=E:(r.md4=E,n&&define(function(){return E}))})()});var yk=ye((Wfe,gk)=>{"use strict";var wN=gt("crypto"),Gfe=pk(),KY=dk();function $Y(r,e){var t=new Buffer.alloc(24),n=new Buffer.alloc(21).fill(0);return e.copy(n),_u(n.slice(0,7),r).copy(t),_u(n.slice(7,14),r).copy(t,8),_u(n.slice(14),r).copy(t,16),t}o($Y,"createLMResponse");function XY(r){var e=new Buffer.alloc(16),t=new Buffer.alloc(14),n=new Buffer.from("KGS!@#$%","ascii");return r.length>14?(e.fill(0),e):(t.fill(0),t.write(r.toUpperCase(),0,"ascii"),Buffer.concat([_u(t.slice(0,7),n),_u(t.slice(7),n)]))}o(XY,"createLMHash");function _u(r,e){var t=new Buffer.alloc(8);t[0]=r[0]&254,t[1]=r[0]<<7&255|r[1]>>1,t[2]=r[1]<<6&255|r[2]>>2,t[3]=r[2]<<5&255|r[3]>>3,t[4]=r[3]<<4&255|r[4]>>4,t[5]=r[4]<<3&255|r[5]>>5,t[6]=r[5]<<2&255|r[6]>>6,t[7]=r[6]<<1&255;for(var n=0;n<8;n++){for(var s=0,i=1;i<8;i++)s+=(t[n]>>i)%2;t[n]|=s%2===0?1:0}var a=a.DES.create({type:"encrypt",ley:t});return a.update(e)}o(_u,"calculateDES");function GY(r,e){var t=new Buffer.alloc(24),n=new Buffer.alloc(21).fill(0);return e.copy(n),_u(n.slice(0,7),r).copy(t),_u(n.slice(7,14),r).copy(t,8),_u(n.slice(14),r).copy(t,16),t}o(GY,"createNTLMResponse");function WY(r){var e=KY.create();return e.update(new Buffer.from(r,"ucs2")),e.buffer()}o(WY,"createNTLMHash");function mk(r,e,t){var n=wN.createHmac("md5",r);return n.update(new Buffer.from(e.toUpperCase()+t,"ucs2")),n.digest()}o(mk,"createNTLMv2Hash");function JY(r,e,t,n,s){var i=new Buffer.alloc(24),a=mk(t,e,s),u=wN.createHmac("md5",a);r.challenge.copy(i,8),i.write(n||SN(16),16,"hex"),u.update(i.slice(8));var l=u.digest();return l.copy(i),i}o(JY,"createLMv2Response");function zY(r,e,t,n,s){var i=new Buffer.alloc(48+r.targetInfo.buffer.length),a=mk(t,e,s),u=wN.createHmac("md5",a);r.challenge.copy(i,8),i.writeUInt32BE(16842752,16),i.writeUInt32LE(0,20);var l=((Date.now()+116444736e5)*1e4).toString(16),f=+("0x"+l.substring(Math.max(0,l.length-8))),h=+("0x"+l.substring(0,Math.max(0,l.length-8)));i.writeUInt32LE(f,24,!1),i.writeUInt32LE(h,28,!1),i.write(n||SN(16),32,"hex"),i.writeUInt32LE(0,40),r.targetInfo.buffer.copy(i,44),i.writeUInt32LE(0,44+r.targetInfo.buffer.length),u.update(i.slice(8));var m=u.digest();return m.copy(i),i}o(zY,"createNTLMv2Response");function SN(r){for(var e="";e.length<r;)e+=Math.floor(Math.random()*16).toString(16);return e}o(SN,"createPseudoRandomValue");gk.exports={createLMHash:XY,createNTLMHash:WY,createLMResponse:$Y,createNTLMResponse:GY,createLMv2Response:JY,createNTLMv2Response:zY,createPseudoRandomValue:SN}});var Sk=ye((zfe,wk)=>{"use strict";var vk=gt("os"),Pu=Q4(),Ru=yk(),Ou="NTLMSSP\0";function YY(r,e){var t=32,n=0,s=new Buffer.alloc(1024);return r=r===void 0?vk.hostname():r,e=e===void 0?"":e,s.write(Ou,n,Ou.length,"ascii"),n+=Ou.length,s.writeUInt32LE(1,n),n+=4,s.writeUInt32LE(Pu.NTLMFLAG_NEGOTIATE_OEM|Pu.NTLMFLAG_REQUEST_TARGET|Pu.NTLMFLAG_NEGOTIATE_NTLM_KEY|Pu.NTLMFLAG_NEGOTIATE_NTLM2_KEY|Pu.NTLMFLAG_NEGOTIATE_ALWAYS_SIGN,n),n+=4,s.writeUInt16LE(e.length,n),n+=2,s.writeUInt16LE(e.length,n),n+=2,s.writeUInt32LE(e.length===0?0:t,n),n+=4,e.length>0&&(t+=s.write(e,t,"ascii")),s.writeUInt16LE(r.length,n),n+=2,s.writeUInt16LE(r.length,n),n+=2,s.writeUInt32LE(r.length===0?0:t,n),n+=4,r.length>0&&(t+=s.write(r,t,"ascii")),"NTLM "+s.toString("base64",0,t)}o(YY,"createType1Message");function QY(r){if(r===void 0)throw new Error("Invalid argument");if(Object.prototype.toString.call(r)!=="[object String]")if(r.hasOwnProperty("headers")&&r.headers.hasOwnProperty("www-authenticate"))r=r.headers["www-authenticate"];else throw new Error("Invalid argument");var e=/^NTLM ([^,\s]+)/.exec(r);e&&(r=e[1]);var t=new Buffer.from(r,"base64"),n={};if(t.toString("ascii",0,Ou.length)!==Ou)throw new Error("Invalid message signature: "+r);if(t.readUInt32LE(Ou.length)!==2)throw new Error("Invalid message type (no type 2)");return n.flags=t.readUInt32LE(20),n.encoding=n.flags&Pu.NTLMFLAG_NEGOTIATE_OEM?"ascii":"ucs2",n.version=n.flags&Pu.NTLMFLAG_NEGOTIATE_NTLM2_KEY?2:1,n.challenge=t.slice(24,32),n.targetName=(function(){var s=t.readUInt16LE(12),i=t.readUInt32LE(16);if(s===0)return"";if(i+s>t.length||i<32)throw new Error("Bad type 2 message");return t.toString(n.encoding,i,i+s)})(),n.flags&Pu.NTLMFLAG_NEGOTIATE_TARGET_INFO&&(n.targetInfo=(function(){var s={},i=t.readUInt16LE(40),a=t.readUInt32LE(44),u=new Buffer.alloc(i);if(t.copy(u,0,a,a+i),i===0)return s;if(a+i>t.length||a<32)throw new Error("Bad type 2 message");for(var l=a;l<a+i;){var f=t.readUInt16LE(l);l+=2;var h=t.readUInt16LE(l);if(l+=2,f===0)break;var m=void 0;switch(f){case 1:m="SERVER";break;case 2:m="DOMAIN";break;case 3:m="FQDN";break;case 4:m="DNS";break;case 5:m="PARENT_DNS";break;default:m="";break}m&&(s[m]=t.toString("ucs2",l,l+h)),l+=h}return{parsed:s,buffer:u}})()),n}o(QY,"decodeType2Message");function ZY(r,e,t,n,s){var i=52,a=new Buffer.alloc(1024);if(n===void 0&&(n=vk.hostname()),s===void 0&&(s=r.targetName),a.write(Ou,0,Ou.length,"ascii"),a.writeUInt32LE(3,8),r.version===2){i=64;var u=Ru.createNTLMHash(t),l=Ru.createPseudoRandomValue(16),f=Ru.createLMv2Response(r,e,u,l,s),h=Ru.createNTLMv2Response(r,e,u,l,s);a.writeUInt16LE(f.length,12),a.writeUInt16LE(f.length,14),a.writeUInt32LE(i,16),f.copy(a,i),i+=f.length,a.writeUInt16LE(h.length,20),a.writeUInt16LE(h.length,22),a.writeUInt32LE(i,24),h.copy(a,i),i+=h.length}else{var m=Ru.createLMHash(t),u=Ru.createNTLMHash(t),g=Ru.createLMResponse(r.challenge,m),w=Ru.createNTLMResponse(r.challenge,u);a.writeUInt16LE(g.length,12),a.writeUInt16LE(g.length,14),a.writeUInt32LE(i,16),g.copy(a,i),i+=g.length,a.writeUInt16LE(w.length,20),a.writeUInt16LE(w.length,22),a.writeUInt32LE(i,24),w.copy(a,i),i+=w.length}return a.writeUInt16LE(r.encoding==="ascii"?s.length:s.length*2,28),a.writeUInt16LE(r.encoding==="ascii"?s.length:s.length*2,30),a.writeUInt32LE(i,32),i+=a.write(s,i,r.encoding),a.writeUInt16LE(r.encoding==="ascii"?e.length:e.length*2,36),a.writeUInt16LE(r.encoding==="ascii"?e.length:e.length*2,38),a.writeUInt32LE(i,40),i+=a.write(e,i,r.encoding),a.writeUInt16LE(r.encoding==="ascii"?n.length:n.length*2,44),a.writeUInt16LE(r.encoding==="ascii"?n.length:n.length*2,46),a.writeUInt32LE(i,48),i+=a.write(n,i,r.encoding),r.version===2&&(a.writeUInt16LE(0,52),a.writeUInt16LE(0,54),a.writeUInt32LE(0,56),a.writeUInt32LE(r.flags,60)),"NTLM "+a.toString("base64",0,i)}o(ZY,"createType3Message");wk.exports={createType1Message:YY,decodeType2Message:QY,createType3Message:ZY}});var bk=ye((Qfe,Ck)=>{"use strict";var eQ=gt("util"),tQ=gt("stream"),Ek=tQ.Writable,Ak=Ak||function(r){setTimeout(r,0)};Ck.exports=jm;eQ.inherits(jm,Ek);function jm(r){if(!(this instanceof jm))return new jm(r);r=r||{},Ek.call(this,r)}o(jm,"DevNull");jm.prototype._write=function(r,e,t){Ak(t)}});var Nk=ye(Vn=>{"use strict";var rQ=Vn&&Vn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),nQ=Vn&&Vn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),CS=Vn&&Vn.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&rQ(t,e,n[s]);return nQ(t,e),t}})(),sQ=Vn&&Vn.__awaiter||function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return o(s,"adopt"),new(t||(t=Promise))(function(i,a){function u(h){try{f(n.next(h))}catch(m){a(m)}}o(u,"fulfilled");function l(h){try{f(n.throw(h))}catch(m){a(m)}}o(l,"rejected");function f(h){h.done?i(h.value):s(h.value).then(u,l)}o(f,"step"),f((n=n.apply(r,e||[])).next())})},iQ=Vn&&Vn.__generator||function(r,e){var t={label:0,sent:o(function(){if(i[0]&1)throw i[1];return i[1]},"sent"),trys:[],ops:[]},n,s,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(f){return function(h){return l([f,h])}}function l(f){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(t=0)),t;)try{if(n=1,s&&(i=f[0]&2?s.return:f[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,f[1])).done)return i;switch(s=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,s=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){t.label=f[1];break}if(f[0]===6&&t.label<i[1]){t.label=i[1],i=f;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(f);break}i[2]&&t.ops.pop(),t.trys.pop();continue}f=e.call(r,t)}catch(h){f=[6,h],s=0}finally{n=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},aQ=Vn&&Vn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.AxiosError=void 0;Vn.NtlmClient=cQ;var xk=CS(pN());Object.defineProperty(Vn,"AxiosError",{enumerable:!0,get:o(function(){return xk.AxiosError},"get")});var EN=CS(Sk()),oQ=CS(gt("https")),uQ=CS(gt("http")),lQ=aQ(bk());function cQ(r,e){var t=this,n=e??{};n.httpAgent||(n.httpAgent=new uQ.Agent({keepAlive:!0})),n.httpsAgent||(n.httpsAgent=new oQ.Agent({keepAlive:!0}));var s=xk.default.create(n);return s.interceptors.response.use(function(i){return i},function(i){return sQ(t,void 0,void 0,function(){var a,u,l,f,h,m,g,w;return iQ(this,function(y){switch(y.label){case 0:return a=i.response,a&&a.status===401&&a.headers["www-authenticate"]&&a.headers["www-authenticate"].includes("NTLM")&&(!a.config.headers["X-retry"]||a.config.headers["X-retry"]!=="false")?(u=((g=a.headers["www-authenticate"].split(",").find(function(S){return S.match(/ *NTLM/)}))===null||g===void 0?void 0:g.trim())||"",a.config.headers||(a.config.headers={}),u.length<50?(l=EN.createType1Message(r.workstation,r.domain),a.config.headers.Authorization=l):(f=EN.decodeType2Message((u.match(/^NTLM\s+(.+?)(,|\s+|$)/)||[])[1]),h=EN.createType3Message(f,r.username,r.password,r.workstation,r.domain),a.config.headers["X-retry"]="false",a.config.headers.Authorization=h),a.config.responseType!=="stream"?[3,2]:(m=(w=i.response)===null||w===void 0?void 0:w.data,m&&!m.readableEnded?[4,new Promise(function(S){m.pipe((0,lQ.default)()),m.once("close",S)})]:[3,2])):[3,3];case 1:y.sent(),y.label=2;case 2:return[2,s(a.config)];case 3:throw i}})})}),s}o(cQ,"NtlmClient")});var Fm=ye(ku=>{"use strict";ku.removeLeadingAndTrailingHTTPWhitespace=r=>r.replace(/^[ \t\n\r]+/u,"").replace(/[ \t\n\r]+$/u,"");ku.removeTrailingHTTPWhitespace=r=>r.replace(/[ \t\n\r]+$/u,"");ku.isHTTPWhitespaceChar=r=>r===" "||r===" "||r===`
48
- `||r==="\r";ku.solelyContainsHTTPTokenCodePoints=r=>/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(r);ku.soleyContainsHTTPQuotedStringTokenCodePoints=r=>/^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(r);ku.asciiLowercase=r=>r.replace(/[A-Z]/ug,e=>e.toLowerCase());ku.collectAnHTTPQuotedString=(r,e)=>{let t="";for(e++;;){for(;e<r.length&&r[e]!=='"'&&r[e]!=="\\";)t+=r[e],++e;if(e>=r.length)break;let n=r[e];if(++e,n==="\\"){if(e>=r.length){t+="\\";break}t+=r[e],++e}else break}return[t,e]}});var Ik=ye((she,Tk)=>{"use strict";var{asciiLowercase:bS,solelyContainsHTTPTokenCodePoints:fQ,soleyContainsHTTPQuotedStringTokenCodePoints:hQ}=Fm();Tk.exports=class{static{o(this,"MIMETypeParameters")}constructor(e){this._map=e}get size(){return this._map.size}get(e){return e=bS(String(e)),this._map.get(e)}has(e){return e=bS(String(e)),this._map.has(e)}set(e,t){if(e=bS(String(e)),t=String(t),!fQ(e))throw new Error(`Invalid MIME type parameter name "${e}": only HTTP token code points are valid.`);if(!hQ(t))throw new Error(`Invalid MIME type parameter value "${t}": only HTTP quoted-string token code points are valid.`);return this._map.set(e,t)}clear(){this._map.clear()}delete(e){return e=bS(String(e)),this._map.delete(e)}forEach(e,t){this._map.forEach(e,t)}keys(){return this._map.keys()}values(){return this._map.values()}entries(){return this._map.entries()}[Symbol.iterator](){return this._map[Symbol.iterator]()}}});var _k=ye((ahe,Dk)=>{"use strict";var{removeLeadingAndTrailingHTTPWhitespace:pQ,removeTrailingHTTPWhitespace:Bk,isHTTPWhitespaceChar:dQ,solelyContainsHTTPTokenCodePoints:AN,soleyContainsHTTPQuotedStringTokenCodePoints:mQ,asciiLowercase:CN,collectAnHTTPQuotedString:gQ}=Fm();Dk.exports=r=>{r=pQ(r);let e=0,t="";for(;e<r.length&&r[e]!=="/";)t+=r[e],++e;if(t.length===0||!AN(t)||e>=r.length)return null;++e;let n="";for(;e<r.length&&r[e]!==";";)n+=r[e],++e;if(n=Bk(n),n.length===0||!AN(n))return null;let s={type:CN(t),subtype:CN(n),parameters:new Map};for(;e<r.length;){for(++e;dQ(r[e]);)++e;let i="";for(;e<r.length&&r[e]!==";"&&r[e]!=="=";)i+=r[e],++e;if(i=CN(i),e<r.length){if(r[e]===";")continue;++e}let a=null;if(r[e]==='"')for([a,e]=gQ(r,e);e<r.length&&r[e]!==";";)++e;else{for(a="";e<r.length&&r[e]!==";";)a+=r[e],++e;if(a=Bk(a),a==="")continue}i.length>0&&AN(i)&&mQ(a)&&!s.parameters.has(i)&&s.parameters.set(i,a)}return s}});var Pk=ye((ohe,Rk)=>{"use strict";var{solelyContainsHTTPTokenCodePoints:yQ}=Fm();Rk.exports=r=>{let e=`${r.type}/${r.subtype}`;if(r.parameters.size===0)return e;for(let[t,n]of r.parameters)e+=";",e+=t,e+="=",(!yQ(n)||n.length===0)&&(n=n.replace(/(["\\])/ug,"\\$1"),n=`"${n}"`),e+=n;return e}});var Vk=ye((lhe,Lk)=>{"use strict";var vQ=Ik(),wQ=_k(),SQ=Pk(),{asciiLowercase:Ok,solelyContainsHTTPTokenCodePoints:kk}=Fm();Lk.exports=class{static{o(this,"MIMEType")}constructor(e){e=String(e);let t=wQ(e);if(t===null)throw new Error(`Could not parse MIME type string "${e}"`);this._type=t.type,this._subtype=t.subtype,this._parameters=new vQ(t.parameters)}static parse(e){try{return new this(e)}catch{return null}}get essence(){return`${this.type}/${this.subtype}`}get type(){return this._type}set type(e){if(e=Ok(String(e)),e.length===0)throw new Error("Invalid type: must be a non-empty string");if(!kk(e))throw new Error(`Invalid type ${e}: must contain only HTTP token code points`);this._type=e}get subtype(){return this._subtype}set subtype(e){if(e=Ok(String(e)),e.length===0)throw new Error("Invalid subtype: must be a non-empty string");if(!kk(e))throw new Error(`Invalid subtype ${e}: must contain only HTTP token code points`);this._subtype=e}get parameters(){return this._parameters}toString(){return SQ(this)}isJavaScript({prohibitParameters:e=!1}={}){switch(this._type){case"text":switch(this._subtype){case"ecmascript":case"javascript":case"javascript1.0":case"javascript1.1":case"javascript1.2":case"javascript1.3":case"javascript1.4":case"javascript1.5":case"jscript":case"livescript":case"x-ecmascript":case"x-javascript":return!e||this._parameters.size===0;default:return!1}case"application":switch(this._subtype){case"ecmascript":case"javascript":case"x-ecmascript":case"x-javascript":return!e||this._parameters.size===0;default:return!1}default:return!1}}isXML(){return this._subtype==="xml"&&(this._type==="text"||this._type==="application")||this._subtype.endsWith("+xml")}isHTML(){return this._subtype==="html"&&this._type==="text"}}});var Lu=ye(cn=>{"use strict";var EQ=cn&&cn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),AQ=cn&&cn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),CQ=cn&&cn.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&EQ(t,e,n[s]);return AQ(t,e),t}})();Object.defineProperty(cn,"__esModule",{value:!0});cn.wsdlCacheSingleton=cn.TNS_PREFIX=void 0;cn.passwordDigest=xQ;cn.findPrefix=NQ;cn.splitQName=TQ;cn.xmlEscape=IQ;cn.parseMTOMResp=BQ;var bQ=CQ(gt("crypto"));function xQ(r,e,t){let n=bQ.createHash("sha1"),s=Buffer.from(r||"","base64"),i=Buffer.from(e||"","utf8"),a=Buffer.from(t||"","utf8"),u=Buffer.concat([s,i,a]);return n.update(u),n.digest("base64")}o(xQ,"passwordDigest");cn.TNS_PREFIX="__tns__";function NQ(r,e){for(let t in r)if(t!==cn.TNS_PREFIX&&r[t]===e)return t}o(NQ,"findPrefix");function TQ(r){if(typeof r!="string")return{prefix:cn.TNS_PREFIX,name:r};let[e]=r.split("|",1),t=e.indexOf(":");return{prefix:e.substring(0,t)||cn.TNS_PREFIX,name:e.substring(t+1)}}o(TQ,"splitQName");function IQ(r){return typeof r=="string"?r.substr(0,9)==="<![CDATA["&&r.substr(-3)==="]]>"?r:r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"):r}o(IQ,"xmlEscape");function BQ(r,e,t){return import("./src-NRIPS2N7.mjs").then(({MultipartParser:n})=>{let s={parts:[]},i="",a="",u,l=0,f=new n;return f.initWithBoundary(e),f.on("data",({name:h,buffer:m,start:g,end:w})=>{switch(h){case"partBegin":s.parts[l]={body:null,headers:{}},u=Buffer.from("");break;case"headerField":i=m.slice(g,w).toString();break;case"headerValue":a=m.slice(g,w).toString();break;case"headerEnd":s.parts[l].headers[i.toLowerCase()]=a;break;case"partData":u=Buffer.concat([u,m.slice(g,w)]);break;case"partEnd":s.parts[l].body=u,l++;break}}),f.write(r),t(null,s)}).catch(t)}o(BQ,"parseMTOMResp");var DQ=class{static{o(this,"DefaultWSDLCache")}constructor(){this.cache={}}has(e){return!!this.cache[e]}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}clear(){this.cache={}}};cn.wsdlCacheSingleton=new DQ});var Uk=ye((dhe,_Q)=>{_Q.exports={name:"soap",version:"1.6.0",description:"A minimal node SOAP client",engines:{node:">=14.17.0"},author:"Vinay Pulim <v@pulim.com>",dependencies:{axios:"^1.12.2","axios-ntlm":"^1.4.6",debug:"^4.4.3",formidable:"^3.5.4","get-stream":"^6.0.1",lodash:"^4.17.21",sax:"^1.4.1","strip-bom":"^3.0.0","whatwg-mimetype":"4.0.0","xml-crypto":"^6.1.2"},repository:{type:"git",url:"https://github.com/vpulim/node-soap.git"},main:"./lib/soap.js",types:"./lib/soap.d.ts",directories:{lib:"./lib",test:"./test"},scripts:{build:"tsc -p .",watch:"tsc -w -p .",lint:"eslint .",format:"prettier --write .","format:check":"prettier --check .",toc:"./node_modules/.bin/doctoc Readme.md --github --maxlevel 3",cover:"OPENSSL_ENABLE_SHA1_SIGNATURES=1 nyc --extension=.ts --reporter=lcov --reporter=html --reporter=text mocha --no-parallel --timeout 30000 --exit test/*-test.js test/security/*.js",coveralls:"cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js -v",docs:"typedoc --out docs",test:"mocha --timeout 15000 --bail --exit test/*-test.js test/security/*.js"},keywords:["soap"],license:"MIT",devDependencies:{"@eslint/js":"^9.38.0","@types/debug":"^4.1.12","@types/formidable":"^3.4.6","@types/lodash":"^4.17.20","@types/node":"^14.0.0","@types/sax":"^1.2.7","@types/whatwg-mimetype":"^3.0.2","body-parser":"^2.2.0",colors:"^1.4.0",diff:"^8.0.2",doctoc:"^2.2.1",duplexer:"~0.1.2",eslint:"^9.38.0",express:"^5.1.0",finalhandler:"^2.1.0",glob:"^11.0.3",mocha:"^11.7.4",nyc:"^17.1.0",prettier:"^3.6.2","readable-stream":"^4.7.0",semver:"^7.7.3","serve-static":"^2.2.0",should:"^13.2.3",sinon:"^21.0.0","source-map-support":"^0.5.21",timekeeper:"^2.3.1",typedoc:"^0.28.14",typescript:"^5.9.3","typescript-eslint":"^8.46.1"}}});var xS=ye(vi=>{"use strict";var RQ=vi&&vi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),PQ=vi&&vi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Fk=vi&&vi.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&RQ(t,e,n[s]);return PQ(t,e),t}})(),qk=vi&&vi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(vi,"__esModule",{value:!0});vi.HttpClient=void 0;var OQ=Fk(pN()),kQ=Nk(),Mk=gt("crypto"),LQ=qk(dw()),VQ=Fk(gt("url")),UQ=qk(Vk()),MQ=gt("zlib"),jQ=Lu(),jk=(0,LQ.default)("node-soap"),FQ=Uk(),qQ=class{static{o(this,"HttpClient")}constructor(e){e=e||{},this.options=e,this._request=e.request||OQ.create()}buildRequest(e,t,n,s={}){let i=VQ.parse(e),a=t?"POST":"GET",u=i.hostname,l=parseInt(i.port,10),f={"User-Agent":"node-soap/"+FQ.version,Accept:"text/html,application/xhtml+xml,application/xml,text/xml;q=0.9,*/*;q=0.8","Accept-Encoding":"none","Accept-Charset":"utf-8",...s.forever&&{Connection:"keep-alive"},Host:u+(isNaN(l)?"":":"+l)},h=["headers"],{attachments:m,...g}=s,w=m||[];typeof t=="string"&&w.length===0&&!s.forceMTOM&&(f["Content-Length"]=Buffer.byteLength(t,"utf8"),f["Content-Type"]="application/x-www-form-urlencoded"),n=n||{};for(let S in n)f[S]=n[S];let y={url:i.href,method:a,headers:f,transformResponse:o(S=>S,"transformResponse")};if(s.ntlm||(y.validateStatus=null),s.forceMTOM||w.length>0){let S=(0,Mk.randomUUID)(),E=null;if(f["Content-Type"].indexOf("action")>-1)for(let C of f["Content-Type"].split("; "))C.indexOf("action")>-1&&(E=C);let b=(0,Mk.randomUUID)();f["Content-Type"]='multipart/related; type="application/xop+xml"; start="<'+S+'>"; start-info="text/xml"; boundary='+b,E&&(f["Content-Type"]=f["Content-Type"]+"; "+E);let T=[{"Content-Type":'application/xop+xml; charset=UTF-8; type="text/xml"',"Content-ID":"<"+S+">",body:t}];w.forEach(C=>{T.push({"Content-Type":C.mimetype,"Content-Transfer-Encoding":"binary","Content-ID":"<"+C.contentId+">","Content-Disposition":'attachment; filename="'+C.name+'"',body:C.body})}),y.data=[Buffer.from(`--${b}\r
49
- `)];let A=0;T.forEach(C=>{Object.keys(C).forEach(x=>{x!=="body"&&y.data.push(Buffer.from(`${x}: ${C[x]}\r
50
- `))}),y.data.push(Buffer.from(`\r
51
- `),Buffer.from(C.body),Buffer.from(`\r
52
- --${b}${A===T.length-1?"--":""}\r
53
- `)),A++}),y.data=Buffer.concat(y.data)}else y.data=t;s.forceGzip&&(y.decompress=!0,y.data=(0,MQ.gzipSync)(y.data),y.headers["Accept-Encoding"]="gzip,deflate",y.headers["Content-Encoding"]="gzip");for(let S in g)if(h.indexOf(S)!==-1)for(let E in s[S])y[S][E]=s[S][E];else y[S]=s[S];return jk("Http request: %j",y),y}handleResponse(e,t,n){if(jk("Http response body: %j",n),typeof n=="string"){let s=/(?:<\?[^?]*\?>[\s]*)?<([^:]*):Envelope([\S\s]*)<\/\1:Envelope>/i,i=n.replace(/<!--[\s\S]*?-->/,"").match(s);i&&(n=i[0])}return n}request(e,t,n,s,i){let a=this.buildRequest(e,t,s,i),u;i!==void 0&&i.ntlm?u=(0,kQ.NtlmClient)({username:i.username,password:i.password,workstation:i.workstation||"",domain:i.domain||""})(a):(this.options.parseReponseAttachments&&(a.responseType="arraybuffer",a.responseEncoding="binary"),u=this._request(a));let l=this;return u.then(f=>{let h=o(m=>(f.data=this.handleResponse(u,f,m||f.data),n(null,f,f.data),f),"handleBody");if(l.options.parseReponseAttachments)if(f.headers["content-type"]&&f.headers["content-type"].toLowerCase().indexOf("multipart/related")>-1){let g,w=UQ.default.parse(f.headers["content-type"]);return w&&(g=w.parameters.get("boundary")),g?(0,jQ.parseMTOMResp)(f.data,g,(y,S)=>{if(y)return n(y);let E=S.parts.shift();return!E||!E.body?n(new Error("Cannot parse multipart response")):(f.mtomResponseAttachments=S,h(E.body.toString(l.options.encoding||"utf8")))}):n(new Error("Missing boundary from content-type"))}else return h(f.data.toString(l.options.encoding||"utf8"));else return h()},f=>n(f)),u}requestStream(e,t,n,s){let i=this.buildRequest(e,t,n,s);i.responseType="stream";let a=this._request(i).then(u=>(u.data=this.handleResponse(a,u,u.data),u));return a}};vi.HttpClient=qQ});var bN=ye(wi=>{"use strict";var HQ=wi&&wi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),KQ=wi&&wi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Xk=wi&&wi.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&HQ(t,e,n[s]);return KQ(t,e),t}})(),Gk=wi&&wi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wi,"__esModule",{value:!0});wi.Client=void 0;var Hk=Xk(gt("assert")),$Q=gt("crypto"),XQ=Gk(dw()),GQ=gt("events"),WQ=Gk(r4()),Kk=Xk(go()),JQ=xS(),zQ=Lu(),YQ=(0,XQ.default)("node-soap"),$k=/[^a-z$_0-9]/i,QQ=class extends GQ.EventEmitter{static{o(this,"Client")}constructor(e,t,n){super(),n=n||{},this.wsdl=e,this._initializeOptions(n),this._initializeServices(t),this.httpClient=n.httpClient||new JQ.HttpClient(n)}addSoapHeader(e,t,n,s){return this.soapHeaders||(this.soapHeaders=[]),e=this._processSoapHeader(e,t,n,s),this.soapHeaders.push(e)-1}changeSoapHeader(e,t,n,s,i){this.soapHeaders||(this.soapHeaders=[]),t=this._processSoapHeader(t,n,s,i),this.soapHeaders[e]=t}getSoapHeaders(){return this.soapHeaders}clearSoapHeaders(){this.soapHeaders=null}addHttpHeader(e,t){this.httpHeaders||(this.httpHeaders={}),this.httpHeaders[e]=t}getHttpHeaders(){return this.httpHeaders}clearHttpHeaders(){this.httpHeaders=null}addBodyAttribute(e){if(this.bodyAttributes||(this.bodyAttributes=[]),typeof e=="object"){let t="";Object.getOwnPropertyNames(e).forEach(n=>{t+=" "+n+'="'+e[n]+'"'}),e=t}e.substr(0,1)!==" "&&(e=" "+e),this.bodyAttributes.push(e)}getBodyAttributes(){return this.bodyAttributes}clearBodyAttributes(){this.bodyAttributes=null}setEndpoint(e){this.endpoint=e,this._initializeServices(e)}describe(){return this.wsdl.describeServices()}setSecurity(e){this.security=e}setSOAPAction(e){this.SOAPAction=e}_initializeServices(e){let n=this.wsdl.definitions.services;for(let s in n)this[s]=this._defineService(n[s],e)}_initializeOptions(e){this.streamAllowed=e.stream,this.returnSaxStream=e.returnSaxStream,this.normalizeNames=e.normalizeNames,this.overridePromiseSuffix=e.overridePromiseSuffix||"Async",this.wsdl.options.attributesKey=e.attributesKey||"attributes",this.wsdl.options.envelopeKey=e.envelopeKey||"soap",this.wsdl.options.envelopeSoapUrl=e.envelopeSoapUrl||"http://schemas.xmlsoap.org/soap/envelope/",this.wsdl.options.preserveWhitespace=!!e.preserveWhitespace,this.wsdl.options.forceUseSchemaXmlns=!!e.forceUseSchemaXmlns;let t=e.ignoredNamespaces;t!==void 0&&typeof t=="object"&&"override"in t&&t.override===!0&&t.namespaces!==void 0&&(this.wsdl.options.ignoredNamespaces=t.namespaces),e.overrideElementKey!==void 0&&(this.wsdl.options.overrideElementKey=e.overrideElementKey),e.overrideRootElement!==void 0&&(this.wsdl.options.overrideRootElement=e.overrideRootElement),this.wsdl.options.forceSoap12Headers=!!e.forceSoap12Headers}_defineService(e,t){let n=e.ports,s={};for(let i in n)s[i]=this._definePort(n[i],t||n[i].location);return s}_definePort(e,t){let n=t,i=e.binding.methods,a={};for(let u in i){a[u]=this._defineMethod(i[u],n);let l=this.normalizeNames?u.replace($k,"_"):u;if(this[l]=a[u],!$k.test(l)){let f=this.overridePromiseSuffix;this[l+f]=this._promisifyMethod(a[u])}}return a}_promisifyMethod(e){return(t,n,s)=>new Promise((i,a)=>{e(t,o((l,f,h,m,g,w)=>{l?a(l):i([f,h,m,g,w])},"callback"),n,s)})}_defineMethod(e,t){let n;return(s,i,a,u)=>{typeof s=="function"?(i=s,s={}):typeof a=="function"?(n=i,i=a,a=n):typeof u=="function"&&(n=i,i=u,u=a,a=n),this._invoke(e,s,t,(l,f,h,m,g,w)=>{i(l,f,h,m,g,w)},a,u)}}_processSoapHeader(e,t,n,s){switch(typeof e){case"object":return this.wsdl.objectToXML(e,t,n,s,!0);case"function":{let i=this;return(...a)=>{let u=e.apply(null,[...a]);return typeof u=="object"?i.wsdl.objectToXML(u,t,n,s,!0):u}}default:return e}}_invoke(e,t,n,s,i,a){let u=e.$name,l=e.input,f=e.output,h=e.style,m=this.wsdl.definitions,g=this.wsdl.options.envelopeKey,w=this.wsdl.options.envelopeSoapUrl,y=m.$targetNamespace,S="",E="",b=null,T,A=(0,zQ.findPrefix)(m.xmlns,y),C={"Content-Type":"text/xml; charset=utf-8"},x="xmlns:"+g+'="'+w+'"',B=o((G,he,le)=>{let oe;if(!f)return s(null,null,he,G.Header,b,le.mtomResponseAttachments);if(!G.html&&!G.Body){if(le.status>=400){let Z=new Error("Error http status codes");return Z.response=le,Z.body=he,this.emit("soapError",Z,H),s(Z,G,he,G.Header)}return s(null,G,he,G.Header)}if(typeof G.Body!="object"){let Z=new Error("Cannot parse response");return Z.response=le,Z.body=he,s(Z,G,he,void 0,b)}oe=G.Body[f.$name],oe||(oe=G.Body[f.$name.replace(/(?:Out(?:put)?|Response)$/,"")]),oe||["Response","Out","Output"].forEach(Z=>{if(Object.hasOwnProperty.call(G.Body,u+Z))return oe=G.Body[u+Z]}),s(null,oe,he,G.Header,b,le.mtomResponseAttachments)},"finish"),F=o((G,he)=>{let le;try{le=this.wsdl.xmlToObject(G)}catch(oe){if(!f||!f.$lookupTypes){YQ("Response element is not present. Unable to convert response xml to json.");let Z=Kk.isObject(G)?G:q(G);if(Z)return s(null,he,Z,void 0,b)}return oe.response=he,oe.body=G,this.emit("soapError",oe,H),s(oe,he,G,void 0,b,he.mtomResponseAttachments)}return B(le,G,he)},"parseSync");this.SOAPAction?T=this.SOAPAction:e.soapAction!==void 0&&e.soapAction!==null?T=e.soapAction:T=(y.lastIndexOf("/")!==y.length-1?y+"/":y)+u,this.wsdl.options.forceSoap12Headers?(C["Content-Type"]=`application/soap+xml; charset=utf-8; action="${T}"`,x="xmlns:"+g+'="http://www.w3.org/2003/05/soap-envelope"'):C.SOAPAction='"'+T+'"',i=i||{},this.security&&this.security.addHeaders&&this.security.addHeaders(C),this.security&&this.security.addOptions&&this.security.addOptions(i),h==="rpc"&&(l.parts||l.name==="element"||t===null)?(Hk.ok(!h||h==="rpc","invalid message definition for document style binding"),E=this.wsdl.objectToRpcXML(u,t,A,y,l.name!=="element"),e.inputSoap==="encoded"&&(S='soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" ')):(Hk.ok(!h||h==="document","invalid message definition for rpc style binding"),E=this.wsdl.objectToDocumentXML(l.$name,t,l.targetNSAlias,l.targetNamespace,l.$type||l.$lookupType));let R;this.soapHeaders&&(R=this.soapHeaders.map(G=>typeof G=="function"?G(e,n,T,t):G).join(" ")),b='<?xml version="1.0" encoding="utf-8"?><'+g+":Envelope "+x+' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '+S+this.wsdl.xmlnsInEnvelope+">"+(R||this.security?"<"+g+":Header"+(this.wsdl.xmlnsInHeader?" "+this.wsdl.xmlnsInHeader:"")+">"+(R||"")+(this.security&&!this.security.postProcess?this.security.toXML():"")+"</"+g+":Header>":"")+"<"+g+":Body"+(this.bodyAttributes?this.bodyAttributes.join(" "):"")+">"+E+"</"+g+":Body></"+g+":Envelope>",this.security&&this.security.postProcess&&(b=this.security.postProcess(b,g)),i&&i.postProcess&&(b=i.postProcess(b)),this.lastMessage=E,this.lastRequest=b,this.lastEndpoint=n;let H=i.exchangeId||(0,$Q.randomUUID)();if(this.emit("message",E,H),this.emit("request",b,H),this.httpHeaders===null)C={};else{for(let G in this.httpHeaders)C[G]=this.httpHeaders[G];for(let G in a)C[G]=a[G]}let q=o(G=>{try{return JSON.parse(G)}catch{return}},"tryJSONparse");if(this.streamAllowed&&typeof this.httpClient.requestStream=="function"){s=Kk.once(s);let G=Date.now(),he=o(le=>{this.lastResponse=null,this.lastResponseHeaders=null,this.lastElapsedTime=null,this.lastRequestHeaders=le.config&&le.config.headers,this.emit("response",null,null,H),this.returnSaxStream||!le.response||!le.response.data?s(le,void 0,void 0,void 0,b):(le.response.data.on("close",()=>{s(le,void 0,void 0,void 0,b)}),le.response.data.on("data",oe=>{le.response.data=oe.toString()}))},"onError");this.httpClient.requestStream(n,b,C,i,this).then(le=>{if(this.lastRequestHeaders=le.headers,le.data.on&&le.data.on("error",oe=>he(oe)),le.status!==200||!f||!f.$lookupTypes){(0,WQ.default)(le.data).then(oe=>(this.lastResponse=oe,this.lastElapsedTime=Date.now()-G,this.lastResponseHeaders=le&&le.headers,this.lastRequestHeaders=le.config&&le.config.headers||le.headers,this.emit("response",oe,le,H),F(oe,le)));return}if(this.returnSaxStream){let oe=this.wsdl.getSaxStream(le.data);return B({saxStream:oe},"<stream>",le.data)}else this.wsdl.xmlToObject(le.data,(oe,Z)=>(this.lastResponse=le,this.lastElapsedTime=Date.now()-G,this.lastResponseHeaders=le&&le.headers,this.lastRequestHeaders=le.config.headers,this.emit("response","<stream>",le.data,H),oe?(oe.response=le,oe.body="<stream>",this.emit("soapError",oe,H),s(oe,le,void 0,void 0,b)):B(Z,"<stream>",le)))},he);return}let K=Date.now();return this.httpClient.request(n,b,(G,he,le)=>{if(this.lastResponse=le,he&&(this.lastResponseHeaders=he.headers,this.lastElapsedTime=Date.now()-K,this.lastResponseAttachments=he.mtomResponseAttachments,this.lastRequestHeaders=he.config&&he.config.headers),this.emit("response",le,he,H),G){this.lastRequestHeaders=G.config&&G.config.headers;try{G.response&&G.response.data&&this.wsdl.xmlToObject(G.response.data)}catch(oe){G.root=oe.root||oe}s(G,void 0,void 0,void 0,b)}else return F(le,he)},C,i,this)}};wi.Client=QQ});var Jk=ye(Ta=>{"use strict";var ZQ=Ta&&Ta.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),eZ=Ta&&Ta.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),tZ=Ta&&Ta.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&ZQ(t,e,n[s]);return eZ(t,e),t}})();Object.defineProperty(Ta,"__esModule",{value:!0});Ta.BasicAuthSecurity=void 0;var Wk=tZ(go()),rZ=class{static{o(this,"BasicAuthSecurity")}constructor(e,t,n){this._username=e,this._password=t,this.defaults={},Wk.merge(this.defaults,n)}addHeaders(e){e.Authorization="Basic "+Buffer.from(this._username+":"+this._password||"").toString("base64")}toXML(){return""}addOptions(e){Wk.merge(e,this.defaults)}};Ta.BasicAuthSecurity=rZ});var Yk=ye(Ia=>{"use strict";var nZ=Ia&&Ia.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),sZ=Ia&&Ia.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),iZ=Ia&&Ia.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&nZ(t,e,n[s]);return sZ(t,e),t}})();Object.defineProperty(Ia,"__esModule",{value:!0});Ia.BearerSecurity=void 0;var zk=iZ(go()),aZ=class{static{o(this,"BearerSecurity")}constructor(e,t){this._token=e,this.defaults={},zk.merge(this.defaults,t)}addHeaders(e){e.Authorization="Bearer "+this._token}toXML(){return""}addOptions(e){zk.merge(e,this.defaults)}};Ia.BearerSecurity=aZ});var eL=ye(Ba=>{"use strict";var oZ=Ba&&Ba.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),uZ=Ba&&Ba.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),NN=Ba&&Ba.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&oZ(t,e,n[s]);return uZ(t,e),t}})();Object.defineProperty(Ba,"__esModule",{value:!0});Ba.ClientSSLSecurity=void 0;var xN=NN(gt("fs")),Qk=NN(gt("https")),Zk=NN(go()),lZ=class{static{o(this,"ClientSSLSecurity")}constructor(e,t,n,s){if(e)if(Buffer.isBuffer(e))this.key=e;else if(typeof e=="string")this.key=xN.readFileSync(e);else throw new Error("key should be a buffer or a string!");if(t)if(Buffer.isBuffer(t))this.cert=t;else if(typeof t=="string")this.cert=xN.readFileSync(t);else throw new Error("cert should be a buffer or a string!");n&&(Buffer.isBuffer(n)||Array.isArray(n)?this.ca=n:typeof n=="string"?this.ca=xN.readFileSync(n):(s=n,this.ca=null)),this.defaults={},Zk.merge(this.defaults,s),this.agent=null}toXML(){return""}addOptions(e){let t=null;e.key=this.key,e.cert=this.cert,e.ca=this.ca,Zk.merge(e,this.defaults),e.forever?(this.agent||(e.keepAlive=!0,this.agent=new Qk.Agent(e)),t=this.agent):t=new Qk.Agent(e),e.httpsAgent=t}};Ba.ClientSSLSecurity=lZ});var rL=ye(Da=>{"use strict";var cZ=Da&&Da.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),fZ=Da&&Da.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),TN=Da&&Da.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&cZ(t,e,n[s]);return fZ(t,e),t}})();Object.defineProperty(Da,"__esModule",{value:!0});Da.ClientSSLSecurityPFX=void 0;var hZ=TN(gt("fs")),pZ=TN(gt("https")),tL=TN(go()),dZ=class{static{o(this,"ClientSSLSecurityPFX")}constructor(e,t,n){if(typeof t=="object"&&(n=t),e)if(Buffer.isBuffer(e))this.pfx=e;else if(typeof e=="string")this.pfx=hZ.readFileSync(e);else throw new Error("supplied pfx file should be a buffer or a file location");t&&typeof t=="string"&&(this.passphrase=t),this.defaults={},tL.merge(this.defaults,n)}toXML(){return""}addOptions(e){e.pfx=this.pfx,this.passphrase&&(e.passphrase=this.passphrase),tL.merge(e,this.defaults),e.httpsAgent=new pZ.Agent(e)}};Da.ClientSSLSecurityPFX=dZ});var nL=ye(_a=>{"use strict";var mZ=_a&&_a.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),gZ=_a&&_a.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),yZ=_a&&_a.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&mZ(t,e,n[s]);return gZ(t,e),t}})();Object.defineProperty(_a,"__esModule",{value:!0});_a.NTLMSecurity=void 0;var vZ=yZ(go()),wZ=class{static{o(this,"NTLMSecurity")}constructor(e,t,n,s){typeof e=="object"?(this.defaults=e,this.defaults.ntlm=!0):this.defaults={ntlm:!0,username:e,password:t,domain:n,workstation:s}}addHeaders(e){e.Connection="keep-alive"}toXML(){return""}addOptions(e){vZ.merge(e,this.defaults)}};_a.NTLMSecurity=wZ});var sL=ye(Ra=>{"use strict";var SZ=Ra&&Ra.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),EZ=Ra&&Ra.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),AZ=Ra&&Ra.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&SZ(t,e,n[s]);return EZ(t,e),t}})();Object.defineProperty(Ra,"__esModule",{value:!0});Ra.WSSecurity=void 0;var CZ=AZ(gt("crypto")),IN=Lu(),bZ=["PasswordDigest","PasswordText"],xZ=class{static{o(this,"WSSecurity")}constructor(e,t,n){n=n||{},this._username=e,this._password=t,this._envelopeKey="soap",typeof n=="string"?(this._passwordType=n||"PasswordText",n={}):this._passwordType=n.passwordType?n.passwordType:"PasswordText",bZ.indexOf(this._passwordType)===-1&&(this._passwordType="PasswordText"),this._hasTimeStamp=n.hasTimeStamp||typeof n.hasTimeStamp=="boolean"?!!n.hasTimeStamp:!0,n.hasNonce!=null&&(this._hasNonce=!!n.hasNonce),this._hasTokenCreated=n.hasTokenCreated||typeof n.hasTokenCreated=="boolean"?!!n.hasTokenCreated:!0,n.actor!=null&&(this._actor=n.actor),n.mustUnderstand!=null&&(this._mustUnderstand=!!n.mustUnderstand),n.envelopeKey&&(this._envelopeKey=n.envelopeKey)}toXML(){function e(u){function l(f){return f<10?"0"+f:f}return o(l,"pad"),u.getUTCFullYear()+"-"+l(u.getUTCMonth()+1)+"-"+l(u.getUTCDate())+"T"+l(u.getUTCHours())+":"+l(u.getUTCMinutes())+":"+l(u.getUTCSeconds())+"Z"}o(e,"getDate");let t=new Date,n=e(t),s="";if(this._hasTimeStamp){let u=e(new Date(t.getTime()+6e5));s='<wsu:Timestamp wsu:Id="Timestamp-'+n+'"><wsu:Created>'+n+"</wsu:Created><wsu:Expires>"+u+"</wsu:Expires></wsu:Timestamp>"}let i,a;if(this._hasNonce||this._passwordType!=="PasswordText"){let u=CZ.createHash("sha1");u.update(n+Math.random()),a=u.digest("base64")}return this._passwordType==="PasswordText"?(i='<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">'+(0,IN.xmlEscape)(this._password)+"</wsse:Password>",a&&(i+='<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">'+a+"</wsse:Nonce>")):i='<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">'+(0,IN.passwordDigest)(a,n,this._password)+'</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">'+a+"</wsse:Nonce>","<wsse:Security "+(this._actor?`${this._envelopeKey}:actor="${this._actor}" `:"")+(this._mustUnderstand?`${this._envelopeKey}:mustUnderstand="1" `:"")+'xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">'+s+'<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-'+n+'"><wsse:Username>'+(0,IN.xmlEscape)(this._username)+"</wsse:Username>"+i+(this._hasTokenCreated?"<wsu:Created>"+n+"</wsu:Created>":"")+"</wsse:UsernameToken></wsse:Security>"}};Ra.WSSecurity=xZ});var NS=ye(BN=>{"use strict";var NZ=typeof BN>"u"?{}:BN;(function(r){"use strict";function e(d){var I=Array.prototype.slice,$=d.length,te=o(function(X,nt){return function(){return nt.apply(this,X.concat(I.call(arguments)))}},"partial"),ie=o(function(){var X=I.call(arguments);return X.length<$?te(X,ie):d.apply(this,I.apply(arguments,[0,$]))},"fn1");return ie}o(e,"curry");var t=o(function(d,I){for(var $=0;$<I.length;$+=1)d(I[$],$,I)},"forEach"),n=o(function(d,I,$){var te=I;return t(function(ie,X){te=d(te,ie,X)},$),te},"reduce"),s=o(function(d,I){var $=new Array(I.length);return t(function(te,ie){$[ie]=d(te)},I),$},"map"),i=o(function(d,I){var $=[];return t(function(te,ie){d(te,ie)&&$.push(te)},I),$},"filter"),a=o(function(d,I){for(var $=0;$<d.length;$+=1)if(d[$]===I)return!0;return!1},"includes");function u(d){return function(){return d}}o(u,"always");function l(d){return d.toString()}o(l,"toString");var f=o(function(d,I){return I.join(d)},"join"),h=o(function(d,I,$){return d+$+I},"wrap"),m=Array.prototype.concat,g=32767;function w(d){for(var I=[],$=0;$<d.length;$+=g){var te=d.slice($,$+g);I=m.apply(I,te)}return I}o(w,"flatten");function y(d,I){for(var $=Object(d),te=1;te<arguments.length;te++){var ie=arguments[te];if(ie!=null)for(var X in ie)Object.prototype.hasOwnProperty.call(ie,X)&&($[X]=ie[X])}return $}o(y,"assign");var S={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11};E.prototype=new Object,E.prototype.constructor=E,E.superclass=Object.prototype;function E(){this.init()}o(E,"XPathParser"),E.prototype.init=function(){this.reduceActions=[],this.reduceActions[3]=function(d){return new F(d[0],d[2])},this.reduceActions[5]=function(d){return new R(d[0],d[2])},this.reduceActions[7]=function(d){return new H(d[0],d[2])},this.reduceActions[8]=function(d){return new q(d[0],d[2])},this.reduceActions[10]=function(d){return new K(d[0],d[2])},this.reduceActions[11]=function(d){return new G(d[0],d[2])},this.reduceActions[12]=function(d){return new he(d[0],d[2])},this.reduceActions[13]=function(d){return new le(d[0],d[2])},this.reduceActions[15]=function(d){return new oe(d[0],d[2])},this.reduceActions[16]=function(d){return new Z(d[0],d[2])},this.reduceActions[18]=function(d){return new fe(d[0],d[2])},this.reduceActions[19]=function(d){return new Se(d[0],d[2])},this.reduceActions[20]=function(d){return new Ke(d[0],d[2])},this.reduceActions[22]=function(d){return new x(d[1])},this.reduceActions[24]=function(d){return new be(d[0],d[2])},this.reduceActions[25]=function(d){return new we(void 0,void 0,d[0])},this.reduceActions[27]=function(d){return d[0].locationPath=d[2],d[0]},this.reduceActions[28]=function(d){return d[0].locationPath=d[2],d[0].locationPath.steps.unshift(new O(O.DESCENDANTORSELF,_.nodeTest,[])),d[0]},this.reduceActions[29]=function(d){return new we(d[0],[],void 0)},this.reduceActions[30]=function(d){return Ze.instance_of(d[0],we)?(d[0].filterPredicates==null&&(d[0].filterPredicates=[]),d[0].filterPredicates.push(d[1]),d[0]):new we(d[0],[d[1]],void 0)},this.reduceActions[32]=function(d){return d[1]},this.reduceActions[33]=function(d){return new Re(d[0])},this.reduceActions[34]=function(d){return new xe(d[0])},this.reduceActions[36]=function(d){return new J(d[0],[])},this.reduceActions[37]=function(d){return new J(d[0],d[2])},this.reduceActions[38]=function(d){return[d[0]]},this.reduceActions[39]=function(d){return d[2].unshift(d[0]),d[2]},this.reduceActions[43]=function(d){return new lt(!0,[])},this.reduceActions[44]=function(d){return d[1].absolute=!0,d[1]},this.reduceActions[46]=function(d){return new lt(!1,[d[0]])},this.reduceActions[47]=function(d){return d[0].steps.push(d[2]),d[0]},this.reduceActions[49]=function(d){return new O(d[0],d[1],[])},this.reduceActions[50]=function(d){return new O(O.CHILD,d[0],[])},this.reduceActions[51]=function(d){return new O(d[0],d[1],d[2])},this.reduceActions[52]=function(d){return new O(O.CHILD,d[0],d[1])},this.reduceActions[54]=function(d){return[d[0]]},this.reduceActions[55]=function(d){return d[1].unshift(d[0]),d[1]},this.reduceActions[56]=function(d){return d[0]=="ancestor"?O.ANCESTOR:d[0]=="ancestor-or-self"?O.ANCESTORORSELF:d[0]=="attribute"?O.ATTRIBUTE:d[0]=="child"?O.CHILD:d[0]=="descendant"?O.DESCENDANT:d[0]=="descendant-or-self"?O.DESCENDANTORSELF:d[0]=="following"?O.FOLLOWING:d[0]=="following-sibling"?O.FOLLOWINGSIBLING:d[0]=="namespace"?O.NAMESPACE:d[0]=="parent"?O.PARENT:d[0]=="preceding"?O.PRECEDING:d[0]=="preceding-sibling"?O.PRECEDINGSIBLING:d[0]=="self"?O.SELF:-1},this.reduceActions[57]=function(d){return O.ATTRIBUTE},this.reduceActions[59]=function(d){return d[0]=="comment"?_.commentTest:d[0]=="text"?_.textTest:d[0]=="processing-instruction"?_.anyPiTest:d[0]=="node"?_.nodeTest:new _(-1,void 0)},this.reduceActions[60]=function(d){return new _.PITest(d[2])},this.reduceActions[61]=function(d){return d[1]},this.reduceActions[63]=function(d){return d[1].absolute=!0,d[1].steps.unshift(new O(O.DESCENDANTORSELF,_.nodeTest,[])),d[1]},this.reduceActions[64]=function(d){return d[0].steps.push(new O(O.DESCENDANTORSELF,_.nodeTest,[])),d[0].steps.push(d[2]),d[0]},this.reduceActions[65]=function(d){return new O(O.SELF,_.nodeTest,[])},this.reduceActions[66]=function(d){return new O(O.PARENT,_.nodeTest,[])},this.reduceActions[67]=function(d){return new ne(d[1])},this.reduceActions[68]=function(d){return _.nameTestAny},this.reduceActions[69]=function(d){return new _.NameTestPrefixAny(d[0].split(":")[0])},this.reduceActions[70]=function(d){return new _.NameTestQName(d[0])}},E.actionTable=[" s s sssssssss s ss s ss"," s ","r rrrrrrrrr rrrrrrr rr r "," rrrrr "," s s sssssssss s ss s ss","rs rrrrrrrr s sssssrrrrrr rrs rs "," s s sssssssss s ss s ss"," s "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s "," s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr r ","a ","r s rr r ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrs rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r srrrrrrrr rrrrrrs rr sr ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r "," sssss ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrr rrrrr rr r "," s "," s "," rrrrr "," s s sssssssss s sss s ss","r srrrrrrrr rrrrrrs rr r "," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss ss s ss"," s s sssssssss s ss s ss"," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr rr "," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," rr "," s "," rs ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrr rr r "," r "," s ","r srrrrrrrr rrrrrrs rr r ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s s sssssssss s ss s ss","r rrrrrrrrr rrrrrrr rr rr "," r "],E.actionTableNumber=[` 1 0 /.-,+*)(' & %$ # "!`," J ","a aaaaaaaaa aaaaaaa aa a "," YYYYY ",` 1 0 /.-,+*)(' & %$ # "!`,`K1 KKKKKKKK . +*)('KKKKKK KK# K" `,` 1 0 /.-,+*)(' & %$ # "!`," N "," O ","e eeeeeeeee eeeeeee ee ee ","f fffffffff fffffff ff ff ","d ddddddddd ddddddd dd dd ","B BBBBBBBBB BBBBBBB BB BB ","A AAAAAAAAA AAAAAAA AA AA "," P "," Q ",` 1 . +*)(' # " `,"b bbbbbbbbb bbbbbbb bb b "," ","! S !! ! ",'" T" "" " ',"$ V $$ U $$ $ ","& &ZY&& &XW && & ",") ))))) )))\\[ )) ) ",". ....._^] ..... .. . ","1 11111111 11111 11 1 ","5 55555555 55555` 55 5 ","7 77777777 777777 77 7 ","9 99999999 999999 99 9 ",": c:::::::: ::::::b :: a: ","I fIIIIIIII IIIIIIe II I ","= ========= ======= == == ","? ????????? ??????? ?? ?? ","C CCCCCCCCC CCCCCCC CC CC ","J JJJJJJJJ JJJJJJ JJ J ","M MMMMMMMM MMMMMM MM M ","N NNNNNNNNN NNNNNNN NN N ","P PPPPPPPPP PPPPPPP PP P "," +*)(' ","R RRRRRRRRR RRRRRRR RR aR ","U UUUUUUUUU UUUUUUU UU U ","Z ZZZZZZZZZ ZZZZZZZ ZZ ZZ ","c ccccccccc ccccccc cc cc "," j ","L fLLLLLLLL LLLLLLe LL L ","6 66666666 66666 66 6 "," k "," l "," XXXXX ",` 1 0 /.-,+*)(' & %$m # "!`,"_ f________ ______e __ _ ",` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 . +*)(' # " `,` 1 . +*)(' # " `,"> >>>>>>>>> >>>>>>> >> >> ",` 1 . +*)(' # " `,` 1 . +*)(' # " `,"Q QQQQQQQQQ QQQQQQQ QQ aQ ","V VVVVVVVVV VVVVVVV VV aV ","T TTTTTTTTT TTTTTTT TT T ","@ @@@@@@@@@ @@@@@@@ @@ @@ "," \x87 ","[ [[[[[[[[[ [[[[[[[ [[ [[ ","D DDDDDDDDD DDDDDDD DD DD "," HH "," \x88 "," F\x89 ","# T# ## # ","% V %% U %% % ","' 'ZY'' 'XW '' ' ","( (ZY(( (XW (( ( ","+ +++++ +++\\[ ++ + ","* ***** ***\\[ ** * ","- ----- ---\\[ -- - ",", ,,,,, ,,,\\[ ,, , ","0 00000_^] 00000 00 0 ","/ /////_^] ///// // / ","2 22222222 22222 22 2 ","3 33333333 33333 33 3 ","4 44444444 44444 44 4 ","8 88888888 888888 88 8 "," ^ "," \x8A ","; f;;;;;;;; ;;;;;;e ;; ; ","< f<<<<<<<< <<<<<<e << < ","O OOOOOOOOO OOOOOOO OO O ","` ````````` ``````` `` ` ","S SSSSSSSSS SSSSSSS SS S ","W WWWWWWWWW WWWWWWW WW W ","\\ \\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\ \\\\ \\\\ ","E EEEEEEEEE EEEEEEE EE EE ",` 1 0 /.-,+*)(' & %$ # "!`,"] ]]]]]]]]] ]]]]]]] ]] ]] "," G "],E.gotoTable=["3456789:;<=>?@ AB CDEFGH IJ "," "," "," ","L456789:;<=>?@ AB CDEFGH IJ "," M EFGH IJ "," N;<=>?@ AB CDEFGH IJ "," "," "," "," "," "," "," "," "," "," S EFGH IJ "," "," "," "," "," "," "," "," "," "," "," "," "," e "," "," "," "," "," "," "," "," "," h J "," i j "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ ABpqCDEFGH IJ "," "," r6789:;<=>?@ AB CDEFGH IJ "," s789:;<=>?@ AB CDEFGH IJ "," t89:;<=>?@ AB CDEFGH IJ "," u89:;<=>?@ AB CDEFGH IJ "," v9:;<=>?@ AB CDEFGH IJ "," w9:;<=>?@ AB CDEFGH IJ "," x9:;<=>?@ AB CDEFGH IJ "," y9:;<=>?@ AB CDEFGH IJ "," z:;<=>?@ AB CDEFGH IJ "," {:;<=>?@ AB CDEFGH IJ "," |;<=>?@ AB CDEFGH IJ "," };<=>?@ AB CDEFGH IJ "," ~;<=>?@ AB CDEFGH IJ "," \x7F=>?@ AB CDEFGH IJ ","\x80456789:;<=>?@ AB CDEFGH IJ\x81"," \x82 EFGH IJ "," \x83 EFGH IJ "," "," \x84 GH IJ "," \x85 GH IJ "," i \x86 "," i \x87 "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ AB\x8CqCDEFGH IJ "," "," "],E.productions=[[1,1,2],[2,1,3],[3,1,4],[3,3,3,-9,4],[4,1,5],[4,3,4,-8,5],[5,1,6],[5,3,5,-22,6],[5,3,5,-5,6],[6,1,7],[6,3,6,-23,7],[6,3,6,-24,7],[6,3,6,-6,7],[6,3,6,-7,7],[7,1,8],[7,3,7,-25,8],[7,3,7,-26,8],[8,1,9],[8,3,8,-12,9],[8,3,8,-11,9],[8,3,8,-10,9],[9,1,10],[9,2,-26,9],[10,1,11],[10,3,10,-27,11],[11,1,12],[11,1,13],[11,3,13,-28,14],[11,3,13,-4,14],[13,1,15],[13,2,13,16],[15,1,17],[15,3,-29,2,-30],[15,1,-15],[15,1,-16],[15,1,18],[18,3,-13,-29,-30],[18,4,-13,-29,19,-30],[19,1,20],[19,3,20,-31,19],[20,1,2],[12,1,14],[12,1,21],[21,1,-28],[21,2,-28,14],[21,1,22],[14,1,23],[14,3,14,-28,23],[14,1,24],[23,2,25,26],[23,1,26],[23,3,25,26,27],[23,2,26,27],[23,1,28],[27,1,16],[27,2,16,27],[25,2,-14,-3],[25,1,-32],[26,1,29],[26,3,-20,-29,-30],[26,4,-21,-29,-15,-30],[16,3,-33,30,-34],[30,1,2],[22,2,-4,14],[24,3,14,-4,23],[28,1,-35],[28,1,-2],[17,2,-36,-18],[29,1,-17],[29,1,-19],[29,1,-18]],E.DOUBLEDOT=2,E.DOUBLECOLON=3,E.DOUBLESLASH=4,E.NOTEQUAL=5,E.LESSTHANOREQUAL=6,E.GREATERTHANOREQUAL=7,E.AND=8,E.OR=9,E.MOD=10,E.DIV=11,E.MULTIPLYOPERATOR=12,E.FUNCTIONNAME=13,E.AXISNAME=14,E.LITERAL=15,E.NUMBER=16,E.ASTERISKNAMETEST=17,E.QNAME=18,E.NCNAMECOLONASTERISK=19,E.NODETYPE=20,E.PROCESSINGINSTRUCTIONWITHLITERAL=21,E.EQUALS=22,E.LESSTHAN=23,E.GREATERTHAN=24,E.PLUS=25,E.MINUS=26,E.BAR=27,E.SLASH=28,E.LEFTPARENTHESIS=29,E.RIGHTPARENTHESIS=30,E.COMMA=31,E.AT=32,E.LEFTBRACKET=33,E.RIGHTBRACKET=34,E.DOT=35,E.DOLLAR=36,E.prototype.tokenize=function(d){for(var I=[],$=[],te=d+"\0",ie=0,X=te.charAt(ie++);;){for(;X==" "||X==" "||X=="\r"||X==`
54
- `;)X=te.charAt(ie++);if(X=="\0"||ie>=te.length)break;if(X=="("){I.push(E.LEFTPARENTHESIS),$.push(X),X=te.charAt(ie++);continue}if(X==")"){I.push(E.RIGHTPARENTHESIS),$.push(X),X=te.charAt(ie++);continue}if(X=="["){I.push(E.LEFTBRACKET),$.push(X),X=te.charAt(ie++);continue}if(X=="]"){I.push(E.RIGHTBRACKET),$.push(X),X=te.charAt(ie++);continue}if(X=="@"){I.push(E.AT),$.push(X),X=te.charAt(ie++);continue}if(X==","){I.push(E.COMMA),$.push(X),X=te.charAt(ie++);continue}if(X=="|"){I.push(E.BAR),$.push(X),X=te.charAt(ie++);continue}if(X=="+"){I.push(E.PLUS),$.push(X),X=te.charAt(ie++);continue}if(X=="-"){I.push(E.MINUS),$.push(X),X=te.charAt(ie++);continue}if(X=="="){I.push(E.EQUALS),$.push(X),X=te.charAt(ie++);continue}if(X=="$"){I.push(E.DOLLAR),$.push(X),X=te.charAt(ie++);continue}if(X=="."){if(X=te.charAt(ie++),X=="."){I.push(E.DOUBLEDOT),$.push(".."),X=te.charAt(ie++);continue}if(X>="0"&&X<="9"){var nt="."+X;for(X=te.charAt(ie++);X>="0"&&X<="9";)nt+=X,X=te.charAt(ie++);I.push(E.NUMBER),$.push(nt);continue}I.push(E.DOT),$.push(".");continue}if(X=="'"||X=='"'){for(var kt=X,Wt="";ie<te.length&&(X=te.charAt(ie))!==kt;)Wt+=X,ie+=1;if(X!==kt)throw Dn.fromMessage("Unterminated string literal: "+kt+Wt);ie+=1,I.push(E.LITERAL),$.push(Wt),X=te.charAt(ie++);continue}if(X>="0"&&X<="9"){var nt=X;for(X=te.charAt(ie++);X>="0"&&X<="9";)nt+=X,X=te.charAt(ie++);if(X=="."&&te.charAt(ie)>="0"&&te.charAt(ie)<="9")for(nt+=X,nt+=te.charAt(ie++),X=te.charAt(ie++);X>="0"&&X<="9";)nt+=X,X=te.charAt(ie++);I.push(E.NUMBER),$.push(nt);continue}if(X=="*"){if(I.length>0){var et=I[I.length-1];if(et!=E.AT&&et!=E.DOUBLECOLON&&et!=E.LEFTPARENTHESIS&&et!=E.LEFTBRACKET&&et!=E.AND&&et!=E.OR&&et!=E.MOD&&et!=E.DIV&&et!=E.MULTIPLYOPERATOR&&et!=E.SLASH&&et!=E.DOUBLESLASH&&et!=E.BAR&&et!=E.PLUS&&et!=E.MINUS&&et!=E.EQUALS&&et!=E.NOTEQUAL&&et!=E.LESSTHAN&&et!=E.LESSTHANOREQUAL&&et!=E.GREATERTHAN&&et!=E.GREATERTHANOREQUAL){I.push(E.MULTIPLYOPERATOR),$.push(X),X=te.charAt(ie++);continue}}I.push(E.ASTERISKNAMETEST),$.push(X),X=te.charAt(ie++);continue}if(X==":"&&te.charAt(ie)==":"){I.push(E.DOUBLECOLON),$.push("::"),ie++,X=te.charAt(ie++);continue}if(X=="/"){if(X=te.charAt(ie++),X=="/"){I.push(E.DOUBLESLASH),$.push("//"),X=te.charAt(ie++);continue}I.push(E.SLASH),$.push("/");continue}if(X=="!"&&te.charAt(ie)=="="){I.push(E.NOTEQUAL),$.push("!="),ie++,X=te.charAt(ie++);continue}if(X=="<"){if(te.charAt(ie)=="="){I.push(E.LESSTHANOREQUAL),$.push("<="),ie++,X=te.charAt(ie++);continue}I.push(E.LESSTHAN),$.push("<"),X=te.charAt(ie++);continue}if(X==">"){if(te.charAt(ie)=="="){I.push(E.GREATERTHANOREQUAL),$.push(">="),ie++,X=te.charAt(ie++);continue}I.push(E.GREATERTHAN),$.push(">"),X=te.charAt(ie++);continue}if(X=="_"||Ze.isLetter(X.charCodeAt(0))){var Dt=X;for(X=te.charAt(ie++);Ze.isNCNameChar(X.charCodeAt(0));)Dt+=X,X=te.charAt(ie++);if(I.length>0){var et=I[I.length-1];if(et!=E.AT&&et!=E.DOUBLECOLON&&et!=E.LEFTPARENTHESIS&&et!=E.LEFTBRACKET&&et!=E.AND&&et!=E.OR&&et!=E.MOD&&et!=E.DIV&&et!=E.MULTIPLYOPERATOR&&et!=E.SLASH&&et!=E.DOUBLESLASH&&et!=E.BAR&&et!=E.PLUS&&et!=E.MINUS&&et!=E.EQUALS&&et!=E.NOTEQUAL&&et!=E.LESSTHAN&&et!=E.LESSTHANOREQUAL&&et!=E.GREATERTHAN&&et!=E.GREATERTHANOREQUAL){if(Dt=="and"){I.push(E.AND),$.push(Dt);continue}if(Dt=="or"){I.push(E.OR),$.push(Dt);continue}if(Dt=="mod"){I.push(E.MOD),$.push(Dt);continue}if(Dt=="div"){I.push(E.DIV),$.push(Dt);continue}}}if(X==":"){if(te.charAt(ie)=="*"){I.push(E.NCNAMECOLONASTERISK),$.push(Dt+":*"),ie++,X=te.charAt(ie++);continue}if(te.charAt(ie)=="_"||Ze.isLetter(te.charCodeAt(ie))){for(Dt+=":",X=te.charAt(ie++);Ze.isNCNameChar(X.charCodeAt(0));)Dt+=X,X=te.charAt(ie++);if(X=="("){I.push(E.FUNCTIONNAME),$.push(Dt);continue}I.push(E.QNAME),$.push(Dt);continue}if(te.charAt(ie)==":"){I.push(E.AXISNAME),$.push(Dt);continue}}if(X=="("){if(Dt=="comment"||Dt=="text"||Dt=="node"){I.push(E.NODETYPE),$.push(Dt);continue}if(Dt=="processing-instruction"){te.charAt(ie)==")"?I.push(E.NODETYPE):I.push(E.PROCESSINGINSTRUCTIONWITHLITERAL),$.push(Dt);continue}I.push(E.FUNCTIONNAME),$.push(Dt);continue}I.push(E.QNAME),$.push(Dt);continue}throw new Error("Unexpected character "+X)}return I.push(1),$.push("[EOF]"),[I,$]},E.SHIFT="s",E.REDUCE="r",E.ACCEPT="a",E.prototype.parse=function(Wt){var I,$,te=this.tokenize(Wt);if(te!=null){I=te[0],$=te[1];var ie=0,X=[],nt=[],kt=[],Wt,et,Dt;for(X.push(0),nt.push(1),kt.push("_S"),et=I[ie],Dt=$[ie++];;)switch(Wt=X[X.length-1],E.actionTable[Wt].charAt(et-1)){case E.SHIFT:nt.push(-et),kt.push(Dt),X.push(E.actionTableNumber[Wt].charCodeAt(et-1)-32),et=I[ie],Dt=$[ie++];break;case E.REDUCE:for(var _n=E.productions[E.actionTableNumber[Wt].charCodeAt(et-1)-32][1],ti=[],or=0;or<_n;or++)nt.pop(),ti.unshift(kt.pop()),X.pop();var ua=X[X.length-1];nt.push(E.productions[E.actionTableNumber[Wt].charCodeAt(et-1)-32][0]),this.reduceActions[E.actionTableNumber[Wt].charCodeAt(et-1)-32]==null?kt.push(ti[0]):kt.push(this.reduceActions[E.actionTableNumber[Wt].charCodeAt(et-1)-32](ti)),X.push(E.gotoTable[ua].charCodeAt(E.productions[E.actionTableNumber[Wt].charCodeAt(et-1)-32][0]-2)-33);break;case E.ACCEPT:return new b(kt.pop());default:throw new Error("XPath parse error")}}},b.prototype=new Object,b.prototype.constructor=b,b.superclass=Object.prototype;function b(d){this.expression=d}o(b,"XPath"),b.prototype.toString=function(){return this.expression.toString()};function T(d,I,$){I in d||(d[I]=$)}o(T,"setIfUnset"),b.prototype.evaluate=function(d){return d.contextNode=d.expressionContextNode,d.contextSize=1,d.contextPosition=1,d.isHtml&&(T(d,"caseInsensitive",!0),T(d,"allowAnyNamespaceForNoPrefix",!0)),T(d,"caseInsensitive",!1),this.expression.evaluate(d)},b.XML_NAMESPACE_URI="http://www.w3.org/XML/1998/namespace",b.XMLNS_NAMESPACE_URI="http://www.w3.org/2000/xmlns/",A.prototype=new Object,A.prototype.constructor=A,A.superclass=Object.prototype;function A(){}o(A,"Expression"),A.prototype.init=function(){},A.prototype.toString=function(){return"<Expression>"},A.prototype.evaluate=function(d){throw new Error("Could not evaluate expression.")},C.prototype=new A,C.prototype.constructor=C,C.superclass=A.prototype;function C(d){arguments.length>0&&this.init(d)}o(C,"UnaryOperation"),C.prototype.init=function(d){this.rhs=d},x.prototype=new C,x.prototype.constructor=x,x.superclass=C.prototype;function x(d){arguments.length>0&&this.init(d)}o(x,"UnaryMinusOperation"),x.prototype.init=function(d){x.superclass.init.call(this,d)},x.prototype.evaluate=function(d){return this.rhs.evaluate(d).number().negate()},x.prototype.toString=function(){return"-"+this.rhs.toString()},B.prototype=new A,B.prototype.constructor=B,B.superclass=A.prototype;function B(d,I){arguments.length>0&&this.init(d,I)}o(B,"BinaryOperation"),B.prototype.init=function(d,I){this.lhs=d,this.rhs=I},F.prototype=new B,F.prototype.constructor=F,F.superclass=B.prototype;function F(d,I){arguments.length>0&&this.init(d,I)}o(F,"OrOperation"),F.prototype.init=function(d,I){F.superclass.init.call(this,d,I)},F.prototype.toString=function(){return"("+this.lhs.toString()+" or "+this.rhs.toString()+")"},F.prototype.evaluate=function(d){var I=this.lhs.evaluate(d).bool();return I.booleanValue()?I:this.rhs.evaluate(d).bool()},R.prototype=new B,R.prototype.constructor=R,R.superclass=B.prototype;function R(d,I){arguments.length>0&&this.init(d,I)}o(R,"AndOperation"),R.prototype.init=function(d,I){R.superclass.init.call(this,d,I)},R.prototype.toString=function(){return"("+this.lhs.toString()+" and "+this.rhs.toString()+")"},R.prototype.evaluate=function(d){var I=this.lhs.evaluate(d).bool();return I.booleanValue()?this.rhs.evaluate(d).bool():I},H.prototype=new B,H.prototype.constructor=H,H.superclass=B.prototype;function H(d,I){arguments.length>0&&this.init(d,I)}o(H,"EqualsOperation"),H.prototype.init=function(d,I){H.superclass.init.call(this,d,I)},H.prototype.toString=function(){return"("+this.lhs.toString()+" = "+this.rhs.toString()+")"},H.prototype.evaluate=function(d){return this.lhs.evaluate(d).equals(this.rhs.evaluate(d))},q.prototype=new B,q.prototype.constructor=q,q.superclass=B.prototype;function q(d,I){arguments.length>0&&this.init(d,I)}o(q,"NotEqualOperation"),q.prototype.init=function(d,I){q.superclass.init.call(this,d,I)},q.prototype.toString=function(){return"("+this.lhs.toString()+" != "+this.rhs.toString()+")"},q.prototype.evaluate=function(d){return this.lhs.evaluate(d).notequal(this.rhs.evaluate(d))},K.prototype=new B,K.prototype.constructor=K,K.superclass=B.prototype;function K(d,I){arguments.length>0&&this.init(d,I)}o(K,"LessThanOperation"),K.prototype.init=function(d,I){K.superclass.init.call(this,d,I)},K.prototype.evaluate=function(d){return this.lhs.evaluate(d).lessthan(this.rhs.evaluate(d))},K.prototype.toString=function(){return"("+this.lhs.toString()+" < "+this.rhs.toString()+")"},G.prototype=new B,G.prototype.constructor=G,G.superclass=B.prototype;function G(d,I){arguments.length>0&&this.init(d,I)}o(G,"GreaterThanOperation"),G.prototype.init=function(d,I){G.superclass.init.call(this,d,I)},G.prototype.evaluate=function(d){return this.lhs.evaluate(d).greaterthan(this.rhs.evaluate(d))},G.prototype.toString=function(){return"("+this.lhs.toString()+" > "+this.rhs.toString()+")"},he.prototype=new B,he.prototype.constructor=he,he.superclass=B.prototype;function he(d,I){arguments.length>0&&this.init(d,I)}o(he,"LessThanOrEqualOperation"),he.prototype.init=function(d,I){he.superclass.init.call(this,d,I)},he.prototype.evaluate=function(d){return this.lhs.evaluate(d).lessthanorequal(this.rhs.evaluate(d))},he.prototype.toString=function(){return"("+this.lhs.toString()+" <= "+this.rhs.toString()+")"},le.prototype=new B,le.prototype.constructor=le,le.superclass=B.prototype;function le(d,I){arguments.length>0&&this.init(d,I)}o(le,"GreaterThanOrEqualOperation"),le.prototype.init=function(d,I){le.superclass.init.call(this,d,I)},le.prototype.evaluate=function(d){return this.lhs.evaluate(d).greaterthanorequal(this.rhs.evaluate(d))},le.prototype.toString=function(){return"("+this.lhs.toString()+" >= "+this.rhs.toString()+")"},oe.prototype=new B,oe.prototype.constructor=oe,oe.superclass=B.prototype;function oe(d,I){arguments.length>0&&this.init(d,I)}o(oe,"PlusOperation"),oe.prototype.init=function(d,I){oe.superclass.init.call(this,d,I)},oe.prototype.evaluate=function(d){return this.lhs.evaluate(d).number().plus(this.rhs.evaluate(d).number())},oe.prototype.toString=function(){return"("+this.lhs.toString()+" + "+this.rhs.toString()+")"},Z.prototype=new B,Z.prototype.constructor=Z,Z.superclass=B.prototype;function Z(d,I){arguments.length>0&&this.init(d,I)}o(Z,"MinusOperation"),Z.prototype.init=function(d,I){Z.superclass.init.call(this,d,I)},Z.prototype.evaluate=function(d){return this.lhs.evaluate(d).number().minus(this.rhs.evaluate(d).number())},Z.prototype.toString=function(){return"("+this.lhs.toString()+" - "+this.rhs.toString()+")"},fe.prototype=new B,fe.prototype.constructor=fe,fe.superclass=B.prototype;function fe(d,I){arguments.length>0&&this.init(d,I)}o(fe,"MultiplyOperation"),fe.prototype.init=function(d,I){fe.superclass.init.call(this,d,I)},fe.prototype.evaluate=function(d){return this.lhs.evaluate(d).number().multiply(this.rhs.evaluate(d).number())},fe.prototype.toString=function(){return"("+this.lhs.toString()+" * "+this.rhs.toString()+")"},Se.prototype=new B,Se.prototype.constructor=Se,Se.superclass=B.prototype;function Se(d,I){arguments.length>0&&this.init(d,I)}o(Se,"DivOperation"),Se.prototype.init=function(d,I){Se.superclass.init.call(this,d,I)},Se.prototype.evaluate=function(d){return this.lhs.evaluate(d).number().div(this.rhs.evaluate(d).number())},Se.prototype.toString=function(){return"("+this.lhs.toString()+" div "+this.rhs.toString()+")"},Ke.prototype=new B,Ke.prototype.constructor=Ke,Ke.superclass=B.prototype;function Ke(d,I){arguments.length>0&&this.init(d,I)}o(Ke,"ModOperation"),Ke.prototype.init=function(d,I){Ke.superclass.init.call(this,d,I)},Ke.prototype.evaluate=function(d){return this.lhs.evaluate(d).number().mod(this.rhs.evaluate(d).number())},Ke.prototype.toString=function(){return"("+this.lhs.toString()+" mod "+this.rhs.toString()+")"},be.prototype=new B,be.prototype.constructor=be,be.superclass=B.prototype;function be(d,I){arguments.length>0&&this.init(d,I)}o(be,"BarOperation"),be.prototype.init=function(d,I){be.superclass.init.call(this,d,I)},be.prototype.evaluate=function(d){return this.lhs.evaluate(d).nodeset().union(this.rhs.evaluate(d).nodeset())},be.prototype.toString=function(){return s(l,[this.lhs,this.rhs]).join(" | ")},we.prototype=new A,we.prototype.constructor=we,we.superclass=A.prototype;function we(d,I,$){arguments.length>0&&this.init(d,I,$)}o(we,"PathExpr"),we.prototype.init=function(d,I,$){we.superclass.init.call(this),this.filter=d,this.filterPredicates=I,this.locationPath=$};function Me(d){for(;d&&d.parentNode;)d=d.parentNode;return d}o(Me,"findRoot"),we.applyPredicates=function(d,I,$){if(d.length===0)return $;var te=I.extend({});return n(function(ie,X){return te.contextSize=ie.length,i(function(nt,kt){return te.contextNode=nt,te.contextPosition=kt+1,we.predicateMatches(X,te)},ie)},$,d)},we.getRoot=function(d,I){var $=I[0];if($.nodeType===S.DOCUMENT_NODE)return $;if(d.virtualRoot)return d.virtualRoot;var te=$.ownerDocument;if(te)return te;for(var ie=$;ie.parentNode!=null;)ie=ie.parentNode;return ie},we.applyStep=function(d,I,$){var te=this,ie=[];switch(I.contextNode=$,d.axis){case O.ANCESTOR:if(I.contextNode===I.virtualRoot)break;var X;for(I.contextNode.nodeType==S.ATTRIBUTE_NODE?X=we.getOwnerElement(I.contextNode):X=I.contextNode.parentNode;X!=null&&(d.nodeTest.matches(X,I)&&ie.push(X),X!==I.virtualRoot);)X=X.parentNode;break;case O.ANCESTORORSELF:for(var X=I.contextNode;X!=null&&(d.nodeTest.matches(X,I)&&ie.push(X),X!==I.virtualRoot);X=X.nodeType==S.ATTRIBUTE_NODE?we.getOwnerElement(X):X.parentNode);break;case O.ATTRIBUTE:var nt=I.contextNode.attributes;if(nt!=null)for(var kt=0;kt<nt.length;kt++){var X=nt.item(kt);d.nodeTest.matches(X,I)&&ie.push(X)}break;case O.CHILD:for(var X=I.contextNode.firstChild;X!=null;X=X.nextSibling)d.nodeTest.matches(X,I)&&ie.push(X);break;case O.DESCENDANT:for(var or=[I.contextNode.firstChild];or.length>0;)for(var X=or.pop();X!=null;)d.nodeTest.matches(X,I)&&ie.push(X),X.firstChild!=null?(or.push(X.nextSibling),X=X.firstChild):X=X.nextSibling;break;case O.DESCENDANTORSELF:d.nodeTest.matches(I.contextNode,I)&&ie.push(I.contextNode);for(var or=[I.contextNode.firstChild];or.length>0;)for(var X=or.pop();X!=null;)d.nodeTest.matches(X,I)&&ie.push(X),X.firstChild!=null?(or.push(X.nextSibling),X=X.firstChild):X=X.nextSibling;break;case O.FOLLOWING:if(I.contextNode===I.virtualRoot)break;var or=[];I.contextNode.firstChild!=null?or.unshift(I.contextNode.firstChild):or.unshift(I.contextNode.nextSibling);for(var X=I.contextNode.parentNode;X!=null&&X.nodeType!=S.DOCUMENT_NODE&&X!==I.virtualRoot;X=X.parentNode)or.unshift(X.nextSibling);do for(var X=or.pop();X!=null;)d.nodeTest.matches(X,I)&&ie.push(X),X.firstChild!=null?(or.push(X.nextSibling),X=X.firstChild):X=X.nextSibling;while(or.length>0);break;case O.FOLLOWINGSIBLING:if(I.contextNode===I.virtualRoot)break;for(var X=I.contextNode.nextSibling;X!=null;X=X.nextSibling)d.nodeTest.matches(X,I)&&ie.push(X);break;case O.NAMESPACE:var Wt={};if(I.contextNode.nodeType==S.ELEMENT_NODE){Wt.xml=b.XML_NAMESPACE_URI,Wt.xmlns=b.XMLNS_NAMESPACE_URI;for(var X=I.contextNode;X!=null&&X.nodeType==S.ELEMENT_NODE;X=X.parentNode)for(var kt=0;kt<X.attributes.length;kt++){var et=X.attributes.item(kt),Dt=String(et.name);if(Dt=="xmlns")Wt[""]==null&&(Wt[""]=et.value);else if(Dt.length>6&&Dt.substring(0,6)=="xmlns:"){var _n=Dt.substring(6,Dt.length);Wt[_n]==null&&(Wt[_n]=et.value)}}for(var _n in Wt){var ti=new Ur(_n,Wt[_n],I.contextNode);d.nodeTest.matches(ti,I)&&ie.push(ti)}}break;case O.PARENT:X=null,I.contextNode!==I.virtualRoot&&(I.contextNode.nodeType==S.ATTRIBUTE_NODE?X=we.getOwnerElement(I.contextNode):X=I.contextNode.parentNode),X!=null&&d.nodeTest.matches(X,I)&&ie.push(X);break;case O.PRECEDING:var or;I.virtualRoot!=null?or=[I.virtualRoot]:or=[Me(I.contextNode)];e:for(;or.length>0;)for(var X=or.pop();X!=null;){if(X==I.contextNode)break e;d.nodeTest.matches(X,I)&&ie.unshift(X),X.firstChild!=null?(or.push(X.nextSibling),X=X.firstChild):X=X.nextSibling}break;case O.PRECEDINGSIBLING:if(I.contextNode===I.virtualRoot)break;for(var X=I.contextNode.previousSibling;X!=null;X=X.previousSibling)d.nodeTest.matches(X,I)&&ie.push(X);break;case O.SELF:d.nodeTest.matches(I.contextNode,I)&&ie.push(I.contextNode);break;default:}return ie};function Je(d,I,$){return we.applyPredicates(d.predicates,I,we.applyStep(d,I,$))}o(Je,"applyStepWithPredicates");function Ye(d,I,$){return w(s(Je.bind(null,$,d),I))}o(Ye,"applyStepToNodes"),we.applySteps=function(d,I,$){return n(Ye.bind(null,I),$,d)},we.prototype.applyFilter=function(d,I){if(!this.filter)return{nodes:[d.contextNode]};var $=this.filter.evaluate(d);if(!Ze.instance_of($,Ge)){if(this.filterPredicates!=null&&this.filterPredicates.length>0||this.locationPath!=null)throw new Error("Path expression filter must evaluate to a nodeset if predicates or location path are used");return{nonNodes:$}}return{nodes:we.applyPredicates(this.filterPredicates||[],I,$.toUnsortedArray())}},we.applyLocationPath=function(d,I,$){if(!d)return $;var te=d.absolute?[we.getRoot(I,$)]:$;return we.applySteps(d.steps,I,te)},we.prototype.evaluate=function(d){var I=y(new on,d),$=this.applyFilter(d,I);if("nonNodes"in $)return $.nonNodes;var te=new Ge;return te.addArray(we.applyLocationPath(this.locationPath,I,$.nodes)),te},we.predicateMatches=function(d,I){var $=d.evaluate(I);return Ze.instance_of($,xe)?I.contextPosition===$.numberValue():$.booleanValue()},we.predicateString=function(d){return h("[","]",d.toString())},we.predicatesString=function(d){return f("",s(we.predicateString,d))},we.prototype.toString=function(){if(this.filter!=null){var d=l(this.filter);return Ze.instance_of(this.filter,Re)?h("'","'",d):this.filterPredicates!=null&&this.filterPredicates.length?h("(",")",d)+we.predicatesString(this.filterPredicates):this.locationPath!=null?d+(this.locationPath.absolute?"":"/")+l(this.locationPath):d}return l(this.locationPath)},we.getOwnerElement=function(d){if(d.ownerElement)return d.ownerElement;try{if(d.selectSingleNode)return d.selectSingleNode("..")}catch{}for(var I=d.nodeType==S.DOCUMENT_NODE?d:d.ownerDocument,$=I.getElementsByTagName("*"),te=0;te<$.length;te++)for(var ie=$.item(te),X=ie.attributes,nt=0;nt<X.length;nt++){var kt=X.item(nt);if(kt===d)return ie}return null},lt.prototype=new Object,lt.prototype.constructor=lt,lt.superclass=Object.prototype;function lt(d,I){arguments.length>0&&this.init(d,I)}o(lt,"LocationPath"),lt.prototype.init=function(d,I){this.absolute=d,this.steps=I},lt.prototype.toString=function(){return(this.absolute?"/":"")+s(l,this.steps).join("/")},O.prototype=new Object,O.prototype.constructor=O,O.superclass=Object.prototype;function O(d,I,$){arguments.length>0&&this.init(d,I,$)}o(O,"Step"),O.prototype.init=function(d,I,$){this.axis=d,this.nodeTest=I,this.predicates=$},O.prototype.toString=function(){return O.STEPNAMES[this.axis]+"::"+this.nodeTest.toString()+we.predicatesString(this.predicates)},O.ANCESTOR=0,O.ANCESTORORSELF=1,O.ATTRIBUTE=2,O.CHILD=3,O.DESCENDANT=4,O.DESCENDANTORSELF=5,O.FOLLOWING=6,O.FOLLOWINGSIBLING=7,O.NAMESPACE=8,O.PARENT=9,O.PRECEDING=10,O.PRECEDINGSIBLING=11,O.SELF=12,O.STEPNAMES=n(function(d,I){return d[I[0]]=I[1],d},{},[[O.ANCESTOR,"ancestor"],[O.ANCESTORORSELF,"ancestor-or-self"],[O.ATTRIBUTE,"attribute"],[O.CHILD,"child"],[O.DESCENDANT,"descendant"],[O.DESCENDANTORSELF,"descendant-or-self"],[O.FOLLOWING,"following"],[O.FOLLOWINGSIBLING,"following-sibling"],[O.NAMESPACE,"namespace"],[O.PARENT,"parent"],[O.PRECEDING,"preceding"],[O.PRECEDINGSIBLING,"preceding-sibling"],[O.SELF,"self"]]),_.prototype=new Object,_.prototype.constructor=_,_.superclass=Object.prototype;function _(d,I){arguments.length>0&&this.init(d,I)}o(_,"NodeTest"),_.prototype.init=function(d,I){this.type=d,this.value=I},_.prototype.toString=function(){return"<unknown nodetest type>"},_.prototype.matches=function(d,I){console.warn("unknown node test type")},_.NAMETESTANY=0,_.NAMETESTPREFIXANY=1,_.NAMETESTQNAME=2,_.COMMENT=3,_.TEXT=4,_.PI=5,_.NODE=6,_.isNodeType=function(d){return function(I){return a(d,I.nodeType)}},_.makeNodeTestType=function(d,I,$){var te=$||function(){};return te.prototype=new _(d),te.prototype.constructor=te,y(te.prototype,I),te},_.makeNodeTypeTest=function(d,I,$){return new(_.makeNodeTestType(d,{matches:_.isNodeType(I),toString:u($)}))},_.hasPrefix=function(d){return d.prefix||(d.nodeName||d.tagName).indexOf(":")!==-1},_.isElementOrAttribute=_.isNodeType([1,2]),_.nameSpaceMatches=function(d,I,$){var te=$.namespaceURI||"";if(!d)return!te||I.allowAnyNamespaceForNoPrefix&&!_.hasPrefix($);var ie=I.namespaceResolver.getNamespace(d,I.expressionContextNode);if(ie==null)throw new Error("Cannot resolve QName "+d);return ie===te},_.localNameMatches=function(d,I,$){var te=$.localName||$.nodeName;return I.caseInsensitive?d.toLowerCase()===te.toLowerCase():d===te},_.NameTestPrefixAny=_.makeNodeTestType(_.NAMETESTPREFIXANY,{matches:o(function(d,I){return _.isElementOrAttribute(d)&&_.nameSpaceMatches(this.prefix,I,d)},"matches"),toString:o(function(){return this.prefix+":*"},"toString")},o(function(I){this.prefix=I},"NameTestPrefixAny")),_.NameTestQName=_.makeNodeTestType(_.NAMETESTQNAME,{matches:o(function(d,I){return _.isNodeType([S.ELEMENT_NODE,S.ATTRIBUTE_NODE,Ur.XPATH_NAMESPACE_NODE])(d)&&_.nameSpaceMatches(this.prefix,I,d)&&_.localNameMatches(this.localName,I,d)},"matches"),toString:o(function(){return this.name},"toString")},o(function(I){var $=I.split(":");this.name=I,this.prefix=$.length>1?$[0]:null,this.localName=$[$.length>1?1:0]},"NameTestQName")),_.PITest=_.makeNodeTestType(_.PI,{matches:o(function(d,I){return _.isNodeType([S.PROCESSING_INSTRUCTION_NODE])(d)&&(d.target||d.nodeName)===this.name},"matches"),toString:o(function(){return h('processing-instruction("','")',this.name)},"toString")},function(d){this.name=d}),_.nameTestAny=_.makeNodeTypeTest(_.NAMETESTANY,[S.ELEMENT_NODE,S.ATTRIBUTE_NODE,Ur.XPATH_NAMESPACE_NODE],"*"),_.textTest=_.makeNodeTypeTest(_.TEXT,[S.TEXT_NODE,S.CDATA_SECTION_NODE],"text()"),_.commentTest=_.makeNodeTypeTest(_.COMMENT,[S.COMMENT_NODE],"comment()"),_.nodeTest=_.makeNodeTypeTest(_.NODE,[S.ELEMENT_NODE,S.ATTRIBUTE_NODE,S.TEXT_NODE,S.CDATA_SECTION_NODE,S.PROCESSING_INSTRUCTION_NODE,S.COMMENT_NODE,S.DOCUMENT_NODE],"node()"),_.anyPiTest=_.makeNodeTypeTest(_.PI,[S.PROCESSING_INSTRUCTION_NODE],"processing-instruction()"),ne.prototype=new A,ne.prototype.constructor=ne,ne.superclass=A.prototype;function ne(d){arguments.length>0&&this.init(d)}o(ne,"VariableReference"),ne.prototype.init=function(d){this.variable=d},ne.prototype.toString=function(){return"$"+this.variable},ne.prototype.evaluate=function(d){var I=Ze.resolveQName(this.variable,d.namespaceResolver,d.contextNode,!1);if(I[0]==null)throw new Error("Cannot resolve QName "+fn);var $=d.variableResolver.getVariable(I[1],I[0]);if(!$)throw Dn.fromMessage("Undeclared variable: "+this.toString());return $},J.prototype=new A,J.prototype.constructor=J,J.superclass=A.prototype;function J(d,I){arguments.length>0&&this.init(d,I)}o(J,"FunctionCall"),J.prototype.init=function(d,I){this.functionName=d,this.arguments=I},J.prototype.toString=function(){for(var d=this.functionName+"(",I=0;I<this.arguments.length;I++)I>0&&(d+=", "),d+=this.arguments[I].toString();return d+")"},J.prototype.evaluate=function(d){var I=ms.getFunctionFromContext(this.functionName,d);if(!I)throw new Error("Unknown function "+this.functionName);var $=[d].concat(this.arguments);return I.apply(d.functionResolver.thisArg,$)};var Xe=new Object;Xe.equals=function(d,I){return d.equals(I)},Xe.notequal=function(d,I){return d.notequal(I)},Xe.lessthan=function(d,I){return d.lessthan(I)},Xe.greaterthan=function(d,I){return d.greaterthan(I)},Xe.lessthanorequal=function(d,I){return d.lessthanorequal(I)},Xe.greaterthanorequal=function(d,I){return d.greaterthanorequal(I)},Re.prototype=new A,Re.prototype.constructor=Re,Re.superclass=A.prototype;function Re(d){arguments.length>0&&this.init(d)}o(Re,"XString"),Re.prototype.init=function(d){this.str=String(d)},Re.prototype.toString=function(){return this.str},Re.prototype.evaluate=function(d){return this},Re.prototype.string=function(){return this},Re.prototype.number=function(){return new xe(this.str)},Re.prototype.bool=function(){return new je(this.str)},Re.prototype.nodeset=function(){throw new Error("Cannot convert string to nodeset")},Re.prototype.stringValue=function(){return this.str},Re.prototype.numberValue=function(){return this.number().numberValue()},Re.prototype.booleanValue=function(){return this.bool().booleanValue()},Re.prototype.equals=function(d){return Ze.instance_of(d,je)?this.bool().equals(d):Ze.instance_of(d,xe)?this.number().equals(d):Ze.instance_of(d,Ge)?d.compareWithString(this,Xe.equals):new je(this.str==d.str)},Re.prototype.notequal=function(d){return Ze.instance_of(d,je)?this.bool().notequal(d):Ze.instance_of(d,xe)?this.number().notequal(d):Ze.instance_of(d,Ge)?d.compareWithString(this,Xe.notequal):new je(this.str!=d.str)},Re.prototype.lessthan=function(d){return this.number().lessthan(d)},Re.prototype.greaterthan=function(d){return this.number().greaterthan(d)},Re.prototype.lessthanorequal=function(d){return this.number().lessthanorequal(d)},Re.prototype.greaterthanorequal=function(d){return this.number().greaterthanorequal(d)},xe.prototype=new A,xe.prototype.constructor=xe,xe.superclass=A.prototype;function xe(d){arguments.length>0&&this.init(d)}o(xe,"XNumber"),xe.prototype.init=function(d){this.num=typeof d=="string"?this.parse(d):Number(d)},xe.prototype.numberFormat=/^\s*-?[0-9]*\.?[0-9]+\s*$/,xe.prototype.parse=function(d){return this.numberFormat.test(d)?parseFloat(d):Number.NaN};function ct(d){for(var I=d.split("e-"),$=I[0].replace(".",""),te=Number(I[1]),ie=0;ie<te-1;ie+=1)$="0"+$;return"0."+$}o(ct,"padSmallNumber");function rr(d){for(var I=d.split("e"),$=I[0].replace(".",""),te=Number(I[1]),ie=te+1-$.length,X=0;X<ie;X+=1)$+="0";return $}o(rr,"padLargeNumber"),xe.prototype.toString=function(){var d=this.num.toString();return d.indexOf("e-")!==-1?ct(d):d.indexOf("e")!==-1?rr(d):d},xe.prototype.evaluate=function(d){return this},xe.prototype.string=function(){return new Re(this.toString())},xe.prototype.number=function(){return this},xe.prototype.bool=function(){return new je(this.num)},xe.prototype.nodeset=function(){throw new Error("Cannot convert number to nodeset")},xe.prototype.stringValue=function(){return this.string().stringValue()},xe.prototype.numberValue=function(){return this.num},xe.prototype.booleanValue=function(){return this.bool().booleanValue()},xe.prototype.negate=function(){return new xe(-this.num)},xe.prototype.equals=function(d){return Ze.instance_of(d,je)?this.bool().equals(d):Ze.instance_of(d,Re)?this.equals(d.number()):Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.equals):new je(this.num==d.num)},xe.prototype.notequal=function(d){return Ze.instance_of(d,je)?this.bool().notequal(d):Ze.instance_of(d,Re)?this.notequal(d.number()):Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.notequal):new je(this.num!=d.num)},xe.prototype.lessthan=function(d){return Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.greaterthan):Ze.instance_of(d,je)||Ze.instance_of(d,Re)?this.lessthan(d.number()):new je(this.num<d.num)},xe.prototype.greaterthan=function(d){return Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.lessthan):Ze.instance_of(d,je)||Ze.instance_of(d,Re)?this.greaterthan(d.number()):new je(this.num>d.num)},xe.prototype.lessthanorequal=function(d){return Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.greaterthanorequal):Ze.instance_of(d,je)||Ze.instance_of(d,Re)?this.lessthanorequal(d.number()):new je(this.num<=d.num)},xe.prototype.greaterthanorequal=function(d){return Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.lessthanorequal):Ze.instance_of(d,je)||Ze.instance_of(d,Re)?this.greaterthanorequal(d.number()):new je(this.num>=d.num)},xe.prototype.plus=function(d){return new xe(this.num+d.num)},xe.prototype.minus=function(d){return new xe(this.num-d.num)},xe.prototype.multiply=function(d){return new xe(this.num*d.num)},xe.prototype.div=function(d){return new xe(this.num/d.num)},xe.prototype.mod=function(d){return new xe(this.num%d.num)},je.prototype=new A,je.prototype.constructor=je,je.superclass=A.prototype;function je(d){arguments.length>0&&this.init(d)}o(je,"XBoolean"),je.prototype.init=function(d){this.b=!!d},je.prototype.toString=function(){return this.b.toString()},je.prototype.evaluate=function(d){return this},je.prototype.string=function(){return new Re(this.b)},je.prototype.number=function(){return new xe(this.b)},je.prototype.bool=function(){return this},je.prototype.nodeset=function(){throw new Error("Cannot convert boolean to nodeset")},je.prototype.stringValue=function(){return this.string().stringValue()},je.prototype.numberValue=function(){return this.number().numberValue()},je.prototype.booleanValue=function(){return this.b},je.prototype.not=function(){return new je(!this.b)},je.prototype.equals=function(d){return Ze.instance_of(d,Re)||Ze.instance_of(d,xe)?this.equals(d.bool()):Ze.instance_of(d,Ge)?d.compareWithBoolean(this,Xe.equals):new je(this.b==d.b)},je.prototype.notequal=function(d){return Ze.instance_of(d,Re)||Ze.instance_of(d,xe)?this.notequal(d.bool()):Ze.instance_of(d,Ge)?d.compareWithBoolean(this,Xe.notequal):new je(this.b!=d.b)},je.prototype.lessthan=function(d){return this.number().lessthan(d)},je.prototype.greaterthan=function(d){return this.number().greaterthan(d)},je.prototype.lessthanorequal=function(d){return this.number().lessthanorequal(d)},je.prototype.greaterthanorequal=function(d){return this.number().greaterthanorequal(d)},je.true_=new je(!0),je.false_=new je(!1),nr.prototype=new Object,nr.prototype.constructor=nr,nr.superclass=Object.prototype;function nr(d){this.init(d)}o(nr,"AVLTree"),nr.prototype.init=function(d){this.left=null,this.right=null,this.node=d,this.depth=1},nr.prototype.balance=function(){var d=this.left==null?0:this.left.depth,I=this.right==null?0:this.right.depth;if(d>I+1){var $=this.left.left==null?0:this.left.left.depth,te=this.left.right==null?0:this.left.right.depth;$<te&&this.left.rotateRR(),this.rotateLL()}else if(d+1<I){var ie=this.right.right==null?0:this.right.right.depth,X=this.right.left==null?0:this.right.left.depth;X>ie&&this.right.rotateLL(),this.rotateRR()}},nr.prototype.rotateLL=function(){var d=this.node,I=this.right;this.node=this.left.node,this.right=this.left,this.left=this.left.left,this.right.left=this.right.right,this.right.right=I,this.right.node=d,this.right.updateInNewLocation(),this.updateInNewLocation()},nr.prototype.rotateRR=function(){var d=this.node,I=this.left;this.node=this.right.node,this.left=this.right,this.right=this.right.right,this.left.right=this.left.left,this.left.left=I,this.left.node=d,this.left.updateInNewLocation(),this.updateInNewLocation()},nr.prototype.updateInNewLocation=function(){this.getDepthFromChildren()},nr.prototype.getDepthFromChildren=function(){this.depth=this.node==null?0:1,this.left!=null&&(this.depth=this.left.depth+1),this.right!=null&&this.depth<=this.right.depth&&(this.depth=this.right.depth+1)};function Ls(d,I){if(d===I)return 0;if(d.compareDocumentPosition){var $=d.compareDocumentPosition(I);return $&1||$&10?1:$&20?-1:0}for(var te=0,ie=0,X=d;X!=null;X=X.parentNode||X.ownerElement)te++;for(var nt=I;nt!=null;nt=nt.parentNode||nt.ownerElement)ie++;if(te>ie){for(;te>ie;)d=d.parentNode||d.ownerElement,te--;if(d===I)return 1}else if(ie>te){for(;ie>te;)I=I.parentNode||I.ownerElement,ie--;if(d===I)return-1}for(var kt=d.parentNode||d.ownerElement,Wt=I.parentNode||I.ownerElement;kt!==Wt;)d=kt,I=Wt,kt=d.parentNode||d.ownerElement,Wt=I.parentNode||I.ownerElement;var et=Ze.isAttribute(d),Dt=Ze.isAttribute(I);if(et&&!Dt)return-1;if(!et&&Dt)return 1;if(kt)for(var _n=et?kt.attributes:kt.childNodes,ti=_n.length,or=0;or<ti;or+=1){var ua=_n[or];if(ua===d)return-1;if(ua===I)return 1}throw new Error("Unexpected: could not determine node order")}o(Ls,"nodeOrder"),nr.prototype.add=function(d){if(d===this.node)return!1;var I=Ls(d,this.node),$=!1;return I==-1?this.left==null?(this.left=new nr(d),$=!0):($=this.left.add(d),$&&this.balance()):I==1&&(this.right==null?(this.right=new nr(d),$=!0):($=this.right.add(d),$&&this.balance())),$&&this.getDepthFromChildren(),$},Ge.prototype=new A,Ge.prototype.constructor=Ge,Ge.superclass=A.prototype;function Ge(){this.init()}o(Ge,"XNodeSet"),Ge.prototype.init=function(){this.tree=null,this.nodes=[],this.size=0},Ge.prototype.toString=function(){var d=this.first();return d==null?"":this.stringForNode(d)},Ge.prototype.evaluate=function(d){return this},Ge.prototype.string=function(){return new Re(this.toString())},Ge.prototype.stringValue=function(){return this.toString()},Ge.prototype.number=function(){return new xe(this.string())},Ge.prototype.numberValue=function(){return Number(this.string())},Ge.prototype.bool=function(){return new je(this.booleanValue())},Ge.prototype.booleanValue=function(){return!!this.size},Ge.prototype.nodeset=function(){return this},Ge.prototype.stringForNode=function(d){return d.nodeType==S.DOCUMENT_NODE||d.nodeType==S.ELEMENT_NODE||d.nodeType===S.DOCUMENT_FRAGMENT_NODE?this.stringForContainerNode(d):d.nodeType===S.ATTRIBUTE_NODE?d.value||d.nodeValue:d.isNamespaceNode?d.namespace:d.nodeValue},Ge.prototype.stringForContainerNode=function(d){for(var I="",$=d.firstChild;$!=null;$=$.nextSibling){var te=$.nodeType;(te===1||te===3||te===4||te===9||te===11)&&(I+=this.stringForNode($))}return I},Ge.prototype.buildTree=function(){if(!this.tree&&this.nodes.length){this.tree=new nr(this.nodes[0]);for(var d=1;d<this.nodes.length;d+=1)this.tree.add(this.nodes[d])}return this.tree},Ge.prototype.first=function(){var d=this.buildTree();if(d==null)return null;for(;d.left!=null;)d=d.left;return d.node},Ge.prototype.add=function(d){for(var I=0;I<this.nodes.length;I+=1)if(d===this.nodes[I])return;this.tree=null,this.nodes.push(d),this.size+=1},Ge.prototype.addArray=function(d){var I=this;t(function($){I.add($)},d)},Ge.prototype.toArray=function(){var d=[];return this.toArrayRec(this.buildTree(),d),d},Ge.prototype.toArrayRec=function(d,I){d!=null&&(this.toArrayRec(d.left,I),I.push(d.node),this.toArrayRec(d.right,I))},Ge.prototype.toUnsortedArray=function(){return this.nodes.slice()},Ge.prototype.compareWithString=function(d,I){for(var $=this.toUnsortedArray(),te=0;te<$.length;te++){var ie=$[te],X=new Re(this.stringForNode(ie)),nt=I(X,d);if(nt.booleanValue())return nt}return new je(!1)},Ge.prototype.compareWithNumber=function(d,I){for(var $=this.toUnsortedArray(),te=0;te<$.length;te++){var ie=$[te],X=new xe(this.stringForNode(ie)),nt=I(X,d);if(nt.booleanValue())return nt}return new je(!1)},Ge.prototype.compareWithBoolean=function(d,I){return I(this.bool(),d)},Ge.prototype.compareWithNodeSet=function(d,I){for(var $=this.toUnsortedArray(),te=o(function(kt,Wt){return I(Wt,kt)},"oInvert"),ie=0;ie<$.length;ie++){var X=new Re(this.stringForNode($[ie])),nt=d.compareWithString(X,te);if(nt.booleanValue())return nt}return new je(!1)},Ge.compareWith=e(function(d,I){return Ze.instance_of(I,Re)?this.compareWithString(I,d):Ze.instance_of(I,xe)?this.compareWithNumber(I,d):Ze.instance_of(I,je)?this.compareWithBoolean(I,d):this.compareWithNodeSet(I,d)}),Ge.prototype.equals=Ge.compareWith(Xe.equals),Ge.prototype.notequal=Ge.compareWith(Xe.notequal),Ge.prototype.lessthan=Ge.compareWith(Xe.lessthan),Ge.prototype.greaterthan=Ge.compareWith(Xe.greaterthan),Ge.prototype.lessthanorequal=Ge.compareWith(Xe.lessthanorequal),Ge.prototype.greaterthanorequal=Ge.compareWith(Xe.greaterthanorequal),Ge.prototype.union=function(d){var I=new Ge;return I.addArray(this.toUnsortedArray()),I.addArray(d.toUnsortedArray()),I},Ur.prototype=new Object,Ur.prototype.constructor=Ur,Ur.superclass=Object.prototype;function Ur(d,I,$){this.isXPathNamespace=!0,this.ownerDocument=$.ownerDocument,this.nodeName="#namespace",this.prefix=d,this.localName=d,this.namespaceURI=I,this.nodeValue=I,this.ownerElement=$,this.nodeType=Ur.XPATH_NAMESPACE_NODE}o(Ur,"XPathNamespace"),Ur.prototype.toString=function(){return'{ "'+this.prefix+'", "'+this.namespaceURI+'" }'},on.prototype=new Object,on.prototype.constructor=on,on.superclass=Object.prototype;function on(d,I,$){this.variableResolver=d??new $n,this.namespaceResolver=I??new ns,this.functionResolver=$??new ms}o(on,"XPathContext"),on.prototype.extend=function(d){return y(new on,this,d)},$n.prototype=new Object,$n.prototype.constructor=$n,$n.superclass=Object.prototype;function $n(){}o($n,"VariableResolver"),$n.prototype.getVariable=function(d,I){return null},ms.prototype=new Object,ms.prototype.constructor=ms,ms.superclass=Object.prototype;function ms(d){this.thisArg=d??pt,this.functions=new Object,this.addStandardFunctions()}o(ms,"FunctionResolver"),ms.prototype.addStandardFunctions=function(){this.functions["{}last"]=pt.last,this.functions["{}position"]=pt.position,this.functions["{}count"]=pt.count,this.functions["{}id"]=pt.id,this.functions["{}local-name"]=pt.localName,this.functions["{}namespace-uri"]=pt.namespaceURI,this.functions["{}name"]=pt.name,this.functions["{}string"]=pt.string,this.functions["{}concat"]=pt.concat,this.functions["{}starts-with"]=pt.startsWith,this.functions["{}contains"]=pt.contains,this.functions["{}substring-before"]=pt.substringBefore,this.functions["{}substring-after"]=pt.substringAfter,this.functions["{}substring"]=pt.substring,this.functions["{}string-length"]=pt.stringLength,this.functions["{}normalize-space"]=pt.normalizeSpace,this.functions["{}translate"]=pt.translate,this.functions["{}boolean"]=pt.boolean_,this.functions["{}not"]=pt.not,this.functions["{}true"]=pt.true_,this.functions["{}false"]=pt.false_,this.functions["{}lang"]=pt.lang,this.functions["{}number"]=pt.number,this.functions["{}sum"]=pt.sum,this.functions["{}floor"]=pt.floor,this.functions["{}ceiling"]=pt.ceiling,this.functions["{}round"]=pt.round},ms.prototype.addFunction=function(d,I,$){this.functions["{"+d+"}"+I]=$},ms.getFunctionFromContext=function(d,I){var $=Ze.resolveQName(d,I.namespaceResolver,I.contextNode,!1);if($[0]===null)throw new Error("Cannot resolve QName "+name);return I.functionResolver.getFunction($[1],$[0])},ms.prototype.getFunction=function(d,I){return this.functions["{"+I+"}"+d]},ns.prototype=new Object,ns.prototype.constructor=ns,ns.superclass=Object.prototype;function ns(){}o(ns,"NamespaceResolver"),ns.prototype.getNamespace=function(d,I){if(d=="xml")return b.XML_NAMESPACE_URI;if(d=="xmlns")return b.XMLNS_NAMESPACE_URI;for(I.nodeType==S.DOCUMENT_NODE?I=I.documentElement:I.nodeType==S.ATTRIBUTE_NODE?I=we.getOwnerElement(I):I.nodeType!=S.ELEMENT_NODE&&(I=I.parentNode);I!=null&&I.nodeType==S.ELEMENT_NODE;){for(var $=I.attributes,te=0;te<$.length;te++){var ie=$.item(te),X=ie.name||ie.nodeName;if(X==="xmlns"&&d===""||X==="xmlns:"+d)return String(ie.value||ie.nodeValue)}I=I.parentNode}return null};var pt=new Object;pt.last=function(d){if(arguments.length!=1)throw new Error("Function last expects ()");return new xe(d.contextSize)},pt.position=function(d){if(arguments.length!=1)throw new Error("Function position expects ()");return new xe(d.contextPosition)},pt.count=function(){var d=arguments[0],I;if(arguments.length!=2||!Ze.instance_of(I=arguments[1].evaluate(d),Ge))throw new Error("Function count expects (node-set)");return new xe(I.size)},pt.id=function(){var d=arguments[0],I;if(arguments.length!=2)throw new Error("Function id expects (object)");I=arguments[1].evaluate(d),Ze.instance_of(I,Ge)?I=I.toArray().join(" "):I=I.stringValue();for(var $=I.split(/[\x0d\x0a\x09\x20]+/),te=0,ie=new Ge,X=d.contextNode.nodeType==S.DOCUMENT_NODE?d.contextNode:d.contextNode.ownerDocument,nt=0;nt<$.length;nt++){var kt;X.getElementById?kt=X.getElementById($[nt]):kt=Ze.getElementById(X,$[nt]),kt!=null&&(ie.add(kt),te++)}return ie},pt.localName=function(d,I){var $;if(arguments.length==1)$=d.contextNode;else if(arguments.length==2)$=I.evaluate(d).first();else throw new Error("Function local-name expects (node-set?)");return $==null?new Re(""):new Re($.localName||$.baseName||$.target||$.nodeName||"")},pt.namespaceURI=function(){var d=arguments[0],I;if(arguments.length==1)I=d.contextNode;else if(arguments.length==2)I=arguments[1].evaluate(d).first();else throw new Error("Function namespace-uri expects (node-set?)");return I==null?new Re(""):new Re(I.namespaceURI)},pt.name=function(){var d=arguments[0],I;if(arguments.length==1)I=d.contextNode;else if(arguments.length==2)I=arguments[1].evaluate(d).first();else throw new Error("Function name expects (node-set?)");return I==null?new Re(""):I.nodeType==S.ELEMENT_NODE?new Re(I.nodeName):I.nodeType==S.ATTRIBUTE_NODE?new Re(I.name||I.nodeName):I.nodeType===S.PROCESSING_INSTRUCTION_NODE?new Re(I.target||I.nodeName):I.localName==null?new Re(""):new Re(I.localName)},pt.string=function(){var d=arguments[0];if(arguments.length==1)return new Re(Ge.prototype.stringForNode(d.contextNode));if(arguments.length==2)return arguments[1].evaluate(d).string();throw new Error("Function string expects (object?)")},pt.concat=function(d){if(arguments.length<3)throw new Error("Function concat expects (string, string[, string]*)");for(var I="",$=1;$<arguments.length;$++)I+=arguments[$].evaluate(d).stringValue();return new Re(I)},pt.startsWith=function(){var d=arguments[0];if(arguments.length!=3)throw new Error("Function startsWith expects (string, string)");var I=arguments[1].evaluate(d).stringValue(),$=arguments[2].evaluate(d).stringValue();return new je(I.substring(0,$.length)==$)},pt.contains=function(){var d=arguments[0];if(arguments.length!=3)throw new Error("Function contains expects (string, string)");var I=arguments[1].evaluate(d).stringValue(),$=arguments[2].evaluate(d).stringValue();return new je(I.indexOf($)!==-1)},pt.substringBefore=function(){var d=arguments[0];if(arguments.length!=3)throw new Error("Function substring-before expects (string, string)");var I=arguments[1].evaluate(d).stringValue(),$=arguments[2].evaluate(d).stringValue();return new Re(I.substring(0,I.indexOf($)))},pt.substringAfter=function(){var d=arguments[0];if(arguments.length!=3)throw new Error("Function substring-after expects (string, string)");var I=arguments[1].evaluate(d).stringValue(),$=arguments[2].evaluate(d).stringValue();if($.length==0)return new Re(I);var te=I.indexOf($);return te==-1?new Re(""):new Re(I.substring(te+$.length))},pt.substring=function(){var d=arguments[0];if(!(arguments.length==3||arguments.length==4))throw new Error("Function substring expects (string, number, number?)");var I=arguments[1].evaluate(d).stringValue(),$=Math.round(arguments[2].evaluate(d).numberValue())-1,te=arguments.length==4?$+Math.round(arguments[3].evaluate(d).numberValue()):void 0;return new Re(I.substring($,te))},pt.stringLength=function(){var d=arguments[0],I;if(arguments.length==1)I=Ge.prototype.stringForNode(d.contextNode);else if(arguments.length==2)I=arguments[1].evaluate(d).stringValue();else throw new Error("Function string-length expects (string?)");return new xe(I.length)},pt.normalizeSpace=function(){var d=arguments[0],I;if(arguments.length==1)I=Ge.prototype.stringForNode(d.contextNode);else if(arguments.length==2)I=arguments[1].evaluate(d).stringValue();else throw new Error("Function normalize-space expects (string?)");for(var $=0,te=I.length-1;Ze.isSpace(I.charCodeAt(te));)te--;for(var ie="";$<=te&&Ze.isSpace(I.charCodeAt($));)$++;for(;$<=te;)if(Ze.isSpace(I.charCodeAt($)))for(ie+=" ";$<=te&&Ze.isSpace(I.charCodeAt($));)$++;else ie+=I.charAt($),$++;return new Re(ie)},pt.translate=function(d,I,$,te){if(arguments.length!=4)throw new Error("Function translate expects (string, string, string)");var ie=I.evaluate(d).stringValue(),X=$.evaluate(d).stringValue(),nt=te.evaluate(d).stringValue(),kt=n(function(et,Dt,_n){return Dt in et||(et[Dt]=_n>nt.length?"":nt[_n]),et},{},X),Wt=f("",s(function(et){return et in kt?kt[et]:et},ie));return new Re(Wt)},pt.boolean_=function(){var d=arguments[0];if(arguments.length!=2)throw new Error("Function boolean expects (object)");return arguments[1].evaluate(d).bool()},pt.not=function(d,I){if(arguments.length!=2)throw new Error("Function not expects (object)");return I.evaluate(d).bool().not()},pt.true_=function(){if(arguments.length!=1)throw new Error("Function true expects ()");return je.true_},pt.false_=function(){if(arguments.length!=1)throw new Error("Function false expects ()");return je.false_},pt.lang=function(){var d=arguments[0];if(arguments.length!=2)throw new Error("Function lang expects (string)");for(var I,$=d.contextNode;$!=null&&$.nodeType!=S.DOCUMENT_NODE;$=$.parentNode){var te=$.getAttributeNS(b.XML_NAMESPACE_URI,"lang");if(te!=null){I=String(te);break}}if(I==null)return je.false_;var ie=arguments[1].evaluate(d).stringValue();return new je(I.substring(0,ie.length)==ie&&(I.length==ie.length||I.charAt(ie.length)=="-"))},pt.number=function(){var d=arguments[0];if(!(arguments.length==1||arguments.length==2))throw new Error("Function number expects (object?)");return arguments.length==1?new xe(Ge.prototype.stringForNode(d.contextNode)):arguments[1].evaluate(d).number()},pt.sum=function(){var d=arguments[0],I;if(arguments.length!=2||!Ze.instance_of(I=arguments[1].evaluate(d),Ge))throw new Error("Function sum expects (node-set)");I=I.toUnsortedArray();for(var $=0,te=0;te<I.length;te++)$+=new xe(Ge.prototype.stringForNode(I[te])).numberValue();return new xe($)},pt.floor=function(){var d=arguments[0];if(arguments.length!=2)throw new Error("Function floor expects (number)");return new xe(Math.floor(arguments[1].evaluate(d).numberValue()))},pt.ceiling=function(){var d=arguments[0];if(arguments.length!=2)throw new Error("Function ceiling expects (number)");return new xe(Math.ceil(arguments[1].evaluate(d).numberValue()))},pt.round=function(){var d=arguments[0];if(arguments.length!=2)throw new Error("Function round expects (number)");return new xe(Math.round(arguments[1].evaluate(d).numberValue()))};var Ze=new Object;Ze.isAttribute=function(d){return d&&(d.nodeType===S.ATTRIBUTE_NODE||d.ownerElement)},Ze.splitQName=function(d){var I=d.indexOf(":");return I==-1?[null,d]:[d.substring(0,I),d.substring(I+1)]},Ze.resolveQName=function(d,I,$,te){var ie=Ze.splitQName(d);return ie[0]!=null?ie[0]=I.getNamespace(ie[0],$):te?(ie[0]=I.getNamespace("",$),ie[0]==null&&(ie[0]="")):ie[0]="",ie},Ze.isSpace=function(d){return d==9||d==13||d==10||d==32},Ze.isLetter=function(d){return d>=65&&d<=90||d>=97&&d<=122||d>=192&&d<=214||d>=216&&d<=246||d>=248&&d<=255||d>=256&&d<=305||d>=308&&d<=318||d>=321&&d<=328||d>=330&&d<=382||d>=384&&d<=451||d>=461&&d<=496||d>=500&&d<=501||d>=506&&d<=535||d>=592&&d<=680||d>=699&&d<=705||d==902||d>=904&&d<=906||d==908||d>=910&&d<=929||d>=931&&d<=974||d>=976&&d<=982||d==986||d==988||d==990||d==992||d>=994&&d<=1011||d>=1025&&d<=1036||d>=1038&&d<=1103||d>=1105&&d<=1116||d>=1118&&d<=1153||d>=1168&&d<=1220||d>=1223&&d<=1224||d>=1227&&d<=1228||d>=1232&&d<=1259||d>=1262&&d<=1269||d>=1272&&d<=1273||d>=1329&&d<=1366||d==1369||d>=1377&&d<=1414||d>=1488&&d<=1514||d>=1520&&d<=1522||d>=1569&&d<=1594||d>=1601&&d<=1610||d>=1649&&d<=1719||d>=1722&&d<=1726||d>=1728&&d<=1742||d>=1744&&d<=1747||d==1749||d>=1765&&d<=1766||d>=2309&&d<=2361||d==2365||d>=2392&&d<=2401||d>=2437&&d<=2444||d>=2447&&d<=2448||d>=2451&&d<=2472||d>=2474&&d<=2480||d==2482||d>=2486&&d<=2489||d>=2524&&d<=2525||d>=2527&&d<=2529||d>=2544&&d<=2545||d>=2565&&d<=2570||d>=2575&&d<=2576||d>=2579&&d<=2600||d>=2602&&d<=2608||d>=2610&&d<=2611||d>=2613&&d<=2614||d>=2616&&d<=2617||d>=2649&&d<=2652||d==2654||d>=2674&&d<=2676||d>=2693&&d<=2699||d==2701||d>=2703&&d<=2705||d>=2707&&d<=2728||d>=2730&&d<=2736||d>=2738&&d<=2739||d>=2741&&d<=2745||d==2749||d==2784||d>=2821&&d<=2828||d>=2831&&d<=2832||d>=2835&&d<=2856||d>=2858&&d<=2864||d>=2866&&d<=2867||d>=2870&&d<=2873||d==2877||d>=2908&&d<=2909||d>=2911&&d<=2913||d>=2949&&d<=2954||d>=2958&&d<=2960||d>=2962&&d<=2965||d>=2969&&d<=2970||d==2972||d>=2974&&d<=2975||d>=2979&&d<=2980||d>=2984&&d<=2986||d>=2990&&d<=2997||d>=2999&&d<=3001||d>=3077&&d<=3084||d>=3086&&d<=3088||d>=3090&&d<=3112||d>=3114&&d<=3123||d>=3125&&d<=3129||d>=3168&&d<=3169||d>=3205&&d<=3212||d>=3214&&d<=3216||d>=3218&&d<=3240||d>=3242&&d<=3251||d>=3253&&d<=3257||d==3294||d>=3296&&d<=3297||d>=3333&&d<=3340||d>=3342&&d<=3344||d>=3346&&d<=3368||d>=3370&&d<=3385||d>=3424&&d<=3425||d>=3585&&d<=3630||d==3632||d>=3634&&d<=3635||d>=3648&&d<=3653||d>=3713&&d<=3714||d==3716||d>=3719&&d<=3720||d==3722||d==3725||d>=3732&&d<=3735||d>=3737&&d<=3743||d>=3745&&d<=3747||d==3749||d==3751||d>=3754&&d<=3755||d>=3757&&d<=3758||d==3760||d>=3762&&d<=3763||d==3773||d>=3776&&d<=3780||d>=3904&&d<=3911||d>=3913&&d<=3945||d>=4256&&d<=4293||d>=4304&&d<=4342||d==4352||d>=4354&&d<=4355||d>=4357&&d<=4359||d==4361||d>=4363&&d<=4364||d>=4366&&d<=4370||d==4412||d==4414||d==4416||d==4428||d==4430||d==4432||d>=4436&&d<=4437||d==4441||d>=4447&&d<=4449||d==4451||d==4453||d==4455||d==4457||d>=4461&&d<=4462||d>=4466&&d<=4467||d==4469||d==4510||d==4520||d==4523||d>=4526&&d<=4527||d>=4535&&d<=4536||d==4538||d>=4540&&d<=4546||d==4587||d==4592||d==4601||d>=7680&&d<=7835||d>=7840&&d<=7929||d>=7936&&d<=7957||d>=7960&&d<=7965||d>=7968&&d<=8005||d>=8008&&d<=8013||d>=8016&&d<=8023||d==8025||d==8027||d==8029||d>=8031&&d<=8061||d>=8064&&d<=8116||d>=8118&&d<=8124||d==8126||d>=8130&&d<=8132||d>=8134&&d<=8140||d>=8144&&d<=8147||d>=8150&&d<=8155||d>=8160&&d<=8172||d>=8178&&d<=8180||d>=8182&&d<=8188||d==8486||d>=8490&&d<=8491||d==8494||d>=8576&&d<=8578||d>=12353&&d<=12436||d>=12449&&d<=12538||d>=12549&&d<=12588||d>=44032&&d<=55203||d>=19968&&d<=40869||d==12295||d>=12321&&d<=12329},Ze.isNCNameChar=function(d){return d>=48&&d<=57||d>=1632&&d<=1641||d>=1776&&d<=1785||d>=2406&&d<=2415||d>=2534&&d<=2543||d>=2662&&d<=2671||d>=2790&&d<=2799||d>=2918&&d<=2927||d>=3047&&d<=3055||d>=3174&&d<=3183||d>=3302&&d<=3311||d>=3430&&d<=3439||d>=3664&&d<=3673||d>=3792&&d<=3801||d>=3872&&d<=3881||d==46||d==45||d==95||Ze.isLetter(d)||d>=768&&d<=837||d>=864&&d<=865||d>=1155&&d<=1158||d>=1425&&d<=1441||d>=1443&&d<=1465||d>=1467&&d<=1469||d==1471||d>=1473&&d<=1474||d==1476||d>=1611&&d<=1618||d==1648||d>=1750&&d<=1756||d>=1757&&d<=1759||d>=1760&&d<=1764||d>=1767&&d<=1768||d>=1770&&d<=1773||d>=2305&&d<=2307||d==2364||d>=2366&&d<=2380||d==2381||d>=2385&&d<=2388||d>=2402&&d<=2403||d>=2433&&d<=2435||d==2492||d==2494||d==2495||d>=2496&&d<=2500||d>=2503&&d<=2504||d>=2507&&d<=2509||d==2519||d>=2530&&d<=2531||d==2562||d==2620||d==2622||d==2623||d>=2624&&d<=2626||d>=2631&&d<=2632||d>=2635&&d<=2637||d>=2672&&d<=2673||d>=2689&&d<=2691||d==2748||d>=2750&&d<=2757||d>=2759&&d<=2761||d>=2763&&d<=2765||d>=2817&&d<=2819||d==2876||d>=2878&&d<=2883||d>=2887&&d<=2888||d>=2891&&d<=2893||d>=2902&&d<=2903||d>=2946&&d<=2947||d>=3006&&d<=3010||d>=3014&&d<=3016||d>=3018&&d<=3021||d==3031||d>=3073&&d<=3075||d>=3134&&d<=3140||d>=3142&&d<=3144||d>=3146&&d<=3149||d>=3157&&d<=3158||d>=3202&&d<=3203||d>=3262&&d<=3268||d>=3270&&d<=3272||d>=3274&&d<=3277||d>=3285&&d<=3286||d>=3330&&d<=3331||d>=3390&&d<=3395||d>=3398&&d<=3400||d>=3402&&d<=3405||d==3415||d==3633||d>=3636&&d<=3642||d>=3655&&d<=3662||d==3761||d>=3764&&d<=3769||d>=3771&&d<=3772||d>=3784&&d<=3789||d>=3864&&d<=3865||d==3893||d==3895||d==3897||d==3902||d==3903||d>=3953&&d<=3972||d>=3974&&d<=3979||d>=3984&&d<=3989||d==3991||d>=3993&&d<=4013||d>=4017&&d<=4023||d==4025||d>=8400&&d<=8412||d==8417||d>=12330&&d<=12335||d==12441||d==12442||d==183||d==720||d==721||d==903||d==1600||d==3654||d==3782||d==12293||d>=12337&&d<=12341||d>=12445&&d<=12446||d>=12540&&d<=12542},Ze.coalesceText=function(d){for(var I=d.firstChild;I!=null;I=I.nextSibling)if(I.nodeType==S.TEXT_NODE||I.nodeType==S.CDATA_SECTION_NODE){var $=I.nodeValue,te=I;for(I=I.nextSibling;I!=null&&(I.nodeType==S.TEXT_NODE||I.nodeType==S.CDATA_SECTION_NODE);){$+=I.nodeValue;var ie=I;I=I.nextSibling,ie.parentNode.removeChild(ie)}if(te.nodeType==S.CDATA_SECTION_NODE){var X=te.parentNode;if(te.nextSibling==null)X.removeChild(te),X.appendChild(X.ownerDocument.createTextNode($));else{var nt=te.nextSibling;X.removeChild(te),X.insertBefore(X.ownerDocument.createTextNode($),nt)}}else te.nodeValue=$;if(I==null)break}else I.nodeType==S.ELEMENT_NODE&&Ze.coalesceText(I)},Ze.instance_of=function(d,I){for(;d!=null;){if(d.constructor===I)return!0;if(d===Object)return!1;d=d.constructor.superclass}return!1},Ze.getElementById=function(d,I){if(d.nodeType==S.ELEMENT_NODE&&(d.getAttribute("id")==I||d.getAttributeNS(null,"id")==I))return d;for(var $=d.firstChild;$!=null;$=$.nextSibling){var te=Ze.getElementById($,I);if(te!=null)return te}return null};var Dn=(function(){function d($,te){var ie=te?": "+te.toString():"";switch($){case I.INVALID_EXPRESSION_ERR:return"Invalid expression"+ie;case I.TYPE_ERR:return"Type error"+ie}return null}o(d,"getMessage");function I($,te,ie){var X=Error.call(this,d($,te)||ie);return X.code=$,X.exception=te,X}return o(I,"XPathException"),I.prototype=Object.create(Error.prototype),I.prototype.constructor=I,I.superclass=Error,I.prototype.toString=function(){return this.message},I.fromMessage=function($,te){return new I(null,te,$)},I.INVALID_EXPRESSION_ERR=51,I.TYPE_ERR=52,I})();ss.prototype={},ss.prototype.constructor=ss,ss.superclass=Object.prototype;function ss(d,I,$){this.xpath=$.parse(d),this.context=new on,this.context.namespaceResolver=new aa(I)}o(ss,"XPathExpression"),ss.getOwnerDocument=function(d){return d.nodeType===S.DOCUMENT_NODE?d:d.ownerDocument},ss.detectHtmlDom=function(d){if(!d)return!1;var I=ss.getOwnerDocument(d);try{return I.implementation.hasFeature("HTML","2.0")}catch{return!0}},ss.prototype.evaluate=function(d,I,$){this.context.expressionContextNode=d,this.context.caseInsensitive=ss.detectHtmlDom(d);var te=this.xpath.evaluate(this.context);return new Rt(te,I)},aa.prototype={},aa.prototype.constructor=aa,aa.superclass=Object.prototype;function aa(d){this.xpathNSResolver=d}o(aa,"XPathNSResolverWrapper"),aa.prototype.getNamespace=function(d,I){return this.xpathNSResolver==null?null:this.xpathNSResolver.lookupNamespaceURI(d)},oa.prototype={},oa.prototype.constructor=oa,oa.superclass=Object.prototype;function oa(d){this.node=d,this.namespaceResolver=new ns}o(oa,"NodeXPathNSResolver"),oa.prototype.lookupNamespaceURI=function(d){return this.namespaceResolver.getNamespace(d,this.node)},Rt.prototype={},Rt.prototype.constructor=Rt,Rt.superclass=Object.prototype;function Rt(d,I){switch(I==Rt.ANY_TYPE&&(d.constructor===Re?I=Rt.STRING_TYPE:d.constructor===xe?I=Rt.NUMBER_TYPE:d.constructor===je?I=Rt.BOOLEAN_TYPE:d.constructor===Ge&&(I=Rt.UNORDERED_NODE_ITERATOR_TYPE)),this.resultType=I,I){case Rt.NUMBER_TYPE:this.numberValue=d.numberValue();return;case Rt.STRING_TYPE:this.stringValue=d.stringValue();return;case Rt.BOOLEAN_TYPE:this.booleanValue=d.booleanValue();return;case Rt.ANY_UNORDERED_NODE_TYPE:case Rt.FIRST_ORDERED_NODE_TYPE:if(d.constructor===Ge){this.singleNodeValue=d.first();return}break;case Rt.UNORDERED_NODE_ITERATOR_TYPE:case Rt.ORDERED_NODE_ITERATOR_TYPE:if(d.constructor===Ge){this.invalidIteratorState=!1,this.nodes=d.toArray(),this.iteratorIndex=0;return}break;case Rt.UNORDERED_NODE_SNAPSHOT_TYPE:case Rt.ORDERED_NODE_SNAPSHOT_TYPE:if(d.constructor===Ge){this.nodes=d.toArray(),this.snapshotLength=this.nodes.length;return}break}throw new Dn(Dn.TYPE_ERR)}o(Rt,"XPathResult"),Rt.prototype.iterateNext=function(){if(this.resultType!=Rt.UNORDERED_NODE_ITERATOR_TYPE&&this.resultType!=Rt.ORDERED_NODE_ITERATOR_TYPE)throw new Dn(Dn.TYPE_ERR);return this.nodes[this.iteratorIndex++]},Rt.prototype.snapshotItem=function(d){if(this.resultType!=Rt.UNORDERED_NODE_SNAPSHOT_TYPE&&this.resultType!=Rt.ORDERED_NODE_SNAPSHOT_TYPE)throw new Dn(Dn.TYPE_ERR);return this.nodes[d]},Rt.ANY_TYPE=0,Rt.NUMBER_TYPE=1,Rt.STRING_TYPE=2,Rt.BOOLEAN_TYPE=3,Rt.UNORDERED_NODE_ITERATOR_TYPE=4,Rt.ORDERED_NODE_ITERATOR_TYPE=5,Rt.UNORDERED_NODE_SNAPSHOT_TYPE=6,Rt.ORDERED_NODE_SNAPSHOT_TYPE=7,Rt.ANY_UNORDERED_NODE_TYPE=8,Rt.FIRST_ORDERED_NODE_TYPE=9;function yh(d,I){d.createExpression=function($,te){try{return new ss($,te,I)}catch(ie){throw new Dn(Dn.INVALID_EXPRESSION_ERR,ie)}},d.createNSResolver=function($){return new oa($)},d.evaluate=function($,te,ie,X,nt){if(X<0||X>9)throw{code:0,toString:o(function(){return"Request type not supported"},"toString")};return d.createExpression($,ie,I).evaluate(te,X,nt)}}o(yh,"installDOM3XPathSupport");try{var vh=!0;try{document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("XPath",null)&&(vh=!1)}catch{}vh&&yh(document,new E)}catch{}yh(r,new E),(function(){var d=new E,I=new ns,$=new ms,te=new $n;function ie(qe){return{getNamespace:o(function(Zt,Xn){var Oi=qe(Zt,Xn);return Oi||I.getNamespace(Zt,Xn)},"getNamespace")}}o(ie,"makeNSResolverFromFunction");function X(qe){return ie(qe.getNamespace.bind(qe))}o(X,"makeNSResolverFromObject");function nt(qe){return ie(function(Zt){return qe[Zt]})}o(nt,"makeNSResolverFromMap");function kt(qe){return qe&&typeof qe.getNamespace=="function"?X(qe):typeof qe=="function"?ie(qe):typeof qe=="object"?nt(qe):I}o(kt,"makeNSResolver");function Wt(qe){if(qe===null||typeof qe>"u"||qe instanceof Re||qe instanceof je||qe instanceof xe||qe instanceof Ge)return qe;switch(typeof qe){case"string":return new Re(qe);case"boolean":return new je(qe);case"number":return new xe(qe)}var Zt=new Ge;return Zt.addArray([].concat(qe)),Zt}o(Wt,"convertValue");function et(qe){return function(Zt){var Xn=Array.prototype.slice.call(arguments,1).map(function(y2){return y2.evaluate(Zt)}),Oi=qe.apply(this,[].concat(Zt,Xn));return Wt(Oi)}}o(et,"makeEvaluator");function Dt(qe){return{getFunction:o(function(Zt,Xn){var Oi=qe(Zt,Xn);return Oi?et(Oi):$.getFunction(Zt,Xn)},"getFunction")}}o(Dt,"makeFunctionResolverFromFunction");function _n(qe){return Dt(qe.getFunction.bind(qe))}o(_n,"makeFunctionResolverFromObject");function ti(qe){return Dt(function(Zt){return qe[Zt]})}o(ti,"makeFunctionResolverFromMap");function or(qe){return qe&&typeof qe.getFunction=="function"?_n(qe):typeof qe=="function"?Dt(qe):typeof qe=="object"?ti(qe):$}o(or,"makeFunctionResolver");function ua(qe){return{getVariable:o(function(Zt,Xn){var Oi=qe(Zt,Xn);return Wt(Oi)},"getVariable")}}o(ua,"makeVariableResolverFromFunction");function Q0(qe){if(qe){if(typeof qe.getVariable=="function")return ua(qe.getVariable.bind(qe));if(typeof qe=="function")return ua(qe);if(typeof qe=="object")return ua(function(Zt){return qe[Zt]})}return te}o(Q0,"makeVariableResolver");function bv(qe,Zt,Xn){qe in Xn&&(Zt[qe]=Xn[qe])}o(bv,"copyIfPresent");function p2(qe){var Zt=new on;return qe?(Zt.namespaceResolver=kt(qe.namespaces),Zt.functionResolver=or(qe.functions),Zt.variableResolver=Q0(qe.variables),Zt.expressionContextNode=qe.node,bv("allowAnyNamespaceForNoPrefix",Zt,qe),bv("isHtml",Zt,qe)):Zt.namespaceResolver=I,Zt}o(p2,"makeContext");function d2(qe,Zt){var Xn=p2(Zt);return qe.evaluate(Xn)}o(d2,"evaluate");var m2={evaluate:o(function(qe){return d2(this.expression,qe)},"evaluate"),evaluateNumber:o(function(qe){return this.evaluate(qe).numberValue()},"evaluateNumber"),evaluateString:o(function(qe){return this.evaluate(qe).stringValue()},"evaluateString"),evaluateBoolean:o(function(qe){return this.evaluate(qe).booleanValue()},"evaluateBoolean"),evaluateNodeSet:o(function(qe){return this.evaluate(qe).nodeset()},"evaluateNodeSet"),select:o(function(qe){return this.evaluateNodeSet(qe).toArray()},"select"),select1:o(function(qe){return this.select(qe)[0]},"select1")};function g2(qe){var Zt=d.parse(qe);return Object.create(m2,{expression:{value:Zt}})}o(g2,"parse"),r.parse=g2})(),y(r,{XPath:b,XPathParser:E,XPathResult:Rt,Step:O,PathExpr:we,NodeTest:_,LocationPath:lt,OrOperation:F,AndOperation:R,BarOperation:be,EqualsOperation:H,NotEqualOperation:q,LessThanOperation:K,GreaterThanOperation:G,LessThanOrEqualOperation:he,GreaterThanOrEqualOperation:le,PlusOperation:oe,MinusOperation:Z,MultiplyOperation:fe,DivOperation:Se,ModOperation:Ke,UnaryMinusOperation:x,FunctionCall:J,VariableReference:ne,XPathContext:on,XNodeSet:Ge,XBoolean:je,XString:Re,XNumber:xe,NamespaceResolver:ns,FunctionResolver:ms,VariableResolver:$n,Utilities:Ze}),r.select=function(d,I,$){return r.selectWithResolver(d,I,null,$)},r.useNamespaces=function(d){var I={mappings:d||{},lookupNamespaceURI:o(function($){return this.mappings[$]},"lookupNamespaceURI")};return function($,te,ie){return r.selectWithResolver($,te,I,ie)}},r.selectWithResolver=function(d,I,$,te){var ie=new ss(d,$,new E),X=Rt.ANY_TYPE,nt=ie.evaluate(I,X,null);return nt.resultType==Rt.STRING_TYPE?nt=nt.stringValue:nt.resultType==Rt.NUMBER_TYPE?nt=nt.numberValue:nt.resultType==Rt.BOOLEAN_TYPE?nt=nt.booleanValue:(nt=nt.nodes,te&&(nt=nt[0])),nt},r.select1=function(d,I){return r.select(d,I,!0)};var tc=o(function(d){return d&&typeof d.nodeType=="number"&&Number.isInteger(d.nodeType)&&d.nodeType>=1&&d.nodeType<=11&&typeof d.nodeName=="string"},"isNodeLike"),Y0=o(function(d){return Array.isArray(d)&&d.every(tc)},"isArrayOfNodes"),Vs=o(function(d){return function(I){return tc(I)&&I.nodeType===d}},"isNodeOfType");y(r,{isNodeLike:tc,isArrayOfNodes:Y0,isElement:Vs(S.ELEMENT_NODE),isAttribute:Vs(S.ATTRIBUTE_NODE),isTextNode:Vs(S.TEXT_NODE),isCDATASection:Vs(S.CDATA_SECTION_NODE),isProcessingInstruction:Vs(S.PROCESSING_INSTRUCTION_NODE),isComment:Vs(S.COMMENT_NODE),isDocumentNode:Vs(S.DOCUMENT_NODE),isDocumentTypeNode:Vs(S.DOCUMENT_TYPE_NODE),isDocumentFragment:Vs(S.DOCUMENT_FRAGMENT_NODE)})})(NZ)});var cp=ye(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.assertIsDocumentFragmentNode=It.assertIsDocumentTypeNode=It.assertIsDocumentNode=It.assertIsCommentNode=It.assertIsProcessingInstructionNode=It.assertIsCDATASectionNode=It.assertIsTextNode=It.assertIsAttributeNode=It.assertIsElementNode=It.isDocumentFragmentNode=It.isDocumentTypeNode=It.isDocumentNode=It.isCommentNode=It.isProcessingInstructionNode=It.isCDATASectionNode=It.isTextNode=It.isAttributeNode=It.isElementNode=It.assertIsArrayOfNodes=It.isArrayOfNodes=It.assertIsNodeLike=It.isNodeLike=It.NodeTypes=void 0;var Yr;(function(r){r[r.ELEMENT_NODE=1]="ELEMENT_NODE",r[r.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",r[r.TEXT_NODE=3]="TEXT_NODE",r[r.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",r[r.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",r[r.COMMENT_NODE=8]="COMMENT_NODE",r[r.DOCUMENT_NODE=9]="DOCUMENT_NODE",r[r.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",r[r.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(Yr||(It.NodeTypes=Yr={}));function TS(r){return r&&typeof r=="object"&&Number.isInteger(r.nodeType)&&r.nodeType>=1&&r.nodeType<=11&&typeof r.nodeName=="string"&&typeof r.appendChild=="function"&&typeof r.removeChild=="function"}o(TS,"isNodeLike");It.isNodeLike=TS;function TZ(r){if(!TS(r))throw new Error(`Value is not a Node-like object. Received: ${r}`)}o(TZ,"assertIsNodeLike");It.assertIsNodeLike=TZ;function iL(r){return Array.isArray(r)&&r.every(TS)}o(iL,"isArrayOfNodes");It.isArrayOfNodes=iL;function IZ(r){if(!iL(r))throw new Error("Value is not an array of Nodes")}o(IZ,"assertIsArrayOfNodes");It.assertIsArrayOfNodes=IZ;function Pa(r,e){return TS(e)&&e.nodeType===r}o(Pa,"isNodeOfType");function yo(r,e){let t=Object.keys(Yr).find(n=>Yr[n]===r);if(!Pa(r,e))throw new Error(`Value is not of type ${t}`)}o(yo,"assertIsNodeOfType");var BZ=o(r=>Pa(Yr.ELEMENT_NODE,r),"isElementNode");It.isElementNode=BZ;var DZ=o(r=>Pa(Yr.ATTRIBUTE_NODE,r),"isAttributeNode");It.isAttributeNode=DZ;var _Z=o(r=>Pa(Yr.TEXT_NODE,r),"isTextNode");It.isTextNode=_Z;var RZ=o(r=>Pa(Yr.CDATA_SECTION_NODE,r),"isCDATASectionNode");It.isCDATASectionNode=RZ;var PZ=o(r=>Pa(Yr.PROCESSING_INSTRUCTION_NODE,r),"isProcessingInstructionNode");It.isProcessingInstructionNode=PZ;var OZ=o(r=>Pa(Yr.COMMENT_NODE,r),"isCommentNode");It.isCommentNode=OZ;var kZ=o(r=>Pa(Yr.DOCUMENT_NODE,r),"isDocumentNode");It.isDocumentNode=kZ;var LZ=o(r=>Pa(Yr.DOCUMENT_TYPE_NODE,r),"isDocumentTypeNode");It.isDocumentTypeNode=LZ;var VZ=o(r=>Pa(Yr.DOCUMENT_FRAGMENT_NODE,r),"isDocumentFragmentNode");It.isDocumentFragmentNode=VZ;var UZ=o(r=>{yo(Yr.ELEMENT_NODE,r)},"assertIsElementNode");It.assertIsElementNode=UZ;var MZ=o(r=>yo(Yr.ATTRIBUTE_NODE,r),"assertIsAttributeNode");It.assertIsAttributeNode=MZ;var jZ=o(r=>yo(Yr.TEXT_NODE,r),"assertIsTextNode");It.assertIsTextNode=jZ;var FZ=o(r=>yo(Yr.CDATA_SECTION_NODE,r),"assertIsCDATASectionNode");It.assertIsCDATASectionNode=FZ;var qZ=o(r=>yo(Yr.PROCESSING_INSTRUCTION_NODE,r),"assertIsProcessingInstructionNode");It.assertIsProcessingInstructionNode=qZ;var HZ=o(r=>yo(Yr.COMMENT_NODE,r),"assertIsCommentNode");It.assertIsCommentNode=HZ;var KZ=o(r=>yo(Yr.DOCUMENT_NODE,r),"assertIsDocumentNode");It.assertIsDocumentNode=KZ;var $Z=o(r=>yo(Yr.DOCUMENT_TYPE_NODE,r),"assertIsDocumentTypeNode");It.assertIsDocumentTypeNode=$Z;var XZ=o(r=>yo(Yr.DOCUMENT_FRAGMENT_NODE,r),"assertIsDocumentFragmentNode");It.assertIsDocumentFragmentNode=XZ});var qm=ye(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.validateDigestValue=cr.findAncestorNs=cr.derToPem=cr.pemToDer=cr.normalizePem=cr.BASE64_REGEX=cr.EXTRACT_X509_CERTS=cr.PEM_FORMAT_REGEX=cr.encodeSpecialCharactersInText=cr.encodeSpecialCharactersInAttribute=cr.findChilds=cr.findChildren=cr.findAttr=cr.isArrayHasLength=void 0;var GZ=NS(),_N=cp();function aL(r){return Array.isArray(r)&&r.length>0}o(aL,"isArrayHasLength");cr.isArrayHasLength=aL;function WZ(r,e,t){return r.localName===e&&(r.namespaceURI===t||t==null)}o(WZ,"attrEqualsExplicitly");function JZ(r,e,t,n){return r.localName===e&&(!r.namespaceURI&&n?.namespaceURI===t||t==null)}o(JZ,"attrEqualsImplicitly");function zZ(r,e,t){for(let n=0;n<r.attributes.length;n++){let s=r.attributes[n];if(WZ(s,e,t)||JZ(s,e,t,r))return s}return null}o(zZ,"findAttr");cr.findAttr=zZ;function oL(r,e,t){let n=r.documentElement??r,s=[];for(let i=0;i<n.childNodes.length;i++){let a=n.childNodes[i];_N.isElementNode(a)&&a.localName===e&&(a.namespaceURI===t||t==null)&&s.push(a)}return s}o(oL,"findChildren");cr.findChildren=oL;function YZ(r,e,t){return oL(r,e,t)}o(YZ,"findChilds");cr.findChilds=YZ;var QZ={"&":"&amp;","<":"&lt;",'"':"&quot;","\r":"&#xD;","\n":"&#xA;"," ":"&#x9;"},ZZ={"&":"&amp;","<":"&lt;",">":"&gt;","\r":"&#xD;"};function eee(r){return r.replace(/([&<"\r\n\t])/g,function(e,t){return QZ[t]})}o(eee,"encodeSpecialCharactersInAttribute");cr.encodeSpecialCharactersInAttribute=eee;function tee(r){return r.replace(/([&<>\r])/g,function(e,t){return ZZ[t]})}o(tee,"encodeSpecialCharactersInText");cr.encodeSpecialCharactersInText=tee;cr.PEM_FORMAT_REGEX=new RegExp("^-----BEGIN [A-Z ]{1,48}-----([^-]*)-----END [A-Z ]{1,48}-----$","s");cr.EXTRACT_X509_CERTS=new RegExp("-----BEGIN CERTIFICATE-----[^-]*-----END CERTIFICATE-----","g");cr.BASE64_REGEX=new RegExp("^(?:[A-Za-z0-9\\+\\/]{4}\\n{0,1})*(?:[A-Za-z0-9\\+\\/]{2}==|[A-Za-z0-9\\+\\/]{3}=)?$","s");function DN(r){return`${(r.trim().replace(/(\r\n|\r)/g,`
55
- `).match(/.{1,64}/g)??[]).join(`
56
- `)}
57
- `}o(DN,"normalizePem");cr.normalizePem=DN;function ree(r){if(!cr.PEM_FORMAT_REGEX.test(r.trim()))throw new Error("Invalid PEM format.");return Buffer.from(r.replace(/(\r\n|\r)/g,"").replace(/-----BEGIN [A-Z\x20]{1,48}-----\n?/,"").replace(/-----END [A-Z\x20]{1,48}-----\n?/,""),"base64")}o(ree,"pemToDer");cr.pemToDer=ree;function nee(r,e){let t=Buffer.isBuffer(r)?r.toString("base64").trim():r.replace(/(\r\n|\r)/g,"").trim();if(cr.PEM_FORMAT_REGEX.test(t))return DN(t);if(cr.BASE64_REGEX.test(t.replace(/ /g,""))){if(e==null)throw new Error("PEM label is required when DER is given.");let n=`-----BEGIN ${e}-----
58
- ${t.replace(/ /g,"")}
59
- -----END ${e}-----`;return DN(n)}throw new Error("Unknown DER format.")}o(nee,"derToPem");cr.derToPem=nee;function uL(r,e=[]){if(!_N.isElementNode(r.parentNode))return e;let t=r.parentNode;if(!t)return e;if(t.attributes&&t.attributes.length>0)for(let n=0;n<t.attributes.length;n++){let s=t.attributes[n];s&&s.nodeName&&s.nodeName.search(/^xmlns:?/)!==-1&&e.push({prefix:s.nodeName.replace(/^xmlns:?/,""),namespaceURI:s.nodeValue||""})}return uL(t,e)}o(uL,"collectAncestorNamespaces");function see(r){let e=r.attributes;for(let t=0;t<e.length;t++){let n=e[t].nodeName;if(n.search(/^xmlns:?/)!==-1)return n.replace(/^xmlns:?/,"")}return r.prefix||""}o(see,"findNSPrefix");function iee(r){return r.every(e=>_N.isElementNode(e))}o(iee,"isElementSubset");function aee(r,e,t){if(e==null)return[];let n=GZ.selectWithResolver(e,r,t);if(!aL(n))return[];if(!iee(n))throw new Error("Document subset must be list of elements");let s=uL(n[0]),i=[];for(let l=0;l<s.length;l++){let f=!0;for(let h in i)if(i[h].prefix===s[l].prefix){f=!1;break}f&&i.push(s[l])}let a=[],u=see(n[0]);for(let l of i)l.prefix!==u&&a.push(l);return a}o(aee,"findAncestorNs");cr.findAncestorNs=aee;function oee(r,e){let t=Buffer.from(r,"base64"),n=Buffer.from(e,"base64");if(typeof t.equals=="function")return t.equals(n);if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)if(t[s]!==n[s])return!1;return!0}o(oee,"validateDigestValue");cr.validateDigestValue=oee});var PN=ye(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.C14nCanonicalizationWithComments=fp.C14nCanonicalization=void 0;var IS=qm(),RN=cp(),lL=class{static{o(this,"C14nCanonicalization")}constructor(){this.includeComments=!1,this.includeComments=!1}attrCompare(e,t){if(!e.namespaceURI&&t.namespaceURI)return-1;if(!t.namespaceURI&&e.namespaceURI)return 1;let n=e.namespaceURI+e.localName,s=t.namespaceURI+t.localName;return n===s?0:n<s?-1:1}nsCompare(e,t){let n=e.prefix,s=t.prefix;return n===s?0:n.localeCompare(s)}renderAttrs(e){let t,n,s=[];if(RN.isCommentNode(e))return this.renderComment(e);if(e.attributes)for(t=0;t<e.attributes.length;++t)n=e.attributes[t],n.name.indexOf("xmlns")!==0&&s.push(n);return s.sort(this.attrCompare),s.map(a=>` ${a.name}="${IS.encodeSpecialCharactersInAttribute(a.value)}"`).join("")}renderNs(e,t,n,s,i){let a,u,l=[],f=n,h=[],m=e.namespaceURI||"";if(e.prefix?t.indexOf(e.prefix)===-1&&(h.push({prefix:e.prefix,namespaceURI:e.namespaceURI||s[e.prefix]}),t.push(e.prefix)):n!==m&&(f=e.namespaceURI||"",l.push(' xmlns="',f,'"')),e.attributes)for(a=0;a<e.attributes.length;++a)u=e.attributes[a],u.prefix==="xmlns"&&t.indexOf(u.localName)===-1&&(h.push({prefix:u.localName,namespaceURI:u.value}),t.push(u.localName)),u.prefix&&t.indexOf(u.prefix)===-1&&u.prefix!=="xmlns"&&u.prefix!=="xml"&&(h.push({prefix:u.prefix,namespaceURI:u.namespaceURI}),t.push(u.prefix));if(IS.isArrayHasLength(i))for(let g of i){let w=!1;for(let y of h)y.prefix===g.prefix&&y.namespaceURI===g.namespaceURI&&(w=!0);w||h.push(g)}return h.sort(this.nsCompare),l.push(...h.map(g=>g.prefix?` xmlns:${g.prefix}="${g.namespaceURI}"`:` xmlns="${g.namespaceURI}"`)),{rendered:l.join(""),newDefaultNs:f}}processInner(e,t,n,s,i){if(RN.isCommentNode(e))return this.renderComment(e);if(e.data)return IS.encodeSpecialCharactersInText(e.data);if(RN.isElementNode(e)){let a,u,l=this.renderNs(e,t,n,s,i),f=["<",e.tagName,l.rendered,this.renderAttrs(e),">"];for(a=0;a<e.childNodes.length;++a)u=t.slice(0),f.push(this.processInner(e.childNodes[a],u,l.newDefaultNs,s,[]));return f.push("</",e.tagName,">"),f.join("")}throw new Error(`Unable to canonicalize node type: ${e.nodeType}`)}renderComment(e){if(!this.includeComments)return"";let t=e.ownerDocument===e.parentNode,n=!1,s=!1;if(t){let l=e,f=e;for(;l!==null;){if(l===e.ownerDocument.documentElement){n=!0;break}l=l.nextSibling}for(;f!==null;){if(f===e.ownerDocument.documentElement){s=!0;break}f=f.previousSibling}}let i=s?`
60
- `:"",a=n?`
61
- `:"",u=IS.encodeSpecialCharactersInText(e.data);return`${i}<!--${u}-->${a}`}process(e,t){t=t||{};let n=t.defaultNs||"",s=t.defaultNsForPrefix||{},i=t.ancestorNamespaces||[],a=[];for(let l=0;l<i.length;l++)a.push(i[l].prefix);return this.processInner(e,a,n,s,i)}getAlgorithmName(){return"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"}};fp.C14nCanonicalization=lL;var uee=class extends lL{static{o(this,"C14nCanonicalizationWithComments")}constructor(){super(),this.includeComments=!0}getAlgorithmName(){return"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"}};fp.C14nCanonicalizationWithComments=uee});var LN=ye(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.ExclusiveCanonicalizationWithComments=hp.ExclusiveCanonicalization=void 0;var xc=qm(),ON=cp();function kN(r,e,t){let n=!1;return r.forEach(function(s){s.prefix===e&&s.namespaceURI===t&&(n=!0)}),n}o(kN,"isPrefixInScope");var cL=class{static{o(this,"ExclusiveCanonicalization")}constructor(){this.includeComments=!1,this.includeComments=!1}attrCompare(e,t){if(!e.namespaceURI&&t.namespaceURI)return-1;if(!t.namespaceURI&&e.namespaceURI)return 1;let n=e.namespaceURI+e.localName,s=t.namespaceURI+t.localName;return n===s?0:n<s?-1:1}nsCompare(e,t){let n=e.prefix,s=t.prefix;return n===s?0:n.localeCompare(s)}renderAttrs(e){let t,n,s=[],i=[];if(ON.isCommentNode(e))return this.renderComment(e);if(e.attributes)for(t=0;t<e.attributes.length;++t)n=e.attributes[t],n.name.indexOf("xmlns")!==0&&i.push(n);i.sort(this.attrCompare);for(n of i)s.push(" ",n.name,'="',xc.encodeSpecialCharactersInAttribute(n.value),'"');return s.join("")}renderNs(e,t,n,s,i){let a,u,l=[],f=n,h=[],m=e.namespaceURI||"";if(e.prefix?kN(t,e.prefix,e.namespaceURI||s[e.prefix])||(h.push({prefix:e.prefix,namespaceURI:e.namespaceURI||s[e.prefix]}),t.push({prefix:e.prefix,namespaceURI:e.namespaceURI||s[e.prefix]})):n!==m&&(f=e.namespaceURI,l.push(' xmlns="',f,'"')),e.attributes)for(a=0;a<e.attributes.length;++a)u=e.attributes[a],u.prefix&&!kN(t,u.localName,u.value)&&i.indexOf(u.localName)>=0&&(h.push({prefix:u.localName,namespaceURI:u.value}),t.push({prefix:u.localName,namespaceURI:u.value})),u.prefix&&!kN(t,u.prefix,u.namespaceURI)&&u.prefix!=="xmlns"&&u.prefix!=="xml"&&(h.push({prefix:u.prefix,namespaceURI:u.namespaceURI}),t.push({prefix:u.prefix,namespaceURI:u.namespaceURI}));h.sort(this.nsCompare);for(let g of h)l.push(" xmlns:",g.prefix,'="',g.namespaceURI,'"');return{rendered:l.join(""),newDefaultNs:f}}processInner(e,t,n,s,i){if(ON.isCommentNode(e))return this.renderComment(e);if(e.data)return xc.encodeSpecialCharactersInText(e.data);if(ON.isElementNode(e)){let a,u,l=this.renderNs(e,t,n,s,i),f=["<",e.tagName,l.rendered,this.renderAttrs(e),">"];for(a=0;a<e.childNodes.length;++a)u=t.slice(0),f.push(this.processInner(e.childNodes[a],u,l.newDefaultNs,s,i));return f.push("</",e.tagName,">"),f.join("")}throw new Error(`Unable to exclusive canonicalize node type: ${e.nodeType}`)}renderComment(e){if(!this.includeComments)return"";let t=e.ownerDocument===e.parentNode,n=!1,s=!1;if(t){let l=e,f=e;for(;l!=null;){if(l===e.ownerDocument.documentElement){n=!0;break}l=l.nextSibling}for(;f!=null;){if(f===e.ownerDocument.documentElement){s=!0;break}f=f.previousSibling}}let i=s?`
62
- `:"",a=n?`
63
- `:"",u=xc.encodeSpecialCharactersInText(e.data);return`${i}<!--${u}-->${a}`}process(e,t){t=t||{};let n=t.inclusiveNamespacesPrefixList||[],s=t.defaultNs||"",i=t.defaultNsForPrefix||{},a=t.ancestorNamespaces||[];if(!xc.isArrayHasLength(n)){let l=xc.findChildren(e,"CanonicalizationMethod");if(l.length!==0){let f=xc.findChildren(l[0],"InclusiveNamespaces");f.length!==0&&(n=(f[0].getAttribute("PrefixList")||"").split(" "))}}return xc.isArrayHasLength(n)&&n.forEach(function(l){a&&a.forEach(function(f){l===f.prefix&&e.setAttributeNS("http://www.w3.org/2000/xmlns/",`xmlns:${l}`,f.namespaceURI)})}),this.processInner(e,[],s,i,n)}getAlgorithmName(){return"http://www.w3.org/2001/10/xml-exc-c14n#"}};hp.ExclusiveCanonicalization=cL;var lee=class extends cL{static{o(this,"ExclusiveCanonicalizationWithComments")}constructor(){super(),this.includeComments=!0}getAlgorithmName(){return"http://www.w3.org/2001/10/xml-exc-c14n#WithComments"}};hp.ExclusiveCanonicalizationWithComments=lee});var Hm=ye(pp=>{"use strict";function cee(r,e,t){if(t===void 0&&(t=Array.prototype),r&&typeof t.find=="function")return t.find.call(r,e);for(var n=0;n<r.length;n++)if(Object.prototype.hasOwnProperty.call(r,n)){var s=r[n];if(e.call(void 0,s,n,r))return s}}o(cee,"find");function VN(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}o(VN,"freeze");function fee(r,e){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r}o(fee,"assign");var fL=VN({HTML:"text/html",isHTML:o(function(r){return r===fL.HTML},"isHTML"),XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),hL=VN({HTML:"http://www.w3.org/1999/xhtml",isHTML:o(function(r){return r===hL.HTML},"isHTML"),SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});pp.assign=fee;pp.find=cee;pp.freeze=VN;pp.MIME_TYPE=fL;pp.NAMESPACE=hL});var WN=ye(Vu=>{"use strict";var SL=Hm(),Oa=SL.find,Km=SL.NAMESPACE;function hee(r){return r!==""}o(hee,"notEmptyString");function pee(r){return r?r.split(/[\t\n\f\r ]+/).filter(hee):[]}o(pee,"splitOnASCIIWhitespace");function dee(r,e){return r.hasOwnProperty(e)||(r[e]=!0),r}o(dee,"orderedSetReducer");function pL(r){if(!r)return[];var e=pee(r);return Object.keys(e.reduce(dee,{}))}o(pL,"toOrderedSet");function mee(r){return function(e){return r&&r.indexOf(e)!==-1}}o(mee,"arrayIncludes");function Gm(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}o(Gm,"copy");function Ns(r,e){var t=r.prototype;if(!(t instanceof e)){let s=function(){};var n=s;o(s,"t"),s.prototype=e.prototype,s=new s,Gm(t,s),r.prototype=t=s}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r)}o(Ns,"_extends");var Ts={},Si=Ts.ELEMENT_NODE=1,mp=Ts.ATTRIBUTE_NODE=2,BS=Ts.TEXT_NODE=3,EL=Ts.CDATA_SECTION_NODE=4,AL=Ts.ENTITY_REFERENCE_NODE=5,gee=Ts.ENTITY_NODE=6,CL=Ts.PROCESSING_INSTRUCTION_NODE=7,bL=Ts.COMMENT_NODE=8,xL=Ts.DOCUMENT_NODE=9,NL=Ts.DOCUMENT_TYPE_NODE=10,wo=Ts.DOCUMENT_FRAGMENT_NODE=11,yee=Ts.NOTATION_NODE=12,zn={},Nn={},tpe=zn.INDEX_SIZE_ERR=(Nn[1]="Index size error",1),rpe=zn.DOMSTRING_SIZE_ERR=(Nn[2]="DOMString size error",2),xs=zn.HIERARCHY_REQUEST_ERR=(Nn[3]="Hierarchy request error",3),npe=zn.WRONG_DOCUMENT_ERR=(Nn[4]="Wrong document",4),spe=zn.INVALID_CHARACTER_ERR=(Nn[5]="Invalid character",5),ipe=zn.NO_DATA_ALLOWED_ERR=(Nn[6]="No data allowed",6),ape=zn.NO_MODIFICATION_ALLOWED_ERR=(Nn[7]="No modification allowed",7),TL=zn.NOT_FOUND_ERR=(Nn[8]="Not found",8),ope=zn.NOT_SUPPORTED_ERR=(Nn[9]="Not supported",9),dL=zn.INUSE_ATTRIBUTE_ERR=(Nn[10]="Attribute in use",10),upe=zn.INVALID_STATE_ERR=(Nn[11]="Invalid state",11),lpe=zn.SYNTAX_ERR=(Nn[12]="Syntax error",12),cpe=zn.INVALID_MODIFICATION_ERR=(Nn[13]="Invalid modification",13),fpe=zn.NAMESPACE_ERR=(Nn[14]="Invalid namespace",14),hpe=zn.INVALID_ACCESS_ERR=(Nn[15]="Invalid access",15);function rn(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,Nn[r]),this.message=Nn[r],Error.captureStackTrace&&Error.captureStackTrace(this,rn);return t.code=r,e&&(this.message=this.message+": "+e),t}o(rn,"DOMException");rn.prototype=Error.prototype;Gm(zn,rn);function vo(){}o(vo,"NodeList");vo.prototype={length:0,item:o(function(r){return r>=0&&r<this.length?this[r]:null},"item"),toString:o(function(r,e){for(var t=[],n=0;n<this.length;n++)dp(this[n],t,r,e);return t.join("")},"toString"),filter:o(function(r){return Array.prototype.filter.call(this,r)},"filter"),indexOf:o(function(r){return Array.prototype.indexOf.call(this,r)},"indexOf")};function gp(r,e){this._node=r,this._refresh=e,jN(this)}o(gp,"LiveNodeList");function jN(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(ML(r,"length",t.length),!r.$$length||t.length<r.$$length)for(var n=t.length;n in r;n++)Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];Gm(t,r),r._inc=e}}o(jN,"_updateLiveList");gp.prototype.item=function(r){return jN(this),this[r]||null};Ns(gp,vo);function DS(){}o(DS,"NamedNodeMap");function IL(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}o(IL,"_findNodeIndex");function mL(r,e,t,n){if(n?e[IL(e,n)]=t:e[e.length++]=t,r){t.ownerElement=r;var s=r.ownerDocument;s&&(n&&_L(s,r,n),vee(s,r,t))}}o(mL,"_addNamedNode");function gL(r,e,t){var n=IL(e,t);if(n>=0){for(var s=e.length-1;n<s;)e[n]=e[++n];if(e.length=s,r){var i=r.ownerDocument;i&&(_L(i,r,t),t.ownerElement=null)}}else throw new rn(TL,new Error(r.tagName+"@"+t))}o(gL,"_removeNamedNode");DS.prototype={length:0,item:vo.prototype.item,getNamedItem:o(function(r){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==r)return t}},"getNamedItem"),setNamedItem:o(function(r){var e=r.ownerElement;if(e&&e!=this._ownerElement)throw new rn(dL);var t=this.getNamedItem(r.nodeName);return mL(this._ownerElement,this,r,t),t},"setNamedItem"),setNamedItemNS:o(function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new rn(dL);return t=this.getNamedItemNS(r.namespaceURI,r.localName),mL(this._ownerElement,this,r,t),t},"setNamedItemNS"),removeNamedItem:o(function(r){var e=this.getNamedItem(r);return gL(this._ownerElement,this,e),e},"removeNamedItem"),removeNamedItemNS:o(function(r,e){var t=this.getNamedItemNS(r,e);return gL(this._ownerElement,this,t),t},"removeNamedItemNS"),getNamedItemNS:o(function(r,e){for(var t=this.length;t--;){var n=this[t];if(n.localName==e&&n.namespaceURI==r)return n}return null},"getNamedItemNS")};function BL(){}o(BL,"DOMImplementation");BL.prototype={hasFeature:o(function(r,e){return!0},"hasFeature"),createDocument:o(function(r,e,t){var n=new Wm;if(n.implementation=this,n.childNodes=new vo,n.doctype=t||null,t&&n.appendChild(t),e){var s=n.createElementNS(r,e);n.appendChild(s)}return n},"createDocument"),createDocumentType:o(function(r,e,t){var n=new PS;return n.name=r,n.nodeName=r,n.publicId=e||"",n.systemId=t||"",n},"createDocumentType")};function Sr(){}o(Sr,"Node");Sr.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:o(function(r,e){return _S(this,r,e)},"insertBefore"),replaceChild:o(function(r,e){_S(this,r,e,PL),e&&this.removeChild(e)},"replaceChild"),removeChild:o(function(r){return RL(this,r)},"removeChild"),appendChild:o(function(r){return this.insertBefore(r,null)},"appendChild"),hasChildNodes:o(function(){return this.firstChild!=null},"hasChildNodes"),cloneNode:o(function(r){return MN(this.ownerDocument||this,this,r)},"cloneNode"),normalize:o(function(){for(var r=this.firstChild;r;){var e=r.nextSibling;e&&e.nodeType==BS&&r.nodeType==BS?(this.removeChild(e),r.appendData(e.data)):(r.normalize(),r=e)}},"normalize"),isSupported:o(function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},"isSupported"),hasAttributes:o(function(){return this.attributes.length>0},"hasAttributes"),lookupPrefix:o(function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&t[n]===r)return n}e=e.nodeType==mp?e.ownerDocument:e.parentNode}return null},"lookupPrefix"),lookupNamespaceURI:o(function(r){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,r))return t[r];e=e.nodeType==mp?e.ownerDocument:e.parentNode}return null},"lookupNamespaceURI"),isDefaultNamespace:o(function(r){var e=this.lookupPrefix(r);return e==null},"isDefaultNamespace")};function DL(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}o(DL,"_xmlEncoder");Gm(Ts,Sr);Gm(Ts,Sr.prototype);function $m(r,e){if(e(r))return!0;if(r=r.firstChild)do if($m(r,e))return!0;while(r=r.nextSibling)}o($m,"_visitNode");function Wm(){this.ownerDocument=this}o(Wm,"Document");function vee(r,e,t){r&&r._inc++;var n=t.namespaceURI;n===Km.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}o(vee,"_onAddAttribute");function _L(r,e,t,n){r&&r._inc++;var s=t.namespaceURI;s===Km.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}o(_L,"_onRemoveAttribute");function FN(r,e,t){if(r&&r._inc){r._inc++;var n=e.childNodes;if(t)n[n.length++]=t;else{for(var s=e.firstChild,i=0;s;)n[i++]=s,s=s.nextSibling;n.length=i,delete n[n.length]}}}o(FN,"_onUpdateChild");function RL(r,e){var t=e.previousSibling,n=e.nextSibling;return t?t.nextSibling=n:r.firstChild=n,n?n.previousSibling=t:r.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,FN(r.ownerDocument,r),e}o(RL,"_removeChild");function wee(r){return r&&(r.nodeType===Sr.DOCUMENT_NODE||r.nodeType===Sr.DOCUMENT_FRAGMENT_NODE||r.nodeType===Sr.ELEMENT_NODE)}o(wee,"hasValidParentNodeType");function See(r){return r&&(ka(r)||qN(r)||So(r)||r.nodeType===Sr.DOCUMENT_FRAGMENT_NODE||r.nodeType===Sr.COMMENT_NODE||r.nodeType===Sr.PROCESSING_INSTRUCTION_NODE)}o(See,"hasInsertableNodeType");function So(r){return r&&r.nodeType===Sr.DOCUMENT_TYPE_NODE}o(So,"isDocTypeNode");function ka(r){return r&&r.nodeType===Sr.ELEMENT_NODE}o(ka,"isElementNode");function qN(r){return r&&r.nodeType===Sr.TEXT_NODE}o(qN,"isTextNode");function yL(r,e){var t=r.childNodes||[];if(Oa(t,ka)||So(e))return!1;var n=Oa(t,So);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}o(yL,"isElementInsertionPossible");function vL(r,e){var t=r.childNodes||[];function n(i){return ka(i)&&i!==e}if(o(n,"hasElementChildThatIsNotChild"),Oa(t,n))return!1;var s=Oa(t,So);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}o(vL,"isElementReplacementPossible");function Eee(r,e,t){if(!wee(r))throw new rn(xs,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new rn(TL,"child not in parent");if(!See(e)||So(e)&&r.nodeType!==Sr.DOCUMENT_NODE)throw new rn(xs,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}o(Eee,"assertPreInsertionValidity1to5");function Aee(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Sr.DOCUMENT_FRAGMENT_NODE){var i=s.filter(ka);if(i.length>1||Oa(s,qN))throw new rn(xs,"More than one element or text in fragment");if(i.length===1&&!yL(r,t))throw new rn(xs,"Element in fragment can not be inserted before doctype")}if(ka(e)&&!yL(r,t))throw new rn(xs,"Only one element can be added and only after doctype");if(So(e)){if(Oa(n,So))throw new rn(xs,"Only one doctype is allowed");var a=Oa(n,ka);if(t&&n.indexOf(a)<n.indexOf(t))throw new rn(xs,"Doctype can only be inserted before an element");if(!t&&a)throw new rn(xs,"Doctype can not be appended since element is present")}}o(Aee,"assertPreInsertionValidityInDocument");function PL(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Sr.DOCUMENT_FRAGMENT_NODE){var i=s.filter(ka);if(i.length>1||Oa(s,qN))throw new rn(xs,"More than one element or text in fragment");if(i.length===1&&!vL(r,t))throw new rn(xs,"Element in fragment can not be inserted before doctype")}if(ka(e)&&!vL(r,t))throw new rn(xs,"Only one element can be added and only after doctype");if(So(e)){let l=function(f){return So(f)&&f!==t};var u=l;if(o(l,"hasDoctypeChildThatIsNotChild"),Oa(n,l))throw new rn(xs,"Only one doctype is allowed");var a=Oa(n,ka);if(t&&n.indexOf(a)<n.indexOf(t))throw new rn(xs,"Doctype can only be inserted before an element")}}o(PL,"assertPreReplacementValidityInDocument");function _S(r,e,t,n){Eee(r,e,t),r.nodeType===Sr.DOCUMENT_NODE&&(n||Aee)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===wo){var i=e.firstChild;if(i==null)return e;var a=e.lastChild}else i=a=e;var u=t?t.previousSibling:r.lastChild;i.previousSibling=u,a.nextSibling=t,u?u.nextSibling=i:r.firstChild=i,t==null?r.lastChild=a:t.previousSibling=a;do{i.parentNode=r;var l=r.ownerDocument||r;Xm(i,l)}while(i!==a&&(i=i.nextSibling));return FN(r.ownerDocument||r,r),e.nodeType==wo&&(e.firstChild=e.lastChild=null),e}o(_S,"_insertBefore");function Xm(r,e){if(r.ownerDocument!==e){if(r.ownerDocument=e,r.nodeType===Si&&r.attributes)for(var t=0;t<r.attributes.length;t++){var n=r.attributes.item(t);n&&(n.ownerDocument=e)}for(var s=r.firstChild;s;)Xm(s,e),s=s.nextSibling}}o(Xm,"_updateOwnerDocument");function Cee(r,e){e.parentNode&&e.parentNode.removeChild(e),e.parentNode=r,e.previousSibling=r.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:r.firstChild=e,r.lastChild=e,FN(r.ownerDocument,r,e);var t=r.ownerDocument||r;return Xm(e,t),e}o(Cee,"_appendSingleChild");Wm.prototype={nodeName:"#document",nodeType:xL,doctype:null,documentElement:null,_inc:1,insertBefore:o(function(r,e){if(r.nodeType==wo){for(var t=r.firstChild;t;){var n=t.nextSibling;this.insertBefore(t,e),t=n}return r}return _S(this,r,e),Xm(r,this),this.documentElement===null&&r.nodeType===Si&&(this.documentElement=r),r},"insertBefore"),removeChild:o(function(r){return this.documentElement==r&&(this.documentElement=null),RL(this,r)},"removeChild"),replaceChild:o(function(r,e){_S(this,r,e,PL),Xm(r,this),e&&this.removeChild(e),ka(r)&&(this.documentElement=r)},"replaceChild"),importNode:o(function(r,e){return UL(this,r,e)},"importNode"),getElementById:o(function(r){var e=null;return $m(this.documentElement,function(t){if(t.nodeType==Si&&t.getAttribute("id")==r)return e=t,!0}),e},"getElementById"),getElementsByClassName:o(function(r){var e=pL(r);return new gp(this,function(t){var n=[];return e.length>0&&$m(t.documentElement,function(s){if(s!==t&&s.nodeType===Si){var i=s.getAttribute("class");if(i){var a=r===i;if(!a){var u=pL(i);a=e.every(mee(u))}a&&n.push(s)}}}),n})},"getElementsByClassName"),createElement:o(function(r){var e=new Nc;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new vo;var t=e.attributes=new DS;return t._ownerElement=e,e},"createElement"),createDocumentFragment:o(function(){var r=new OS;return r.ownerDocument=this,r.childNodes=new vo,r},"createDocumentFragment"),createTextNode:o(function(r){var e=new HN;return e.ownerDocument=this,e.appendData(r),e},"createTextNode"),createComment:o(function(r){var e=new KN;return e.ownerDocument=this,e.appendData(r),e},"createComment"),createCDATASection:o(function(r){var e=new $N;return e.ownerDocument=this,e.appendData(r),e},"createCDATASection"),createProcessingInstruction:o(function(r,e){var t=new GN;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},"createProcessingInstruction"),createAttribute:o(function(r){var e=new RS;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},"createAttribute"),createEntityReference:o(function(r){var e=new XN;return e.ownerDocument=this,e.nodeName=r,e},"createEntityReference"),createElementNS:o(function(r,e){var t=new Nc,n=e.split(":"),s=t.attributes=new DS;return t.childNodes=new vo,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=r,n.length==2?(t.prefix=n[0],t.localName=n[1]):t.localName=e,s._ownerElement=t,t},"createElementNS"),createAttributeNS:o(function(r,e){var t=new RS,n=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=r,t.specified=!0,n.length==2?(t.prefix=n[0],t.localName=n[1]):t.localName=e,t},"createAttributeNS")};Ns(Wm,Sr);function Nc(){this._nsMap={}}o(Nc,"Element");Nc.prototype={nodeType:Si,hasAttribute:o(function(r){return this.getAttributeNode(r)!=null},"hasAttribute"),getAttribute:o(function(r){var e=this.getAttributeNode(r);return e&&e.value||""},"getAttribute"),getAttributeNode:o(function(r){return this.attributes.getNamedItem(r)},"getAttributeNode"),setAttribute:o(function(r,e){var t=this.ownerDocument.createAttribute(r);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},"setAttribute"),removeAttribute:o(function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e)},"removeAttribute"),appendChild:o(function(r){return r.nodeType===wo?this.insertBefore(r,null):Cee(this,r)},"appendChild"),setAttributeNode:o(function(r){return this.attributes.setNamedItem(r)},"setAttributeNode"),setAttributeNodeNS:o(function(r){return this.attributes.setNamedItemNS(r)},"setAttributeNodeNS"),removeAttributeNode:o(function(r){return this.attributes.removeNamedItem(r.nodeName)},"removeAttributeNode"),removeAttributeNS:o(function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t)},"removeAttributeNS"),hasAttributeNS:o(function(r,e){return this.getAttributeNodeNS(r,e)!=null},"hasAttributeNS"),getAttributeNS:o(function(r,e){var t=this.getAttributeNodeNS(r,e);return t&&t.value||""},"getAttributeNS"),setAttributeNS:o(function(r,e,t){var n=this.ownerDocument.createAttributeNS(r,e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},"setAttributeNS"),getAttributeNodeNS:o(function(r,e){return this.attributes.getNamedItemNS(r,e)},"getAttributeNodeNS"),getElementsByTagName:o(function(r){return new gp(this,function(e){var t=[];return $m(e,function(n){n!==e&&n.nodeType==Si&&(r==="*"||n.tagName==r)&&t.push(n)}),t})},"getElementsByTagName"),getElementsByTagNameNS:o(function(r,e){return new gp(this,function(t){var n=[];return $m(t,function(s){s!==t&&s.nodeType===Si&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&n.push(s)}),n})},"getElementsByTagNameNS")};Wm.prototype.getElementsByTagName=Nc.prototype.getElementsByTagName;Wm.prototype.getElementsByTagNameNS=Nc.prototype.getElementsByTagNameNS;Ns(Nc,Sr);function RS(){}o(RS,"Attr");RS.prototype.nodeType=mp;Ns(RS,Sr);function Jm(){}o(Jm,"CharacterData");Jm.prototype={data:"",substringData:o(function(r,e){return this.data.substring(r,r+e)},"substringData"),appendData:o(function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},"appendData"),insertData:o(function(r,e){this.replaceData(r,0,e)},"insertData"),appendChild:o(function(r){throw new Error(Nn[xs])},"appendChild"),deleteData:o(function(r,e){this.replaceData(r,e,"")},"deleteData"),replaceData:o(function(r,e,t){var n=this.data.substring(0,r),s=this.data.substring(r+e);t=n+t+s,this.nodeValue=this.data=t,this.length=t.length},"replaceData")};Ns(Jm,Sr);function HN(){}o(HN,"Text");HN.prototype={nodeName:"#text",nodeType:BS,splitText:o(function(r){var e=this.data,t=e.substring(r);e=e.substring(0,r),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n},"splitText")};Ns(HN,Jm);function KN(){}o(KN,"Comment");KN.prototype={nodeName:"#comment",nodeType:bL};Ns(KN,Jm);function $N(){}o($N,"CDATASection");$N.prototype={nodeName:"#cdata-section",nodeType:EL};Ns($N,Jm);function PS(){}o(PS,"DocumentType");PS.prototype.nodeType=NL;Ns(PS,Sr);function OL(){}o(OL,"Notation");OL.prototype.nodeType=yee;Ns(OL,Sr);function kL(){}o(kL,"Entity");kL.prototype.nodeType=gee;Ns(kL,Sr);function XN(){}o(XN,"EntityReference");XN.prototype.nodeType=AL;Ns(XN,Sr);function OS(){}o(OS,"DocumentFragment");OS.prototype.nodeName="#document-fragment";OS.prototype.nodeType=wo;Ns(OS,Sr);function GN(){}o(GN,"ProcessingInstruction");GN.prototype.nodeType=CL;Ns(GN,Sr);function LL(){}o(LL,"XMLSerializer");LL.prototype.serializeToString=function(r,e,t){return VL.call(r,e,t)};Sr.prototype.toString=VL;function VL(r,e){var t=[],n=this.nodeType==9&&this.documentElement||this,s=n.prefix,i=n.namespaceURI;if(i&&s==null){var s=n.lookupPrefix(i);if(s==null)var a=[{namespace:i,prefix:null}]}return dp(this,t,r,e,a),t.join("")}o(VL,"nodeSerializeToString");function wL(r,e,t){var n=r.prefix||"",s=r.namespaceURI;if(!s||n==="xml"&&s===Km.XML||s===Km.XMLNS)return!1;for(var i=t.length;i--;){var a=t[i];if(a.prefix===n)return a.namespace!==s}return!0}o(wL,"needNamespaceDefine");function UN(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,DL),'"')}o(UN,"addSerializedAttribute");function dp(r,e,t,n,s){if(s||(s=[]),n)if(r=n(r),r){if(typeof r=="string"){e.push(r);return}}else return;switch(r.nodeType){case Si:var i=r.attributes,a=i.length,b=r.firstChild,u=r.tagName;t=Km.isHTML(r.namespaceURI)||t;var l=u;if(!t&&!r.prefix&&r.namespaceURI){for(var f,h=0;h<i.length;h++)if(i.item(h).name==="xmlns"){f=i.item(h).value;break}if(!f)for(var m=s.length-1;m>=0;m--){var g=s[m];if(g.prefix===""&&g.namespace===r.namespaceURI){f=g.namespace;break}}if(f!==r.namespaceURI)for(var m=s.length-1;m>=0;m--){var g=s[m];if(g.namespace===r.namespaceURI){g.prefix&&(l=g.prefix+":"+u);break}}}e.push("<",l);for(var w=0;w<a;w++){var y=i.item(w);y.prefix=="xmlns"?s.push({prefix:y.localName,namespace:y.value}):y.nodeName=="xmlns"&&s.push({prefix:"",namespace:y.value})}for(var w=0;w<a;w++){var y=i.item(w);if(wL(y,t,s)){var S=y.prefix||"",E=y.namespaceURI;UN(e,S?"xmlns:"+S:"xmlns",E),s.push({prefix:S,namespace:E})}dp(y,e,t,n,s)}if(u===l&&wL(r,t,s)){var S=r.prefix||"",E=r.namespaceURI;UN(e,S?"xmlns:"+S:"xmlns",E),s.push({prefix:S,namespace:E})}if(b||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(e.push(">"),t&&/^script$/i.test(u))for(;b;)b.data?e.push(b.data):dp(b,e,t,n,s.slice()),b=b.nextSibling;else for(;b;)dp(b,e,t,n,s.slice()),b=b.nextSibling;e.push("</",l,">")}else e.push("/>");return;case xL:case wo:for(var b=r.firstChild;b;)dp(b,e,t,n,s.slice()),b=b.nextSibling;return;case mp:return UN(e,r.name,r.value);case BS:return e.push(r.data.replace(/[<&>]/g,DL));case EL:return e.push("<![CDATA[",r.data,"]]>");case bL:return e.push("<!--",r.data,"-->");case NL:var T=r.publicId,A=r.systemId;if(e.push("<!DOCTYPE ",r.name),T)e.push(" PUBLIC ",T),A&&A!="."&&e.push(" ",A),e.push(">");else if(A&&A!=".")e.push(" SYSTEM ",A,">");else{var C=r.internalSubset;C&&e.push(" [",C,"]"),e.push(">")}return;case CL:return e.push("<?",r.target," ",r.data,"?>");case AL:return e.push("&",r.nodeName,";");default:e.push("??",r.nodeName)}}o(dp,"serializeToString");function UL(r,e,t){var n;switch(e.nodeType){case Si:n=e.cloneNode(!1),n.ownerDocument=r;case wo:break;case mp:t=!0;break}if(n||(n=e.cloneNode(!1)),n.ownerDocument=r,n.parentNode=null,t)for(var s=e.firstChild;s;)n.appendChild(UL(r,s,t)),s=s.nextSibling;return n}o(UL,"importNode");function MN(r,e,t){var n=new e.constructor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var i=e[s];typeof i!="object"&&i!=n[s]&&(n[s]=i)}switch(e.childNodes&&(n.childNodes=new vo),n.ownerDocument=r,n.nodeType){case Si:var a=e.attributes,u=n.attributes=new DS,l=a.length;u._ownerElement=n;for(var f=0;f<l;f++)n.setAttributeNode(MN(r,a.item(f),!0));break;case mp:t=!0}if(t)for(var h=e.firstChild;h;)n.appendChild(MN(r,h,t)),h=h.nextSibling;return n}o(MN,"cloneNode");function ML(r,e,t){r[e]=t}o(ML,"__set__");try{if(Object.defineProperty){let r=function(e){switch(e.nodeType){case Si:case wo:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(r(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};bee=r,o(r,"getTextContent"),Object.defineProperty(gp.prototype,"length",{get:o(function(){return jN(this),this.$$length},"get")}),Object.defineProperty(Sr.prototype,"textContent",{get:o(function(){return r(this)},"get"),set:o(function(e){switch(this.nodeType){case Si:case wo:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}},"set")}),ML=o(function(e,t,n){e["$$"+t]=n},"__set__")}}catch{}var bee;Vu.DocumentType=PS;Vu.DOMException=rn;Vu.DOMImplementation=BL;Vu.Element=Nc;Vu.Node=Sr;Vu.NodeList=vo;Vu.XMLSerializer=LL});var FL=ye(zm=>{"use strict";var jL=Hm().freeze;zm.XML_ENTITIES=jL({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});zm.HTML_ENTITIES=jL({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
64
- `,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});zm.entityMap=zm.HTML_ENTITIES});var JL=ye(zN=>{"use strict";var eg=Hm().NAMESPACE,JN=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,qL=new RegExp("[\\-\\.0-9"+JN.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),HL=new RegExp("^"+JN.source+qL.source+"*(?::"+JN.source+qL.source+"*)?$"),Ym=0,Uu=1,yp=2,Qm=3,vp=4,wp=5,Zm=6,kS=7;function Sp(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Sp)}o(Sp,"ParseError");Sp.prototype=new Error;Sp.prototype.name=Sp.name;function XL(){}o(XL,"XMLReader");XL.prototype={parse:o(function(r,e,t){var n=this.domBuilder;n.startDocument(),GL(e,e={}),xee(r,e,t,n,this.errorHandler),n.endDocument()},"parse")};function xee(r,e,t,n,s){function i(Z){if(Z>65535){Z-=65536;var fe=55296+(Z>>10),Se=56320+(Z&1023);return String.fromCharCode(fe,Se)}else return String.fromCharCode(Z)}o(i,"fixedFromCharCode");function a(Z){var fe=Z.slice(1,-1);return Object.hasOwnProperty.call(t,fe)?t[fe]:fe.charAt(0)==="#"?i(parseInt(fe.substr(1).replace("x","0x"))):(s.error("entity not found:"+Z),Z)}o(a,"entityReplacer");function u(Z){if(Z>S){var fe=r.substring(S,Z).replace(/&#?\w+;/g,a);g&&l(S),n.characters(fe,0,Z-S),S=Z}}o(u,"appendText");function l(Z,fe){for(;Z>=h&&(fe=m.exec(r));)f=fe.index,h=f+fe[0].length,g.lineNumber++;g.columnNumber=Z-f+1}o(l,"position");for(var f=0,h=0,m=/.*(?:\r\n?|\n)|.*$/g,g=n.locator,w=[{currentNSMap:e}],y={},S=0;;){try{var E=r.indexOf("<",S);if(E<0){if(!r.substr(S).match(/^\s*$/)){var b=n.doc,T=b.createTextNode(r.substr(S));b.appendChild(T),n.currentElement=T}return}switch(E>S&&u(E),r.charAt(E+1)){case"/":var K=r.indexOf(">",E+3),A=r.substring(E+2,K).replace(/[ \t\n\r]+$/g,""),C=w.pop();K<0?(A=r.substring(E+2).replace(/[\s<].*/,""),s.error("end tag name: "+A+" is not complete:"+C.tagName),K=E+1+A.length):A.match(/\s</)&&(A=A.replace(/[\s<].*/,""),s.error("end tag name: "+A+" maybe not complete"),K=E+1+A.length);var x=C.localNSMap,B=C.tagName==A,F=B||C.tagName&&C.tagName.toLowerCase()==A.toLowerCase();if(F){if(n.endElement(C.uri,C.localName,A),x)for(var R in x)Object.prototype.hasOwnProperty.call(x,R)&&n.endPrefixMapping(R);B||s.fatalError("end tag name: "+A+" is not match the current start tagName:"+C.tagName)}else w.push(C);K++;break;case"?":g&&l(E),K=Dee(r,E,n);break;case"!":g&&l(E),K=Bee(r,E,n,s);break;default:g&&l(E);var H=new WL,q=w[w.length-1].currentNSMap,K=Nee(r,E,H,q,a,s),G=H.length;if(!H.closed&&Iee(r,K,H.tagName,y)&&(H.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),g&&G){for(var he=KL(g,{}),le=0;le<G;le++){var oe=H[le];l(oe.offset),oe.locator=KL(g,{})}n.locator=he,$L(H,n,q)&&w.push(H),n.locator=g}else $L(H,n,q)&&w.push(H);eg.isHTML(H.uri)&&!H.closed?K=Tee(r,K,H.tagName,a,n):K++}}catch(Z){if(Z instanceof Sp)throw Z;s.error("element parse error: "+Z),K=-1}K>S?S=K:u(Math.max(E,S)+1)}}o(xee,"parse");function KL(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}o(KL,"copyLocator");function Nee(r,e,t,n,s,i){function a(w,y,S){t.attributeNames.hasOwnProperty(w)&&i.fatalError("Attribute "+w+" redefined"),t.addValue(w,y.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),S)}o(a,"addAttribute");for(var u,l,f=++e,h=Ym;;){var m=r.charAt(f);switch(m){case"=":if(h===Uu)u=r.slice(e,f),h=Qm;else if(h===yp)h=Qm;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(h===Qm||h===Uu)if(h===Uu&&(i.warning('attribute value must after "="'),u=r.slice(e,f)),e=f+1,f=r.indexOf(m,e),f>0)l=r.slice(e,f),a(u,l,e-1),h=wp;else throw new Error("attribute value no end '"+m+"' match");else if(h==vp)l=r.slice(e,f),a(u,l,e),i.warning('attribute "'+u+'" missed start quot('+m+")!!"),e=f+1,h=wp;else throw new Error('attribute value must after "="');break;case"/":switch(h){case Ym:t.setTagName(r.slice(e,f));case wp:case Zm:case kS:h=kS,t.closed=!0;case vp:case Uu:break;case yp:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),h==Ym&&t.setTagName(r.slice(e,f)),f;case">":switch(h){case Ym:t.setTagName(r.slice(e,f));case wp:case Zm:case kS:break;case vp:case Uu:l=r.slice(e,f),l.slice(-1)==="/"&&(t.closed=!0,l=l.slice(0,-1));case yp:h===yp&&(l=u),h==vp?(i.warning('attribute "'+l+'" missed quot(")!'),a(u,l,e)):((!eg.isHTML(n[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),a(l,l,e));break;case Qm:throw new Error("attribute value missed!!")}return f;case"\x80":m=" ";default:if(m<=" ")switch(h){case Ym:t.setTagName(r.slice(e,f)),h=Zm;break;case Uu:u=r.slice(e,f),h=yp;break;case vp:var l=r.slice(e,f);i.warning('attribute "'+l+'" missed quot(")!!'),a(u,l,e);case wp:h=Zm;break}else switch(h){case yp:var g=t.tagName;(!eg.isHTML(n[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+u+'" missed value!! "'+u+'" instead2!!'),a(u,u,e),e=f,h=Uu;break;case wp:i.warning('attribute space is required"'+u+'"!!');case Zm:h=Uu,e=f;break;case Qm:h=vp,e=f;break;case kS:throw new Error("elements closed character '/' and '>' must be connected to")}}f++}}o(Nee,"parseElementStartPart");function $L(r,e,t){for(var n=r.tagName,s=null,m=r.length;m--;){var i=r[m],a=i.qName,u=i.value,g=a.indexOf(":");if(g>0)var l=i.prefix=a.slice(0,g),f=a.slice(g+1),h=l==="xmlns"&&f;else f=a,l=null,h=a==="xmlns"&&"";i.localName=f,h!==!1&&(s==null&&(s={},GL(t,t={})),t[h]=s[h]=u,i.uri=eg.XMLNS,e.startPrefixMapping(h,u))}for(var m=r.length;m--;){i=r[m];var l=i.prefix;l&&(l==="xml"&&(i.uri=eg.XML),l!=="xmlns"&&(i.uri=t[l||""]))}var g=n.indexOf(":");g>0?(l=r.prefix=n.slice(0,g),f=r.localName=n.slice(g+1)):(l=null,f=r.localName=n);var w=r.uri=t[l||""];if(e.startElement(w,f,n,r),r.closed){if(e.endElement(w,f,n),s)for(l in s)Object.prototype.hasOwnProperty.call(s,l)&&e.endPrefixMapping(l)}else return r.currentNSMap=t,r.localNSMap=s,!0}o($L,"appendElement");function Tee(r,e,t,n,s){if(/^(?:script|textarea)$/i.test(t)){var i=r.indexOf("</"+t+">",e),a=r.substring(e+1,i);if(/[&<]/.test(a))return/^script$/i.test(t)?(s.characters(a,0,a.length),i):(a=a.replace(/&#?\w+;/g,n),s.characters(a,0,a.length),i)}return e+1}o(Tee,"parseHtmlSpecialContent");function Iee(r,e,t,n){var s=n[t];return s==null&&(s=r.lastIndexOf("</"+t+">"),s<e&&(s=r.lastIndexOf("</"+t)),n[t]=s),s<e}o(Iee,"fixSelfClosed");function GL(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}o(GL,"_copy");function Bee(r,e,t,n){var s=r.charAt(e+2);switch(s){case"-":if(r.charAt(e+3)==="-"){var i=r.indexOf("-->",e+4);return i>e?(t.comment(r,e+4,i-e-4),i+3):(n.error("Unclosed comment"),-1)}else return-1;default:if(r.substr(e+3,6)=="CDATA["){var i=r.indexOf("]]>",e+9);return t.startCDATA(),t.characters(r,e+9,i-e-9),t.endCDATA(),i+3}var a=_ee(r,e),u=a.length;if(u>1&&/!doctype/i.test(a[0][0])){var l=a[1][0],f=!1,h=!1;u>3&&(/^public$/i.test(a[2][0])?(f=a[3][0],h=u>4&&a[4][0]):/^system$/i.test(a[2][0])&&(h=a[3][0]));var m=a[u-1];return t.startDTD(l,f,h),t.endDTD(),m.index+m[0].length}}return-1}o(Bee,"parseDCC");function Dee(r,e,t){var n=r.indexOf("?>",e);if(n){var s=r.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(s){var i=s[0].length;return t.processingInstruction(s[1],s[2]),n+2}else return-1}return-1}o(Dee,"parseInstruction");function WL(){this.attributeNames={}}o(WL,"ElementAttributes");WL.prototype={setTagName:o(function(r){if(!HL.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},"setTagName"),addValue:o(function(r,e,t){if(!HL.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t}},"addValue"),length:0,getLocalName:o(function(r){return this[r].localName},"getLocalName"),getLocator:o(function(r){return this[r].locator},"getLocator"),getQName:o(function(r){return this[r].qName},"getQName"),getURI:o(function(r){return this[r].uri},"getURI"),getValue:o(function(r){return this[r].value},"getValue")};function _ee(r,e){var t,n=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(r);t=s.exec(r);)if(n.push(t),t[1])return n}o(_ee,"split");zN.XMLReader=XL;zN.ParseError=Sp});var r8=ye(VS=>{"use strict";var Ree=Hm(),Pee=WN(),zL=FL(),ZL=JL(),Oee=Pee.DOMImplementation,YL=Ree.NAMESPACE,kee=ZL.ParseError,Lee=ZL.XMLReader;function e8(r){return r.replace(/\r[\n\u0085]/g,`
65
- `).replace(/[\r\u0085\u2028]/g,`
66
- `)}o(e8,"normalizeLineEndings");function t8(r){this.options=r||{locator:{}}}o(t8,"DOMParser");t8.prototype.parseFromString=function(r,e){var t=this.options,n=new Lee,s=t.domBuilder||new tg,i=t.errorHandler,a=t.locator,u=t.xmlns||{},l=/\/x?html?$/.test(e),f=l?zL.HTML_ENTITIES:zL.XML_ENTITIES;a&&s.setDocumentLocator(a),n.errorHandler=Vee(i,s,a),n.domBuilder=t.domBuilder||s,l&&(u[""]=YL.HTML),u.xml=u.xml||YL.XML;var h=t.normalizeLineEndings||e8;return r&&typeof r=="string"?n.parse(h(r),u,f):n.errorHandler.error("invalid doc source"),s.doc};function Vee(r,e,t){if(!r){if(e instanceof tg)return e;r=e}var n={},s=r instanceof Function;t=t||{};function i(a){var u=r[a];!u&&s&&(u=r.length==2?function(l){r(a,l)}:r),n[a]=u&&function(l){u("[xmldom "+a+"] "+l+YN(t))}||function(){}}return o(i,"build"),i("warning"),i("error"),i("fatalError"),n}o(Vee,"buildErrorHandler");function tg(){this.cdata=!1}o(tg,"DOMHandler");function Ep(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber}o(Ep,"position");tg.prototype={startDocument:o(function(){this.doc=new Oee().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},"startDocument"),startElement:o(function(r,e,t,n){var s=this.doc,i=s.createElementNS(r,t||e),a=n.length;LS(this,i),this.currentElement=i,this.locator&&Ep(this.locator,i);for(var u=0;u<a;u++){var r=n.getURI(u),l=n.getValue(u),t=n.getQName(u),f=s.createAttributeNS(r,t);this.locator&&Ep(n.getLocator(u),f),f.value=f.nodeValue=l,i.setAttributeNode(f)}},"startElement"),endElement:o(function(r,e,t){var n=this.currentElement,s=n.tagName;this.currentElement=n.parentNode},"endElement"),startPrefixMapping:o(function(r,e){},"startPrefixMapping"),endPrefixMapping:o(function(r){},"endPrefixMapping"),processingInstruction:o(function(r,e){var t=this.doc.createProcessingInstruction(r,e);this.locator&&Ep(this.locator,t),LS(this,t)},"processingInstruction"),ignorableWhitespace:o(function(r,e,t){},"ignorableWhitespace"),characters:o(function(r,e,t){if(r=QL.apply(this,arguments),r){if(this.cdata)var n=this.doc.createCDATASection(r);else var n=this.doc.createTextNode(r);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(r)&&this.doc.appendChild(n),this.locator&&Ep(this.locator,n)}},"characters"),skippedEntity:o(function(r){},"skippedEntity"),endDocument:o(function(){this.doc.normalize()},"endDocument"),setDocumentLocator:o(function(r){(this.locator=r)&&(r.lineNumber=0)},"setDocumentLocator"),comment:o(function(r,e,t){r=QL.apply(this,arguments);var n=this.doc.createComment(r);this.locator&&Ep(this.locator,n),LS(this,n)},"comment"),startCDATA:o(function(){this.cdata=!0},"startCDATA"),endCDATA:o(function(){this.cdata=!1},"endCDATA"),startDTD:o(function(r,e,t){var n=this.doc.implementation;if(n&&n.createDocumentType){var s=n.createDocumentType(r,e,t);this.locator&&Ep(this.locator,s),LS(this,s),this.doc.doctype=s}},"startDTD"),warning:o(function(r){console.warn("[xmldom warning] "+r,YN(this.locator))},"warning"),error:o(function(r){console.error("[xmldom error] "+r,YN(this.locator))},"error"),fatalError:o(function(r){throw new kee(r,this.locator)},"fatalError")};function YN(r){if(r)return`
67
- @`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}o(YN,"_locator");function QL(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}o(QL,"_toString");"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){tg.prototype[r]=function(){return null}});function LS(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e)}o(LS,"appendElement");VS.__DOMHandler=tg;VS.normalizeLineEndings=e8;VS.DOMParser=t8});var QN=ye(US=>{"use strict";var n8=WN();US.DOMImplementation=n8.DOMImplementation;US.XMLSerializer=n8.XMLSerializer;US.DOMParser=r8().DOMParser});var s8=ye(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});jS.EnvelopedSignature=void 0;var MS=NS(),ZN=cp(),Uee=class{static{o(this,"EnvelopedSignature")}constructor(){this.includeComments=!1,this.includeComments=!1}process(e,t){if(t.signatureNode==null){let i=MS.select1("./*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",e);return ZN.isNodeLike(i)&&i.parentNode&&i.parentNode.removeChild(i),e}let n=t.signatureNode,s=MS.select1(".//*[local-name(.)='SignatureValue']/text()",n);if(ZN.isTextNode(s)){let i=s.data,a=MS.select(".//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",e);for(let u of Array.isArray(a)?a:[]){let l=MS.select1(".//*[local-name(.)='SignatureValue']/text()",u);if(ZN.isTextNode(l)){let f=l.data;i===f&&u.parentNode&&u.parentNode.removeChild(u)}}}return e}getAlgorithmName(){return"http://www.w3.org/2000/09/xmldsig#enveloped-signature"}};jS.EnvelopedSignature=Uee});var i8=ye(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.Sha512=Mu.Sha256=Mu.Sha1=void 0;var eT=gt("crypto"),Mee=class{static{o(this,"Sha1")}constructor(){this.getHash=function(e){let t=eT.createHash("sha1");return t.update(e,"utf8"),t.digest("base64")},this.getAlgorithmName=function(){return"http://www.w3.org/2000/09/xmldsig#sha1"}}};Mu.Sha1=Mee;var jee=class{static{o(this,"Sha256")}constructor(){this.getHash=function(e){let t=eT.createHash("sha256");return t.update(e,"utf8"),t.digest("base64")},this.getAlgorithmName=function(){return"http://www.w3.org/2001/04/xmlenc#sha256"}}};Mu.Sha256=jee;var Fee=class{static{o(this,"Sha512")}constructor(){this.getHash=function(e){let t=eT.createHash("sha512");return t.update(e,"utf8"),t.digest("base64")},this.getAlgorithmName=function(){return"http://www.w3.org/2001/04/xmlenc#sha512"}}};Mu.Sha512=Fee});var tT=ye(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});FS.createOptionalCallbackFunction=void 0;function qee(r){return typeof r=="function"}o(qee,"isErrorFirstCallback");function Hee(r){return(...e)=>{let t=e[e.length-1];if(qee(t))try{let n=r(...e.slice(0,-1));t(null,n)}catch(n){t(n instanceof Error?n:new Error("Unknown error"))}else return r(...e)}}o(Hee,"createOptionalCallbackFunction");FS.createOptionalCallbackFunction=Hee});var a8=ye(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.HmacSha1=La.RsaSha512=La.RsaSha256=La.RsaSha1=void 0;var ju=gt("crypto"),Fu=tT(),Kee=class{static{o(this,"RsaSha1")}constructor(){this.getSignature=(0,Fu.createOptionalCallbackFunction)((e,t)=>{let n=ju.createSign("RSA-SHA1");return n.update(e),n.sign(t,"base64")}),this.verifySignature=(0,Fu.createOptionalCallbackFunction)((e,t,n)=>{let s=ju.createVerify("RSA-SHA1");return s.update(e),s.verify(t,n,"base64")}),this.getAlgorithmName=()=>"http://www.w3.org/2000/09/xmldsig#rsa-sha1"}};La.RsaSha1=Kee;var $ee=class{static{o(this,"RsaSha256")}constructor(){this.getSignature=(0,Fu.createOptionalCallbackFunction)((e,t)=>{let n=ju.createSign("RSA-SHA256");return n.update(e),n.sign(t,"base64")}),this.verifySignature=(0,Fu.createOptionalCallbackFunction)((e,t,n)=>{let s=ju.createVerify("RSA-SHA256");return s.update(e),s.verify(t,n,"base64")}),this.getAlgorithmName=()=>"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"}};La.RsaSha256=$ee;var Xee=class{static{o(this,"RsaSha512")}constructor(){this.getSignature=(0,Fu.createOptionalCallbackFunction)((e,t)=>{let n=ju.createSign("RSA-SHA512");return n.update(e),n.sign(t,"base64")}),this.verifySignature=(0,Fu.createOptionalCallbackFunction)((e,t,n)=>{let s=ju.createVerify("RSA-SHA512");return s.update(e),s.verify(t,n,"base64")}),this.getAlgorithmName=()=>"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"}};La.RsaSha512=Xee;var Gee=class{static{o(this,"HmacSha1")}constructor(){this.getSignature=(0,Fu.createOptionalCallbackFunction)((e,t)=>{let n=ju.createHmac("SHA1",t);return n.update(e),n.digest("base64")}),this.verifySignature=(0,Fu.createOptionalCallbackFunction)((e,t,n)=>{let s=ju.createHmac("SHA1",t);return s.update(e),s.digest("base64")===n}),this.getAlgorithmName=()=>"http://www.w3.org/2000/09/xmldsig#hmac-sha1"}};La.HmacSha1=Gee});var l8=ye(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});HS.SignedXml=void 0;var Gs=cp(),Tc=QN(),Wee=gt("util"),Ei=NS(),o8=PN(),Jee=s8(),u8=LN(),rT=i8(),qS=a8(),pr=qm(),nT=class Ap{static{o(this,"SignedXml")}constructor(e={}){this.signatureAlgorithm=void 0,this.canonicalizationAlgorithm=void 0,this.inclusiveNamespacesPrefixList=[],this.namespaceResolver={lookupNamespaceURI:o(function(){throw new Error("Not implemented")},"lookupNamespaceURI")},this.implicitTransforms=[],this.keyInfoAttributes={},this.getKeyInfoContent=Ap.getKeyInfoContent,this.getCertFromKeyInfo=Ap.getCertFromKeyInfo,this.id=0,this.signedXml="",this.signatureXml="",this.signatureNode=null,this.signatureValue="",this.originalXmlWithIds="",this.keyInfo=null,this.references=[],this.signedReferences=[],this.CanonicalizationAlgorithms={"http://www.w3.org/TR/2001/REC-xml-c14n-20010315":o8.C14nCanonicalization,"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments":o8.C14nCanonicalizationWithComments,"http://www.w3.org/2001/10/xml-exc-c14n#":u8.ExclusiveCanonicalization,"http://www.w3.org/2001/10/xml-exc-c14n#WithComments":u8.ExclusiveCanonicalizationWithComments,"http://www.w3.org/2000/09/xmldsig#enveloped-signature":Jee.EnvelopedSignature},this.HashAlgorithms={"http://www.w3.org/2000/09/xmldsig#sha1":rT.Sha1,"http://www.w3.org/2001/04/xmlenc#sha256":rT.Sha256,"http://www.w3.org/2001/04/xmlenc#sha512":rT.Sha512},this.SignatureAlgorithms={"http://www.w3.org/2000/09/xmldsig#rsa-sha1":qS.RsaSha1,"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256":qS.RsaSha256,"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512":qS.RsaSha512};let{idMode:t,idAttribute:n,privateKey:s,publicCert:i,signatureAlgorithm:a,canonicalizationAlgorithm:u,inclusiveNamespacesPrefixList:l,implicitTransforms:f,keyInfoAttributes:h,getKeyInfoContent:m,getCertFromKeyInfo:g}=e;this.idMode=t,this.idAttributes=["Id","ID","id"],n&&this.idAttributes.unshift(n),this.privateKey=s,this.publicCert=i,this.signatureAlgorithm=a??this.signatureAlgorithm,this.canonicalizationAlgorithm=u,typeof l=="string"?this.inclusiveNamespacesPrefixList=l.split(" "):pr.isArrayHasLength(l)&&(this.inclusiveNamespacesPrefixList=l),this.implicitTransforms=f??this.implicitTransforms,this.keyInfoAttributes=h??this.keyInfoAttributes,this.getKeyInfoContent=m??this.getKeyInfoContent,this.getCertFromKeyInfo=g??Ap.noop,this.CanonicalizationAlgorithms,this.HashAlgorithms,this.SignatureAlgorithms}enableHMAC(){this.SignatureAlgorithms={"http://www.w3.org/2000/09/xmldsig#hmac-sha1":qS.HmacSha1},this.getKeyInfoContent=Ap.noop}static getKeyInfoContent({publicCert:e,prefix:t}){if(e==null)return null;t=t?`${t}:`:"";let n="";Buffer.isBuffer(e)&&(e=e.toString("latin1"));let s=[];return typeof e=="string"&&(s=e.match(pr.EXTRACT_X509_CERTS)||[]),s.length>0&&(n=s.map(i=>`<${t}X509Certificate>${pr.pemToDer(i).toString("base64")}</${t}X509Certificate>`).join("")),`<${t}X509Data>${n}</${t}X509Data>`}static getCertFromKeyInfo(e){if(e!=null){let t=Ei.select1(".//*[local-name(.)='X509Certificate']",e);if(Gs.isNodeLike(t))return pr.derToPem(t.textContent??"","CERTIFICATE")}return null}checkSignature(e,t){if(t!=null&&typeof t!="function")throw new Error("Last parameter must be a callback function");this.signedXml=e;let n=new Tc.DOMParser().parseFromString(e);this.references=[];let s=this.getCanonSignedInfoXml(n);if(!s){if(t){t(new Error("Canonical signed info cannot be empty"),!1);return}throw new Error("Canonical signed info cannot be empty")}let a=new Tc.DOMParser().parseFromString(s,"text/xml").documentElement;if(!a){if(t){t(new Error("Could not parse unverifiedSignedInfoCanon into a document"),!1);return}throw new Error("Could not parse unverifiedSignedInfoCanon into a document")}let u=pr.findChildren(a,"Reference");if(!pr.isArrayHasLength(u)){if(t){t(new Error("could not find any Reference elements"),!1);return}throw new Error("could not find any Reference elements")}for(let m of u)this.loadReference(m);if(!this.getReferences().every(m=>this.validateReference(m,n))){if(this.signedReferences=[],this.references.forEach(m=>{m.signedReference=void 0}),t){t(new Error("Could not validate all references"),!1);return}return!1}let l=this.findSignatureAlgorithm(this.signatureAlgorithm),f=this.getCertFromKeyInfo(this.keyInfo)||this.publicCert||this.privateKey;if(f==null)throw new Error("KeyInfo or publicCert or privateKey is required to validate signature");if(l.verifySignature(s,f,this.signatureValue)===!0)if(t)t(null,!0);else return!0;else if(this.signedReferences=[],this.references.forEach(m=>{m.signedReference=void 0}),t){t(new Error(`invalid signature: the signature value ${this.signatureValue} is incorrect`));return}else throw new Error(`invalid signature: the signature value ${this.signatureValue} is incorrect`)}getCanonSignedInfoXml(e){if(this.signatureNode==null)throw new Error("No signature found.");if(typeof this.canonicalizationAlgorithm!="string")throw new Error("Missing canonicalizationAlgorithm when trying to get signed info for XML");let t=pr.findChildren(this.signatureNode,"SignedInfo");if(t.length===0)throw new Error("could not find SignedInfo element in the message");if(t.length>1)throw new Error("could not get canonicalized signed info for a signature that contains multiple SignedInfo nodes");if((this.canonicalizationAlgorithm==="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"||this.canonicalizationAlgorithm==="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments")&&(!e||typeof e!="object"))throw new Error("When canonicalization method is non-exclusive, whole xml dom must be provided as an argument");let s={ancestorNamespaces:pr.findAncestorNs(e,"//*[local-name()='SignedInfo']")};return this.getCanonXml([this.canonicalizationAlgorithm],t[0],s)}getCanonReferenceXml(e,t,n){Array.isArray(t.transforms)&&(t.ancestorNamespaces=pr.findAncestorNs(e,t.xpath,this.namespaceResolver));let s={inclusiveNamespacesPrefixList:t.inclusiveNamespacesPrefixList,ancestorNamespaces:t.ancestorNamespaces};return this.getCanonXml(t.transforms,n,s)}calculateSignatureValue(e,t){let n=this.getCanonSignedInfoXml(e),s=this.findSignatureAlgorithm(this.signatureAlgorithm);if(this.privateKey==null)throw new Error("Private key is required to compute signature");typeof t=="function"?s.getSignature(n,this.privateKey,t):this.signatureValue=s.getSignature(n,this.privateKey)}findSignatureAlgorithm(e){if(e==null)throw new Error("signatureAlgorithm is required");let t=this.SignatureAlgorithms[e];if(t)return new t;throw new Error(`signature algorithm '${e}' is not supported`)}findCanonicalizationAlgorithm(e){if(e!=null){let t=this.CanonicalizationAlgorithms[e];if(t)return new t}throw new Error(`canonicalization algorithm '${e}' is not supported`)}findHashAlgorithm(e){let t=this.HashAlgorithms[e];if(t)return new t;throw new Error(`hash algorithm '${e}' is not supported`)}validateElementAgainstReferences(e,t){let n;if(typeof e=="string"){let s=Ei.select1(e,t);Gs.assertIsElementNode(s),n=s}else n=e;for(let s of this.getReferences()){let i=s.uri?.[0]==="#"?s.uri.substring(1):s.uri;for(let f of this.idAttributes){let h=n.getAttribute(f);if(i===h){s.xpath=`//*[@*[local-name(.)='${f}']='${i}']`;break}}let a=this.getCanonReferenceXml(t,s,n),l=this.findHashAlgorithm(s.digestAlgorithm).getHash(a);if(pr.validateDigestValue(l,s.digestValue))return s}throw new Error("No references passed validation")}validateReference(e,t){let n=e.uri?.[0]==="#"?e.uri.substring(1):e.uri,s=null;if(n==="")s=Ei.select1("//*",t);else{if(n?.indexOf("'")!==-1)throw new Error("Cannot validate a uri with quotes inside it");{let l=0;for(let f of this.idAttributes){let h=`//*[@*[local-name(.)='${f}']='${n}']`,m=Ei.select(h,t);if(pr.isArrayHasLength(m)){if(l+=m.length,l>1)throw new Error("Cannot validate a document which contains multiple elements with the same value for the ID / Id / Id attributes, in order to prevent signature wrapping attack.");s=m[0],e.xpath=h}}}}if(e.getValidatedNode=(0,Wee.deprecate)(l=>{if(l=l||e.xpath,typeof l!="string"||e.validationError!=null)return null;let f=Ei.select1(l,t);return Gs.isNodeLike(f)?f:null},"`ref.getValidatedNode()` is deprecated and insecure. Use `ref.signedReference` or `this.getSignedReferences()` instead."),!Gs.isNodeLike(s)){let l=new Error(`invalid signature: the signature references an element with uri ${e.uri} but could not find such element in the xml`);return e.validationError=l,!1}let i=this.getCanonReferenceXml(t,e,s),u=this.findHashAlgorithm(e.digestAlgorithm).getHash(i);if(!pr.validateDigestValue(u,e.digestValue)){let l=new Error(`invalid signature: for uri ${e.uri} calculated digest is ${u} but the xml to validate supplies digest ${e.digestValue}`);return e.validationError=l,!1}return this.signedReferences.push(i),e.signedReference=i,!0}findSignatures(e){let t=Ei.select("//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",e);return Gs.isArrayOfNodes(t)?t:[]}loadSignature(e){typeof e=="string"?this.signatureNode=e=new Tc.DOMParser().parseFromString(e):this.signatureNode=e,this.signatureXml=e.toString();let t=Ei.select1(".//*[local-name(.)='CanonicalizationMethod']/@Algorithm",e);if(!Gs.isNodeLike(t))throw new Error("could not find CanonicalizationMethod/@Algorithm element");Gs.isAttributeNode(t)&&(this.canonicalizationAlgorithm=t.value);let n=Ei.select1(".//*[local-name(.)='SignatureMethod']/@Algorithm",e);Gs.isAttributeNode(n)&&(this.signatureAlgorithm=n.value);let s=pr.findChildren(this.signatureNode,"SignedInfo");if(!pr.isArrayHasLength(s))throw new Error("no signed info node found");if(s.length>1)throw new Error("could not load signature that contains multiple SignedInfo nodes");let i=this.canonicalizationAlgorithm;(!i||i==="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"||i==="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments")&&(i="http://www.w3.org/2001/10/xml-exc-c14n#");let a=this.getCanonXml([i],s[0]),l=new Tc.DOMParser().parseFromString(a,"text/xml").documentElement;this.references=[];let f=pr.findChildren(l,"Reference");if(!pr.isArrayHasLength(f))throw new Error("could not find any Reference elements");for(let g of f)this.loadReference(g);let h=Ei.select1(".//*[local-name(.)='SignatureValue']/text()",e);Gs.isTextNode(h)&&(this.signatureValue=h.data.replace(/\r?\n/g,""));let m=Ei.select1(".//*[local-name(.)='KeyInfo']",e);Gs.isNodeLike(m)&&(this.keyInfo=m)}loadReference(e){let t=pr.findChildren(e,"DigestMethod");if(t.length===0)throw new Error(`could not find DigestMethod in reference ${e.toString()}`);let n=t[0],s=pr.findAttr(n,"Algorithm");if(!s)throw new Error(`could not find Algorithm attribute in node ${n.toString()}`);let i=s.value;if(t=pr.findChildren(e,"DigestValue"),t.length===0)throw new Error(`could not find DigestValue node in reference ${e.toString()}`);if(t.length>1)throw new Error(`could not load reference for a node that contains multiple DigestValue nodes: ${e.toString()}`);let a=t[0].textContent;if(!a)throw new Error(`could not find the value of DigestValue in ${e.toString()}`);let u=[],l=[];if(t=pr.findChildren(e,"Transforms"),t.length!==0){let h=t[0],m=pr.findChildren(h,"Transform");for(let w of m){let y=pr.findAttr(w,"Algorithm");y&&u.push(y.value)}let g=pr.findChildren(m[m.length-1],"InclusiveNamespaces");pr.isArrayHasLength(g)&&(l=g.flatMap(w=>(w.getAttribute("PrefixList")??"").split(" ")).filter(w=>w.length>0))}pr.isArrayHasLength(this.implicitTransforms)&&this.implicitTransforms.forEach(function(h){u.push(h)}),(u.length===0||u[u.length-1]==="http://www.w3.org/2000/09/xmldsig#enveloped-signature")&&u.push("http://www.w3.org/TR/2001/REC-xml-c14n-20010315");let f=Gs.isElementNode(e)&&e.getAttribute("URI")||void 0;this.addReference({transforms:u,digestAlgorithm:i,uri:f,digestValue:a,inclusiveNamespacesPrefixList:l,isEmptyUri:!1})}addReference({xpath:e,transforms:t,digestAlgorithm:n,uri:s="",digestValue:i,inclusiveNamespacesPrefixList:a=[],isEmptyUri:u=!1}){if(n==null)throw new Error("digestAlgorithm is required");if(!pr.isArrayHasLength(t))throw new Error("transforms must contain at least one transform algorithm");this.references.push({xpath:e,transforms:t,digestAlgorithm:n,uri:s,digestValue:i,inclusiveNamespacesPrefixList:a,isEmptyUri:u,getValidatedNode:o(()=>{throw new Error("Reference has not been validated yet; Did you call `sig.checkSignature()`?")},"getValidatedNode")})}getReferences(){return this.references}getSignedReferences(){return[...this.signedReferences]}computeSignature(e,t,n){let s;typeof t=="function"&&n==null?(s=t,t={}):(s=n,t=t??{});let i=new Tc.DOMParser().parseFromString(e),a="xmlns",u=[],l,f=["append","prepend","before","after"],h=t.prefix,m=t.attrs||{},g=t.location||{},w=t.existingPrefixes||{};if(this.namespaceResolver={lookupNamespaceURI:o(function(B){return B?w[B]:null},"lookupNamespaceURI")},g.reference=g.reference||"/*",g.action=g.action||"append",f.indexOf(g.action)===-1){let B=new Error(`location.action option has an invalid action: ${g.action}, must be any of the following values: ${f.join(", ")}`);if(s){s(B);return}else throw B}h?(a+=`:${h}`,l=`${h}:`):l="",Object.keys(m).forEach(function(B){B!=="xmlns"&&B!==a&&u.push(`${B}="${m[B]}"`)}),u.push(`${a}="http://www.w3.org/2000/09/xmldsig#"`);let y=`<${l}Signature ${u.join(" ")}>`;y+=this.createSignedInfo(i,h),y+=this.getKeyInfo(h),y+=`</${l}Signature>`,this.originalXmlWithIds=i.toString();let S="";Object.keys(w).forEach(function(B){S+=`xmlns:${B}="${w[B]}" `});let E=`<Dummy ${S}>${y}</Dummy>`,T=new Tc.DOMParser().parseFromString(E).documentElement.firstChild,A=Ei.select1(g.reference,i);if(!Gs.isNodeLike(A)){let B=new Error(`the following xpath cannot be used because it was not found: ${g.reference}`);if(s){s(B);return}else throw B}if(g.action==="append")A.appendChild(T);else if(g.action==="prepend")A.insertBefore(T,A.firstChild);else if(g.action==="before"){if(A.parentNode==null)throw new Error("`location.reference` refers to the root node (by default), so we can't insert `before`");A.parentNode.insertBefore(T,A)}else if(g.action==="after"){if(A.parentNode==null)throw new Error("`location.reference` refers to the root node (by default), so we can't insert `after`");A.parentNode.insertBefore(T,A.nextSibling)}this.signatureNode=T;let C=pr.findChildren(this.signatureNode,"SignedInfo");if(C.length===0){let B=new Error("could not find SignedInfo element in the message");if(s){s(B);return}else throw B}let x=C[0];typeof s=="function"?this.calculateSignatureValue(i,(B,F)=>{B?s(B):(this.signatureValue=F||"",T.insertBefore(this.createSignature(h),x.nextSibling),this.signatureXml=T.toString(),this.signedXml=i.toString(),s(null,this))}):(this.calculateSignatureValue(i),T.insertBefore(this.createSignature(h),x.nextSibling),this.signatureXml=T.toString(),this.signedXml=i.toString())}getKeyInfo(e){let t=e?`${e}:`:"",n="";this.keyInfoAttributes&&Object.keys(this.keyInfoAttributes).forEach(i=>{n+=` ${i}="${this.keyInfoAttributes[i]}"`});let s=this.getKeyInfoContent({publicCert:this.publicCert,prefix:e});return n||s?`<${t}KeyInfo${n}>${s}</${t}KeyInfo>`:""}createReferences(e,t){let n="";t=t||"",t=t&&`${t}:`;for(let s of this.getReferences()){let i=Ei.selectWithResolver(s.xpath??"",e,this.namespaceResolver);if(!pr.isArrayHasLength(i))throw new Error(`the following xpath cannot be signed because it was not found: ${s.xpath}`);for(let a of i){if(s.isEmptyUri)n+=`<${t}Reference URI="">`;else{let f=this.ensureHasId(a);s.uri=f,n+=`<${t}Reference URI="#${f}">`}n+=`<${t}Transforms>`;for(let f of s.transforms||[]){let h=this.findCanonicalizationAlgorithm(f);n+=`<${t}Transform Algorithm="${h.getAlgorithmName()}"`,pr.isArrayHasLength(s.inclusiveNamespacesPrefixList)?(n+=">",n+=`<InclusiveNamespaces PrefixList="${s.inclusiveNamespacesPrefixList.join(" ")}" xmlns="${h.getAlgorithmName()}"/>`,n+=`</${t}Transform>`):n+=" />"}let u=this.getCanonReferenceXml(e,s,a),l=this.findHashAlgorithm(s.digestAlgorithm);n+=`</${t}Transforms><${t}DigestMethod Algorithm="${l.getAlgorithmName()}" /><${t}DigestValue>${l.getHash(u)}</${t}DigestValue></${t}Reference>`}}return n}getCanonXml(e,t,n={}){n.defaultNsForPrefix=n.defaultNsForPrefix??Ap.defaultNsForPrefix,n.signatureNode=this.signatureNode;let i=t.cloneNode(!0);return e.forEach(a=>{Gs.isNodeLike(i)&&(i=this.findCanonicalizationAlgorithm(a).process(i,n))}),i.toString()}ensureHasId(e){let t;if(this.idMode==="wssecurity"?t=pr.findAttr(e,"Id","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"):this.idAttributes.some(s=>(t=pr.findAttr(e,s),!!t)),t)return t.value;let n=`_${this.id++}`;return this.idMode==="wssecurity"?(e.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:wsu","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"),e.setAttributeNS("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd","wsu:Id",n)):e.setAttribute("Id",n),n}createSignedInfo(e,t){if(typeof this.canonicalizationAlgorithm!="string")throw new Error("Missing canonicalizationAlgorithm when trying to create signed info for XML");let n=this.findCanonicalizationAlgorithm(this.canonicalizationAlgorithm),s=this.findSignatureAlgorithm(this.signatureAlgorithm),i;i=t||"",i=i&&`${i}:`;let a=`<${i}SignedInfo>`;return a+=`<${i}CanonicalizationMethod Algorithm="${n.getAlgorithmName()}"`,pr.isArrayHasLength(this.inclusiveNamespacesPrefixList)?(a+=">",a+=`<InclusiveNamespaces PrefixList="${this.inclusiveNamespacesPrefixList.join(" ")}" xmlns="${n.getAlgorithmName()}"/>`,a+=`</${i}CanonicalizationMethod>`):a+=" />",a+=`<${i}SignatureMethod Algorithm="${s.getAlgorithmName()}" />`,a+=this.createReferences(e,t),a+=`</${i}SignedInfo>`,a}createSignature(e){let t="xmlns";e?(t+=`:${e}`,e+=":"):e="";let n=`<${e}SignatureValue>${this.signatureValue}</${e}SignatureValue>`,s=`<${e}Signature ${t}="http://www.w3.org/2000/09/xmldsig#">${n}</${e}Signature>`;return new Tc.DOMParser().parseFromString(s).documentElement.firstChild}getSignatureXml(){return this.signatureXml}getOriginalXmlWithIds(){return this.originalXmlWithIds}getSignedXml(){return this.signedXml}};HS.SignedXml=nT;nT.defaultNsForPrefix={ds:"http://www.w3.org/2000/09/xmldsig#"};nT.noop=()=>null});var sT=ye(Tn=>{"use strict";var zee=Tn&&Tn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),c8=Tn&&Tn.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&zee(e,r,t)};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.SignedXml=Tn.ExclusiveCanonicalizationWithComments=Tn.ExclusiveCanonicalization=Tn.C14nCanonicalizationWithComments=Tn.C14nCanonicalization=void 0;var f8=PN();Object.defineProperty(Tn,"C14nCanonicalization",{enumerable:!0,get:o(function(){return f8.C14nCanonicalization},"get")});Object.defineProperty(Tn,"C14nCanonicalizationWithComments",{enumerable:!0,get:o(function(){return f8.C14nCanonicalizationWithComments},"get")});var h8=LN();Object.defineProperty(Tn,"ExclusiveCanonicalization",{enumerable:!0,get:o(function(){return h8.ExclusiveCanonicalization},"get")});Object.defineProperty(Tn,"ExclusiveCanonicalizationWithComments",{enumerable:!0,get:o(function(){return h8.ExclusiveCanonicalizationWithComments},"get")});var Yee=l8();Object.defineProperty(Tn,"SignedXml",{enumerable:!0,get:o(function(){return Yee.SignedXml},"get")});c8(tT(),Tn);c8(qm(),Tn)});var m8=ye($S=>{"use strict";Object.defineProperty($S,"__esModule",{value:!0});$S.WSSecurityCert=void 0;var Qee=gt("crypto"),Zee=sT();function ete(r,e){return new Date(r.getTime()+e*6e4)}o(ete,"addMinutes");function p8(r){return r.getUTCFullYear()+"-"+("0"+(r.getUTCMonth()+1)).slice(-2)+"-"+("0"+r.getUTCDate()).slice(-2)+"T"+("0"+r.getUTCHours()).slice(-2)+":"+("0"+r.getUTCMinutes()).slice(-2)+":"+("0"+r.getUTCSeconds()).slice(-2)+"Z"}o(p8,"dateStringForSOAP");function tte(){return p8(new Date)}o(tte,"generateCreated");function rte(){return p8(ete(new Date,10))}o(rte,"generateExpires");function KS(r,e,t){return[e.slice(0,t),r,e.slice(t)].join("")}o(KS,"insertStr");function nte(){return(0,Qee.randomUUID)().replace(/-/gm,"")}o(nte,"generateId");function ste(r,e){for(let t of r)t.xpath===d8&&(t.xpath=e)}o(ste,"resolvePlaceholderInReferences");var qu="http://docs.oasis-open.org/wss/2004/01",d8="[[bodyXpath]]",ite=class{static{o(this,"WSSecurityCert")}constructor(e,t,n,s={}){if(this.signerOptions={},this.additionalReferences=[],this.excludeReferencesFromSigning=[],this.publicP12PEM=t.toString().replace("-----BEGIN CERTIFICATE-----","").replace("-----END CERTIFICATE-----","").replace(/(\r\n|\n|\r)/gm,""),this.signer=new Zee.SignedXml({idMode:s?.signerOptions?.idMode,signatureAlgorithm:s?.signatureAlgorithm}),this.signer.digestAlgorithm=s.digestAlgorithm??"http://www.w3.org/2001/04/xmlenc#sha256",s.signatureAlgorithm==="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"&&(this.signer.signatureAlgorithm=s.signatureAlgorithm,this.signer.addReference({xpath:d8,transforms:["http://www.w3.org/2001/10/xml-exc-c14n#"],digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"})),s.signatureAlgorithm||(this.signer.signatureAlgorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"),this.signer.canonicalizationAlgorithm="http://www.w3.org/2001/10/xml-exc-c14n#",s.additionalReferences&&s.additionalReferences.length>0&&(this.additionalReferences=s.additionalReferences),s.excludeReferencesFromSigning&&s.excludeReferencesFromSigning.length>0&&(this.excludeReferencesFromSigning=s.excludeReferencesFromSigning),s.signerOptions){let{signerOptions:i}=s;this.signerOptions=i,this.signerOptions.existingPrefixes||(this.signerOptions.existingPrefixes={}),this.signerOptions.existingPrefixes&&!this.signerOptions.existingPrefixes.wsse&&(this.signerOptions.existingPrefixes.wsse=`${qu}/oasis-200401-wss-wssecurity-secext-1.0.xsd`)}else this.signerOptions={existingPrefixes:{wsse:`${qu}/oasis-200401-wss-wssecurity-secext-1.0.xsd`}};this.signer.privateKey={key:e,passphrase:n},this.x509Id=`x509-${nte()}`,this.hasTimeStamp=typeof s.hasTimeStamp>"u"?!0:!!s.hasTimeStamp,this.signatureTransformations=Array.isArray(s.signatureTransformations)?s.signatureTransformations:["http://www.w3.org/2000/09/xmldsig#enveloped-signature","http://www.w3.org/2001/10/xml-exc-c14n#"],this.signer.getKeyInfoContent=()=>`<wsse:SecurityTokenReference><wsse:Reference URI="#${this.x509Id}" ValueType="${qu}/oasis-200401-wss-x509-token-profile-1.0#X509v3"/></wsse:SecurityTokenReference>`}postProcess(e,t){this.created=tte(),this.expires=rte();let n="";this.hasTimeStamp&&(n=`<Timestamp xmlns="${qu}/oasis-200401-wss-wssecurity-utility-1.0.xsd"><Created>${this.created}</Created><Expires>${this.expires}</Expires></Timestamp>`);let s=`<wsse:BinarySecurityToken EncodingType="${qu}/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="${qu}/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="${this.x509Id}">${this.publicP12PEM}</wsse:BinarySecurityToken>`+n,i,a=`xmlns:wsse="${qu}/oasis-200401-wss-wssecurity-secext-1.0.xsd"`,u=`xmlns:wsu="${qu}/oasis-200401-wss-wssecurity-utility-1.0.xsd"`,l=e.indexOf("</wsse:Security>");if(l>-1){let y=/<wsse:Security( [^>]*)?>/,S=e.match(y),E="";S[0].includes(` ${t}:mustUnderstand="`)||(E+=`${t}:mustUnderstand="1" `),S[0].includes(a.substring(0,a.indexOf("=")))||(E+=`${a} `),S[0].includes(u.substring(0,a.indexOf("=")))||(E+=`${u} `);let b="<wsse:Security ",T=e.indexOf(b);e=KS(s,e,l),i=KS(E,e,T+b.length)}else{let y=`<wsse:Security ${a} ${u} ${t}:mustUnderstand="1">`+s+"</wsse:Security>";i=KS(y,e,e.indexOf(`</${t}:Header>`))}let f=this.signatureTransformations,h=`//*[name(.)='${t}:Body']`;ste(this.signer.references,h),!this.excludeReferencesFromSigning.some(y=>y==="Body")&&!(this.signer.references.filter(y=>y.xpath===h).length>0)&&this.signer.addReference({xpath:h,transforms:f,digestAlgorithm:this.signer.digestAlgorithm});for(let y of this.additionalReferences){let S=`//*[name(.)='${y}']`;!this.excludeReferencesFromSigning.some(E=>E===y)&&!(this.signer.references.filter(E=>E.xpath===S).length>0)&&this.signer.addReference({xpath:S,transforms:f,digestAlgorithm:this.signer.digestAlgorithm})}let m="//*[name(.)='wsse:Security']/*[local-name(.)='Timestamp']";!this.excludeReferencesFromSigning.some(y=>y==="Timestamp")&&this.hasTimeStamp&&!(this.signer.references.filter(y=>y.xpath===m).length>0)&&this.signer.addReference({xpath:m,transforms:f,digestAlgorithm:this.signer.digestAlgorithm}),this.signer.computeSignature(i,this.signerOptions);let g=this.signer.getOriginalXmlWithIds(),w=this.signer.getSignatureXml();return KS(w,g,g.indexOf("</wsse:Security>"))}};$S.WSSecurityCert=ite});var w8=ye(XS=>{"use strict";Object.defineProperty(XS,"__esModule",{value:!0});XS.WSSecurityCertWithToken=void 0;var ate=gt("crypto"),ote=sT();function ute(r,e){return new Date(r.getTime()+e*6e4)}o(ute,"addMinutes");function y8(r){return r.getUTCFullYear()+"-"+("0"+(r.getUTCMonth()+1)).slice(-2)+"-"+("0"+r.getUTCDate()).slice(-2)+"T"+("0"+r.getUTCHours()).slice(-2)+":"+("0"+r.getUTCMinutes()).slice(-2)+":"+("0"+r.getUTCSeconds()).slice(-2)+"Z"}o(y8,"dateStringForSOAP");function lte(){return y8(new Date)}o(lte,"generateCreated");function cte(){return y8(ute(new Date,10))}o(cte,"generateExpires");function g8(r,e,t){return[e.slice(0,t),r,e.slice(t)].join("")}o(g8,"insertStr");function fte(){return(0,ate.randomUUID)().replace(/-/gm,"")}o(fte,"generateId");function hte(r,e){for(let t of r)t.xpath===v8&&(t.xpath=e)}o(hte,"resolvePlaceholderInReferences");var Hu="http://docs.oasis-open.org/wss/2004/01",v8="[[bodyXpath]]",pte=class{static{o(this,"WSSecurityCertWithToken")}constructor(e){this.signerOptions={},this.additionalReferences=[],this.publicP12PEM=e.publicKey.toString().replace("-----BEGIN CERTIFICATE-----","").replace("-----END CERTIFICATE-----","").replace(/(\r\n|\n|\r)/gm,""),this.username=e.username,this.password=e.password,this.signer=new ote.SignedXml;let t=e.options||{};if(t.signatureAlgorithm==="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"&&(this.signer.signatureAlgorithm=t.signatureAlgorithm,this.signer.addReference({xpath:v8,transforms:["http://www.w3.org/2001/10/xml-exc-c14n#"],digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"})),t.signatureAlgorithm||(this.signer.signatureAlgorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"),this.signer.canonicalizationAlgorithm="http://www.w3.org/2001/10/xml-exc-c14n#",t.additionalReferences&&t.additionalReferences.length>0&&(this.additionalReferences=t.additionalReferences),t.signerOptions){let{signerOptions:n}=e.options;this.signerOptions=n,this.signerOptions.existingPrefixes||(this.signerOptions.existingPrefixes={}),this.signerOptions.existingPrefixes&&!this.signerOptions.existingPrefixes.wsse&&(this.signerOptions.existingPrefixes.wsse=`${Hu}/oasis-200401-wss-wssecurity-secext-1.0.xsd`)}else this.signerOptions={existingPrefixes:{wsse:`${Hu}/oasis-200401-wss-wssecurity-secext-1.0.xsd`}};this.signer.privateKey={key:e.privateKey,passphrase:e.keyPassword},this.x509Id=`x509-${fte()}`,this.hasTimeStamp=typeof t.hasTimeStamp>"u"?!0:!!t.hasTimeStamp,this.signatureTransformations=Array.isArray(t.signatureTransformations)?t.signatureTransformations:["http://www.w3.org/2000/09/xmldsig#enveloped-signature","http://www.w3.org/2001/10/xml-exc-c14n#"],this.signer.keyInfoProvider={},this.signer.getKeyInfo=()=>`<wsse:SecurityTokenReference><wsse:Reference URI="#${this.x509Id}" ValueType="${Hu}/oasis-200401-wss-x509-token-profile-1.0#X509v3"/></wsse:SecurityTokenReference>`}postProcess(e,t){this.created=lte(),this.expires=cte();let n="";this.hasTimeStamp&&(n=`<Timestamp xmlns="${Hu}/oasis-200401-wss-wssecurity-utility-1.0.xsd" Id="_1"><Created>${this.created}</Created><Expires>${this.expires}</Expires></Timestamp>`);let s="";this.username&&(s=`<wsse:UsernameToken wsu:Id="SecurityToken-${this.created}" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:Username>${this.username}</wsse:Username> <wsse:Password>${this.password}</wsse:Password> </wsse:UsernameToken>`);let i=`<wsse:Security xmlns:wsse="${Hu}/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="${Hu}/oasis-200401-wss-wssecurity-utility-1.0.xsd" ${t}:mustUnderstand="1"><wsse:BinarySecurityToken EncodingType="${Hu}/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="${Hu}/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="${this.x509Id}">${this.publicP12PEM}</wsse:BinarySecurityToken>`+s+n+"</wsse:Security>",a=g8(i,e,e.indexOf(`</${t}:Header>`)),u=this.signatureTransformations,l=`//*[name(.)='${t}:Body']`;hte(this.signer.references,l),this.signer.references.filter(h=>h.xpath===l).length>0||this.signer.addReference({xpath:l,transforms:u,digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"});for(let h of this.additionalReferences){let m=`//*[name(.)='${h}']`;this.signer.references.filter(g=>g.xpath===m).length>0||this.signer.addReference({xpath:m,transforms:u,digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"})}let f="//*[name(.)='wsse:Security']/*[local-name(.)='Timestamp']";return this.hasTimeStamp&&!(this.signer.references.filter(h=>h.xpath===f).length>0)&&this.signer.addReference({xpath:f,transforms:u,digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"}),this.signer.computeSignature(a,this.signerOptions),g8(this.signer.getSignatureXml(),a,a.indexOf("</wsse:Security>"))}};XS.WSSecurityCertWithToken=pte});var S8=ye(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});GS.WSSecurityPlusCert=void 0;var dte=class{static{o(this,"WSSecurityPlusCert")}constructor(e,t){this.wsSecurity=e,this.wsSecurityCert=t}postProcess(e,t){let n=this.wsSecurity.toXML(),s=e.indexOf(`</${t}:Header>`);return e=[e.slice(0,s),n,e.slice(s)].join(""),this.wsSecurityCert.postProcess(e,t)}};GS.WSSecurityPlusCert=dte});var iT=ye(hs=>{"use strict";var mte=hs&&hs.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Eo=hs&&hs.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&mte(e,r,t)};Object.defineProperty(hs,"__esModule",{value:!0});Eo(Jk(),hs);Eo(Yk(),hs);Eo(eL(),hs);Eo(rL(),hs);Eo(nL(),hs);Eo(sL(),hs);Eo(m8(),hs);Eo(w8(),hs);Eo(S8(),hs)});var aT=ye(Ai=>{"use strict";var gte=Ai&&Ai.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),yte=Ai&&Ai.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),vte=Ai&&Ai.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&gte(t,e,n[s]);return yte(t,e),t}})(),wte=Ai&&Ai.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.Server=void 0;var Ste=gt("events"),WS=vte(gt("url")),Ete=wte(gt("zlib"));function Ate(r){return typeof r.route=="function"&&typeof r.use=="function"}o(Ate,"isExpress");function E8(r){return!!r&&typeof r.then=="function"}o(E8,"isPromiseLike");function A8(r){function e(t){return t<10?"0"+t:t}return o(e,"pad"),r.getUTCFullYear()+"-"+e(r.getUTCMonth()+1)+"-"+e(r.getUTCDate())+"T"+e(r.getUTCHours())+":"+e(r.getUTCMinutes())+":"+e(r.getUTCSeconds())+"Z"}o(A8,"getDateString");var Cte=class extends Ste.EventEmitter{static{o(this,"Server")}constructor(e,t,n,s,i){super(),i=i||{path:t,services:n},this.path=t,this.services=n,this.wsdl=s,this.suppressStack=i&&i.suppressStack,this.returnFault=i&&i.returnFault,this.onewayOptions=i&&i.oneWay||{},this.enableChunkedEncoding=i.enableChunkedEncoding===void 0?!0:!!i.enableChunkedEncoding,this.callback=i.callback?i.callback:()=>{},typeof t=="string"&&t[t.length-1]!=="/"?t+="/":t instanceof RegExp&&t.source[t.source.length-1]!=="/"&&(t=new RegExp(t.source+"(?:\\/|)")),s.onReady(a=>{if(Ate(e))e.route(t).all((u,l)=>{if(typeof this.authorizeConnection=="function"&&!this.authorizeConnection(u,l)){l.end();return}this._requestListener(u,l)}),this.callback(a,this);else{let u=e.listeners("request").slice();e.removeAllListeners("request"),e.addListener("request",(l,f)=>{if(typeof this.authorizeConnection=="function"&&!this.authorizeConnection(l,f)){f.end();return}let h=WS.parse(l.url).pathname;if(h[h.length-1]!=="/"&&(h+="/"),t===h||t instanceof RegExp&&h.match(t))this._requestListener(l,f);else for(let m=0,g=u.length;m<g;m++)u[m].call(this,l,f)}),this.callback(a,this)}}),this._initializeOptions(i)}addSoapHeader(e,t,n,s){return this.soapHeaders||(this.soapHeaders=[]),e=this._processSoapHeader(e,t,n,s),this.soapHeaders.push(e)-1}changeSoapHeader(e,t,n,s,i){this.soapHeaders||(this.soapHeaders=[]),t=this._processSoapHeader(t,n,s,i),this.soapHeaders[e]=t}getSoapHeaders(){return this.soapHeaders}clearSoapHeaders(){this.soapHeaders=null}_processSoapHeader(e,t,n,s){switch(typeof e){case"object":return this.wsdl.objectToXML(e,t,n,s,!0);case"function":{let i=this;return(...a)=>{let u=e.apply(null,[...a]);return typeof u=="object"?i.wsdl.objectToXML(u,t,n,s,!0):u}}default:return e}}_initializeOptions(e){this.wsdl.options.attributesKey=e.attributesKey||"attributes",this.onewayOptions.statusCode=this.onewayOptions.responseCode||200,this.onewayOptions.emptyBody=!!this.onewayOptions.emptyBody}_processRequestXml(e,t,n){let s;try{typeof this.log=="function"&&this.log("received",n,e),this._process(n,e,t,(i,a)=>{this._sendHttpResponse(t,a,i),typeof this.log=="function"&&this.log("replied",i,e)})}catch(i){if(i.Fault!==void 0)return this._sendError(i.Fault,(a,u)=>{this._sendHttpResponse(t,u||500,a),typeof this.log=="function"&&this.log("error",i,e)},new Date().toISOString());s=i.stack?this.suppressStack===!0?i.message:i.stack:i,this._sendHttpResponse(t,500,s),typeof this.log=="function"&&this.log("error",i,e)}}_requestListener(e,t){let s=WS.parse(e.url).search;if(typeof this.log=="function"&&this.log("info","Handling "+e.method+" on "+e.url,e),e.method==="GET")s&&s.toLowerCase().startsWith("?wsdl")&&(typeof this.log=="function"&&this.log("info","Wants the WSDL",e),t.setHeader("Content-Type","application/xml"),t.write(this.wsdl.toXML())),t.end();else if(e.method==="POST"){if(typeof e.headers["content-type"]<"u"?t.setHeader("Content-Type",e.headers["content-type"]):t.setHeader("Content-Type","application/xml"),e.body&&e.body.length>0)return this._processRequestXml(e,t,e.body.toString());let i=[],a,u=e;e.headers["content-encoding"]==="gzip"&&(a=Ete.default.createGunzip(),e.pipe(a),u=a),u.on("data",l=>{i.push(l)}),u.on("end",()=>{let l=Buffer.concat(i).toString();this._processRequestXml(e,t,l)})}else t.end()}_getSoapAction(e){if(typeof e.headers.soapaction>"u")return;let t=e.headers.soapaction;return t.indexOf('"')===0?t.slice(1,-1):t}_process(e,t,n,s){let i=WS.parse(t.url).pathname.replace(/\/$/,""),a=this.wsdl.xmlToObject(e),u=a.Body,l=a.Header,f,h,m,g,w=a.Header&&a.Header.Security&&a.Header.Security.Timestamp,y=this.authenticate||o(function(){return!0},"defaultAuthenticate"),S=o((b,T)=>{let A={result:b};this.emit("response",A,h),s(A.result,T)},"callback"),E=o(()=>{if(typeof this.log=="function"&&this.log("info","Attempting to bind to "+i,t),!u)throw new Error("Failed to parse the SOAP Message body");if(f=(()=>{let b=this.wsdl.definitions.services,T,A;for(A in b){m=A;let x=b[m].ports;for(A in x){g=A;let B=x[g],F=WS.parse(B.location).pathname.replace(/\/$/,"");if(typeof this.log=="function"&&this.log("info","Trying "+g+" from path "+F,t),F===i)return B.binding;T||(T=B)}}return T?T.binding:void 0})(),!f)throw new Error("Failed to bind to WSDL");try{let b=this._getSoapAction(t),T=Object.keys(u)[0]==="attributes"?Object.keys(u)[1]:Object.keys(u)[0],A=f.topElements[T];b?h=this._getMethodNameBySoapAction(f,b):h=A?A.methodName:T;let C=f.methods[h].style||f.style;this.emit("request",a,h),l&&this.emit("headers",l,h),C==="rpc"?this._executeMethod({serviceName:m,portName:g,methodName:h,outputName:T+"Response",args:u[T],headers:l,style:"rpc"},t,n,S):this._executeMethod({serviceName:m,portName:g,methodName:h,outputName:A.outputName,args:u[T],headers:l,style:"document"},t,n,S,w)}catch(b){if(b.Fault!==void 0)return this._sendError(b.Fault,S,w);throw b}},"process");if(typeof y=="function"){let b=!1,T=o(C=>{if(!b){if(b=!0,C instanceof Error)return this._sendError({Code:{Value:"SOAP-ENV:Server",Subcode:{Value:"InternalServerError"}},Reason:{Text:C.toString()},statusCode:500},S,w);if(typeof C=="boolean")if(C===!0)try{E()}catch(x){return x.Fault!==void 0?this._sendError(x.Fault,S,w):this._sendError({Code:{Value:"SOAP-ENV:Server",Subcode:{Value:"InternalServerError"}},Reason:{Text:x.toString()},statusCode:500},S,w)}else return this._sendError({Code:{Value:"SOAP-ENV:Client",Subcode:{Value:"AuthenticationFailure"}},Reason:{Text:"Invalid username or password"},statusCode:401},S,w)}},"processAuthResult"),A=y(a.Header&&a.Header.Security,T,t,a);E8(A)&&A.then(C=>{T(C)},C=>{T(C)}),typeof A=="boolean"&&T(A)}else throw new Error("Invalid authenticate function (not a function)")}_getMethodNameBySoapAction(e,t){for(let n in e.methods)if(e.methods[n].soapAction===t)return n}_executeMethod(e,t,n,s,i){e=e||{};let a,u,l,f=e.serviceName,h=e.portName,m=this.wsdl.definitions.services[f].ports[h].binding,g=e.methodName,w=e.outputName,y=e.args,S=e.style;this.soapHeaders&&(l=this.soapHeaders.map(C=>typeof C=="function"?C(g,y,e.headers,t,n,this):C).join(`
68
- `));try{a=this.services[f][h][g]}catch{return s(this._envelope("",l,i))}let E=!1,b=o((C,x)=>{if(!E){if(E=!0,C)return C.Fault!==void 0?this._sendError(C.Fault,s,i):this._sendError({Code:{Value:"SOAP-ENV:Server",Subcode:{Value:"InternalServerError"}},Reason:{Text:C.toString()},statusCode:500},s,i);if(S==="rpc")u=this.wsdl.objectToRpcXML(w,x,"",this.wsdl.definitions.$targetNamespace);else if(S==="document"){let B=m.methods[g].output;u=this.wsdl.objectToDocumentXML(w,x,B.targetNSAlias,B.targetNamespace)}else{let B=m.methods[g].output,F=B.$targetNamespace,R=w;F&&(R=`${F}:${R}`),u=this.wsdl.objectToDocumentXML(R,x,B.targetNSAlias,B.targetNamespace)}s(this._envelope(u,l,i))}},"handleResult");m.methods[g].output||(E=!0,u="",this.onewayOptions.emptyBody&&(u=this._envelope("",l,i)),s(u,this.onewayOptions.responseCode));let T=o((C,x)=>{C&&C.Fault!==void 0||x===void 0&&(x=C,C=null),b(C,x)},"methodCallback"),A=a.apply(this,[y,T,e.headers,t,n]);typeof A<"u"&&(E8(A)?A.then(C=>{b(null,C)},C=>{b(C)}):b(null,A))}_envelope(e,t,n){let a='<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="'+(this.wsdl.options.forceSoap12Headers?"http://www.w3.org/2003/05/soap-envelope":"http://schemas.xmlsoap.org/soap/envelope/")+'" '+this.wsdl.xmlnsInEnvelope+">";if(t=t||"",n){let u=new Date,l=A8(u),f=A8(new Date(u.getTime()+1e3*600));t+='<o:Security soap:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <u:Timestamp u:Id="_0"> <u:Created>'+l+"</u:Created> <u:Expires>"+f+`</u:Expires> </u:Timestamp> </o:Security>
69
- `}return t!==""&&(a+="<soap:Header>"+t+"</soap:Header>"),a+=e?"<soap:Body>"+e+"</soap:Body>":"<soap:Body/>",a+="</soap:Envelope>",a}_sendError(e,t,n){let s,i;return e.statusCode&&(i=e.statusCode,e.statusCode=void 0),"faultcode"in e?s=this.wsdl.objectToDocumentXML("soap:Fault",e,void 0):s=this.wsdl.objectToDocumentXML("Fault",e,"soap"),t(this._envelope(s,"",n),i)}_sendHttpResponse(e,t,n){t&&(e.statusCode=t),this.enableChunkedEncoding?(e.write(n),e.end()):e.end(n)}};Ai.Server=Cte});var oT=ye(JS=>{"use strict";(function(r){r.parser=function(O,_){return new t(O,_)},r.SAXParser=t,r.SAXStream=f,r.createStream=l,r.MAX_BUFFER_LENGTH=64*1024;var e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];r.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function t(O,_){if(!(this instanceof t))return new t(O,_);var ne=this;s(ne),ne.q=ne.c="",ne.bufferCheckPosition=r.MAX_BUFFER_LENGTH,ne.opt=_||{},ne.opt.lowercase=ne.opt.lowercase||ne.opt.lowercasetags,ne.looseCase=ne.opt.lowercase?"toLowerCase":"toUpperCase",ne.tags=[],ne.closed=ne.closedRoot=ne.sawRoot=!1,ne.tag=ne.error=null,ne.strict=!!O,ne.noscript=!!(O||ne.opt.noscript),ne.state=R.BEGIN,ne.strictEntities=ne.opt.strictEntities,ne.ENTITIES=ne.strictEntities?Object.create(r.XML_ENTITIES):Object.create(r.ENTITIES),ne.attribList=[],ne.opt.xmlns&&(ne.ns=Object.create(y)),ne.opt.unquotedAttributeValues===void 0&&(ne.opt.unquotedAttributeValues=!O),ne.trackPosition=ne.opt.position!==!1,ne.trackPosition&&(ne.position=ne.line=ne.column=0),q(ne,"onready")}o(t,"SAXParser"),Object.create||(Object.create=function(O){function _(){}o(_,"F"),_.prototype=O;var ne=new _;return ne}),Object.keys||(Object.keys=function(O){var _=[];for(var ne in O)O.hasOwnProperty(ne)&&_.push(ne);return _});function n(O){for(var _=Math.max(r.MAX_BUFFER_LENGTH,10),ne=0,J=0,Xe=e.length;J<Xe;J++){var Re=O[e[J]].length;if(Re>_)switch(e[J]){case"textNode":G(O);break;case"cdata":K(O,"oncdata",O.cdata),O.cdata="";break;case"script":K(O,"onscript",O.script),O.script="";break;default:le(O,"Max buffer length exceeded: "+e[J])}ne=Math.max(ne,Re)}var xe=r.MAX_BUFFER_LENGTH-ne;O.bufferCheckPosition=xe+O.position}o(n,"checkBufferLength");function s(O){for(var _=0,ne=e.length;_<ne;_++)O[e[_]]=""}o(s,"clearBuffers");function i(O){G(O),O.cdata!==""&&(K(O,"oncdata",O.cdata),O.cdata=""),O.script!==""&&(K(O,"onscript",O.script),O.script="")}o(i,"flushBuffers"),t.prototype={end:o(function(){oe(this)},"end"),write:lt,resume:o(function(){return this.error=null,this},"resume"),close:o(function(){return this.write(null)},"close"),flush:o(function(){i(this)},"flush")};var a;try{a=gt("stream").Stream}catch{a=o(function(){},"Stream")}a||(a=o(function(){},"Stream"));var u=r.EVENTS.filter(function(O){return O!=="error"&&O!=="end"});function l(O,_){return new f(O,_)}o(l,"createStream");function f(O,_){if(!(this instanceof f))return new f(O,_);a.apply(this),this._parser=new t(O,_),this.writable=!0,this.readable=!0;var ne=this;this._parser.onend=function(){ne.emit("end")},this._parser.onerror=function(J){ne.emit("error",J),ne._parser.error=null},this._decoder=null,u.forEach(function(J){Object.defineProperty(ne,"on"+J,{get:o(function(){return ne._parser["on"+J]},"get"),set:o(function(Xe){if(!Xe)return ne.removeAllListeners(J),ne._parser["on"+J]=Xe,Xe;ne.on(J,Xe)},"set"),enumerable:!0,configurable:!1})})}o(f,"SAXStream"),f.prototype=Object.create(a.prototype,{constructor:{value:f}}),f.prototype.write=function(O){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(O)){if(!this._decoder){var _=gt("string_decoder").StringDecoder;this._decoder=new _("utf8")}O=this._decoder.write(O)}return this._parser.write(O.toString()),this.emit("data",O),!0},f.prototype.end=function(O){return O&&O.length&&this.write(O),this._parser.end(),!0},f.prototype.on=function(O,_){var ne=this;return!ne._parser["on"+O]&&u.indexOf(O)!==-1&&(ne._parser["on"+O]=function(){var J=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);J.splice(0,0,O),ne.emit.apply(ne,J)}),a.prototype.on.call(ne,O,_)};var h="[CDATA[",m="DOCTYPE",g="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/2000/xmlns/",y={xml:g,xmlns:w},S=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,E=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,b=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,T=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function A(O){return O===" "||O===`
70
- `||O==="\r"||O===" "}o(A,"isWhitespace");function C(O){return O==='"'||O==="'"}o(C,"isQuote");function x(O){return O===">"||A(O)}o(x,"isAttribEnd");function B(O,_){return O.test(_)}o(B,"isMatch");function F(O,_){return!B(O,_)}o(F,"notMatch");var R=0;r.STATE={BEGIN:R++,BEGIN_WHITESPACE:R++,TEXT:R++,TEXT_ENTITY:R++,OPEN_WAKA:R++,SGML_DECL:R++,SGML_DECL_QUOTED:R++,DOCTYPE:R++,DOCTYPE_QUOTED:R++,DOCTYPE_DTD:R++,DOCTYPE_DTD_QUOTED:R++,COMMENT_STARTING:R++,COMMENT:R++,COMMENT_ENDING:R++,COMMENT_ENDED:R++,CDATA:R++,CDATA_ENDING:R++,CDATA_ENDING_2:R++,PROC_INST:R++,PROC_INST_BODY:R++,PROC_INST_ENDING:R++,OPEN_TAG:R++,OPEN_TAG_SLASH:R++,ATTRIB:R++,ATTRIB_NAME:R++,ATTRIB_NAME_SAW_WHITE:R++,ATTRIB_VALUE:R++,ATTRIB_VALUE_QUOTED:R++,ATTRIB_VALUE_CLOSED:R++,ATTRIB_VALUE_UNQUOTED:R++,ATTRIB_VALUE_ENTITY_Q:R++,ATTRIB_VALUE_ENTITY_U:R++,CLOSE_TAG:R++,CLOSE_TAG_SAW_WHITE:R++,SCRIPT:R++,SCRIPT_ENDING:R++},r.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},r.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(r.ENTITIES).forEach(function(O){var _=r.ENTITIES[O],ne=typeof _=="number"?String.fromCharCode(_):_;r.ENTITIES[O]=ne});for(var H in r.STATE)r.STATE[r.STATE[H]]=H;R=r.STATE;function q(O,_,ne){O[_]&&O[_](ne)}o(q,"emit");function K(O,_,ne){O.textNode&&G(O),q(O,_,ne)}o(K,"emitNode");function G(O){O.textNode=he(O.opt,O.textNode),O.textNode&&q(O,"ontext",O.textNode),O.textNode=""}o(G,"closeText");function he(O,_){return O.trim&&(_=_.trim()),O.normalize&&(_=_.replace(/\s+/g," ")),_}o(he,"textopts");function le(O,_){return G(O),O.trackPosition&&(_+=`
71
- Line: `+O.line+`
72
- Column: `+O.column+`
73
- Char: `+O.c),_=new Error(_),O.error=_,q(O,"onerror",_),O}o(le,"error");function oe(O){return O.sawRoot&&!O.closedRoot&&Z(O,"Unclosed root tag"),O.state!==R.BEGIN&&O.state!==R.BEGIN_WHITESPACE&&O.state!==R.TEXT&&le(O,"Unexpected end"),G(O),O.c="",O.closed=!0,q(O,"onend"),t.call(O,O.strict,O.opt),O}o(oe,"end");function Z(O,_){if(typeof O!="object"||!(O instanceof t))throw new Error("bad call to strictFail");O.strict&&le(O,_)}o(Z,"strictFail");function fe(O){O.strict||(O.tagName=O.tagName[O.looseCase]());var _=O.tags[O.tags.length-1]||O,ne=O.tag={name:O.tagName,attributes:{}};O.opt.xmlns&&(ne.ns=_.ns),O.attribList.length=0,K(O,"onopentagstart",ne)}o(fe,"newTag");function Se(O,_){var ne=O.indexOf(":"),J=ne<0?["",O]:O.split(":"),Xe=J[0],Re=J[1];return _&&O==="xmlns"&&(Xe="xmlns",Re=""),{prefix:Xe,local:Re}}o(Se,"qname");function Ke(O){if(O.strict||(O.attribName=O.attribName[O.looseCase]()),O.attribList.indexOf(O.attribName)!==-1||O.tag.attributes.hasOwnProperty(O.attribName)){O.attribName=O.attribValue="";return}if(O.opt.xmlns){var _=Se(O.attribName,!0),ne=_.prefix,J=_.local;if(ne==="xmlns")if(J==="xml"&&O.attribValue!==g)Z(O,"xml: prefix must be bound to "+g+`
74
- Actual: `+O.attribValue);else if(J==="xmlns"&&O.attribValue!==w)Z(O,"xmlns: prefix must be bound to "+w+`
75
- Actual: `+O.attribValue);else{var Xe=O.tag,Re=O.tags[O.tags.length-1]||O;Xe.ns===Re.ns&&(Xe.ns=Object.create(Re.ns)),Xe.ns[J]=O.attribValue}O.attribList.push([O.attribName,O.attribValue])}else O.tag.attributes[O.attribName]=O.attribValue,K(O,"onattribute",{name:O.attribName,value:O.attribValue});O.attribName=O.attribValue=""}o(Ke,"attrib");function be(O,_){if(O.opt.xmlns){var ne=O.tag,J=Se(O.tagName);ne.prefix=J.prefix,ne.local=J.local,ne.uri=ne.ns[J.prefix]||"",ne.prefix&&!ne.uri&&(Z(O,"Unbound namespace prefix: "+JSON.stringify(O.tagName)),ne.uri=J.prefix);var Xe=O.tags[O.tags.length-1]||O;ne.ns&&Xe.ns!==ne.ns&&Object.keys(ne.ns).forEach(function($n){K(O,"onopennamespace",{prefix:$n,uri:ne.ns[$n]})});for(var Re=0,xe=O.attribList.length;Re<xe;Re++){var ct=O.attribList[Re],rr=ct[0],je=ct[1],nr=Se(rr,!0),Ls=nr.prefix,Ge=nr.local,Ur=Ls===""?"":ne.ns[Ls]||"",on={name:rr,value:je,prefix:Ls,local:Ge,uri:Ur};Ls&&Ls!=="xmlns"&&!Ur&&(Z(O,"Unbound namespace prefix: "+JSON.stringify(Ls)),on.uri=Ls),O.tag.attributes[rr]=on,K(O,"onattribute",on)}O.attribList.length=0}O.tag.isSelfClosing=!!_,O.sawRoot=!0,O.tags.push(O.tag),K(O,"onopentag",O.tag),_||(!O.noscript&&O.tagName.toLowerCase()==="script"?O.state=R.SCRIPT:O.state=R.TEXT,O.tag=null,O.tagName=""),O.attribName=O.attribValue="",O.attribList.length=0}o(be,"openTag");function we(O){if(!O.tagName){Z(O,"Weird empty close tag."),O.textNode+="</>",O.state=R.TEXT;return}if(O.script){if(O.tagName!=="script"){O.script+="</"+O.tagName+">",O.tagName="",O.state=R.SCRIPT;return}K(O,"onscript",O.script),O.script=""}var _=O.tags.length,ne=O.tagName;O.strict||(ne=ne[O.looseCase]());for(var J=ne;_--;){var Xe=O.tags[_];if(Xe.name!==J)Z(O,"Unexpected close tag");else break}if(_<0){Z(O,"Unmatched closing tag: "+O.tagName),O.textNode+="</"+O.tagName+">",O.state=R.TEXT;return}O.tagName=ne;for(var Re=O.tags.length;Re-- >_;){var xe=O.tag=O.tags.pop();O.tagName=O.tag.name,K(O,"onclosetag",O.tagName);var ct={};for(var rr in xe.ns)ct[rr]=xe.ns[rr];var je=O.tags[O.tags.length-1]||O;O.opt.xmlns&&xe.ns!==je.ns&&Object.keys(xe.ns).forEach(function(nr){var Ls=xe.ns[nr];K(O,"onclosenamespace",{prefix:nr,uri:Ls})})}_===0&&(O.closedRoot=!0),O.tagName=O.attribValue=O.attribName="",O.attribList.length=0,O.state=R.TEXT}o(we,"closeTag");function Me(O){var _=O.entity,ne=_.toLowerCase(),J,Xe="";return O.ENTITIES[_]?O.ENTITIES[_]:O.ENTITIES[ne]?O.ENTITIES[ne]:(_=ne,_.charAt(0)==="#"&&(_.charAt(1)==="x"?(_=_.slice(2),J=parseInt(_,16),Xe=J.toString(16)):(_=_.slice(1),J=parseInt(_,10),Xe=J.toString(10))),_=_.replace(/^0+/,""),isNaN(J)||Xe.toLowerCase()!==_?(Z(O,"Invalid character entity"),"&"+O.entity+";"):String.fromCodePoint(J))}o(Me,"parseEntity");function Je(O,_){_==="<"?(O.state=R.OPEN_WAKA,O.startTagPosition=O.position):A(_)||(Z(O,"Non-whitespace before first tag."),O.textNode=_,O.state=R.TEXT)}o(Je,"beginWhiteSpace");function Ye(O,_){var ne="";return _<O.length&&(ne=O.charAt(_)),ne}o(Ye,"charAt");function lt(O){var _=this;if(this.error)throw this.error;if(_.closed)return le(_,"Cannot write after close. Assign an onready handler.");if(O===null)return oe(_);typeof O=="object"&&(O=O.toString());for(var ne=0,J="";J=Ye(O,ne++),_.c=J,!!J;)switch(_.trackPosition&&(_.position++,J===`
76
- `?(_.line++,_.column=0):_.column++),_.state){case R.BEGIN:if(_.state=R.BEGIN_WHITESPACE,J==="\uFEFF")continue;Je(_,J);continue;case R.BEGIN_WHITESPACE:Je(_,J);continue;case R.TEXT:if(_.sawRoot&&!_.closedRoot){for(var Xe=ne-1;J&&J!=="<"&&J!=="&";)J=Ye(O,ne++),J&&_.trackPosition&&(_.position++,J===`
77
- `?(_.line++,_.column=0):_.column++);_.textNode+=O.substring(Xe,ne-1)}J==="<"&&!(_.sawRoot&&_.closedRoot&&!_.strict)?(_.state=R.OPEN_WAKA,_.startTagPosition=_.position):(!A(J)&&(!_.sawRoot||_.closedRoot)&&Z(_,"Text data outside of root node."),J==="&"?_.state=R.TEXT_ENTITY:_.textNode+=J);continue;case R.SCRIPT:J==="<"?_.state=R.SCRIPT_ENDING:_.script+=J;continue;case R.SCRIPT_ENDING:J==="/"?_.state=R.CLOSE_TAG:(_.script+="<"+J,_.state=R.SCRIPT);continue;case R.OPEN_WAKA:if(J==="!")_.state=R.SGML_DECL,_.sgmlDecl="";else if(!A(J))if(B(S,J))_.state=R.OPEN_TAG,_.tagName=J;else if(J==="/")_.state=R.CLOSE_TAG,_.tagName="";else if(J==="?")_.state=R.PROC_INST,_.procInstName=_.procInstBody="";else{if(Z(_,"Unencoded <"),_.startTagPosition+1<_.position){var Re=_.position-_.startTagPosition;J=new Array(Re).join(" ")+J}_.textNode+="<"+J,_.state=R.TEXT}continue;case R.SGML_DECL:if(_.sgmlDecl+J==="--"){_.state=R.COMMENT,_.comment="",_.sgmlDecl="";continue}_.doctype&&_.doctype!==!0&&_.sgmlDecl?(_.state=R.DOCTYPE_DTD,_.doctype+="<!"+_.sgmlDecl+J,_.sgmlDecl=""):(_.sgmlDecl+J).toUpperCase()===h?(K(_,"onopencdata"),_.state=R.CDATA,_.sgmlDecl="",_.cdata=""):(_.sgmlDecl+J).toUpperCase()===m?(_.state=R.DOCTYPE,(_.doctype||_.sawRoot)&&Z(_,"Inappropriately located doctype declaration"),_.doctype="",_.sgmlDecl=""):J===">"?(K(_,"onsgmldeclaration",_.sgmlDecl),_.sgmlDecl="",_.state=R.TEXT):(C(J)&&(_.state=R.SGML_DECL_QUOTED),_.sgmlDecl+=J);continue;case R.SGML_DECL_QUOTED:J===_.q&&(_.state=R.SGML_DECL,_.q=""),_.sgmlDecl+=J;continue;case R.DOCTYPE:J===">"?(_.state=R.TEXT,K(_,"ondoctype",_.doctype),_.doctype=!0):(_.doctype+=J,J==="["?_.state=R.DOCTYPE_DTD:C(J)&&(_.state=R.DOCTYPE_QUOTED,_.q=J));continue;case R.DOCTYPE_QUOTED:_.doctype+=J,J===_.q&&(_.q="",_.state=R.DOCTYPE);continue;case R.DOCTYPE_DTD:J==="]"?(_.doctype+=J,_.state=R.DOCTYPE):J==="<"?(_.state=R.OPEN_WAKA,_.startTagPosition=_.position):C(J)?(_.doctype+=J,_.state=R.DOCTYPE_DTD_QUOTED,_.q=J):_.doctype+=J;continue;case R.DOCTYPE_DTD_QUOTED:_.doctype+=J,J===_.q&&(_.state=R.DOCTYPE_DTD,_.q="");continue;case R.COMMENT:J==="-"?_.state=R.COMMENT_ENDING:_.comment+=J;continue;case R.COMMENT_ENDING:J==="-"?(_.state=R.COMMENT_ENDED,_.comment=he(_.opt,_.comment),_.comment&&K(_,"oncomment",_.comment),_.comment=""):(_.comment+="-"+J,_.state=R.COMMENT);continue;case R.COMMENT_ENDED:J!==">"?(Z(_,"Malformed comment"),_.comment+="--"+J,_.state=R.COMMENT):_.doctype&&_.doctype!==!0?_.state=R.DOCTYPE_DTD:_.state=R.TEXT;continue;case R.CDATA:J==="]"?_.state=R.CDATA_ENDING:_.cdata+=J;continue;case R.CDATA_ENDING:J==="]"?_.state=R.CDATA_ENDING_2:(_.cdata+="]"+J,_.state=R.CDATA);continue;case R.CDATA_ENDING_2:J===">"?(_.cdata&&K(_,"oncdata",_.cdata),K(_,"onclosecdata"),_.cdata="",_.state=R.TEXT):J==="]"?_.cdata+="]":(_.cdata+="]]"+J,_.state=R.CDATA);continue;case R.PROC_INST:J==="?"?_.state=R.PROC_INST_ENDING:A(J)?_.state=R.PROC_INST_BODY:_.procInstName+=J;continue;case R.PROC_INST_BODY:if(!_.procInstBody&&A(J))continue;J==="?"?_.state=R.PROC_INST_ENDING:_.procInstBody+=J;continue;case R.PROC_INST_ENDING:J===">"?(K(_,"onprocessinginstruction",{name:_.procInstName,body:_.procInstBody}),_.procInstName=_.procInstBody="",_.state=R.TEXT):(_.procInstBody+="?"+J,_.state=R.PROC_INST_BODY);continue;case R.OPEN_TAG:B(E,J)?_.tagName+=J:(fe(_),J===">"?be(_):J==="/"?_.state=R.OPEN_TAG_SLASH:(A(J)||Z(_,"Invalid character in tag name"),_.state=R.ATTRIB));continue;case R.OPEN_TAG_SLASH:J===">"?(be(_,!0),we(_)):(Z(_,"Forward-slash in opening tag not followed by >"),_.state=R.ATTRIB);continue;case R.ATTRIB:if(A(J))continue;J===">"?be(_):J==="/"?_.state=R.OPEN_TAG_SLASH:B(S,J)?(_.attribName=J,_.attribValue="",_.state=R.ATTRIB_NAME):Z(_,"Invalid attribute name");continue;case R.ATTRIB_NAME:J==="="?_.state=R.ATTRIB_VALUE:J===">"?(Z(_,"Attribute without value"),_.attribValue=_.attribName,Ke(_),be(_)):A(J)?_.state=R.ATTRIB_NAME_SAW_WHITE:B(E,J)?_.attribName+=J:Z(_,"Invalid attribute name");continue;case R.ATTRIB_NAME_SAW_WHITE:if(J==="=")_.state=R.ATTRIB_VALUE;else{if(A(J))continue;Z(_,"Attribute without value"),_.tag.attributes[_.attribName]="",_.attribValue="",K(_,"onattribute",{name:_.attribName,value:""}),_.attribName="",J===">"?be(_):B(S,J)?(_.attribName=J,_.state=R.ATTRIB_NAME):(Z(_,"Invalid attribute name"),_.state=R.ATTRIB)}continue;case R.ATTRIB_VALUE:if(A(J))continue;C(J)?(_.q=J,_.state=R.ATTRIB_VALUE_QUOTED):(_.opt.unquotedAttributeValues||le(_,"Unquoted attribute value"),_.state=R.ATTRIB_VALUE_UNQUOTED,_.attribValue=J);continue;case R.ATTRIB_VALUE_QUOTED:if(J!==_.q){J==="&"?_.state=R.ATTRIB_VALUE_ENTITY_Q:_.attribValue+=J;continue}Ke(_),_.q="",_.state=R.ATTRIB_VALUE_CLOSED;continue;case R.ATTRIB_VALUE_CLOSED:A(J)?_.state=R.ATTRIB:J===">"?be(_):J==="/"?_.state=R.OPEN_TAG_SLASH:B(S,J)?(Z(_,"No whitespace between attributes"),_.attribName=J,_.attribValue="",_.state=R.ATTRIB_NAME):Z(_,"Invalid attribute name");continue;case R.ATTRIB_VALUE_UNQUOTED:if(!x(J)){J==="&"?_.state=R.ATTRIB_VALUE_ENTITY_U:_.attribValue+=J;continue}Ke(_),J===">"?be(_):_.state=R.ATTRIB;continue;case R.CLOSE_TAG:if(_.tagName)J===">"?we(_):B(E,J)?_.tagName+=J:_.script?(_.script+="</"+_.tagName,_.tagName="",_.state=R.SCRIPT):(A(J)||Z(_,"Invalid tagname in closing tag"),_.state=R.CLOSE_TAG_SAW_WHITE);else{if(A(J))continue;F(S,J)?_.script?(_.script+="</"+J,_.state=R.SCRIPT):Z(_,"Invalid tagname in closing tag."):_.tagName=J}continue;case R.CLOSE_TAG_SAW_WHITE:if(A(J))continue;J===">"?we(_):Z(_,"Invalid characters in closing tag");continue;case R.TEXT_ENTITY:case R.ATTRIB_VALUE_ENTITY_Q:case R.ATTRIB_VALUE_ENTITY_U:var xe,ct;switch(_.state){case R.TEXT_ENTITY:xe=R.TEXT,ct="textNode";break;case R.ATTRIB_VALUE_ENTITY_Q:xe=R.ATTRIB_VALUE_QUOTED,ct="attribValue";break;case R.ATTRIB_VALUE_ENTITY_U:xe=R.ATTRIB_VALUE_UNQUOTED,ct="attribValue";break}if(J===";"){var rr=Me(_);_.opt.unparsedEntities&&!Object.values(r.XML_ENTITIES).includes(rr)?(_.entity="",_.state=xe,_.write(rr)):(_[ct]+=rr,_.entity="",_.state=xe)}else B(_.entity.length?T:b,J)?_.entity+=J:(Z(_,"Invalid character in entity name"),_[ct]+="&"+_.entity+J,_.entity="",_.state=xe);continue;default:throw new Error(_,"Unknown state: "+_.state)}return _.position>=_.bufferCheckPosition&&n(_),_}o(lt,"write");String.fromCodePoint||(function(){var O=String.fromCharCode,_=Math.floor,ne=o(function(){var J=16384,Xe=[],Re,xe,ct=-1,rr=arguments.length;if(!rr)return"";for(var je="";++ct<rr;){var nr=Number(arguments[ct]);if(!isFinite(nr)||nr<0||nr>1114111||_(nr)!==nr)throw RangeError("Invalid code point: "+nr);nr<=65535?Xe.push(nr):(nr-=65536,Re=(nr>>10)+55296,xe=nr%1024+56320,Xe.push(Re,xe)),(ct+1===rr||Xe.length>J)&&(je+=O.apply(null,Xe),Xe.length=0)}return je},"fromCodePoint");Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:ne,configurable:!0,writable:!0}):String.fromCodePoint=ne})()})(typeof JS>"u"?JS.sax={}:JS)});var b8=ye((nde,C8)=>{"use strict";C8.exports=r=>{if(typeof r!="string")throw new TypeError("Expected a string, got "+typeof r);return r.charCodeAt(0)===65279?r.slice(1):r}});var x8=ye(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});zS.NamespaceContext=void 0;var bte=class{static{o(this,"NamespaceScope")}constructor(e){this.parent=e,this.namespaces={}}getNamespaceURI(e,t){switch(e){case"xml":return"http://www.w3.org/XML/1998/namespace";case"xmlns":return"http://www.w3.org/2000/xmlns/";default:{let n=this.namespaces[e];return n!=null?n.uri:!t&&this.parent?this.parent.getNamespaceURI(e):null}}}getNamespaceMapping(e){switch(e){case"xml":return{uri:"http://www.w3.org/XML/1998/namespace",prefix:"xml",declared:!0};case"xmlns":return{uri:"http://www.w3.org/2000/xmlns/",prefix:"xmlns",declared:!0};default:{let t=this.namespaces[e];return t??(this.parent?this.parent.getNamespaceMapping(e):null)}}}getPrefix(e,t){switch(e){case"http://www.w3.org/XML/1998/namespace":return"xml";case"http://www.w3.org/2000/xmlns/":return"xmlns";default:for(let n in this.namespaces)if(this.namespaces[n].uri===e)return n;return!t&&this.parent?this.parent.getPrefix(e):null}}},xte=class{static{o(this,"NamespaceContext")}constructor(){this.scopes=[],this.pushContext(),this.prefixCount=0}addNamespace(e,t,n){return this.getNamespaceURI(e,n)===t?!1:this.currentScope?(this.currentScope.namespaces[e]={uri:t,prefix:e,declared:!1},!0):!1}pushContext(){let e=new bte(this.currentScope);return this.scopes.push(e),this.currentScope=e,e}popContext(){let e=this.scopes.pop();return e?this.currentScope=e.parent:this.currentScope=null,e}getNamespaceURI(e,t){return this.currentScope&&this.currentScope.getNamespaceURI(e,t)}getPrefix(e,t){return this.currentScope&&this.currentScope.getPrefix(e,t)}registerNamespace(e){let t=this.getPrefix(e);if(t)return t;for(;t="ns"+ ++this.prefixCount,!!this.getNamespaceURI(t););return this.addNamespace(t,e,!0),t}declareNamespace(e,t){if(this.currentScope){let n=this.currentScope.getNamespaceMapping(e);return n&&n.uri===t&&n.declared?!1:(this.currentScope.namespaces[e]={uri:t,prefix:e,declared:!0},!0)}return!1}};zS.NamespaceContext=xte});var L8=ye(at=>{"use strict";var Nte=at&&at.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Tte=at&&at.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Ite=at&&at.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&Nte(t,e,n[s]);return Tte(t,e),t}})(),Bte=at&&at.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(at,"__esModule",{value:!0});at.ImportElement=at.IncludeElement=at.BodyElement=at.DefinitionsElement=at.ServiceElement=at.PortElement=at.BindingElement=at.PortTypeElement=at.OperationElement=at.TypesElement=at.SchemaElement=at.DocumentationElement=at.MessageElement=at.AllElement=at.AttributeElement=at.SequenceElement=at.SimpleContentElement=at.ComplexContentElement=at.ComplexTypeElement=at.EnumerationElement=at.ChoiceElement=at.ExtensionElement=at.RestrictionElement=at.SimpleTypeElement=at.OutputElement=at.InputElement=at.AnyElement=at.ElementElement=at.UnexpectedElement=at.Element=void 0;var uT=gt("assert"),Dte=Bte(dw()),Ki=Ite(go()),Yn=Lu(),_te=(0,Dte.default)("node-soap"),YS={string:1,boolean:1,decimal:1,float:1,double:1,anyType:1,byte:1,int:1,long:1,short:1,negativeInteger:1,nonNegativeInteger:1,positiveInteger:1,nonPositiveInteger:1,unsignedByte:1,unsignedInt:1,unsignedLong:1,unsignedShort:1,duration:0,dateTime:0,time:0,date:0,gYearMonth:0,gYear:0,gMonthDay:0,gDay:0,gMonth:0,hexBinary:0,base64Binary:0,anyURI:0,QName:0,NOTATION:0},dr=class{static{o(this,"Element")}constructor(e,t,n,s){this.allowedChildren={},this.children=[];let i=(0,Yn.splitQName)(e);this.nsName=e,this.prefix=i.prefix,this.name=i.name,this.children=[],this.xmlns={},this.schemaXmlns={},this._initializeOptions(n);for(let a in t){let u=/^xmlns:?(.*)$/.exec(a);u?this.xmlns[u[1]?u[1]:Yn.TNS_PREFIX]=t[a]:a==="value"?this[this.valueKey]=t[a]:this["$"+a]=t[a]}for(let a in s){let u=/^xmlns:?(.*)$/.exec(a);u&&u[1]&&(this.schemaXmlns[u[1]]=s[a])}this.$targetNamespace!==void 0&&(this.xmlns[Yn.TNS_PREFIX]=this.$targetNamespace),this.init()}deleteFixedAttrs(){this.children&&this.children.length===0&&delete this.children,this.xmlns&&Object.keys(this.xmlns).length===0&&delete this.xmlns,delete this.nsName,delete this.prefix,delete this.name}startElement(e,t,n,s,i){if(!this.allowedChildren)return;let a=this.allowedChildren[(0,Yn.splitQName)(t).name];if(a==null&&!this.strict&&(a=N8),a){let u=new a(t,n,s,i);u.init();let l=e[0];l instanceof vT&&(u.definitionsXmlns=l.xmlns),e.push(u)}else this.unexpected(t)}endElement(e,t){if(this.nsName===t){if(e.length<2)return;let n=e[e.length-2];this!==e[0]&&(Ki.defaultsDeep(e[0].xmlns,this.xmlns),n.children.push(this),n.addChild(this)),e.pop()}}addChild(e){}unexpected(e){throw new Error("Found unexpected element ("+e+") inside "+this.nsName)}description(e,t){return this.$name||this.name}init(){}_initializeOptions(e){e?(this.valueKey=e.valueKey||"$value",this.xmlKey=e.xmlKey||"$xml",this.ignoredNamespaces=e.ignoredNamespaces||[],this.strict=e.strict||!1,this.forceUseSchemaXmlns=e.forceUseSchemaXmlns||!1):(this.valueKey="$value",this.xmlKey="$xml",this.ignoredNamespaces=[],this.strict=!1,this.forceUseSchemaXmlns=!1)}};at.Element=dr;var N8=class T8 extends dr{static{o(this,"UnexpectedElement")}startElement(e,t,n,s,i){let a=new T8(t,n,s,i);a.init(),e.push(a)}};at.UnexpectedElement=N8;var lT=class extends dr{static{o(this,"ElementElement")}constructor(){super(...arguments),this.allowedChildren=nn(["annotation","complexType","simpleType"])}description(e,t){let n={},s=this.$name,i=1,a=1;this.$maxOccurs==="unbounded"?a=1/0:this.$maxOccurs&&(a=parseInt(this.$maxOccurs,10)),this.$minOccurs&&(i=parseInt(this.$minOccurs,10));let u=a>1;u&&s&&(s+="[]"),t&&t[Yn.TNS_PREFIX]&&(this.$targetNamespace=t[Yn.TNS_PREFIX]);let l=this.$type||this.$ref;if(l){l=(0,Yn.splitQName)(l);let f=l.name,h=!!Ku(l.prefix,this.definitionsXmlns,e.xmlns)||!!Ku(this.targetNSAlias,this.definitionsXmlns,e.xmlns)||this.forceUseSchemaXmlns,m=Ku(l.prefix,t,this.xmlns,h?this.schemaXmlns:void 0,this.definitionsXmlns,e.xmlns),g=e.schemas[m],w=g&&(this.$type?g.complexTypes[f]||g.types[f]:g.elements[f]),y=this.$type?e.descriptions.types:e.descriptions.elements;if(m&&e.schemas[m]&&(t=e.schemas[m].xmlns),w&&!(f in YS))if(f in y)if(this.$ref)if(u){let S=f+"[]";y[S]=y[f],n[S]=y[S]}else n=y[f];else n[s]=y[f];else{let S={};y[f]=S,u&&"maxOccurs"in w&&(w.maxOccurs=this.$maxOccurs),this.$minOccurs&&"minOccurs"in w&&(w.minOccurs=this.$minOccurs);let E=w.description(e,t);if(typeof E=="string")S=E;else{Object.keys(E).forEach(T=>{S[T]=E[T]});let b=E[$i.Symbol];b&&(S[$i.Symbol]=b)}this.$ref?n=S:n[s]=S,typeof S=="object"&&(S.targetNSAlias=l.prefix,S.targetNamespace=m),y[f]=S}else n[s]=this.$type}else{let f=this.children;n[s]={};for(let h of f)(h instanceof rE||h instanceof ZS)&&(n[s]=h.description(e,t))}return n}};at.ElementElement=lT;var QS=class extends dr{static{o(this,"AnyElement")}};at.AnyElement=QS;var I8=class extends dr{static{o(this,"InputElement")}constructor(){super(...arguments),this.allowedChildren=nn(["body","documentation","header","SecuritySpecRef"])}addChild(e){e instanceof nE&&(this.use=e.$use,this.use==="encoded"&&(this.encodingStyle=e.$encodingStyle),this.children.pop())}};at.InputElement=I8;var B8=class extends dr{static{o(this,"OutputElement")}constructor(){super(...arguments),this.allowedChildren=nn(["body","documentation","header","SecuritySpecRef"])}addChild(e){e instanceof nE&&(this.use=e.$use,this.use==="encoded"&&(this.encodingStyle=e.$encodingStyle),this.children.pop())}};at.OutputElement=B8;var ZS=class extends dr{static{o(this,"SimpleTypeElement")}constructor(){super(...arguments),this.allowedChildren=nn(["restriction"])}description(e){for(let t of this.children)if(t instanceof eE)return[this.$name,t.description()].filter(Boolean).join("|");return{}}};at.SimpleTypeElement=ZS;var eE=class extends dr{static{o(this,"RestrictionElement")}constructor(){super(...arguments),this.allowedChildren=nn(["all","choice","enumeration","sequence","attribute"])}description(e,t){let n=this.children,s,i=!1,a={};for(let l of n){if(l instanceof $i){a[l.$name]=l.description(e);continue}!i&&(l instanceof sg||l instanceof ng)&&(i=!0,s=l.description(e,t))}if(Object.keys(a).length>0&&(s=s??{},s[$i.Symbol]=a),s&&this.$base){let l=(0,Yn.splitQName)(this.$base),f=l.name,h=Ku(l.prefix,t,this.definitionsXmlns,e.xmlns),m=e.schemas[h],g=m&&(m.complexTypes[f]||m.types[f]||m.elements[f]);if(s.getBase=()=>g.description(e,m.xmlns),g){let w=g.description(e,m.xmlns);w[$i.Symbol]&&Ki.defaults(a,w[$i.Symbol]),s=Ki.defaults(s,w)}return s}let u=this.children.map(l=>l.description()).join(",");return[this.$base,u].filter(Boolean).join("|")}};at.RestrictionElement=eE;var tE=class extends dr{static{o(this,"ExtensionElement")}constructor(){super(...arguments),this.allowedChildren=nn(["all","choice","sequence"])}description(e,t){let n={};for(let s of this.children)(s instanceof sg||s instanceof ng)&&(n=s.description(e,t));if(this.$base){let s=(0,Yn.splitQName)(this.$base),i=s.name,a=Ku(s.prefix,t,this.definitionsXmlns,e.xmlns),u=e.schemas[a];if(i in YS)return this.$base;{let l=u&&(u.complexTypes[i]||u.types[i]||u.elements[i]);if(l){let f=l.description(e,u.xmlns);n=typeof f=="string"?f:Ki.defaults(f,n)}}}return n}};at.ExtensionElement=tE;var ng=class extends dr{static{o(this,"ChoiceElement")}constructor(){super(...arguments),this.allowedChildren=nn(["any","choice","element","sequence"])}description(e,t){let n={};for(let s of this.children){let i=s.description(e,t);for(let a in i)n[a]=i[a]}return n}};at.ChoiceElement=ng;var D8=class extends dr{static{o(this,"EnumerationElement")}description(){return this[this.valueKey]}};at.EnumerationElement=D8;var rE=class extends dr{static{o(this,"ComplexTypeElement")}constructor(){super(...arguments),this.allowedChildren=nn(["all","annotation","choice","complexContent","sequence","simpleContent","attribute"])}description(e,t){let n={},s=!1,i={},a=this.children||[];for(let u of a){if(u instanceof $i){i[u.$name]=u.description(e);continue}!s&&(u instanceof ng||u instanceof sg||u instanceof hT||u instanceof fT||u instanceof cT)&&(s=!0,n=u.description(e,t))}return Object.keys(i).length>0&&(n[$i.Symbol]=i),n}};at.ComplexTypeElement=rE;var cT=class extends dr{static{o(this,"ComplexContentElement")}constructor(){super(...arguments),this.allowedChildren=nn(["extension","restriction"])}description(e,t){for(let n of this.children)if(n instanceof tE||n instanceof eE)return n.description(e,t);return{}}};at.ComplexContentElement=cT;var fT=class extends dr{static{o(this,"SimpleContentElement")}constructor(){super(...arguments),this.allowedChildren=nn(["extension"])}description(e,t){for(let n of this.children)if(n instanceof tE)return n.description(e,t);return{}}};at.SimpleContentElement=fT;var sg=class extends dr{static{o(this,"SequenceElement")}constructor(){super(...arguments),this.allowedChildren=nn(["any","choice","element","sequence"])}description(e,t){let n={};for(let s of this.children){if(s instanceof QS)continue;let i=s.description(e,t);for(let a in i)n[a]=i[a]}return n}};at.SequenceElement=sg;var $i=class extends dr{static{o(this,"AttributeElement")}description(e){return{type:this.$type,required:this.$use==="required"}}};at.AttributeElement=$i;$i.Symbol=Symbol("$attributes");var hT=class extends dr{static{o(this,"AllElement")}constructor(){super(...arguments),this.allowedChildren=nn(["choice","element"])}description(e,t){let n={};for(let s of this.children){if(s instanceof QS)continue;let i=s.description(e,t);for(let a in i)n[a]=i[a]}return n}};at.AllElement=hT;var pT=class extends dr{static{o(this,"MessageElement")}constructor(){super(...arguments),this.allowedChildren=nn(["part","documentation"]),this.element=null,this.parts=null}postProcess(e){let t=null,n=this.children||[];for(let s of n)if(s.name==="part"){t=s;break}if(t){if(t.$element){let s=[];delete this.parts;let i=(0,Yn.splitQName)(t.$element),a=Ku(i.prefix,this.definitionsXmlns,e.xmlns),u=e.schemas[a];if(this.element=u.elements[i.name],!this.element){_te(i.name+" is not present in wsdl and cannot be processed correctly.");return}this.element.targetNSAlias=i.prefix,this.element.targetNamespace=a,this.element.$lookupType=t.$element;let l=this.element.children;if(l.length>0)for(let f of l)s.push(this._getNestedLookupTypeString(f));if(s.length>0){s=s.join("_").split("_").filter(o(function(m){return m!=="^"},"removeEmptyLookupTypes"));let f=e.schemas[this.element.targetNamespace].xmlns;for(let h=0;h<s.length;h++)s[h]=this._createLookupTypeObject(s[h],f)}if(this.element.$lookupTypes=s,this.element.$type){let f=(0,Yn.splitQName)(this.element.$type),h=Ku(f.prefix,u.xmlns,this.definitionsXmlns,e.xmlns);if(h&&!(f.name in YS)){u=e.schemas[h];let m=u.complexTypes[f.name]||u.types[f.name]||u.elements[f.name];m&&(this.parts=m.description(e,u.xmlns))}}else{let f=this.element.description(e,u.xmlns);this.parts=f[i.name]}this.children.splice(0,1)}else{this.parts={},delete this.element;for(let s=0;s<this.children.length;s++){let i=this.children[s];if(i.name==="documentation")continue;(0,uT.ok)(i.name==="part","Expected part element");let a=(0,Yn.splitQName)(i.$type),u=Ku(a.prefix,this.definitionsXmlns,e.xmlns),l=a.name;typeof e.schemas[u]<"u"?this.parts[i.$name]=e.schemas[u].types[l]||e.schemas[u].complexTypes[l]:this.parts[i.$name]=i.$type,typeof this.parts[i.$name]=="object"&&(this.parts[i.$name].prefix=a.prefix,this.parts[i.$name].xmlns=u),this.children.splice(s--,1)}}this.deleteFixedAttrs()}}description(e){if(this.element)return this.element&&this.element.description(e);let t={};return t[this.$name]=this.parts,t}_createLookupTypeObject(e,t){let n=(0,Yn.splitQName)(e),s=n.prefix,i=n.name.split("#"),a=i[0],u=i[1];return{$namespace:t[s],$type:s+":"+a,$name:u}}_getNestedLookupTypeString(e){let t="^",n=this.ignoredNamespaces.concat("xs");return Object.hasOwnProperty.call(e,"$type")&&typeof e.$type=="string"&&n.indexOf(e.$type.split(":")[0])===-1&&(t+="_"+e.$type+"#"+e.$name),e.children.length>0&&e.children.forEach(s=>{let i=this._getNestedLookupTypeString(s).replace(/\^_/,"");i&&typeof i=="string"&&(t+="_"+i)}),t}};at.MessageElement=pT;var _8=class extends dr{static{o(this,"DocumentationElement")}};at.DocumentationElement=_8;var rg=class R8 extends dr{static{o(this,"SchemaElement")}constructor(){super(...arguments),this.allowedChildren=nn(["complexType","element","import","include","simpleType"]),this.complexTypes={},this.types={},this.elements={},this.includes=[]}merge(e){return(0,uT.ok)(e instanceof R8),Ki.merge(this.complexTypes,e.complexTypes),Ki.merge(this.types,e.types),Ki.merge(this.elements,e.elements),Ki.merge(this.xmlns,e.xmlns),Ki.merge(this,Ki.pickBy(e,(t,n)=>n.startsWith("$")&&!Object.hasOwnProperty.call(this,n))),this}addChild(e){if(!(e.$name in YS)){if(e instanceof wT||e instanceof ST){let t=e.$schemaLocation||e.$location;t&&this.includes.push({namespace:e.$namespace||e.$targetNamespace||this.$targetNamespace,location:t})}else e instanceof rE?this.complexTypes[e.$name]=e:e instanceof lT?this.elements[e.$name]=e:e instanceof ZS&&(this.types[e.$name]=e);this.children.pop()}}};at.SchemaElement=rg;var dT=class extends dr{static{o(this,"TypesElement")}constructor(){super(...arguments),this.allowedChildren=nn(["documentation","schema"]),this.schemas={}}addChild(e){(0,uT.ok)(e instanceof rg);let t=e.includes.find(i=>Object.hasOwnProperty.call(i,"namespace")),n=typeof t<"u"&&Object.hasOwnProperty.call(t,"namespace")&&e instanceof rg?t.namespace:void 0,s=e.$targetNamespace||e.includes[0]?.namespace||n;Object.hasOwnProperty.call(this.schemas,s)?s===e.$targetNamespace?this.schemas[s]=e:console.error('Target-Namespace "'+s+'" already in use by another Schema!'):this.schemas[s]=e}};at.TypesElement=dT;var P8=class O8 extends dr{static{o(this,"OperationElement")}constructor(){super(...arguments),this.allowedChildren=nn(["documentation","fault","input","operation","output"]),this.input=null,this.output=null,this.inputSoap=null,this.outputSoap=null,this.style="",this.soapAction=""}addChild(e){e instanceof O8&&(this.soapAction=e.$soapAction||"",this.style=e.$style||"",this.children.pop())}postProcess(e,t){let n=this.children;for(let s=0;s<n.length;s++){let i=n[s];if(i.name!=="input"&&i.name!=="output")continue;if(t==="binding"){this[i.name]=i,n.splice(s--,1);continue}let a=(0,Yn.splitQName)(i.$message).name,u=e.messages[a];u&&(u.postProcess(e),u.element?(e.messages[u.element.$name]=u,this[i.name]=u.element):this[i.name]=u,n.splice(s--,1))}this.deleteFixedAttrs()}description(e){let t=this.input?this.input.description(e):null,n=this.output?this.output.description(e):null;return{input:t&&t[Object.keys(t)[0]],output:n&&n[Object.keys(n)[0]]}}};at.OperationElement=P8;var mT=class extends dr{static{o(this,"PortTypeElement")}constructor(){super(...arguments),this.allowedChildren=nn(["documentation","operation"]),this.methods={}}postProcess(e){let t=this.children;if(!(typeof t>"u")){for(let n=0;n<t.length;n++){let s=t[n];s.name==="operation"&&(s.postProcess(e,"portType"),this.methods[s.$name]=s,t.splice(n--,1))}delete this.$name,this.deleteFixedAttrs()}}description(e){let t={};for(let n in this.methods){let s=this.methods[n];t[n]=s.description(e)}return t}};at.PortTypeElement=mT;var gT=class extends dr{static{o(this,"BindingElement")}constructor(){super(...arguments),this.allowedChildren=nn(["binding","documentation","operation","SecuritySpec"]),this.transport="",this.style="",this.methods={}}addChild(e){e.name==="binding"&&(this.transport=e.$transport,this.style=e.$style,this.children.pop())}postProcess(e){let t=(0,Yn.splitQName)(this.$type).name,n=e.portTypes[t],s=this.style,i=this.children;if(n){n.postProcess(e),this.methods=n.methods;for(let a=0;a<i.length;a++){let u=i[a];if(u.name!=="operation")continue;u.postProcess(e,"binding"),i.splice(a--,1),u.style||(u.style=s);let l=this.methods[u.$name];l&&(l.style=u.style,l.soapAction=u.soapAction,l.inputSoap=u.input||null,l.outputSoap=u.output||null,l.inputSoap&&l.inputSoap.deleteFixedAttrs(),l.outputSoap&&l.outputSoap.deleteFixedAttrs())}}delete this.$name,delete this.$type,this.deleteFixedAttrs()}description(e){let t={};for(let n in this.methods){let s=this.methods[n];t[n]=s.description(e)}return t}};at.BindingElement=gT;var k8=class extends dr{static{o(this,"PortElement")}constructor(){super(...arguments),this.allowedChildren=nn(["address","documentation"]),this.location=null}addChild(e){e.name==="address"&&typeof e.$location<"u"&&(this.location=e.$location)}};at.PortElement=k8;var yT=class extends dr{static{o(this,"ServiceElement")}constructor(){super(...arguments),this.allowedChildren=nn(["documentation","port"]),this.ports={}}postProcess(e){let t=this.children,n=e.bindings;if(t&&t.length>0)for(let s=0;s<t.length;s++){let i=t[s];if(i.name!=="port")continue;let a=(0,Yn.splitQName)(i.$binding).name,u=n[a];u&&(u.postProcess(e),this.ports[i.$name]={location:i.location,binding:u},t.splice(s--,1))}delete this.$name,this.deleteFixedAttrs()}description(e){let t={};for(let n in this.ports){let s=this.ports[n];t[n]=s.binding.description(e)}return t}};at.ServiceElement=yT;var vT=class extends dr{static{o(this,"DefinitionsElement")}constructor(){super(...arguments),this.allowedChildren=nn(["binding","documentation","import","message","portType","service","types"]),this.messages={},this.portTypes={},this.bindings={},this.services={},this.schemas={},this.descriptions={types:{},elements:{}}}init(){this.name!=="definitions"&&this.unexpected(this.nsName)}addChild(e){if(e instanceof dT)Ki.merge(this.schemas,e.schemas);else if(e instanceof pT)this.messages[e.$name]=e;else if(e.name==="import"){let t=new rg(e.$namespace,{});t.init(),this.schemas[e.$namespace]=t,this.schemas[e.$namespace].addChild(e)}else e instanceof mT?this.portTypes[e.$name]=e:e instanceof gT?(e.transport==="http://schemas.xmlsoap.org/soap/http"||e.transport==="http://www.w3.org/2003/05/soap/bindings/HTTP/")&&(this.bindings[e.$name]=e):e instanceof yT&&(this.services[e.$name]=e);this.children.pop()}};at.DefinitionsElement=vT;var nE=class extends dr{static{o(this,"BodyElement")}};at.BodyElement=nE;var wT=class extends dr{static{o(this,"IncludeElement")}};at.IncludeElement=wT;var ST=class extends dr{static{o(this,"ImportElement")}};at.ImportElement=ST;var Rte={all:hT,any:QS,binding:gT,body:nE,choice:ng,complexContent:cT,complexType:rE,definitions:vT,documentation:_8,element:lT,enumeration:D8,extension:tE,fault:dr,import:ST,include:wT,input:I8,message:pT,operation:P8,output:B8,port:k8,portType:mT,restriction:eE,schema:rg,sequence:sg,service:yT,simpleContent:fT,simpleType:ZS,types:dT,attribute:$i};function nn(r){let e={};for(let t of r)e[t.replace(/^_/,"")]=Rte[t]||dr;return e}o(nn,"buildAllowedChildren");function Ku(r,...e){for(let t of e)if(t?.[r])return t[r]}o(Ku,"findNs")});var CT=ye(Is=>{"use strict";var Pte=Is&&Is.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Ote=Is&&Is.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Cp=Is&&Is.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&Pte(t,e,n[s]);return Ote(t,e),t}})(),j8=Is&&Is.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Is,"__esModule",{value:!0});Is.WSDL=void 0;Is.trim=AT;Is.open_wsdl=F8;var kte=gt("assert"),Lte=j8(dw()),Vte=Cp(gt("fs")),V8=Cp(go()),ig=Cp(gt("path")),sE=Cp(oT()),Ute=j8(b8()),Mte=Cp(gt("url")),jte=xS(),Fte=x8(),Nr=Lu(),Ic=Cp(L8()),U8=(0,Lte.default)("node-soap"),M8="http://www.w3.org/2001/XMLSchema-instance",qte="http://schemas.xmlsoap.org/soap/envelope/";function AT(r){return r.trim()}o(AT,"trim");function iE(r){return r&&r.charAt(r.length-1)!==":"?r+":":r}o(iE,"appendColon");function ET(r){return r&&r.charAt(r.length-1)===":"?r.substring(0,r.length-1):r}o(ET,"noColonNameSpace");var aE=class{static{o(this,"WSDL")}constructor(e,t,n){this.ignoredNamespaces=["tns","targetNamespace","typedNamespace"],this.ignoreBaseNameSpaces=!1,this.valueKey="$value",this.xmlKey="$xml";let s;if(this.uri=t,this.callback=()=>{},this._includesWsdl=[],this.WSDL_CACHE={},n&&n.WSDL_CACHE&&(this.WSDL_CACHE=n.WSDL_CACHE),this._initializeOptions(n),typeof e=="string")e=(0,Ute.default)(e),s=this._fromXML;else if(typeof e=="object")s=this._fromServices;else throw new Error("WSDL constructor takes either an XML string or service definition");process.nextTick(()=>{try{s.call(this,e)}catch(i){return this.callback(i)}this.processIncludes(i=>{let a;if(i)return this.callback(i);try{this.definitions.deleteFixedAttrs();let u=this.services=this.definitions.services;if(u)for(a in u)u[a].postProcess(this.definitions);let l=this.definitions.complexTypes;if(l)for(a in l)l[a].deleteFixedAttrs();let f=this.definitions.bindings;for(let h in f){let m=f[h];typeof m.style>"u"&&(m.style="document");let g=m.methods,w=m.topElements={};for(let y in g)if((g[y].style||m.style)==="document"&&g[y].input){let S=g[y].input.$name,E="";g[y].output&&(E=g[y].output.$name),w[S]={methodName:y,outputName:E}}}this.xmlnsInEnvelope=this._xmlnsMap(),this.callback(i,this)}catch(u){this.callback(u)}})})}onReady(e){e&&(this.callback=e)}processIncludes(e){let t=this.definitions.schemas,n=[];for(let s in t){let i=t[s];n=n.concat(i.includes||[])}this._processNextInclude(n,e)}describeServices(){let e={};for(let t in this.services){let n=this.services[t];e[t]=n.description(this.definitions)}return e}toXML(){return this.xml||""}getSaxStream(e){let t=sE.createStream(!0,null);return e.pipe(t),t}xmlToObject(e,t){let n=typeof t=="function"?{}:sE.parser(!0,null),s=null,i={},u=[{name:null,object:i,schema:{Envelope:{Header:{Security:{UsernameToken:{Username:"string",Password:"string"}}},Body:{Fault:{faultcode:"string",faultstring:"string",detail:"string"}}}}}],l=new Map,f="soap",h={},m={};if(n.onopentag=w=>{let y=w.name,S=w.attributes,E=(0,Nr.splitQName)(y).name,b,T=u[u.length-1],A=T.schema,C={},x=!1,B=!1,F={},R=E;if(S.href){let K=S.href.substr(1);m[K]||(m[K]={hrefs:[],obj:null}),m[K].hrefs.push({par:T.object,key:E,obj:F})}S.id&&(m[S.id]||(m[S.id]={hrefs:[],obj:null}));for(b in S){let K=S[b];if(/^xmlns:|^xmlns$/.test(b)){let G=(0,Nr.splitQName)(b).name;h[G]=K,K===M8&&l.set(G,K),K===qte&&(f=G);continue}x=!0,C[b]=K}for(b in C){let K=(0,Nr.splitQName)(b);if(K.name==="nil"&&h[K.prefix]===M8&&C[b]&&(C[b].toLowerCase()==="true"||C[b]==="1")){B=!0;break}}if(x&&(F[this.options.attributesKey]=C),!s&&h[f]&&T.name==="Body"&&E!=="Fault"){let K=this.definitions.messages[E];if(!K)try{let G=!1;/Response$/.test(E)?E=E.replace(/Response$/,""):/Request$/.test(E)?(G=!0,E=E.replace(/Request$/,"")):/Solicit$/.test(E)&&(G=!0,E=E.replace(/Solicit$/,""));let he=this.definitions.portTypes,le=Object.keys(he),oe=he[le[0]];G?E=oe.methods[E].input.$name:E=oe.methods[E].output.$name,K=this.definitions.messages[E],this.definitions.messages[R]=this.definitions.messages[E]}catch(G){this.options.returnFault&&n.onerror(G)}A=K.description(this.definitions),s=R}let H,q;for(let K of l.keys())if(`${K}:type`in C){q=C[`${K}:type`];break}if(q){let K=(0,Nr.splitQName)(q),G;K.prefix===Nr.TNS_PREFIX?G=h[K.prefix]||h.xmlns:G=h[K.prefix];let he=this.findSchemaObject(G,K.name);he&&(H=he.description(this.definitions))}A&&A[E+"[]"]&&(E=E+"[]"),u.push({name:R,object:F,schema:H||A&&A[E],id:S.id,nil:B})},n.onclosetag=w=>{let y=u.pop(),S=y.object,E=u[u.length-1],b=E.object,T=E.schema,A=(0,Nr.splitQName)(w).name;if(typeof y.schema=="string"&&(y.schema==="string"||y.schema.split(":")[1]==="string")&&typeof S=="object"&&Object.keys(S).length===0&&(S=y.object=this.options.preserveWhitespace&&y.text||""),y.nil===!0)if(this.options.handleNilAsNull)S=null;else return;V8.isPlainObject(S)&&!Object.keys(S).length&&(S=null),T&&T[A+"[]"]?(b[A]||(b[A]=[]),b[A].push(S)):A in b?(Array.isArray(b[A])||(b[A]=[b[A]]),b[A].push(S)):b[A]=S,y.id&&(m[y.id].obj=S)},n.oncdata=w=>{let y=w;if(w=AT(w),!!w.length)if(/<\?xml[\s\S]+\?>/.test(w)){let S=u[u.length-1],E=this.xmlToObject(w);S.object[this.options.attributesKey]?S.object[this.options.valueKey]=E:S.object=E}else n.ontext(y)},n.onerror=w=>{throw n.resume(),{Fault:{faultcode:500,faultstring:"Invalid XML",detail:new Error(w).message,statusCode:500}}},n.ontext=w=>{let y=u[u.length-1],S=w;if(w=AT(w),!w.length){this.options.preserveWhitespace&&(y.text=(y.text||"")+S);return}let E=(0,Nr.splitQName)(y.schema).name,b;this.options&&this.options.customDeserializer&&this.options.customDeserializer[E]?b=this.options.customDeserializer[E](w,y):E==="int"||E==="integer"||E==="short"||E==="long"?b=parseInt(w,10):E==="double"||E==="float"||E==="decimal"?b=Number(w):E==="bool"||E==="boolean"?b=w.toLowerCase()==="true"||w==="1":E==="dateTime"||E==="date"?b=new Date(w):(this.options.preserveWhitespace&&(w=S),typeof y.object!="string"?b=w:b=y.object+w),y.object[this.options.attributesKey]?y.object[this.options.valueKey]=b:y.object=b},typeof t=="function"){let w=sE.createStream(!0,null);w.on("opentag",n.onopentag),w.on("closetag",n.onclosetag),w.on("cdata",n.oncdata),w.on("text",n.ontext),e.pipe(w).on("error",y=>{t(y)}).on("end",()=>{let y;try{y=g()}catch(S){return t(S)}t(null,y)});return}return n.write(e).close(),g();function g(){for(let w in m){let y=m[w];for(let S of y.hrefs)Object.assign(S.obj,y.obj)}if(i.Envelope){let w=i.Envelope.Body;if(w&&w.Fault){let y=w.Fault,S=y.faultcode&&y.faultcode.$value,E=y.faultstring&&y.faultstring.$value,b=y.detail&&y.detail.$value;S=S||y.faultcode,E=E||y.faultstring,b=b||y.detail,S=S||y.Code&&`${y.Code.Value}: ${y.Code.Subcode&&y.Code.Subcode.Value}`,E=E||y.Reason&&y.Reason.Text.$value,E=E||y.Reason&&y.Reason.Text,b=b||y.Detail;let T=new Error(S+": "+E+(b?": "+JSON.stringify(b):""));throw T.root=i,T}return i.Envelope}return i}o(g,"finish")}findSchemaObject(e,t){if(!e||!t)return null;let n=null;if(this.definitions.schemas){let s=this.definitions.schemas[e];s&&(t.indexOf(":")!==-1&&(t=t.substring(t.indexOf(":")+1,t.length)),n=s.complexTypes[t]||s.types[t]||s.elements[t])}return n}objectToDocumentXML(e,t,n,s,i){if(t&&t._xml)return t._xml;let a={};a[e]=t;let u=i?this.findSchemaObject(s,i):null;return this.objectToXML(a,null,n,s,!0,null,u)}objectToRpcXML(e,t,n,s,i){let a=[],u=this.definitions,l="_xmlns";n=n||(0,Nr.findPrefix)(u.xmlns,s),s=s||u.xmlns[n],n=n===Nr.TNS_PREFIX?"":n+":",a.push(["<",n,e,">"].join(""));for(let f in t)if(Object.prototype.hasOwnProperty.call(t,f)&&f!==l){let h=t[f];if(f===this.options.xmlKey)a.push(this.objectToXML({[f]:h},null,n,s));else{let m=(i?"":n)+f,g=[];if(typeof h=="object"&&Object.prototype.hasOwnProperty.call(h,this.options.attributesKey)){let w=h[this.options.attributesKey];for(let y in w)g.push(" "+y+'="'+w[y]+'"')}a.push(["<",m].concat(g).concat(">").join("")),a.push(typeof h=="object"?this.objectToXML(h,f,n,s):(0,Nr.xmlEscape)(h)),a.push(["</",m,">"].join(""))}}return a.push(["</",n,e,">"].join("")),a.join("")}isIgnoredNameSpace(e){return this.options.ignoredNamespaces.indexOf(e)>-1}filterOutIgnoredNameSpace(e){let t=ET(e);return this.isIgnoredNameSpace(t)?"":t}objectToXML(e,t,n,s,i,a,u,l){let f=this.definitions.schemas[s];if(this.options.overrideElementKey&&Object.keys(this.options.overrideElementKey).length>0)for(let A in this.options.overrideElementKey){let C=this.options.overrideElementKey[A];e&&e[A]&&(Object.defineProperty(e,C,Object.getOwnPropertyDescriptor(e,A)),delete e[A])}let h=n?n.parent:void 0;typeof h<"u"&&(n=n.current),h=ET(h),this.isIgnoredNameSpace(h)&&(h="");let m=!f,g=f&&f.$elementFormDefault==="qualified",w=[],y=(n||g)&&n!==Nr.TNS_PREFIX,S="";s&&i&&(this.options.overrideRootElement&&this.options.overrideRootElement.xmlnsAttributes?this.options.overrideRootElement.xmlnsAttributes.forEach(A=>{S+=" "+A.name+'="'+A.value+'"'}):(y&&!this.isIgnoredNameSpace(n)&&(S+=" xmlns:"+n+'="'+s+'"'),(g||m)&&(S+=' xmlns="'+s+'"'))),l?l.pushContext():(l=new Fte.NamespaceContext,l.declareNamespace(n,s)),a&&!(this.options.overrideRootElement&&this.options.overrideRootElement.xmlnsAttributes)&&(S=a);let E="";this.options.overrideRootElement&&i?E=this.options.overrideRootElement.namespace:y&&(g||i||m)&&!this.isIgnoredNameSpace(n)&&(E=n);let b,T;if(Array.isArray(e)){let A="",C=!1,x=/^([^:]+):([^:]+)$/.exec(t);for(x?(A=x[1],t=x[2]):t[0]===":"&&(C=!0,t=t.substr(1)),b=0,T=e.length;b<T;b++){let B=e[b],F=this.processAttributes(B,l),R=A||h||E,H=this.objectToXML(B,t,n,s,!1,null,u,l),q=["<",t,F,S];C||(q=["<",iE(R),t,F,S]),H===""&&this.options.useEmptyTag?(q.push(" />"),w.push(q.join(""))):(q.push(">"),(this.options.namespaceArrayElements||b===0)&&w.push(q.join("")),w.push(H),(this.options.namespaceArrayElements||b===T-1)&&(C?w.push(["</",t,">"].join("")):w.push(["</",iE(R),t,">"].join(""))))}}else if(typeof e=="object"){let A="";for(t in e){if(e.hasOwnProperty||(e=Object.assign({},e)),!Object.prototype.hasOwnProperty.call(e,t)||t===this.options.attributesKey)continue;if(t===this.options.xmlKey)return l.popContext(),e[t];if(t===this.options.valueKey)return l.popContext(),(0,Nr.xmlEscape)(e[t]);let C=e[t];if(typeof C>"u")continue;let x=this.processAttributes(C,l),B="",F="",R=!1,H=/^([^:]+):([^:]+)$/.exec(t);if(H?(F=H[1]+":",t=H[2]):t[0]===":"&&(R=!0,t=t.substr(1)),i)B=this.objectToXML(C,t,n,s,!1,null,u,l);else if(this.definitions.schemas)if(f){let K=this.findChildSchemaObject(u,t);if(K&&(K.$type&&K.$type.indexOf("xsd:")===-1||K.$ref||K.$name)){let G="",he="",le,oe="",Z=K.$ref||K.$name;if(Z){Z=(0,Nr.splitQName)(Z),he=Z.name,Z.prefix===Nr.TNS_PREFIX?(le=K.$targetNamespace,G=l.registerNamespace(le),this.isIgnoredNameSpace(G)&&(G=n)):(G=Z.prefix,this.isIgnoredNameSpace(G)&&(G=n),le=f.xmlns[G]||this.definitions.xmlns[G]);let Se=!1;K.$name&&K.targetNamespace===void 0&&(K.$form==="unqualified"?Se=!0:K.$form==="qualified"?Se=!1:Se=f.$elementFormDefault!=="qualified"),Se&&(G=""),le&&G&&l.declareNamespace(G,le)&&(oe=" xmlns:"+G+'="'+le+'"',S.includes(G)||(A=oe,S+=oe))}let fe;if(K.$type){let Se=(0,Nr.splitQName)(K.$type),Ke=K.$baseNameSpace||Se.prefix,be=f.xmlns[Ke]||this.definitions.xmlns[Ke];le=be,be!=="http://www.w3.org/2001/XMLSchema"&&Ke!==Nr.TNS_PREFIX&&l.addNamespace(Ke,be),fe=this.findSchemaType(Se.name,be)||K}else fe=this.findSchemaObject(le,he)||K;K.$baseNameSpace&&this.options.ignoreBaseNameSpaces&&(G=n,le=s),this.options.ignoreBaseNameSpaces&&(G="",le=""),E=G,Array.isArray(C)?(G={current:G,parent:E},oe=oe&&oe.length?oe:A):oe=null,B=this.objectToXML(C,t,G,le,!1,oe,fe,l)}else e[this.options.attributesKey]&&e[this.options.attributesKey].xsi_type?(F=e[this.options.attributesKey].xsi_type.prefix,l.addNamespace(e[this.options.attributesKey].xsi_type.prefix,e[this.options.attributesKey].xsi_type.xmlns),B=this.objectToXML(C,t,e[this.options.attributesKey].xsi_type.prefix,e[this.options.attributesKey].xsi_type.xmlns,!1,null,null,l)):(Array.isArray(C)&&(R?t=":"+t:t=F+t),B=this.objectToXML(C,t,n,s,!1,null,null,l))}else B=this.objectToXML(C,t,n,s,!1,null,null,l);E=ET(E),y&&!g&&i&&!this.options.overrideRootElement?E=n:this.isIgnoredNameSpace(E)&&(E="");let q=!B&&this.options.useEmptyTag;Array.isArray(C)||w.push(["<",R?"":iE(F||E),t,x,S,C===null?' xsi:nil="true"':"",q?" />":">"].join("")),q||(w.push(B),Array.isArray(C)||w.push(["</",R?"":iE(F||E),t,">"].join("")))}}else e!==void 0&&w.push(this.options.escapeXML?(0,Nr.xmlEscape)(e):e);return l.popContext(),w.join("")}processAttributes(e,t){let n="";e==null&&(e=[]);let s=e[this.options.attributesKey]||{};if(s&&s.xsi_type){let i=s.xsi_type,a=i.prefix||i.namespace;i.xmlns&&(a?t.declareNamespace(a,i.xmlns):a=t.registerNamespace(i.xmlns),i.prefix=a)}return Object.keys(s).forEach(i=>{let a=s[i];if(i==="xsi_type"){let u=a.type;a.prefix&&(u=`${a.prefix}:${u}`),n+=` xsi:type="${u}"`,a.xmlns&&(n+=` xmlns:${a.prefix}="${a.xmlns}"`)}else n+=` ${i}="${(0,Nr.xmlEscape)(a)}"`}),n}findSchemaType(e,t){if(!this.definitions.schemas||!e||!t)return null;let n=this.definitions.schemas[t];return!n||!n.complexTypes?null:n.complexTypes[e]}findChildSchemaObject(e,t,n){if(!e||!t||(n||(n=[]),n.indexOf(e)>=0))return null;n=n.concat([e]);let s=null,i=0,a;if(Array.isArray(e.$lookupTypes)&&e.$lookupTypes.length){let f=e.$lookupTypes;for(i=0;i<f.length;i++){let h=f[i];if(h.$name===t){s=h;break}}}let u=e;if(u.$name===t&&u.name==="element"||u.$ref&&(a=(0,Nr.splitQName)(u.$ref),a.name===t))return u;let l;if(u.$type&&n.length===1){let f=(0,Nr.splitQName)(u.$type);f.prefix===Nr.TNS_PREFIX?l=e.$targetNamespace:l=this.definitions.xmlns[f.prefix];let h=this.findSchemaType(f.name,l);if(h)return this.findChildSchemaObject(h,t,n)}if(u.$base&&(!Array.isArray(u.children)||!u.children.length)){let f=(0,Nr.splitQName)(u.$base);l=e.$targetNamespace,f.prefix!==Nr.TNS_PREFIX&&(l=this.definitions.xmlns[f.prefix]);let h=this.findSchemaType(f.name,l);if(h)return this.findChildSchemaObject(h,t,n)}if(Array.isArray(u.children)&&u.children.length>0)for(let f of u.children){if(s=this.findChildSchemaObject(f,t,n),s)break;if(f.$base){let h=(0,Nr.splitQName)(f.$base),m=h.prefix===Nr.TNS_PREFIX?"":h.prefix;l=f.xmlns[h.prefix]||f.schemaXmlns[h.prefix];let g=this.findSchemaType(h.name,l);if(g&&(s=this.findChildSchemaObject(g,t,n),s)){s.$baseNameSpace=m;break}}}return!s&&u.$name===t?u:s}_initializeOptions(e){this._originalIgnoredNamespaces=(e||{}).ignoredNamespaces,this.options={};let t=e?e.ignoredNamespaces:null;t&&(Array.isArray(t.namespaces)||typeof t.namespaces=="string")?t.override?this.options.ignoredNamespaces=t.namespaces:this.options.ignoredNamespaces=this.ignoredNamespaces.concat(t.namespaces):this.options.ignoredNamespaces=this.ignoredNamespaces,this.options.valueKey=e.valueKey||this.valueKey,this.options.xmlKey=e.xmlKey||this.xmlKey,e.escapeXML!==void 0?this.options.escapeXML=e.escapeXML:this.options.escapeXML=!0,e.returnFault!==void 0?this.options.returnFault=e.returnFault:this.options.returnFault=!1,this.options.handleNilAsNull=!!e.handleNilAsNull,e.namespaceArrayElements!==void 0?this.options.namespaceArrayElements=e.namespaceArrayElements:this.options.namespaceArrayElements=!0,this.options.wsdl_headers=e.wsdl_headers,this.options.wsdl_options=e.wsdl_options,e.httpClient&&(this.options.httpClient=e.httpClient),e.request&&(this.options.request=e.request);let n=e?e.ignoreBaseNameSpaces:null;n!==null&&typeof n<"u"?this.options.ignoreBaseNameSpaces=n:this.options.ignoreBaseNameSpaces=this.ignoreBaseNameSpaces,this.options.forceSoap12Headers=e.forceSoap12Headers,this.options.customDeserializer=e.customDeserializer,this.options.forceUseSchemaXmlns=e.forceUseSchemaXmlns,e.overrideElementKey!==void 0&&(this.options.overrideElementKey=e.overrideElementKey),e.overrideRootElement!==void 0&&(this.options.overrideRootElement=e.overrideRootElement),this.options.useEmptyTag=!!e.useEmptyTag}_processNextInclude(e,t){let n=e.shift();if(!n)return t();let s;!/^https?:/i.test(this.uri)&&!/^https?:/i.test(n.location)?(this.options.wsdl_options!==void 0&&Object.prototype.hasOwnProperty.call(this.options.wsdl_options,"fixedPath")?this.options.wsdl_options.fixedPath:!1)?s=ig.resolve(ig.dirname(this.uri),ig.parse(n.location).base):s=ig.resolve(ig.dirname(this.uri),n.location):s=Mte.resolve(this.uri||"",n.location);let i=Object.assign({},this.options);if(i.ignoredNamespaces=this._originalIgnoredNamespaces||this.options.ignoredNamespaces,i.WSDL_CACHE=this.WSDL_CACHE,this.options.wsdl_options!==void 0&&typeof this.options.wsdl_options.overrideImportLocation=="function")try{s=this.options.wsdl_options.overrideImportLocation(s,this.uri,n.location,i)}catch(a){return t(a)}Hte(s,i,(a,u)=>{if(a)return t(a);if(this._includesWsdl.push(u),u.definitions instanceof Ic.DefinitionsElement)V8.mergeWith(this.definitions,u.definitions,(l,f)=>l instanceof Ic.SchemaElement?l.merge(f):void 0);else return t(new Error("wsdl.defintions is not an instance of elements.DefinitionsElement"));this._processNextInclude(e,l=>{t(l)})})}_parse(e){let t=sE.parser(!0,null),n=[],s=null,i=null,a=null,u=null,l=this.options;return t.onopentag=f=>{let h=f.name,m=f.attributes,g=n[n.length-1],w=(0,Nr.splitQName)(h).name;if(w==="schema"&&(u=m),g)try{g.startElement(n,h,m,l,u)}catch(y){if(this.options.strict)throw y;n.push(new Ic.Element(h,m,l,u))}else if(w==="definitions")s=new Ic.DefinitionsElement(h,m,l),n.push(s);else if(w==="schema")s=new Ic.DefinitionsElement("definitions",{},{}),i=new Ic.TypesElement("types",{},{}),a=new Ic.SchemaElement(h,m,l),i.addChild(a),s.addChild(i),n.push(a);else throw w==="html"?new Error("Root element of WSDL was <html>. This is likely an authentication issue."):new Error("Unexpected root element of WSDL or include")},t.onclosetag=f=>{let h=n[n.length-1];(0,kte.ok)(h,"Unmatched close tag: "+f),h.endElement(n,f)},t.write(e).close(),s}_fromXML(e){this.definitions=this._parse(e),this.definitions.descriptions={types:{},elements:{}},this.xml=e}_fromServices(e){}_xmlnsMap(){let e=this.definitions.xmlns,t="";for(let n in e){if(n===""||n===Nr.TNS_PREFIX)continue;let s=e[n];switch(s){case"http://xml.apache.org/xml-soap":case"http://schemas.xmlsoap.org/wsdl/":case"http://schemas.xmlsoap.org/wsdl/soap/":case"http://schemas.xmlsoap.org/wsdl/soap12/":case"http://schemas.xmlsoap.org/soap/encoding/":case"http://www.w3.org/2001/XMLSchema":continue}~s.indexOf("http://schemas.xmlsoap.org/")||~s.indexOf("http://www.w3.org/")||~s.indexOf("http://xml.apache.org/")||(t+=" xmlns:"+n+'="'+s+'"')}return t}};Is.WSDL=aE;function Hte(r,e,t){let n,s;typeof e=="function"?(n={},s=e):(n=e,s=t);let i=n.WSDL_CACHE[r];return i?s.call(i,null,i):F8(r,n,s)}o(Hte,"open_wsdl_recursive");function F8(r,e,t){let n,s;typeof e=="function"?(n={},s=e):typeof t=="function"&&(n=e,s=t);let i=n.WSDL_CACHE||{},a=n.wsdl_headers,u=n.wsdl_options,l;return/^<\?xml[^>]*?>/i.test(r)?(l=new aE(r,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s)):/^https?:/i.test(r)?(U8("Reading url: %s",r),(n.httpClient||new jte.HttpClient(n)).request(r,null,(h,m,g)=>{h?s(h):m&&m.status===200?(l=new aE(g,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s)):s(new Error("Invalid WSDL URL: "+r+`
78
-
79
- \r Code: `+m.status+`
80
-
81
- \r Response Body: `+m.data))},a,u)):(U8("Reading file: %s",r),Vte.readFile(r,"utf8",(f,h)=>{f?s(f):(l=new aE(h,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s))})),l}o(F8,"open_wsdl")});var H8=ye(q8=>{"use strict";Object.defineProperty(q8,"__esModule",{value:!0})});var G8=ye(Ot=>{"use strict";var K8=Ot&&Ot.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Kte=Ot&&Ot.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),$te=Ot&&Ot.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&K8(t,e,n[s]);return Kte(t,e),t}})(),Xte=Ot&&Ot.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&K8(e,r,t)};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.WSDL=Ot.passwordDigest=Ot.Server=Ot.WSSecurityCertWithToken=Ot.WSSecurityPlusCert=Ot.WSSecurityCert=Ot.WSSecurity=Ot.NTLMSecurity=Ot.ClientSSLSecurityPFX=Ot.ClientSSLSecurity=Ot.BearerSecurity=Ot.BasicAuthSecurity=Ot.HttpClient=Ot.Client=Ot.security=void 0;Ot.createClient=X8;Ot.createClientAsync=sre;Ot.listen=ire;var Gte=bN(),Wte=$te(iT()),Jte=aT(),zte=Lu(),$8=CT();Ot.security=Wte;var Yte=bN();Object.defineProperty(Ot,"Client",{enumerable:!0,get:o(function(){return Yte.Client},"get")});var Qte=xS();Object.defineProperty(Ot,"HttpClient",{enumerable:!0,get:o(function(){return Qte.HttpClient},"get")});var Ao=iT();Object.defineProperty(Ot,"BasicAuthSecurity",{enumerable:!0,get:o(function(){return Ao.BasicAuthSecurity},"get")});Object.defineProperty(Ot,"BearerSecurity",{enumerable:!0,get:o(function(){return Ao.BearerSecurity},"get")});Object.defineProperty(Ot,"ClientSSLSecurity",{enumerable:!0,get:o(function(){return Ao.ClientSSLSecurity},"get")});Object.defineProperty(Ot,"ClientSSLSecurityPFX",{enumerable:!0,get:o(function(){return Ao.ClientSSLSecurityPFX},"get")});Object.defineProperty(Ot,"NTLMSecurity",{enumerable:!0,get:o(function(){return Ao.NTLMSecurity},"get")});Object.defineProperty(Ot,"WSSecurity",{enumerable:!0,get:o(function(){return Ao.WSSecurity},"get")});Object.defineProperty(Ot,"WSSecurityCert",{enumerable:!0,get:o(function(){return Ao.WSSecurityCert},"get")});Object.defineProperty(Ot,"WSSecurityPlusCert",{enumerable:!0,get:o(function(){return Ao.WSSecurityPlusCert},"get")});Object.defineProperty(Ot,"WSSecurityCertWithToken",{enumerable:!0,get:o(function(){return Ao.WSSecurityCertWithToken},"get")});var Zte=aT();Object.defineProperty(Ot,"Server",{enumerable:!0,get:o(function(){return Zte.Server},"get")});var ere=Lu();Object.defineProperty(Ot,"passwordDigest",{enumerable:!0,get:o(function(){return ere.passwordDigest},"get")});Xte(H8(),Ot);var tre=CT();Object.defineProperty(Ot,"WSDL",{enumerable:!0,get:o(function(){return tre.WSDL},"get")});function rre(r,e,t,n){e.has(r)?process.nextTick(()=>{n(null,e.get(r))}):t((s,i)=>{if(s)return n(s);e.set(r,i),n(null,i)})}o(rre,"getFromCache");function nre(r,e,t){typeof e=="function"&&(t=e,e={});let n=o(s=>{(0,$8.open_wsdl)(r,e,s)},"openWsdl");if(e.disableCache===!0)n(t);else{let s;e.wsdlCache?s=e.wsdlCache:s=zte.wsdlCacheSingleton,rre(r,s,n,t)}}o(nre,"_requestWSDL");function X8(r,e,t,n){let s=n,i,a;typeof e=="function"?(i=e,s=t,a={}):typeof t=="function"&&(a=e,i=t,s=n),s=a.endpoint||s,nre(r,a,(u,l)=>{i(u,l&&new Gte.Client(l,s,a))})}o(X8,"createClient");function sre(r,e,t){return typeof e>"u"&&(e={}),new Promise((n,s)=>{X8(r,e,(i,a)=>{i&&s(i),n(a)},t)})}o(sre,"createClientAsync");function ire(r,e,t,n,s){let i,a,u="";typeof e=="object"&&!(e instanceof RegExp)?(i=e,a=i.path,t=i.services,n=i.xml,u=i.uri):(a=e,i={path:e,services:t,callback:s});let l=new $8.WSDL(n||t,u,i);return new Jte.Server(r,a,t,l,i)}o(ire,"listen")});var oE=ye(bT=>{"use strict";(function(){bT.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
82
- `},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(bT)});var Va=ye((Q8,$u)=>{"use strict";(function(){var r,e,t,n,s,i,a,u=[].slice,l={}.hasOwnProperty;r=o(function(){var f,h,m,g,w,y;if(y=arguments[0],w=2<=arguments.length?u.call(arguments,1):[],s(Object.assign))Object.assign.apply(null,arguments);else for(f=0,m=w.length;f<m;f++)if(g=w[f],g!=null)for(h in g)l.call(g,h)&&(y[h]=g[h]);return y},"assign"),s=o(function(f){return!!f&&Object.prototype.toString.call(f)==="[object Function]"},"isFunction"),i=o(function(f){var h;return!!f&&((h=typeof f)=="function"||h==="object")},"isObject"),t=o(function(f){return s(Array.isArray)?Array.isArray(f):Object.prototype.toString.call(f)==="[object Array]"},"isArray"),n=o(function(f){var h;if(t(f))return!f.length;for(h in f)if(l.call(f,h))return!1;return!0},"isEmpty"),a=o(function(f){var h,m;return i(f)&&(m=Object.getPrototypeOf(f))&&(h=m.constructor)&&typeof h=="function"&&h instanceof h&&Function.prototype.toString.call(h)===Function.prototype.toString.call(Object)},"isPlainObject"),e=o(function(f){return s(f.valueOf)?f.valueOf():f},"getValue"),$u.exports.assign=r,$u.exports.isFunction=s,$u.exports.isObject=i,$u.exports.isArray=t,$u.exports.isEmpty=n,$u.exports.isPlainObject=a,$u.exports.getValue=e}).call(Q8)});var xT=ye((Z8,e5)=>{"use strict";(function(){var r;e5.exports=r=(function(){function e(){}return o(e,"XMLDOMImplementation"),e.prototype.hasFeature=function(t,n){return!0},e.prototype.createDocumentType=function(t,n,s){throw new Error("This DOM method is not implemented.")},e.prototype.createDocument=function(t,n,s){throw new Error("This DOM method is not implemented.")},e.prototype.createHTMLDocument=function(t){throw new Error("This DOM method is not implemented.")},e.prototype.getFeature=function(t,n){throw new Error("This DOM method is not implemented.")},e})()}).call(Z8)});var n5=ye((t5,r5)=>{"use strict";(function(){var r;r5.exports=r=(function(){function e(){}return o(e,"XMLDOMErrorHandler"),e.prototype.handleError=function(t){throw new Error(t)},e})()}).call(t5)});var a5=ye((s5,i5)=>{"use strict";(function(){var r;i5.exports=r=(function(){function e(t){this.arr=t||[]}return o(e,"XMLDOMStringList"),Object.defineProperty(e.prototype,"length",{get:o(function(){return this.arr.length},"get")}),e.prototype.item=function(t){return this.arr[t]||null},e.prototype.contains=function(t){return this.arr.indexOf(t)!==-1},e})()}).call(s5)});var l5=ye((o5,u5)=>{"use strict";(function(){var r,e,t;e=n5(),t=a5(),u5.exports=r=(function(){function n(){var s;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new e,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=s=Object.create(this.defaultParams)}return o(n,"XMLDOMConfiguration"),Object.defineProperty(n.prototype,"parameterNames",{get:o(function(){return new t(Object.keys(this.defaultParams))},"get")}),n.prototype.getParameter=function(s){return this.params.hasOwnProperty(s)?this.params[s]:null},n.prototype.canSetParameter=function(s,i){return!0},n.prototype.setParameter=function(s,i){return i!=null?this.params[s]=i:delete this.params[s]},n})()}).call(o5)});var sn=ye((c5,f5)=>{"use strict";(function(){f5.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(c5)});var NT=ye((h5,p5)=>{"use strict";(function(){var r,e,t;r=sn(),t=Ws(),p5.exports=e=(function(){function n(s,i,a){if(this.parent=s,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),i==null)throw new Error("Missing attribute name. "+this.debugInfo(i));this.name=this.stringify.name(i),this.value=this.stringify.attValue(a),this.type=r.Attribute,this.isId=!1,this.schemaTypeInfo=null}return o(n,"XMLAttribute"),Object.defineProperty(n.prototype,"nodeType",{get:o(function(){return this.type},"get")}),Object.defineProperty(n.prototype,"ownerElement",{get:o(function(){return this.parent},"get")}),Object.defineProperty(n.prototype,"textContent",{get:o(function(){return this.value},"get"),set:o(function(s){return this.value=s||""},"set")}),Object.defineProperty(n.prototype,"namespaceURI",{get:o(function(){return""},"get")}),Object.defineProperty(n.prototype,"prefix",{get:o(function(){return""},"get")}),Object.defineProperty(n.prototype,"localName",{get:o(function(){return this.name},"get")}),Object.defineProperty(n.prototype,"specified",{get:o(function(){return!0},"get")}),n.prototype.clone=function(){return Object.create(this)},n.prototype.toString=function(s){return this.options.writer.attribute(this,this.options.writer.filterOptions(s))},n.prototype.debugInfo=function(s){return s=s||this.name,s==null?"parent: <"+this.parent.name+">":"attribute: {"+s+"}, parent: <"+this.parent.name+">"},n.prototype.isEqualNode=function(s){return!(s.namespaceURI!==this.namespaceURI||s.prefix!==this.prefix||s.localName!==this.localName||s.value!==this.value)},n})()}).call(h5)});var uE=ye((d5,m5)=>{"use strict";(function(){var r;m5.exports=r=(function(){function e(t){this.nodes=t}return o(e,"XMLNamedNodeMap"),Object.defineProperty(e.prototype,"length",{get:o(function(){return Object.keys(this.nodes).length||0},"get")}),e.prototype.clone=function(){return this.nodes=null},e.prototype.getNamedItem=function(t){return this.nodes[t]},e.prototype.setNamedItem=function(t){var n;return n=this.nodes[t.nodeName],this.nodes[t.nodeName]=t,n||null},e.prototype.removeNamedItem=function(t){var n;return n=this.nodes[t],delete this.nodes[t],n||null},e.prototype.item=function(t){return this.nodes[Object.keys(this.nodes)[t]]||null},e.prototype.getNamedItemNS=function(t,n){throw new Error("This DOM method is not implemented.")},e.prototype.setNamedItemNS=function(t){throw new Error("This DOM method is not implemented.")},e.prototype.removeNamedItemNS=function(t,n){throw new Error("This DOM method is not implemented.")},e})()}).call(d5)});var lE=ye((g5,y5)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f=o(function(m,g){for(var w in g)h.call(g,w)&&(m[w]=g[w]);function y(){this.constructor=m}return o(y,"ctor"),y.prototype=g.prototype,m.prototype=new y,m.__super__=g.prototype,m},"extend"),h={}.hasOwnProperty;l=Va(),u=l.isObject,a=l.isFunction,i=l.getValue,s=Ws(),r=sn(),e=NT(),n=uE(),y5.exports=t=(function(m){f(g,m);function g(w,y,S){var E,b,T,A;if(g.__super__.constructor.call(this,w),y==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(y),this.type=r.Element,this.attribs={},this.schemaTypeInfo=null,S!=null&&this.attribute(S),w.type===r.Document&&(this.isRoot=!0,this.documentObject=w,w.rootObject=this,w.children)){for(A=w.children,b=0,T=A.length;b<T;b++)if(E=A[b],E.type===r.DocType){E.name=this.name;break}}}return o(g,"XMLElement"),Object.defineProperty(g.prototype,"tagName",{get:o(function(){return this.name},"get")}),Object.defineProperty(g.prototype,"namespaceURI",{get:o(function(){return""},"get")}),Object.defineProperty(g.prototype,"prefix",{get:o(function(){return""},"get")}),Object.defineProperty(g.prototype,"localName",{get:o(function(){return this.name},"get")}),Object.defineProperty(g.prototype,"id",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(g.prototype,"className",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(g.prototype,"classList",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(g.prototype,"attributes",{get:o(function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new n(this.attribs)),this.attributeMap},"get")}),g.prototype.clone=function(){var w,y,S,E;S=Object.create(this),S.isRoot&&(S.documentObject=null),S.attribs={},E=this.attribs;for(y in E)h.call(E,y)&&(w=E[y],S.attribs[y]=w.clone());return S.children=[],this.children.forEach(function(b){var T;return T=b.clone(),T.parent=S,S.children.push(T)}),S},g.prototype.attribute=function(w,y){var S,E;if(w!=null&&(w=i(w)),u(w))for(S in w)h.call(w,S)&&(E=w[S],this.attribute(S,E));else a(y)&&(y=y.apply()),this.options.keepNullAttributes&&y==null?this.attribs[w]=new e(this,w,""):y!=null&&(this.attribs[w]=new e(this,w,y));return this},g.prototype.removeAttribute=function(w){var y,S,E;if(w==null)throw new Error("Missing attribute name. "+this.debugInfo());if(w=i(w),Array.isArray(w))for(S=0,E=w.length;S<E;S++)y=w[S],delete this.attribs[y];else delete this.attribs[w];return this},g.prototype.toString=function(w){return this.options.writer.element(this,this.options.writer.filterOptions(w))},g.prototype.att=function(w,y){return this.attribute(w,y)},g.prototype.a=function(w,y){return this.attribute(w,y)},g.prototype.getAttribute=function(w){return this.attribs.hasOwnProperty(w)?this.attribs[w].value:null},g.prototype.setAttribute=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNode=function(w){return this.attribs.hasOwnProperty(w)?this.attribs[w]:null},g.prototype.setAttributeNode=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNode=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNS=function(w,y,S){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNodeNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNodeNS=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.hasAttribute=function(w){return this.attribs.hasOwnProperty(w)},g.prototype.hasAttributeNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttribute=function(w,y){return this.attribs.hasOwnProperty(w)?this.attribs[w].isId:y},g.prototype.setIdAttributeNS=function(w,y,S){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttributeNode=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByClassName=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isEqualNode=function(w){var y,S,E;if(!g.__super__.isEqualNode.apply(this,arguments).isEqualNode(w)||w.namespaceURI!==this.namespaceURI||w.prefix!==this.prefix||w.localName!==this.localName||w.attribs.length!==this.attribs.length)return!1;for(y=S=0,E=this.attribs.length-1;0<=E?S<=E:S>=E;y=0<=E?++S:--S)if(!this.attribs[y].isEqualNode(w.attribs[y]))return!1;return!0},g})(s)}).call(g5)});var ag=ye((v5,w5)=>{"use strict";(function(){var r,e,t=o(function(s,i){for(var a in i)n.call(i,a)&&(s[a]=i[a]);function u(){this.constructor=s}return o(u,"ctor"),u.prototype=i.prototype,s.prototype=new u,s.__super__=i.prototype,s},"extend"),n={}.hasOwnProperty;e=Ws(),w5.exports=r=(function(s){t(i,s);function i(a){i.__super__.constructor.call(this,a),this.value=""}return o(i,"XMLCharacterData"),Object.defineProperty(i.prototype,"data",{get:o(function(){return this.value},"get"),set:o(function(a){return this.value=a||""},"set")}),Object.defineProperty(i.prototype,"length",{get:o(function(){return this.value.length},"get")}),Object.defineProperty(i.prototype,"textContent",{get:o(function(){return this.value},"get"),set:o(function(a){return this.value=a||""},"set")}),i.prototype.clone=function(){return Object.create(this)},i.prototype.substringData=function(a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.appendData=function(a){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.insertData=function(a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.deleteData=function(a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.replaceData=function(a,u,l){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.isEqualNode=function(a){return!(!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(a)||a.data!==this.data)},i})(e)}).call(v5)});var cE=ye((S5,E5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=sn(),t=ag(),E5.exports=e=(function(i){n(a,i);function a(u,l){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=r.CData,this.value=this.stringify.cdata(l)}return o(a,"XMLCData"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.cdata(this,this.options.writer.filterOptions(u))},a})(t)}).call(S5)});var fE=ye((A5,C5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=sn(),e=ag(),C5.exports=t=(function(i){n(a,i);function a(u,l){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=r.Comment,this.value=this.stringify.comment(l)}return o(a,"XMLComment"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.comment(this,this.options.writer.filterOptions(u))},a})(e)}).call(A5)});var hE=ye((b5,x5)=>{"use strict";(function(){var r,e,t,n,s=o(function(a,u){for(var l in u)i.call(u,l)&&(a[l]=u[l]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;n=Va().isObject,t=Ws(),r=sn(),x5.exports=e=(function(a){s(u,a);function u(l,f,h,m){var g;u.__super__.constructor.call(this,l),n(f)&&(g=f,f=g.version,h=g.encoding,m=g.standalone),f||(f="1.0"),this.type=r.Declaration,this.version=this.stringify.xmlVersion(f),h!=null&&(this.encoding=this.stringify.xmlEncoding(h)),m!=null&&(this.standalone=this.stringify.xmlStandalone(m))}return o(u,"XMLDeclaration"),u.prototype.toString=function(l){return this.options.writer.declaration(this,this.options.writer.filterOptions(l))},u})(t)}).call(b5)});var pE=ye((N5,T5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=Ws(),r=sn(),T5.exports=e=(function(i){n(a,i);function a(u,l,f,h,m,g){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(f==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(l));if(!h)throw new Error("Missing DTD attribute type. "+this.debugInfo(l));if(!m)throw new Error("Missing DTD attribute default. "+this.debugInfo(l));if(m.indexOf("#")!==0&&(m="#"+m),!m.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(l));if(g&&!m.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(l));this.elementName=this.stringify.name(l),this.type=r.AttributeDeclaration,this.attributeName=this.stringify.name(f),this.attributeType=this.stringify.dtdAttType(h),g&&(this.defaultValue=this.stringify.dtdAttDefault(g)),this.defaultValueType=m}return o(a,"XMLDTDAttList"),a.prototype.toString=function(u){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(u))},a})(t)}).call(N5)});var dE=ye((I5,B5)=>{"use strict";(function(){var r,e,t,n,s=o(function(a,u){for(var l in u)i.call(u,l)&&(a[l]=u[l]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;n=Va().isObject,t=Ws(),r=sn(),B5.exports=e=(function(a){s(u,a);function u(l,f,h,m){if(u.__super__.constructor.call(this,l),h==null)throw new Error("Missing DTD entity name. "+this.debugInfo(h));if(m==null)throw new Error("Missing DTD entity value. "+this.debugInfo(h));if(this.pe=!!f,this.name=this.stringify.name(h),this.type=r.EntityDeclaration,!n(m))this.value=this.stringify.dtdEntityValue(m),this.internal=!0;else{if(!m.pubID&&!m.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(h));if(m.pubID&&!m.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(h));if(this.internal=!1,m.pubID!=null&&(this.pubID=this.stringify.dtdPubID(m.pubID)),m.sysID!=null&&(this.sysID=this.stringify.dtdSysID(m.sysID)),m.nData!=null&&(this.nData=this.stringify.dtdNData(m.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(h))}}return o(u,"XMLDTDEntity"),Object.defineProperty(u.prototype,"publicId",{get:o(function(){return this.pubID},"get")}),Object.defineProperty(u.prototype,"systemId",{get:o(function(){return this.sysID},"get")}),Object.defineProperty(u.prototype,"notationName",{get:o(function(){return this.nData||null},"get")}),Object.defineProperty(u.prototype,"inputEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(u.prototype,"xmlEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(u.prototype,"xmlVersion",{get:o(function(){return null},"get")}),u.prototype.toString=function(l){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(l))},u})(t)}).call(I5)});var mE=ye((D5,_5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=Ws(),r=sn(),_5.exports=e=(function(i){n(a,i);function a(u,l,f){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing DTD element name. "+this.debugInfo());f||(f="(#PCDATA)"),Array.isArray(f)&&(f="("+f.join(",")+")"),this.name=this.stringify.name(l),this.type=r.ElementDeclaration,this.value=this.stringify.dtdElementValue(f)}return o(a,"XMLDTDElement"),a.prototype.toString=function(u){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(u))},a})(t)}).call(D5)});var gE=ye((R5,P5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=Ws(),r=sn(),P5.exports=e=(function(i){n(a,i);function a(u,l,f){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing DTD notation name. "+this.debugInfo(l));if(!f.pubID&&!f.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(l));this.name=this.stringify.name(l),this.type=r.NotationDeclaration,f.pubID!=null&&(this.pubID=this.stringify.dtdPubID(f.pubID)),f.sysID!=null&&(this.sysID=this.stringify.dtdSysID(f.sysID))}return o(a,"XMLDTDNotation"),Object.defineProperty(a.prototype,"publicId",{get:o(function(){return this.pubID},"get")}),Object.defineProperty(a.prototype,"systemId",{get:o(function(){return this.sysID},"get")}),a.prototype.toString=function(u){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(u))},a})(t)}).call(R5)});var yE=ye((O5,k5)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f=o(function(m,g){for(var w in g)h.call(g,w)&&(m[w]=g[w]);function y(){this.constructor=m}return o(y,"ctor"),y.prototype=g.prototype,m.prototype=new y,m.__super__=g.prototype,m},"extend"),h={}.hasOwnProperty;l=Va().isObject,u=Ws(),r=sn(),e=pE(),n=dE(),t=mE(),s=gE(),a=uE(),k5.exports=i=(function(m){f(g,m);function g(w,y,S){var E,b,T,A,C,x;if(g.__super__.constructor.call(this,w),this.type=r.DocType,w.children){for(A=w.children,b=0,T=A.length;b<T;b++)if(E=A[b],E.type===r.Element){this.name=E.name;break}}this.documentObject=w,l(y)&&(C=y,y=C.pubID,S=C.sysID),S==null&&(x=[y,S],S=x[0],y=x[1]),y!=null&&(this.pubID=this.stringify.dtdPubID(y)),S!=null&&(this.sysID=this.stringify.dtdSysID(S))}return o(g,"XMLDocType"),Object.defineProperty(g.prototype,"entities",{get:o(function(){var w,y,S,E,b;for(E={},b=this.children,y=0,S=b.length;y<S;y++)w=b[y],w.type===r.EntityDeclaration&&!w.pe&&(E[w.name]=w);return new a(E)},"get")}),Object.defineProperty(g.prototype,"notations",{get:o(function(){var w,y,S,E,b;for(E={},b=this.children,y=0,S=b.length;y<S;y++)w=b[y],w.type===r.NotationDeclaration&&(E[w.name]=w);return new a(E)},"get")}),Object.defineProperty(g.prototype,"publicId",{get:o(function(){return this.pubID},"get")}),Object.defineProperty(g.prototype,"systemId",{get:o(function(){return this.sysID},"get")}),Object.defineProperty(g.prototype,"internalSubset",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),g.prototype.element=function(w,y){var S;return S=new t(this,w,y),this.children.push(S),this},g.prototype.attList=function(w,y,S,E,b){var T;return T=new e(this,w,y,S,E,b),this.children.push(T),this},g.prototype.entity=function(w,y){var S;return S=new n(this,!1,w,y),this.children.push(S),this},g.prototype.pEntity=function(w,y){var S;return S=new n(this,!0,w,y),this.children.push(S),this},g.prototype.notation=function(w,y){var S;return S=new s(this,w,y),this.children.push(S),this},g.prototype.toString=function(w){return this.options.writer.docType(this,this.options.writer.filterOptions(w))},g.prototype.ele=function(w,y){return this.element(w,y)},g.prototype.att=function(w,y,S,E,b){return this.attList(w,y,S,E,b)},g.prototype.ent=function(w,y){return this.entity(w,y)},g.prototype.pent=function(w,y){return this.pEntity(w,y)},g.prototype.not=function(w,y){return this.notation(w,y)},g.prototype.up=function(){return this.root()||this.documentObject},g.prototype.isEqualNode=function(w){return!(!g.__super__.isEqualNode.apply(this,arguments).isEqualNode(w)||w.name!==this.name||w.publicId!==this.publicId||w.systemId!==this.systemId)},g})(u)}).call(O5)});var vE=ye((L5,V5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=sn(),e=Ws(),V5.exports=t=(function(i){n(a,i);function a(u,l){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=r.Raw,this.value=this.stringify.raw(l)}return o(a,"XMLRaw"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.raw(this,this.options.writer.filterOptions(u))},a})(e)}).call(L5)});var wE=ye((U5,M5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=sn(),e=ag(),M5.exports=t=(function(i){n(a,i);function a(u,l){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=r.Text,this.value=this.stringify.text(l)}return o(a,"XMLText"),Object.defineProperty(a.prototype,"isElementContentWhitespace",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(a.prototype,"wholeText",{get:o(function(){var u,l,f;for(f="",l=this.previousSibling;l;)f=l.data+f,l=l.previousSibling;for(f+=this.data,u=this.nextSibling;u;)f=f+u.data,u=u.nextSibling;return f},"get")}),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.text(this,this.options.writer.filterOptions(u))},a.prototype.splitText=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.replaceWholeText=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},a})(e)}).call(U5)});var SE=ye((j5,F5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=sn(),e=ag(),F5.exports=t=(function(i){n(a,i);function a(u,l,f){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=r.ProcessingInstruction,this.target=this.stringify.insTarget(l),this.name=this.target,f&&(this.value=this.stringify.insValue(f))}return o(a,"XMLProcessingInstruction"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(u))},a.prototype.isEqualNode=function(u){return!(!a.__super__.isEqualNode.apply(this,arguments).isEqualNode(u)||u.target!==this.target)},a})(e)}).call(j5)});var TT=ye((q5,H5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=Ws(),r=sn(),H5.exports=e=(function(i){n(a,i);function a(u){a.__super__.constructor.call(this,u),this.type=r.Dummy}return o(a,"XMLDummy"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return""},a})(t)}).call(q5)});var X5=ye((K5,$5)=>{"use strict";(function(){var r;$5.exports=r=(function(){function e(t){this.nodes=t}return o(e,"XMLNodeList"),Object.defineProperty(e.prototype,"length",{get:o(function(){return this.nodes.length||0},"get")}),e.prototype.clone=function(){return this.nodes=null},e.prototype.item=function(t){return this.nodes[t]||null},e})()}).call(K5)});var J5=ye((G5,W5)=>{"use strict";(function(){W5.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(G5)});var Ws=ye((z5,Y5)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f,h,m,g,w,y,S,E,b,T,A={}.hasOwnProperty;T=Va(),b=T.isObject,E=T.isFunction,S=T.isEmpty,y=T.getValue,u=null,t=null,n=null,s=null,i=null,g=null,w=null,m=null,a=null,e=null,h=null,l=null,r=null,Y5.exports=f=(function(){function C(x){this.parent=x,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,u||(u=lE(),t=cE(),n=fE(),s=hE(),i=yE(),g=vE(),w=wE(),m=SE(),a=TT(),e=sn(),h=X5(),l=uE(),r=J5())}return o(C,"XMLNode"),Object.defineProperty(C.prototype,"nodeName",{get:o(function(){return this.name},"get")}),Object.defineProperty(C.prototype,"nodeType",{get:o(function(){return this.type},"get")}),Object.defineProperty(C.prototype,"nodeValue",{get:o(function(){return this.value},"get")}),Object.defineProperty(C.prototype,"parentNode",{get:o(function(){return this.parent},"get")}),Object.defineProperty(C.prototype,"childNodes",{get:o(function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new h(this.children)),this.childNodeList},"get")}),Object.defineProperty(C.prototype,"firstChild",{get:o(function(){return this.children[0]||null},"get")}),Object.defineProperty(C.prototype,"lastChild",{get:o(function(){return this.children[this.children.length-1]||null},"get")}),Object.defineProperty(C.prototype,"previousSibling",{get:o(function(){var x;return x=this.parent.children.indexOf(this),this.parent.children[x-1]||null},"get")}),Object.defineProperty(C.prototype,"nextSibling",{get:o(function(){var x;return x=this.parent.children.indexOf(this),this.parent.children[x+1]||null},"get")}),Object.defineProperty(C.prototype,"ownerDocument",{get:o(function(){return this.document()||null},"get")}),Object.defineProperty(C.prototype,"textContent",{get:o(function(){var x,B,F,R,H;if(this.nodeType===e.Element||this.nodeType===e.DocumentFragment){for(H="",R=this.children,B=0,F=R.length;B<F;B++)x=R[B],x.textContent&&(H+=x.textContent);return H}else return null},"get"),set:o(function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},"set")}),C.prototype.setParent=function(x){var B,F,R,H,q;for(this.parent=x,x&&(this.options=x.options,this.stringify=x.stringify),H=this.children,q=[],F=0,R=H.length;F<R;F++)B=H[F],q.push(B.setParent(this));return q},C.prototype.element=function(x,B,F){var R,H,q,K,G,he,le,oe,Z,fe,Se;if(he=null,B===null&&F==null&&(Z=[{},null],B=Z[0],F=Z[1]),B==null&&(B={}),B=y(B),b(B)||(fe=[B,F],F=fe[0],B=fe[1]),x!=null&&(x=y(x)),Array.isArray(x))for(q=0,le=x.length;q<le;q++)H=x[q],he=this.element(H);else if(E(x))he=this.element(x.apply());else if(b(x)){for(G in x)if(A.call(x,G))if(Se=x[G],E(Se)&&(Se=Se.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&G.indexOf(this.stringify.convertAttKey)===0)he=this.attribute(G.substr(this.stringify.convertAttKey.length),Se);else if(!this.options.separateArrayItems&&Array.isArray(Se)&&S(Se))he=this.dummy();else if(b(Se)&&S(Se))he=this.element(G);else if(!this.options.keepNullNodes&&Se==null)he=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(Se))for(K=0,oe=Se.length;K<oe;K++)H=Se[K],R={},R[G]=H,he=this.element(R);else b(Se)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&G.indexOf(this.stringify.convertTextKey)===0?he=this.element(Se):(he=this.element(G),he.element(Se)):he=this.element(G,Se)}else!this.options.keepNullNodes&&F===null?he=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&x.indexOf(this.stringify.convertTextKey)===0?he=this.text(F):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&x.indexOf(this.stringify.convertCDataKey)===0?he=this.cdata(F):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&x.indexOf(this.stringify.convertCommentKey)===0?he=this.comment(F):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&x.indexOf(this.stringify.convertRawKey)===0?he=this.raw(F):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&x.indexOf(this.stringify.convertPIKey)===0?he=this.instruction(x.substr(this.stringify.convertPIKey.length),F):he=this.node(x,B,F);if(he==null)throw new Error("Could not create any elements with: "+x+". "+this.debugInfo());return he},C.prototype.insertBefore=function(x,B,F){var R,H,q,K,G;if(x?.type)return q=x,K=B,q.setParent(this),K?(H=children.indexOf(K),G=children.splice(H),children.push(q),Array.prototype.push.apply(children,G)):children.push(q),q;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(x));return H=this.parent.children.indexOf(this),G=this.parent.children.splice(H),R=this.parent.element(x,B,F),Array.prototype.push.apply(this.parent.children,G),R},C.prototype.insertAfter=function(x,B,F){var R,H,q;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(x));return H=this.parent.children.indexOf(this),q=this.parent.children.splice(H+1),R=this.parent.element(x,B,F),Array.prototype.push.apply(this.parent.children,q),R},C.prototype.remove=function(){var x,B;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return x=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[x,x-x+1].concat(B=[])),this.parent},C.prototype.node=function(x,B,F){var R,H;return x!=null&&(x=y(x)),B||(B={}),B=y(B),b(B)||(H=[B,F],F=H[0],B=H[1]),R=new u(this,x,B),F!=null&&R.text(F),this.children.push(R),R},C.prototype.text=function(x){var B;return b(x)&&this.element(x),B=new w(this,x),this.children.push(B),this},C.prototype.cdata=function(x){var B;return B=new t(this,x),this.children.push(B),this},C.prototype.comment=function(x){var B;return B=new n(this,x),this.children.push(B),this},C.prototype.commentBefore=function(x){var B,F,R;return F=this.parent.children.indexOf(this),R=this.parent.children.splice(F),B=this.parent.comment(x),Array.prototype.push.apply(this.parent.children,R),this},C.prototype.commentAfter=function(x){var B,F,R;return F=this.parent.children.indexOf(this),R=this.parent.children.splice(F+1),B=this.parent.comment(x),Array.prototype.push.apply(this.parent.children,R),this},C.prototype.raw=function(x){var B;return B=new g(this,x),this.children.push(B),this},C.prototype.dummy=function(){var x;return x=new a(this),x},C.prototype.instruction=function(x,B){var F,R,H,q,K;if(x!=null&&(x=y(x)),B!=null&&(B=y(B)),Array.isArray(x))for(q=0,K=x.length;q<K;q++)F=x[q],this.instruction(F);else if(b(x))for(F in x)A.call(x,F)&&(R=x[F],this.instruction(F,R));else E(B)&&(B=B.apply()),H=new m(this,x,B),this.children.push(H);return this},C.prototype.instructionBefore=function(x,B){var F,R,H;return R=this.parent.children.indexOf(this),H=this.parent.children.splice(R),F=this.parent.instruction(x,B),Array.prototype.push.apply(this.parent.children,H),this},C.prototype.instructionAfter=function(x,B){var F,R,H;return R=this.parent.children.indexOf(this),H=this.parent.children.splice(R+1),F=this.parent.instruction(x,B),Array.prototype.push.apply(this.parent.children,H),this},C.prototype.declaration=function(x,B,F){var R,H;return R=this.document(),H=new s(R,x,B,F),R.children.length===0?R.children.unshift(H):R.children[0].type===e.Declaration?R.children[0]=H:R.children.unshift(H),R.root()||R},C.prototype.dtd=function(x,B){var F,R,H,q,K,G,he,le,oe,Z;for(R=this.document(),H=new i(R,x,B),oe=R.children,q=K=0,he=oe.length;K<he;q=++K)if(F=oe[q],F.type===e.DocType)return R.children[q]=H,H;for(Z=R.children,q=G=0,le=Z.length;G<le;q=++G)if(F=Z[q],F.isRoot)return R.children.splice(q,0,H),H;return R.children.push(H),H},C.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},C.prototype.root=function(){var x;for(x=this;x;){if(x.type===e.Document)return x.rootObject;if(x.isRoot)return x;x=x.parent}},C.prototype.document=function(){var x;for(x=this;x;){if(x.type===e.Document)return x;x=x.parent}},C.prototype.end=function(x){return this.document().end(x)},C.prototype.prev=function(){var x;if(x=this.parent.children.indexOf(this),x<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[x-1]},C.prototype.next=function(){var x;if(x=this.parent.children.indexOf(this),x===-1||x===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[x+1]},C.prototype.importDocument=function(x){var B;return B=x.root().clone(),B.parent=this,B.isRoot=!1,this.children.push(B),this},C.prototype.debugInfo=function(x){var B,F;return x=x||this.name,x==null&&!((B=this.parent)!=null&&B.name)?"":x==null?"parent: <"+this.parent.name+">":(F=this.parent)!=null&&F.name?"node: <"+x+">, parent: <"+this.parent.name+">":"node: <"+x+">"},C.prototype.ele=function(x,B,F){return this.element(x,B,F)},C.prototype.nod=function(x,B,F){return this.node(x,B,F)},C.prototype.txt=function(x){return this.text(x)},C.prototype.dat=function(x){return this.cdata(x)},C.prototype.com=function(x){return this.comment(x)},C.prototype.ins=function(x,B){return this.instruction(x,B)},C.prototype.doc=function(){return this.document()},C.prototype.dec=function(x,B,F){return this.declaration(x,B,F)},C.prototype.e=function(x,B,F){return this.element(x,B,F)},C.prototype.n=function(x,B,F){return this.node(x,B,F)},C.prototype.t=function(x){return this.text(x)},C.prototype.d=function(x){return this.cdata(x)},C.prototype.c=function(x){return this.comment(x)},C.prototype.r=function(x){return this.raw(x)},C.prototype.i=function(x,B){return this.instruction(x,B)},C.prototype.u=function(){return this.up()},C.prototype.importXMLBuilder=function(x){return this.importDocument(x)},C.prototype.replaceChild=function(x,B){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.removeChild=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.appendChild=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.hasChildNodes=function(){return this.children.length!==0},C.prototype.cloneNode=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isSupported=function(x,B){return!0},C.prototype.hasAttributes=function(){return this.attribs.length!==0},C.prototype.compareDocumentPosition=function(x){var B,F;return B=this,B===x?0:this.document()!==x.document()?(F=r.Disconnected|r.ImplementationSpecific,Math.random()<.5?F|=r.Preceding:F|=r.Following,F):B.isAncestor(x)?r.Contains|r.Preceding:B.isDescendant(x)?r.Contains|r.Following:B.isPreceding(x)?r.Preceding:r.Following},C.prototype.isSameNode=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.lookupPrefix=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isDefaultNamespace=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.lookupNamespaceURI=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isEqualNode=function(x){var B,F,R;if(x.nodeType!==this.nodeType||x.children.length!==this.children.length)return!1;for(B=F=0,R=this.children.length-1;0<=R?F<=R:F>=R;B=0<=R?++F:--F)if(!this.children[B].isEqualNode(x.children[B]))return!1;return!0},C.prototype.getFeature=function(x,B){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.setUserData=function(x,B,F){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.getUserData=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.contains=function(x){return x?x===this||this.isDescendant(x):!1},C.prototype.isDescendant=function(x){var B,F,R,H,q;for(q=this.children,R=0,H=q.length;R<H;R++)if(B=q[R],x===B||(F=B.isDescendant(x),F))return!0;return!1},C.prototype.isAncestor=function(x){return x.isDescendant(this)},C.prototype.isPreceding=function(x){var B,F;return B=this.treePosition(x),F=this.treePosition(this),B===-1||F===-1?!1:B<F},C.prototype.isFollowing=function(x){var B,F;return B=this.treePosition(x),F=this.treePosition(this),B===-1||F===-1?!1:B>F},C.prototype.treePosition=function(x){var B,F;return F=0,B=!1,this.foreachTreeNode(this.document(),function(R){if(F++,!B&&R===x)return B=!0}),B?F:-1},C.prototype.foreachTreeNode=function(x,B){var F,R,H,q,K;for(x||(x=this.document()),q=x.children,R=0,H=q.length;R<H;R++){if(F=q[R],K=B(F))return K;if(K=this.foreachTreeNode(F,B),K)return K}},C})()}).call(z5)});var IT=ye((Q5,Z5)=>{"use strict";(function(){var r,e=o(function(n,s){return function(){return n.apply(s,arguments)}},"bind"),t={}.hasOwnProperty;Z5.exports=r=(function(){function n(s){this.assertLegalName=e(this.assertLegalName,this),this.assertLegalChar=e(this.assertLegalChar,this);var i,a,u;s||(s={}),this.options=s,this.options.version||(this.options.version="1.0"),a=s.stringify||{};for(i in a)t.call(a,i)&&(u=a[i],this[i]=u)}return o(n,"XMLStringifier"),n.prototype.name=function(s){return this.options.noValidation?s:this.assertLegalName(""+s||"")},n.prototype.text=function(s){return this.options.noValidation?s:this.assertLegalChar(this.textEscape(""+s||""))},n.prototype.cdata=function(s){return this.options.noValidation?s:(s=""+s||"",s=s.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(s))},n.prototype.comment=function(s){if(this.options.noValidation)return s;if(s=""+s||"",s.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+s);return this.assertLegalChar(s)},n.prototype.raw=function(s){return this.options.noValidation?s:""+s||""},n.prototype.attValue=function(s){return this.options.noValidation?s:this.assertLegalChar(this.attEscape(s=""+s||""))},n.prototype.insTarget=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.insValue=function(s){if(this.options.noValidation)return s;if(s=""+s||"",s.match(/\?>/))throw new Error("Invalid processing instruction value: "+s);return this.assertLegalChar(s)},n.prototype.xmlVersion=function(s){if(this.options.noValidation)return s;if(s=""+s||"",!s.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+s);return s},n.prototype.xmlEncoding=function(s){if(this.options.noValidation)return s;if(s=""+s||"",!s.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+s);return this.assertLegalChar(s)},n.prototype.xmlStandalone=function(s){return this.options.noValidation?s:s?"yes":"no"},n.prototype.dtdPubID=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdSysID=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdElementValue=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdAttType=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdAttDefault=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdEntityValue=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdNData=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.convertAttKey="@",n.prototype.convertPIKey="?",n.prototype.convertTextKey="#text",n.prototype.convertCDataKey="#cdata",n.prototype.convertCommentKey="#comment",n.prototype.convertRawKey="#raw",n.prototype.assertLegalChar=function(s){var i,a;if(this.options.noValidation)return s;if(i="",this.options.version==="1.0"){if(i=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,a=s.match(i))throw new Error("Invalid character in string: "+s+" at index "+a.index)}else if(this.options.version==="1.1"&&(i=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,a=s.match(i)))throw new Error("Invalid character in string: "+s+" at index "+a.index);return s},n.prototype.assertLegalName=function(s){var i;if(this.options.noValidation)return s;if(this.assertLegalChar(s),i=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!s.match(i))throw new Error("Invalid character in name");return s},n.prototype.textEscape=function(s){var i;return this.options.noValidation?s:(i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,s.replace(i,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;"))},n.prototype.attEscape=function(s){var i;return this.options.noValidation?s:(i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,s.replace(i,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;"))},n})()}).call(Q5)});var og=ye((eV,tV)=>{"use strict";(function(){tV.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(eV)});var BT=ye((rV,nV)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f,h,m,g,w,y,S,E,b={}.hasOwnProperty;E=Va().assign,r=sn(),l=hE(),f=yE(),t=cE(),n=fE(),m=lE(),w=vE(),y=wE(),g=SE(),h=TT(),s=pE(),i=mE(),a=dE(),u=gE(),e=og(),nV.exports=S=(function(){function T(A){var C,x,B;A||(A={}),this.options=A,x=A.writer||{};for(C in x)b.call(x,C)&&(B=x[C],this["_"+C]=this[C],this[C]=B)}return o(T,"XMLWriterBase"),T.prototype.filterOptions=function(A){var C,x,B,F,R,H,q,K;return A||(A={}),A=E({},this.options,A),C={writer:this},C.pretty=A.pretty||!1,C.allowEmpty=A.allowEmpty||!1,C.indent=(x=A.indent)!=null?x:" ",C.newline=(B=A.newline)!=null?B:`
83
- `,C.offset=(F=A.offset)!=null?F:0,C.dontPrettyTextNodes=(R=(H=A.dontPrettyTextNodes)!=null?H:A.dontprettytextnodes)!=null?R:0,C.spaceBeforeSlash=(q=(K=A.spaceBeforeSlash)!=null?K:A.spacebeforeslash)!=null?q:"",C.spaceBeforeSlash===!0&&(C.spaceBeforeSlash=" "),C.suppressPrettyCount=0,C.user={},C.state=e.None,C},T.prototype.indent=function(A,C,x){var B;return!C.pretty||C.suppressPrettyCount?"":C.pretty&&(B=(x||0)+C.offset+1,B>0)?new Array(B).join(C.indent):""},T.prototype.endline=function(A,C,x){return!C.pretty||C.suppressPrettyCount?"":C.newline},T.prototype.attribute=function(A,C,x){var B;return this.openAttribute(A,C,x),B=" "+A.name+'="'+A.value+'"',this.closeAttribute(A,C,x),B},T.prototype.cdata=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<![CDATA[",C.state=e.InsideTag,B+=A.value,C.state=e.CloseTag,B+="]]>"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.comment=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<!-- ",C.state=e.InsideTag,B+=A.value,C.state=e.CloseTag,B+=" -->"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.declaration=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<?xml",C.state=e.InsideTag,B+=' version="'+A.version+'"',A.encoding!=null&&(B+=' encoding="'+A.encoding+'"'),A.standalone!=null&&(B+=' standalone="'+A.standalone+'"'),C.state=e.CloseTag,B+=C.spaceBeforeSlash+"?>",B+=this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.docType=function(A,C,x){var B,F,R,H,q;if(x||(x=0),this.openNode(A,C,x),C.state=e.OpenTag,H=this.indent(A,C,x),H+="<!DOCTYPE "+A.root().name,A.pubID&&A.sysID?H+=' PUBLIC "'+A.pubID+'" "'+A.sysID+'"':A.sysID&&(H+=' SYSTEM "'+A.sysID+'"'),A.children.length>0){for(H+=" [",H+=this.endline(A,C,x),C.state=e.InsideTag,q=A.children,F=0,R=q.length;F<R;F++)B=q[F],H+=this.writeChildNode(B,C,x+1);C.state=e.CloseTag,H+="]"}return C.state=e.CloseTag,H+=C.spaceBeforeSlash+">",H+=this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),H},T.prototype.element=function(A,C,x){var B,F,R,H,q,K,G,he,le,oe,Z,fe,Se,Ke;x||(x=0),oe=!1,Z="",this.openNode(A,C,x),C.state=e.OpenTag,Z+=this.indent(A,C,x)+"<"+A.name,fe=A.attribs;for(le in fe)b.call(fe,le)&&(B=fe[le],Z+=this.attribute(B,C,x));if(R=A.children.length,H=R===0?null:A.children[0],R===0||A.children.every(function(be){return(be.type===r.Text||be.type===r.Raw)&&be.value===""}))C.allowEmpty?(Z+=">",C.state=e.CloseTag,Z+="</"+A.name+">"+this.endline(A,C,x)):(C.state=e.CloseTag,Z+=C.spaceBeforeSlash+"/>"+this.endline(A,C,x));else if(C.pretty&&R===1&&(H.type===r.Text||H.type===r.Raw)&&H.value!=null)Z+=">",C.state=e.InsideTag,C.suppressPrettyCount++,oe=!0,Z+=this.writeChildNode(H,C,x+1),C.suppressPrettyCount--,oe=!1,C.state=e.CloseTag,Z+="</"+A.name+">"+this.endline(A,C,x);else{if(C.dontPrettyTextNodes){for(Se=A.children,q=0,G=Se.length;q<G;q++)if(F=Se[q],(F.type===r.Text||F.type===r.Raw)&&F.value!=null){C.suppressPrettyCount++,oe=!0;break}}for(Z+=">"+this.endline(A,C,x),C.state=e.InsideTag,Ke=A.children,K=0,he=Ke.length;K<he;K++)F=Ke[K],Z+=this.writeChildNode(F,C,x+1);C.state=e.CloseTag,Z+=this.indent(A,C,x)+"</"+A.name+">",oe&&C.suppressPrettyCount--,Z+=this.endline(A,C,x),C.state=e.None}return this.closeNode(A,C,x),Z},T.prototype.writeChildNode=function(A,C,x){switch(A.type){case r.CData:return this.cdata(A,C,x);case r.Comment:return this.comment(A,C,x);case r.Element:return this.element(A,C,x);case r.Raw:return this.raw(A,C,x);case r.Text:return this.text(A,C,x);case r.ProcessingInstruction:return this.processingInstruction(A,C,x);case r.Dummy:return"";case r.Declaration:return this.declaration(A,C,x);case r.DocType:return this.docType(A,C,x);case r.AttributeDeclaration:return this.dtdAttList(A,C,x);case r.ElementDeclaration:return this.dtdElement(A,C,x);case r.EntityDeclaration:return this.dtdEntity(A,C,x);case r.NotationDeclaration:return this.dtdNotation(A,C,x);default:throw new Error("Unknown XML node type: "+A.constructor.name)}},T.prototype.processingInstruction=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<?",C.state=e.InsideTag,B+=A.target,A.value&&(B+=" "+A.value),C.state=e.CloseTag,B+=C.spaceBeforeSlash+"?>",B+=this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.raw=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x),C.state=e.InsideTag,B+=A.value,C.state=e.CloseTag,B+=this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.text=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x),C.state=e.InsideTag,B+=A.value,C.state=e.CloseTag,B+=this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.dtdAttList=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<!ATTLIST",C.state=e.InsideTag,B+=" "+A.elementName+" "+A.attributeName+" "+A.attributeType,A.defaultValueType!=="#DEFAULT"&&(B+=" "+A.defaultValueType),A.defaultValue&&(B+=' "'+A.defaultValue+'"'),C.state=e.CloseTag,B+=C.spaceBeforeSlash+">"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.dtdElement=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<!ELEMENT",C.state=e.InsideTag,B+=" "+A.name+" "+A.value,C.state=e.CloseTag,B+=C.spaceBeforeSlash+">"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.dtdEntity=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<!ENTITY",C.state=e.InsideTag,A.pe&&(B+=" %"),B+=" "+A.name,A.value?B+=' "'+A.value+'"':(A.pubID&&A.sysID?B+=' PUBLIC "'+A.pubID+'" "'+A.sysID+'"':A.sysID&&(B+=' SYSTEM "'+A.sysID+'"'),A.nData&&(B+=" NDATA "+A.nData)),C.state=e.CloseTag,B+=C.spaceBeforeSlash+">"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.dtdNotation=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<!NOTATION",C.state=e.InsideTag,B+=" "+A.name,A.pubID&&A.sysID?B+=' PUBLIC "'+A.pubID+'" "'+A.sysID+'"':A.pubID?B+=' PUBLIC "'+A.pubID+'"':A.sysID&&(B+=' SYSTEM "'+A.sysID+'"'),C.state=e.CloseTag,B+=C.spaceBeforeSlash+">"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.openNode=function(A,C,x){},T.prototype.closeNode=function(A,C,x){},T.prototype.openAttribute=function(A,C,x){},T.prototype.closeAttribute=function(A,C,x){},T})()}).call(rV)});var EE=ye((sV,iV)=>{"use strict";(function(){var r,e,t=o(function(s,i){for(var a in i)n.call(i,a)&&(s[a]=i[a]);function u(){this.constructor=s}return o(u,"ctor"),u.prototype=i.prototype,s.prototype=new u,s.__super__=i.prototype,s},"extend"),n={}.hasOwnProperty;e=BT(),iV.exports=r=(function(s){t(i,s);function i(a){i.__super__.constructor.call(this,a)}return o(i,"XMLStringWriter"),i.prototype.document=function(a,u){var l,f,h,m,g;for(u=this.filterOptions(u),m="",g=a.children,f=0,h=g.length;f<h;f++)l=g[f],m+=this.writeChildNode(l,u,0);return u.pretty&&m.slice(-u.newline.length)===u.newline&&(m=m.slice(0,-u.newline.length)),m},i})(e)}).call(sV)});var DT=ye((aV,oV)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l=o(function(h,m){for(var g in m)f.call(m,g)&&(h[g]=m[g]);function w(){this.constructor=h}return o(w,"ctor"),w.prototype=m.prototype,h.prototype=new w,h.__super__=m.prototype,h},"extend"),f={}.hasOwnProperty;u=Va().isPlainObject,t=xT(),e=l5(),s=Ws(),r=sn(),a=IT(),i=EE(),oV.exports=n=(function(h){l(m,h);function m(g){m.__super__.constructor.call(this,null),this.name="#document",this.type=r.Document,this.documentURI=null,this.domConfig=new e,g||(g={}),g.writer||(g.writer=new i),this.options=g,this.stringify=new a(g)}return o(m,"XMLDocument"),Object.defineProperty(m.prototype,"implementation",{value:new t}),Object.defineProperty(m.prototype,"doctype",{get:o(function(){var g,w,y,S;for(S=this.children,w=0,y=S.length;w<y;w++)if(g=S[w],g.type===r.DocType)return g;return null},"get")}),Object.defineProperty(m.prototype,"documentElement",{get:o(function(){return this.rootObject||null},"get")}),Object.defineProperty(m.prototype,"inputEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"strictErrorChecking",{get:o(function(){return!1},"get")}),Object.defineProperty(m.prototype,"xmlEncoding",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].encoding:null},"get")}),Object.defineProperty(m.prototype,"xmlStandalone",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].standalone==="yes":!1},"get")}),Object.defineProperty(m.prototype,"xmlVersion",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].version:"1.0"},"get")}),Object.defineProperty(m.prototype,"URL",{get:o(function(){return this.documentURI},"get")}),Object.defineProperty(m.prototype,"origin",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"compatMode",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"characterSet",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"contentType",{get:o(function(){return null},"get")}),m.prototype.end=function(g){var w;return w={},g?u(g)&&(w=g,g=this.options.writer):g=this.options.writer,g.document(this,g.filterOptions(w))},m.prototype.toString=function(g){return this.options.writer.document(this,this.options.writer.filterOptions(g))},m.prototype.createElement=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTextNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createComment=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createCDATASection=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createProcessingInstruction=function(g,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttribute=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEntityReference=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.importNode=function(g,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createElementNS=function(g,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttributeNS=function(g,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagNameNS=function(g,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementById=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.adoptNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.renameNode=function(g,w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByClassName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEvent=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createNodeIterator=function(g,w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTreeWalker=function(g,w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m})(s)}).call(aV)});var cV=ye((uV,lV)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f,h,m,g,w,y,S,E,b,T,A,C,x,B,F,R={}.hasOwnProperty;F=Va(),x=F.isObject,C=F.isFunction,B=F.isPlainObject,A=F.getValue,r=sn(),m=DT(),w=lE(),n=cE(),s=fE(),S=vE(),T=wE(),y=SE(),f=hE(),h=yE(),i=pE(),u=dE(),a=mE(),l=gE(),t=NT(),b=IT(),E=EE(),e=og(),lV.exports=g=(function(){function H(q,K,G){var he;this.name="?xml",this.type=r.Document,q||(q={}),he={},q.writer?B(q.writer)&&(he=q.writer,q.writer=new E):q.writer=new E,this.options=q,this.writer=q.writer,this.writerOptions=this.writer.filterOptions(he),this.stringify=new b(q),this.onDataCallback=K||function(){},this.onEndCallback=G||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return o(H,"XMLDocumentCB"),H.prototype.createChildNode=function(q){var K,G,he,le,oe,Z,fe,Se;switch(q.type){case r.CData:this.cdata(q.value);break;case r.Comment:this.comment(q.value);break;case r.Element:he={},fe=q.attribs;for(G in fe)R.call(fe,G)&&(K=fe[G],he[G]=K.value);this.node(q.name,he);break;case r.Dummy:this.dummy();break;case r.Raw:this.raw(q.value);break;case r.Text:this.text(q.value);break;case r.ProcessingInstruction:this.instruction(q.target,q.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+q.constructor.name)}for(Se=q.children,oe=0,Z=Se.length;oe<Z;oe++)le=Se[oe],this.createChildNode(le),le.type===r.Element&&this.up();return this},H.prototype.dummy=function(){return this},H.prototype.node=function(q,K,G){var he;if(q==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(q));return this.openCurrent(),q=A(q),K==null&&(K={}),K=A(K),x(K)||(he=[K,G],G=he[0],K=he[1]),this.currentNode=new w(this,q,K),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,G!=null&&this.text(G),this},H.prototype.element=function(q,K,G){var he,le,oe,Z,fe,Se;if(this.currentNode&&this.currentNode.type===r.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(q)||x(q)||C(q))for(Z=this.options.noValidation,this.options.noValidation=!0,Se=new m(this.options).element("TEMP_ROOT"),Se.element(q),this.options.noValidation=Z,fe=Se.children,le=0,oe=fe.length;le<oe;le++)he=fe[le],this.createChildNode(he),he.type===r.Element&&this.up();else this.node(q,K,G);return this},H.prototype.attribute=function(q,K){var G,he;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(q));if(q!=null&&(q=A(q)),x(q))for(G in q)R.call(q,G)&&(he=q[G],this.attribute(G,he));else C(K)&&(K=K.apply()),this.options.keepNullAttributes&&K==null?this.currentNode.attribs[q]=new t(this,q,""):K!=null&&(this.currentNode.attribs[q]=new t(this,q,K));return this},H.prototype.text=function(q){var K;return this.openCurrent(),K=new T(this,q),this.onData(this.writer.text(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.cdata=function(q){var K;return this.openCurrent(),K=new n(this,q),this.onData(this.writer.cdata(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.comment=function(q){var K;return this.openCurrent(),K=new s(this,q),this.onData(this.writer.comment(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.raw=function(q){var K;return this.openCurrent(),K=new S(this,q),this.onData(this.writer.raw(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.instruction=function(q,K){var G,he,le,oe,Z;if(this.openCurrent(),q!=null&&(q=A(q)),K!=null&&(K=A(K)),Array.isArray(q))for(G=0,oe=q.length;G<oe;G++)he=q[G],this.instruction(he);else if(x(q))for(he in q)R.call(q,he)&&(le=q[he],this.instruction(he,le));else C(K)&&(K=K.apply()),Z=new y(this,q,K),this.onData(this.writer.processingInstruction(Z,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},H.prototype.declaration=function(q,K,G){var he;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return he=new f(this,q,K,G),this.onData(this.writer.declaration(he,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.doctype=function(q,K,G){if(this.openCurrent(),q==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new h(this,K,G),this.currentNode.rootNodeName=q,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},H.prototype.dtdElement=function(q,K){var G;return this.openCurrent(),G=new a(this,q,K),this.onData(this.writer.dtdElement(G,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.attList=function(q,K,G,he,le){var oe;return this.openCurrent(),oe=new i(this,q,K,G,he,le),this.onData(this.writer.dtdAttList(oe,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.entity=function(q,K){var G;return this.openCurrent(),G=new u(this,!1,q,K),this.onData(this.writer.dtdEntity(G,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.pEntity=function(q,K){var G;return this.openCurrent(),G=new u(this,!0,q,K),this.onData(this.writer.dtdEntity(G,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.notation=function(q,K){var G;return this.openCurrent(),G=new l(this,q,K),this.onData(this.writer.dtdNotation(G,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},H.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},H.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},H.prototype.openNode=function(q){var K,G,he,le;if(!q.isOpen){if(!this.root&&this.currentLevel===0&&q.type===r.Element&&(this.root=q),G="",q.type===r.Element){this.writerOptions.state=e.OpenTag,G=this.writer.indent(q,this.writerOptions,this.currentLevel)+"<"+q.name,le=q.attribs;for(he in le)R.call(le,he)&&(K=le[he],G+=this.writer.attribute(K,this.writerOptions,this.currentLevel));G+=(q.children?">":"/>")+this.writer.endline(q,this.writerOptions,this.currentLevel),this.writerOptions.state=e.InsideTag}else this.writerOptions.state=e.OpenTag,G=this.writer.indent(q,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+q.rootNodeName,q.pubID&&q.sysID?G+=' PUBLIC "'+q.pubID+'" "'+q.sysID+'"':q.sysID&&(G+=' SYSTEM "'+q.sysID+'"'),q.children?(G+=" [",this.writerOptions.state=e.InsideTag):(this.writerOptions.state=e.CloseTag,G+=">"),G+=this.writer.endline(q,this.writerOptions,this.currentLevel);return this.onData(G,this.currentLevel),q.isOpen=!0}},H.prototype.closeNode=function(q){var K;if(!q.isClosed)return K="",this.writerOptions.state=e.CloseTag,q.type===r.Element?K=this.writer.indent(q,this.writerOptions,this.currentLevel)+"</"+q.name+">"+this.writer.endline(q,this.writerOptions,this.currentLevel):K=this.writer.indent(q,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(q,this.writerOptions,this.currentLevel),this.writerOptions.state=e.None,this.onData(K,this.currentLevel),q.isClosed=!0},H.prototype.onData=function(q,K){return this.documentStarted=!0,this.onDataCallback(q,K+1)},H.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},H.prototype.debugInfo=function(q){return q==null?"":"node: <"+q+">"},H.prototype.ele=function(){return this.element.apply(this,arguments)},H.prototype.nod=function(q,K,G){return this.node(q,K,G)},H.prototype.txt=function(q){return this.text(q)},H.prototype.dat=function(q){return this.cdata(q)},H.prototype.com=function(q){return this.comment(q)},H.prototype.ins=function(q,K){return this.instruction(q,K)},H.prototype.dec=function(q,K,G){return this.declaration(q,K,G)},H.prototype.dtd=function(q,K,G){return this.doctype(q,K,G)},H.prototype.e=function(q,K,G){return this.element(q,K,G)},H.prototype.n=function(q,K,G){return this.node(q,K,G)},H.prototype.t=function(q){return this.text(q)},H.prototype.d=function(q){return this.cdata(q)},H.prototype.c=function(q){return this.comment(q)},H.prototype.r=function(q){return this.raw(q)},H.prototype.i=function(q,K){return this.instruction(q,K)},H.prototype.att=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},H.prototype.a=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},H.prototype.ent=function(q,K){return this.entity(q,K)},H.prototype.pent=function(q,K){return this.pEntity(q,K)},H.prototype.not=function(q,K){return this.notation(q,K)},H})()}).call(uV)});var pV=ye((fV,hV)=>{"use strict";(function(){var r,e,t,n,s=o(function(a,u){for(var l in u)i.call(u,l)&&(a[l]=u[l]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;r=sn(),n=BT(),e=og(),hV.exports=t=(function(a){s(u,a);function u(l,f){this.stream=l,u.__super__.constructor.call(this,f)}return o(u,"XMLStreamWriter"),u.prototype.endline=function(l,f,h){return l.isLastRootNode&&f.state===e.CloseTag?"":u.__super__.endline.call(this,l,f,h)},u.prototype.document=function(l,f){var h,m,g,w,y,S,E,b,T;for(E=l.children,m=g=0,y=E.length;g<y;m=++g)h=E[m],h.isLastRootNode=m===l.children.length-1;for(f=this.filterOptions(f),b=l.children,T=[],w=0,S=b.length;w<S;w++)h=b[w],T.push(this.writeChildNode(h,f,0));return T},u.prototype.attribute=function(l,f,h){return this.stream.write(u.__super__.attribute.call(this,l,f,h))},u.prototype.cdata=function(l,f,h){return this.stream.write(u.__super__.cdata.call(this,l,f,h))},u.prototype.comment=function(l,f,h){return this.stream.write(u.__super__.comment.call(this,l,f,h))},u.prototype.declaration=function(l,f,h){return this.stream.write(u.__super__.declaration.call(this,l,f,h))},u.prototype.docType=function(l,f,h){var m,g,w,y;if(h||(h=0),this.openNode(l,f,h),f.state=e.OpenTag,this.stream.write(this.indent(l,f,h)),this.stream.write("<!DOCTYPE "+l.root().name),l.pubID&&l.sysID?this.stream.write(' PUBLIC "'+l.pubID+'" "'+l.sysID+'"'):l.sysID&&this.stream.write(' SYSTEM "'+l.sysID+'"'),l.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(l,f,h)),f.state=e.InsideTag,y=l.children,g=0,w=y.length;g<w;g++)m=y[g],this.writeChildNode(m,f,h+1);f.state=e.CloseTag,this.stream.write("]")}return f.state=e.CloseTag,this.stream.write(f.spaceBeforeSlash+">"),this.stream.write(this.endline(l,f,h)),f.state=e.None,this.closeNode(l,f,h)},u.prototype.element=function(l,f,h){var m,g,w,y,S,E,b,T,A,C;h||(h=0),this.openNode(l,f,h),f.state=e.OpenTag,this.stream.write(this.indent(l,f,h)+"<"+l.name),A=l.attribs;for(b in A)i.call(A,b)&&(m=A[b],this.attribute(m,f,h));if(w=l.children.length,y=w===0?null:l.children[0],w===0||l.children.every(function(x){return(x.type===r.Text||x.type===r.Raw)&&x.value===""}))f.allowEmpty?(this.stream.write(">"),f.state=e.CloseTag,this.stream.write("</"+l.name+">")):(f.state=e.CloseTag,this.stream.write(f.spaceBeforeSlash+"/>"));else if(f.pretty&&w===1&&(y.type===r.Text||y.type===r.Raw)&&y.value!=null)this.stream.write(">"),f.state=e.InsideTag,f.suppressPrettyCount++,T=!0,this.writeChildNode(y,f,h+1),f.suppressPrettyCount--,T=!1,f.state=e.CloseTag,this.stream.write("</"+l.name+">");else{for(this.stream.write(">"+this.endline(l,f,h)),f.state=e.InsideTag,C=l.children,S=0,E=C.length;S<E;S++)g=C[S],this.writeChildNode(g,f,h+1);f.state=e.CloseTag,this.stream.write(this.indent(l,f,h)+"</"+l.name+">")}return this.stream.write(this.endline(l,f,h)),f.state=e.None,this.closeNode(l,f,h)},u.prototype.processingInstruction=function(l,f,h){return this.stream.write(u.__super__.processingInstruction.call(this,l,f,h))},u.prototype.raw=function(l,f,h){return this.stream.write(u.__super__.raw.call(this,l,f,h))},u.prototype.text=function(l,f,h){return this.stream.write(u.__super__.text.call(this,l,f,h))},u.prototype.dtdAttList=function(l,f,h){return this.stream.write(u.__super__.dtdAttList.call(this,l,f,h))},u.prototype.dtdElement=function(l,f,h){return this.stream.write(u.__super__.dtdElement.call(this,l,f,h))},u.prototype.dtdEntity=function(l,f,h){return this.stream.write(u.__super__.dtdEntity.call(this,l,f,h))},u.prototype.dtdNotation=function(l,f,h){return this.stream.write(u.__super__.dtdNotation.call(this,l,f,h))},u})(n)}).call(fV)});var mV=ye((dV,Xu)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f;f=Va(),u=f.assign,l=f.isFunction,t=xT(),n=DT(),s=cV(),a=EE(),i=pV(),r=sn(),e=og(),Xu.exports.create=function(h,m,g,w){var y,S;if(h==null)throw new Error("Root element needs a name.");return w=u({},m,g,w),y=new n(w),S=y.element(h),w.headless||(y.declaration(w),(w.pubID!=null||w.sysID!=null)&&y.dtd(w)),S},Xu.exports.begin=function(h,m,g){var w;return l(h)&&(w=[h,m],m=w[0],g=w[1],h={}),m?new s(h,m,g):new n(h)},Xu.exports.stringWriter=function(h){return new a(h)},Xu.exports.streamWriter=function(h,m){return new i(h,m)},Xu.exports.implementation=new t,Xu.exports.nodeType=r,Xu.exports.writerState=e}).call(dV)});var gV=ye(_T=>{"use strict";(function(){"use strict";var r,e,t,n,s,i={}.hasOwnProperty;r=mV(),e=oE().defaults,n=o(function(a){return typeof a=="string"&&(a.indexOf("&")>=0||a.indexOf(">")>=0||a.indexOf("<")>=0)},"requiresCDATA"),s=o(function(a){return"<![CDATA["+t(a)+"]]>"},"wrapCDATA"),t=o(function(a){return a.replace("]]>","]]]]><![CDATA[>")},"escapeCDATA"),_T.Builder=(function(){function a(u){var l,f,h;this.options={},f=e["0.2"];for(l in f)i.call(f,l)&&(h=f[l],this.options[l]=h);for(l in u)i.call(u,l)&&(h=u[l],this.options[l]=h)}return o(a,"Builder"),a.prototype.buildObject=function(u){var l,f,h,m,g;return l=this.options.attrkey,f=this.options.charkey,Object.keys(u).length===1&&this.options.rootName===e["0.2"].rootName?(g=Object.keys(u)[0],u=u[g]):g=this.options.rootName,h=(function(w){return function(y,S){var E,b,T,A,C,x;if(typeof S!="object")w.options.cdata&&n(S)?y.raw(s(S)):y.txt(S);else if(Array.isArray(S)){for(A in S)if(i.call(S,A)){b=S[A];for(C in b)T=b[C],y=h(y.ele(C),T).up()}}else for(C in S)if(i.call(S,C))if(b=S[C],C===l){if(typeof b=="object")for(E in b)x=b[E],y=y.att(E,x)}else if(C===f)w.options.cdata&&n(b)?y=y.raw(s(b)):y=y.txt(b);else if(Array.isArray(b))for(A in b)i.call(b,A)&&(T=b[A],typeof T=="string"?w.options.cdata&&n(T)?y=y.ele(C).raw(s(T)).up():y=y.ele(C,T).up():y=h(y.ele(C),T).up());else typeof b=="object"?y=h(y.ele(C),b).up():typeof b=="string"&&w.options.cdata&&n(b)?y=y.ele(C).raw(s(b)).up():(b==null&&(b=""),y=y.ele(C,b.toString()).up());return y}})(this),m=r.create(g,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),h(m,u).end(this.options.renderOpts)},a})()}).call(_T)});var yV=ye(RT=>{"use strict";(function(){"use strict";RT.stripBOM=function(r){return r[0]==="\uFEFF"?r.substring(1):r}}).call(RT)});var PT=ye(Bc=>{"use strict";(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/),Bc.normalize=function(e){return e.toLowerCase()},Bc.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},Bc.stripPrefix=function(e){return e.replace(r,"")},Bc.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},Bc.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(Bc)});var vV=ye(Co=>{"use strict";(function(){"use strict";var r,e,t,n,s,i,a,u,l,f=o(function(g,w){return function(){return g.apply(w,arguments)}},"bind"),h=o(function(g,w){for(var y in w)m.call(w,y)&&(g[y]=w[y]);function S(){this.constructor=g}return o(S,"ctor"),S.prototype=w.prototype,g.prototype=new S,g.__super__=w.prototype,g},"extend"),m={}.hasOwnProperty;u=oT(),n=gt("events"),r=yV(),a=PT(),l=gt("timers").setImmediate,e=oE().defaults,s=o(function(g){return typeof g=="object"&&g!=null&&Object.keys(g).length===0},"isEmpty"),i=o(function(g,w,y){var S,E,b;for(S=0,E=g.length;S<E;S++)b=g[S],w=b(w,y);return w},"processItem"),t=o(function(g,w,y){var S;return S=Object.create(null),S.value=y,S.writable=!0,S.enumerable=!0,S.configurable=!0,Object.defineProperty(g,w,S)},"defineProperty"),Co.Parser=(function(g){h(w,g);function w(y){this.parseStringPromise=f(this.parseStringPromise,this),this.parseString=f(this.parseString,this),this.reset=f(this.reset,this),this.assignOrPush=f(this.assignOrPush,this),this.processAsync=f(this.processAsync,this);var S,E,b;if(!(this instanceof Co.Parser))return new Co.Parser(y);this.options={},E=e["0.2"];for(S in E)m.call(E,S)&&(b=E[S],this.options[S]=b);for(S in y)m.call(y,S)&&(b=y[S],this.options[S]=b);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(a.normalize)),this.reset()}return o(w,"Parser"),w.prototype.processAsync=function(){var y,S;try{return this.remaining.length<=this.options.chunkSize?(y=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(y),this.saxParser.close()):(y=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(y),l(this.processAsync))}catch(E){if(S=E,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(S)}},w.prototype.assignOrPush=function(y,S,E){return S in y?(y[S]instanceof Array||t(y,S,[y[S]]),y[S].push(E)):this.options.explicitArray?t(y,S,[E]):t(y,S,E)},w.prototype.reset=function(){var y,S,E,b;return this.removeAllListeners(),this.saxParser=u.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(function(T){return function(A){if(T.saxParser.resume(),!T.saxParser.errThrown)return T.saxParser.errThrown=!0,T.emit("error",A)}})(this),this.saxParser.onend=(function(T){return function(){if(!T.saxParser.ended)return T.saxParser.ended=!0,T.emit("end",T.resultObject)}})(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,b=[],y=this.options.attrkey,S=this.options.charkey,this.saxParser.onopentag=(function(T){return function(A){var C,x,B,F,R;if(B={},B[S]="",!T.options.ignoreAttrs){R=A.attributes;for(C in R)m.call(R,C)&&(!(y in B)&&!T.options.mergeAttrs&&(B[y]={}),x=T.options.attrValueProcessors?i(T.options.attrValueProcessors,A.attributes[C],C):A.attributes[C],F=T.options.attrNameProcessors?i(T.options.attrNameProcessors,C):C,T.options.mergeAttrs?T.assignOrPush(B,F,x):t(B[y],F,x))}return B["#name"]=T.options.tagNameProcessors?i(T.options.tagNameProcessors,A.name):A.name,T.options.xmlns&&(B[T.options.xmlnskey]={uri:A.uri,local:A.local}),b.push(B)}})(this),this.saxParser.onclosetag=(function(T){return function(){var A,C,x,B,F,R,H,q,K,G;if(R=b.pop(),F=R["#name"],(!T.options.explicitChildren||!T.options.preserveChildrenOrder)&&delete R["#name"],R.cdata===!0&&(A=R.cdata,delete R.cdata),K=b[b.length-1],R[S].match(/^\s*$/)&&!A?(C=R[S],delete R[S]):(T.options.trim&&(R[S]=R[S].trim()),T.options.normalize&&(R[S]=R[S].replace(/\s{2,}/g," ").trim()),R[S]=T.options.valueProcessors?i(T.options.valueProcessors,R[S],F):R[S],Object.keys(R).length===1&&S in R&&!T.EXPLICIT_CHARKEY&&(R=R[S])),s(R)&&(typeof T.options.emptyTag=="function"?R=T.options.emptyTag():R=T.options.emptyTag!==""?T.options.emptyTag:C),T.options.validator!=null&&(G="/"+(function(){var he,le,oe;for(oe=[],he=0,le=b.length;he<le;he++)B=b[he],oe.push(B["#name"]);return oe})().concat(F).join("/"),(function(){var he;try{return R=T.options.validator(G,K&&K[F],R)}catch(le){return he=le,T.emit("error",he)}})()),T.options.explicitChildren&&!T.options.mergeAttrs&&typeof R=="object"){if(!T.options.preserveChildrenOrder)B={},T.options.attrkey in R&&(B[T.options.attrkey]=R[T.options.attrkey],delete R[T.options.attrkey]),!T.options.charsAsChildren&&T.options.charkey in R&&(B[T.options.charkey]=R[T.options.charkey],delete R[T.options.charkey]),Object.getOwnPropertyNames(R).length>0&&(B[T.options.childkey]=R),R=B;else if(K){K[T.options.childkey]=K[T.options.childkey]||[],H={};for(x in R)m.call(R,x)&&t(H,x,R[x]);K[T.options.childkey].push(H),delete R["#name"],Object.keys(R).length===1&&S in R&&!T.EXPLICIT_CHARKEY&&(R=R[S])}}return b.length>0?T.assignOrPush(K,F,R):(T.options.explicitRoot&&(q=R,R={},t(R,F,q)),T.resultObject=R,T.saxParser.ended=!0,T.emit("end",T.resultObject))}})(this),E=(function(T){return function(A){var C,x;if(x=b[b.length-1],x)return x[S]+=A,T.options.explicitChildren&&T.options.preserveChildrenOrder&&T.options.charsAsChildren&&(T.options.includeWhiteChars||A.replace(/\\n/g,"").trim()!=="")&&(x[T.options.childkey]=x[T.options.childkey]||[],C={"#name":"__text__"},C[S]=A,T.options.normalize&&(C[S]=C[S].replace(/\s{2,}/g," ").trim()),x[T.options.childkey].push(C)),x}})(this),this.saxParser.ontext=E,this.saxParser.oncdata=(function(T){return function(A){var C;if(C=E(A),C)return C.cdata=!0}})(this)},w.prototype.parseString=function(y,S){var E;S!=null&&typeof S=="function"&&(this.on("end",function(b){return this.reset(),S(null,b)}),this.on("error",function(b){return this.reset(),S(b)}));try{return y=y.toString(),y.trim()===""?(this.emit("end",null),!0):(y=r.stripBOM(y),this.options.async?(this.remaining=y,l(this.processAsync),this.saxParser):this.saxParser.write(y).close())}catch(b){if(E=b,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw E}else return this.emit("error",E),this.saxParser.errThrown=!0}},w.prototype.parseStringPromise=function(y){return new Promise((function(S){return function(E,b){return S.parseString(y,function(T,A){return T?b(T):E(A)})}})(this))},w})(n),Co.parseString=function(g,w,y){var S,E,b;return y!=null?(typeof y=="function"&&(S=y),typeof w=="object"&&(E=w)):(typeof w=="function"&&(S=w),E={}),b=new Co.Parser(E),b.parseString(g,S)},Co.parseStringPromise=function(g,w){var y,S;return typeof w=="object"&&(y=w),S=new Co.Parser(y),S.parseStringPromise(g)}}).call(Co)});var wV=ye(bo=>{"use strict";(function(){"use strict";var r,e,t,n,s=o(function(a,u){for(var l in u)i.call(u,l)&&(a[l]=u[l]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;e=oE(),r=gV(),t=vV(),n=PT(),bo.defaults=e.defaults,bo.processors=n,bo.ValidationError=(function(a){s(u,a);function u(l){this.message=l}return o(u,"ValidationError"),u})(Error),bo.Builder=r.Builder,bo.Parser=t.Parser,bo.parseString=t.parseString,bo.parseStringPromise=t.parseStringPromise}).call(bo)});var Ib="http://www.w3.org/2000/09/xmldsig#",OR="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",Bb=(function(r){return r.RSA_SHA1="http://www.w3.org/2000/09/xmldsig#rsa-sha1",r.RSA_SHA256="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",r})({}),Rh=(function(r){return r.SHA1="sha1",r.SHA256="sha256",r})({}),Db=(function(r){return r.SHA1="http://www.w3.org/2000/09/xmldsig#sha1",r.SHA256="http://www.w3.org/2001/04/xmlenc#sha256",r})({});var NK={AC:"12",AL:"27",AM:"13",AP:"16",BA:"29",CE:"23",DF:"53",ES:"32",GO:"52",MA:"21",MG:"31",MS:"50",MT:"51",PA:"15",PB:"25",PE:"26",PI:"22",PR:"41",RJ:"33",RN:"24",RO:"11",RR:"14",RS:"43",SC:"42",SE:"28",SP:"35",TO:"17"},hae=Object.keys(NK);var dae={Production:"1",Homolog:"2"};var Ks=class extends Error{static{o(this,"NFeTsError")}};var kR=class extends Ks{static{o(this,"ValidationError")}};var dm={includeComments:!1,exclusive:!0};import{NFeTsError as TK}from"@nfets/core/domain/errors/nfets-error";var _b=o(r=>{throw new TK("Didn't expect to get here")},"unreachable");var Ph=class{static{o(this,"Signer")}toolkit;certificateRepository;algorithm;canonical;constructor(e,t,n=Rh.SHA1,s=dm){this.toolkit=e,this.certificateRepository=t,this.algorithm=n,this.canonical=s}assemble(e,t,n){let s=this.certificateRepository.getStringCertificate(n);return{$:{xmlns:Ib},SignedInfo:e,SignatureValue:t,KeyInfo:{X509Data:{X509Certificate:s}}}}signedInfo(e,t){return{CanonicalizationMethod:{$:{Algorithm:OR}},SignatureMethod:{$:{Algorithm:this.signatureMethod}},Reference:{$:{URI:`#${this.toolkit.getAttribute(e,t)}`},Transforms:this.transforms,DigestMethod:{$:{Algorithm:this.digestAlgorithm}},DigestValue:this.digest(e)}}}digest(e){return this.toolkit.digest(e,this.algorithm,this.canonical)}async signOrLeft(e,t){let n=this.toolkit.canonicalize(await this.toolkit.build({$:{xmlns:Ib},...e},{rootName:"SignedInfo"}),this.canonical);return await this.certificateRepository.sign(n,t,this.algorithm)}get transforms(){return{Transform:[{$:{Algorithm:"http://www.w3.org/2000/09/xmldsig#enveloped-signature"}},{$:{Algorithm:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"}}]}}get digestAlgorithm(){switch(this.algorithm){case Rh.SHA256:return Db.SHA256;case Rh.SHA1:return Db.SHA1;default:return _b(this.algorithm)}}get signatureMethod(){switch(this.algorithm){case Rh.SHA256:return Bb.RSA_SHA256;case Rh.SHA1:return Bb.RSA_SHA1;default:return _b(this.algorithm)}}};var Rb=class{static{o(this,"Left")}value;constructor(e){this.value=e}isLeft(){return!0}isRight(){return!1}},mw=class{static{o(this,"Right")}value;constructor(e){this.value=e}isLeft(){return!1}isRight(){return!0}},lo=o(r=>new Rb(r),"left"),Oh=o(r=>r===void 0?new mw(void 0):new mw(r),"right");var LR=class extends Ph{static{o(this,"EntitySigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{privateKey:a,certificate:u}=n;if(!e[s])return lo(new Ks(`Node ${String(s)} not found`));let l=await this.toolkit.build(this.ns(e,s),{headless:!0,rootName:String(s),renderOpts:{pretty:!1}}),f=this.signedInfo(l,i),h=await this.signOrLeft(f,a);if(h.isLeft())return h;let m=e;return m.Signature=this.assemble(f,h.value,u),Oh(m)}ns(e,t){let n=e.$?.xmlns,{$:s,...i}=e[t],{xmlns:a,...u}=s??{};return{$:{xmlns:n,...u},...i}}};var VR=class extends Ph{static{o(this,"XmlSigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{privateKey:a,certificate:u}=n,l=this.toolkit.getNode(e,s);if(!l)return lo(new Ks(`Node ${s} not found`));let f=this.signedInfo(l,i),h=await this.signOrLeft(f,a);if(h.isLeft())return h;let m=await this.toolkit.build(this.assemble(f,h.value,u),{rootName:"Signature"});return Oh(this.toolkit.appendNode(e,m))}};import"reflect-metadata";import{validateSync as BK}from"class-validator";import"reflect-metadata";var mm="__SkipValidation__",roe=o(()=>(r,e)=>{Reflect.defineMetadata(mm,!0,r,e.toString())},"SkipValidation"),noe=o(()=>r=>{Reflect.defineMetadata(mm,!0,r)},"SkipAllValidations");import{plainToInstance as IK}from"class-transformer";var gw=o(r=>{for(let[e,t]of Object.entries(r))typeof t>"u"&&delete r[e],t===""&&delete r[e],t&&typeof t=="object"&&gw(t)},"clearEmptyValues"),UR=o((r,e,t={})=>{let n=IK(e,r);return t.clearEmptyValues&&gw(n),n},"plainToInstance");var MR="__ValidateErrors__",jR=o((r,e)=>r.reduce((t,n)=>{if(n.children?.length)return t.concat(jR(n.children,e?`${e}.${n.property}`:n.property));let s=Object.values(n.constraints??{}).map(i=>e?`${e}.${i}`:i).join(", ");return s?t.concat(s):t},[]),"mapConstraintsToErrors"),poe=o(r=>(e,t,n)=>{let s=n.value;n.value=function(...i){let a=Reflect.getMetadata(mm,this.constructor);if(Reflect.getMetadata(mm,this.constructor.prototype,t.toString())===!0||a===!0)return s?.apply(this,i);let[l,...f]=i,h=UR(l,r),m=BK(h,{whitelist:!0});if(gw(h),m.length){let g=Reflect.getMetadata(MR,this)??[];Reflect.defineMetadata(MR,g.concat(jR(m,s?.name)),this)}return s?.apply(this,[h,...f])}},"Validates");import"reflect-metadata";import{Decimal as DK}from"@nfets/core/infrastructure";import{registerDecorator as _K}from"class-validator";var FR=o(r=>(e,t)=>{_K({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof DK?!0:typeof n=="string"||typeof n=="number"||typeof n=="bigint"},defaultMessage(n){return`${n.property} is not a valid Decimal value`}}})},"IsDecimal");import"reflect-metadata";import{registerDecorator as qR}from"class-validator";var kh=Symbol("choice"),Lh=o(r=>r==null||r==="","isEmpty"),Coe=o(r=>e=>{let{properties:t,required:n=!1,...s}=r,i=Reflect.getMetadata(kh,e)??[],a={properties:t,required:n};i.push(a),Reflect.defineMetadata(kh,i,e);for(let u of t)qR({name:"choice",target:e,propertyName:u,options:s,validator:{validate(l,f){let h=f.object,m=f.property,g=Reflect.getMetadata(kh,e);if(!g)return!0;let w=g.find(y=>y.properties.includes(m));if(!w||Lh(l))return!0;for(let y of w.properties){if(y===m)continue;let S=h[y];if(!Lh(S))return!1}for(let y of g)if(y!==w)for(let S of y.properties){let E=h[S];if(!Lh(E))return!1}return!0},defaultMessage(l){let f=Reflect.getMetadata(kh,e);if(!f)return`${l.property} validation error`;let h=f.find(g=>g.properties.includes(l.property));if(!h)return`${l.property} validation error`;let m=l.object;for(let g of h.properties){let w=m[g];if(!Lh(w)&&g!==l.property)return`${l.property} cannot be set because ${g} is already set. Only one property from this choice group is allowed.`}for(let g of f)if(g!==h)for(let w of g.properties){let y=m[w];if(!Lh(y))return`${l.property} cannot be set because ${w} from a different choice group is already set.`}return`${l.property} validation error`}}});if(n)for(let u of t)qR({name:"choiceGroupRequired",target:e,propertyName:u,options:{...s,always:!0},validator:{validate(l,f){let h=f.object,m=Reflect.getMetadata(kh,e);if(!m)return!0;let g=m.find(w=>w.properties.includes(f.property));if(!g?.required)return!0;for(let w of g.properties){let y=h[w];if(!Lh(y))return!0}return f.property!==g.properties[0]},defaultMessage(l){let f=Reflect.getMetadata(kh,e);if(!f)return"At least one property from a choice group must be provided";let h=f.find(m=>m.properties.includes(l.property));return h?`You must provide a value for one of the following properties: ${h.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");import"reflect-metadata";import{Decimal as RK}from"@nfets/core/infrastructure";import{Transform as PK}from"class-transformer";var Doe=o(({fixed:r,...e}={fixed:2})=>(t,n)=>{FR(e)(t,n),PK(({value:s})=>RK.newOrUndefined(s)?.toFixed(r))(t,n)},"TransformDecimal");import{Transform as LK}from"class-transformer";import{IsDateString as VK}from"class-validator";import Pb from"dayjs";import OK from"dayjs/plugin/utc";import kK from"dayjs/plugin/timezone";Pb.extend(OK);Pb.extend(kK);var HR=Pb;var joe=o((r={})=>(e,t)=>{LK(({value:n})=>{let s=n instanceof Date?n.toISOString():n;return s?HR(s).tz("America/Sao_Paulo").format(r.format):void 0})(e,t),VK()(e,t)},"TransformDateString");var KR=class{static{o(this,"StateCodeAcValidator")}execute(e){if(e=e.replace(/\D/g,""),!/^01\d{11}$/.test(e))return!1;let t=e.split("").map(Number),n=t.slice(0,11),s=t[11],i=t[12],a=[4,3,2,9,8,7,6,5,4,3,2],l=n.reduce((y,S,E)=>y+S*a[E],0)%11,f=l===0||l===1?0:11-l,h=[5,4,3,2,9,8,7,6,5,4,3,2],g=[...n,f].reduce((y,S,E)=>y+S*h[E],0)%11,w=g===0||g===1?0:11-g;return s===f&&i===w}};var $R=class{static{o(this,"StateCodeAlValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let l=0;l<8;l++)s+=parseInt(t[l],10)*n[l];let a=s*10%11;return(a===10?0:a)===parseInt(t[8],10)}};var XR=class{static{o(this,"StateCodeAmValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let a=0;a<8;a++)s+=parseInt(t[a],10)*n[a];let i;if(s<11)i=11-s;else{let a=s%11;i=a<=1?0:11-a}return i===parseInt(t[8],10)}};var GR=class{static{o(this,"StateCodeApValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("03"))return!1;let n=t.substring(0,8),s=parseInt(n,10),i,a;s>=3017001&&s<=3019022?(i=9,a=1):s>=3000001&&s<=3017e3?(i=5,a=0):(i=0,a=0);let u=[9,8,7,6,5,4,3,2],l=i;for(let m=0;m<8;m++)l+=parseInt(t[m],10)*u[m];let h=11-l%11;return h===10?h=0:h===11&&(h=a),h===parseInt(t[8],10)}};var WR=class{static{o(this,"StateCodeBaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8&&t.length!==9)return!1;let n=t.split("").map(S=>parseInt(S,10)),s=(t.length===8?n[0]:n[1])<=5||n[0]===8?10:11,i=t.length===8?[7,6,5,4,3,2]:[8,7,6,5,4,3,2],a=0;for(let S=0;S<i.length;S++)a+=n[S]*i[S];let u=a%s,l=s-u;(s===11&&u<=1||s===10&&u===0)&&(l=0);let h=(t.slice(0,t.length-2)+l.toString()).split("").map(S=>parseInt(S,10)),m=t.length===8?[8,7,6,5,4,3,2]:[9,8,7,6,5,4,3,2],g=0;for(let S=0;S<m.length;S++)g+=h[S]*m[S];let w=g%s,y=s-w;return(s===11&&w<=1||s===10&&w===0)&&(y=0),y===n[t.length-2]&&l===n[t.length-1]}};var JR=class{static{o(this,"StateCodeCeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var zR=class{static{o(this,"StateCodeDfValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13||!t.startsWith("07"))return!1;let n=t.slice(0,11).split("").map(Number),s=t.slice(11).split("").map(Number),i=[2,3,4,5,6,7,8,9],a=0;for(let m=10,g=0;m>=0;m--,g=(g+1)%i.length)a+=n[m]*i[g];let u=11-a%11;(u===10||u===11)&&(u=0);let l=n.concat([u]),f=0;for(let m=11,g=0;m>=0;m--,g=(g+1)%i.length)f+=l[m]*i[g];let h=11-f%11;return(h===10||h===11)&&(h=0),u===s[0]&&h===s[1]}};var YR=class{static{o(this,"StateCodeEsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<2?0:11-i)===parseInt(t[8],10)}};var QR=class{static{o(this,"StateCodeGoValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=parseInt(t.substring(0,2));if(!(n===10||n===11||n>=20&&n<=29))return!1;let s=[9,8,7,6,5,4,3,2],i=0;for(let l=0;l<8;l++)i+=parseInt(t[l],10)*s[l];let a=i%11;return(a===0||a===1?0:11-a)===parseInt(t[8],10)}};var ZR=class{static{o(this,"StateCodeMaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("12"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8],10)}};var eP=class{static{o(this,"StateCodeMgValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13)return!1;let n=t.slice(0,11),s=n.slice(0,3)+"0"+n.slice(3),i=0;for(let w=0;w<12;w++){let y=w%2===0?1:2,S=(parseInt(s[w])*y).toString();i+=S.split("").reduce((E,b)=>E+parseInt(b),0)}let u=Math.ceil(i/10)*10-i,l=n+u.toString(),f=[3,2,11,10,9,8,7,6,5,4,3,2],h=0;for(let w=0;w<12;w++)h+=parseInt(l[w])*f[w];let m=h%11,g=m<2?0:11-m;return parseInt(t[11])===u&&parseInt(t[12])===g}};var tP=class{static{o(this,"StateCodeMsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!(t.startsWith("28")||t.startsWith("50")))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let l=0;l<8;l++)s+=parseInt(t[l],10)*n[l];let i=s%11,a=11-i;return(i===0||a>9?0:a)===parseInt(t[8],10)}};var rP=class{static{o(this,"StateCodeMtValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=[3,2,9,8,7,6,5,4,3,2],s=0;for(let u=0;u<10;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[10],10)}};var nP=class{static{o(this,"StateCodePaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8])}};var sP=class{static{o(this,"StateCodePbValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8])}};var iP=class{static{o(this,"StateCodePeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=t.slice(0,7).split("").map(Number),s=[8,7,6,5,4,3,2],i=0;for(let w=0;w<7;w++)i+=n[w]*s[w];let a=i%11,u=a===0||a===1?0:11-a,l=[...n,u],f=[9,8,7,6,5,4,3,2],h=0;for(let w=0;w<8;w++)h+=l[w]*f[w];let m=h%11,g=m===0||m===1?0:11-m;return u===parseInt(t[7])&&g===parseInt(t[8])}};var aP=class{static{o(this,"StateCodePiValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var oP=class{static{o(this,"StateCodePrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=t.slice(0,8).split("").map(Number),s=[3,2,7,6,5,4,3,2],i=[4,3,2,7,6,5,4,3,2],a=0;for(let m=0;m<8;m++)a+=n[m]*s[m];let u=11-a%11;u>=10&&(u=0);let l=[...n,u],f=0;for(let m=0;m<9;m++)f+=l[m]*i[m];let h=11-f%11;return h>=10&&(h=0),u===parseInt(t[8])&&h===parseInt(t[9])}};var uP=class{static{o(this,"StateCodeRjValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8)return!1;let n=[2,7,6,5,4,3,2],s=0;for(let u=0;u<7;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<=1?0:11-i)===parseInt(t[7],10)}};var lP=class{static{o(this,"StateCodeRnValidator")}execute(e){let t=e.replace(/\D/g,"");if(!(t.length===9||t.length===10)||!t.startsWith("20"))return!1;let n=t.length===9?[9,8,7,6,5,4,3,2]:[10,9,8,7,6,5,4,3,2],s=t.slice(0,n.length).split("").map(Number),i=0;for(let f=0;f<n.length;f++)i+=s[f]*n[f];let u=i*10%11;return(u===10?0:u)===parseInt(t[t.length-1])}};var cP=class{static{o(this,"StateCodeRoValidator")}execute(e){let t=e.replace(/\D/g,""),n,s;if(t.length===9)n=t.slice(3,8).split("").map(Number),s=[6,5,4,3,2];else if(t.length===14)n=t.slice(0,13).split("").map(Number),s=[6,5,4,3,2,9,8,7,6,5,4,3,2];else return!1;let i=0;for(let l=0;l<s.length;l++)i+=n[l]*s[l];let u=11-i%11;return(u===10||u===11)&&(u-=10),u===parseInt(t[t.length-1])}};var fP=class{static{o(this,"StateCodeRrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=0;for(let i=0;i<8;i++)n+=(i+1)*parseInt(t[i],10);return n%9===parseInt(t[8],10)}};var hP=class{static{o(this,"StateCodeRsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=[2,9,8,7,6,5,4,3,2],s=0;for(let a=0;a<9;a++)s+=parseInt(t[a],10)*n[a];let i=11-s%11;return(i===10||i===11)&&(i=0),i===parseInt(t[9],10)}};var pP=class{static{o(this,"StateCodeScValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var dP=class{static{o(this,"StateCodeSeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var mP=class{static{o(this,"StateCodeSpValidator")}execute(e){let t=e;if(t.length!==12)return!1;let n=t.split("").map(Number),s=[1,3,4,5,6,7,8,10],i=0;for(let h=0;h<8;h++)i+=n[h]*s[h];let a=i%11%10,u=[3,2,10,9,8,7,6,5,4,3,2],l=0;for(let h=0;h<11;h++)l+=n[h]*u[h];let f=l%11%10;return a===n[8]&&f===n[11]}};var gP=class{static{o(this,"StateCodeToValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=t.split(""),s=n.slice(0,2).concat(n.slice(4,10)).map(Number),i=[9,8,7,6,5,4,3,2],a=0;for(let f=0;f<i.length;f++)a+=s[f]*i[f];let u=a%11;return(u<2?0:11-u)===parseInt(t[10])}};var yP=class{static{o(this,"ASN1")}extractCertificateInfo(e){let n=e.subject.split(`
84
- `).reduce((i,a)=>{let[u,l]=a.split("=").map(f=>f.trim());return!u||!l?i:i.set(u,l)},new Map),s=this.oid("2.16.76.1.3.1",e.raw);return{CNPJ:this.oid("2.16.76.1.3.3",e.raw),CPF:s,CN:n.get("CN")?.replace(/:.*$/g,""),O:n.get("O"),OU:n.get("OU"),ST:n.get("ST"),L:n.get("L"),C:n.get("C")}}oid(e,t){let n=this.marker(e),s=t.indexOf(n);if(s===-1)return;let i=[t.subarray(0,s),t.subarray(s)];if(i.length<=1)return;let u=i[0].subarray(-4),l=u.subarray(-2);u[0]===48?l=u:u[1]===48&&(l=u.subarray(-3));let f=Buffer.concat([l,n,i[1]]),h=this.length(f),m=n.length,g=f.subarray(2+m,2+m+h),w=g.length-l.length-2;if(w<=0||w>g.length)return;let S=g.subarray(-w).toString("utf8");return S.substring(Buffer.from(S).findIndex((E,b)=>S.charCodeAt(b)>=32&&S.charCodeAt(b)<=126))}length(e){return e.length<2?0:e[1]<=127?e[1]:Buffer.from([e[1]&15]).reduce((t,n)=>t<<8|n,0)}marker(e){let t=e.split("."),n=t.slice(2).reduce((s,i)=>{let a=this.base128(s,Number.parseInt(i,10),!0);return s.length=0,s.push(...a),s},[]);return Buffer.from([6,n.length+1,40*Number.parseInt(t[0],10)+Number.parseInt(t[1],10),...n])}base128(e,t,n){let s=[...e];if(t>127){let a=this.base128(e,Math.floor(t/128),!1);a.length=0,s.push(...a)}let i=t%128;return n?s.push(i):s.push(128|i),s}};var Vh=9e15,mu=1e9,Ob="0123456789abcdef",ww="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Sw="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",kb={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Vh,maxE:Vh,crypto:!1},EP,co,Bt=!0,Aw="[DecimalError] ",du=Aw+"Invalid argument: ",AP=Aw+"Precision limit exceeded",CP=Aw+"crypto unavailable",bP="[object Decimal]",Jn=Math.floor,gn=Math.pow,UK=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,MK=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,jK=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,xP=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Mi=1e7,At=7,FK=9007199254740991,qK=ww.length-1,Lb=Sw.length-1,Pe={toStringTag:bP};Pe.absoluteValue=Pe.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),mt(r)};Pe.ceil=function(){return mt(new this.constructor(this),this.e+1,2)};Pe.clampedTo=Pe.clamp=function(r,e){var t,n=this,s=n.constructor;if(r=new s(r),e=new s(e),!r.s||!e.s)return new s(NaN);if(r.gt(e))throw Error(du+e);return t=n.cmp(r),t<0?r:n.cmp(e)>0?e:new s(n)};Pe.comparedTo=Pe.cmp=function(r){var e,t,n,s,i=this,a=i.d,u=(r=new i.constructor(r)).d,l=i.s,f=r.s;if(!a||!u)return!l||!f?NaN:l!==f?l:a===u?0:!a^l<0?1:-1;if(!a[0]||!u[0])return a[0]?l:u[0]?-f:0;if(l!==f)return l;if(i.e!==r.e)return i.e>r.e^l<0?1:-1;for(n=a.length,s=u.length,e=0,t=n<s?n:s;e<t;++e)if(a[e]!==u[e])return a[e]>u[e]^l<0?1:-1;return n===s?0:n>s^l<0?1:-1};Pe.cosine=Pe.cos=function(){var r,e,t=this,n=t.constructor;return t.d?t.d[0]?(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+At,n.rounding=1,t=HK(n,DP(n,t)),n.precision=r,n.rounding=e,mt(co==2||co==3?t.neg():t,r,e,!0)):new n(1):new n(NaN)};Pe.cubeRoot=Pe.cbrt=function(){var r,e,t,n,s,i,a,u,l,f,h=this,m=h.constructor;if(!h.isFinite()||h.isZero())return new m(h);for(Bt=!1,i=h.s*gn(h.s*h,1/3),!i||Math.abs(i)==1/0?(t=Pn(h.d),r=h.e,(i=(r-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=gn(t,1/3),r=Jn((r+1)/3)-(r%3==(r<0?-1:2)),i==1/0?t="5e"+r:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+r),n=new m(t),n.s=h.s):n=new m(i.toString()),a=(r=m.precision)+3;;)if(u=n,l=u.times(u).times(u),f=l.plus(h),n=br(f.plus(h).times(u),f.plus(l),a+2,1),Pn(u.d).slice(0,a)===(t=Pn(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!s&&t=="4999"){if(!s&&(mt(u,r+1,0),u.times(u).times(u).eq(h))){n=u;break}a+=4,s=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(mt(n,r+1,1),e=!n.times(n).times(n).eq(h));break}return Bt=!0,mt(n,r,m.rounding,e)};Pe.decimalPlaces=Pe.dp=function(){var r,e=this.d,t=NaN;if(e){if(r=e.length-1,t=(r-Jn(this.e/At))*At,r=e[r],r)for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t};Pe.dividedBy=Pe.div=function(r){return br(this,new this.constructor(r))};Pe.dividedToIntegerBy=Pe.divToInt=function(r){var e=this,t=e.constructor;return mt(br(e,new t(r),0,1,1),t.precision,t.rounding)};Pe.equals=Pe.eq=function(r){return this.cmp(r)===0};Pe.floor=function(){return mt(new this.constructor(this),this.e+1,3)};Pe.greaterThan=Pe.gt=function(r){return this.cmp(r)>0};Pe.greaterThanOrEqualTo=Pe.gte=function(r){var e=this.cmp(r);return e==1||e===0};Pe.hyperbolicCosine=Pe.cosh=function(){var r,e,t,n,s,i=this,a=i.constructor,u=new a(1);if(!i.isFinite())return new a(i.s?1/0:NaN);if(i.isZero())return u;t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,s=i.d.length,s<32?(r=Math.ceil(s/3),e=(1/bw(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),i=Uh(a,1,i.times(e),new a(1),!0);for(var l,f=r,h=new a(8);f--;)l=i.times(i),i=u.minus(l.times(h.minus(l.times(h))));return mt(i,a.precision=t,a.rounding=n,!0)};Pe.hyperbolicSine=Pe.sinh=function(){var r,e,t,n,s=this,i=s.constructor;if(!s.isFinite()||s.isZero())return new i(s);if(e=i.precision,t=i.rounding,i.precision=e+Math.max(s.e,s.sd())+4,i.rounding=1,n=s.d.length,n<3)s=Uh(i,2,s,s,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,s=s.times(1/bw(5,r)),s=Uh(i,2,s,s,!0);for(var a,u=new i(5),l=new i(16),f=new i(20);r--;)a=s.times(s),s=s.times(u.plus(a.times(l.times(a).plus(f))))}return i.precision=e,i.rounding=t,mt(s,e,t,!0)};Pe.hyperbolicTangent=Pe.tanh=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+7,n.rounding=1,br(t.sinh(),t.cosh(),n.precision=r,n.rounding=e)):new n(t.s)};Pe.inverseCosine=Pe.acos=function(){var r=this,e=r.constructor,t=r.abs().cmp(1),n=e.precision,s=e.rounding;return t!==-1?t===0?r.isNeg()?ha(e,n,s):new e(0):new e(NaN):r.isZero()?ha(e,n+4,s).times(.5):(e.precision=n+6,e.rounding=1,r=new e(1).minus(r).div(r.plus(1)).sqrt().atan(),e.precision=n,e.rounding=s,r.times(2))};Pe.inverseHyperbolicCosine=Pe.acosh=function(){var r,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(r=n.precision,e=n.rounding,n.precision=r+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,Bt=!1,t=t.times(t).minus(1).sqrt().plus(t),Bt=!0,n.precision=r,n.rounding=e,t.ln()):new n(t)};Pe.inverseHyperbolicSine=Pe.asinh=function(){var r,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,Bt=!1,t=t.times(t).plus(1).sqrt().plus(t),Bt=!0,n.precision=r,n.rounding=e,t.ln())};Pe.inverseHyperbolicTangent=Pe.atanh=function(){var r,e,t,n,s=this,i=s.constructor;return s.isFinite()?s.e>=0?new i(s.abs().eq(1)?s.s/0:s.isZero()?s:NaN):(r=i.precision,e=i.rounding,n=s.sd(),Math.max(n,r)<2*-s.e-1?mt(new i(s),r,e,!0):(i.precision=t=n-s.e,s=br(s.plus(1),new i(1).minus(s),t+r,1),i.precision=r+4,i.rounding=1,s=s.ln(),i.precision=r,i.rounding=e,s.times(.5))):new i(NaN)};Pe.inverseSine=Pe.asin=function(){var r,e,t,n,s=this,i=s.constructor;return s.isZero()?new i(s):(e=s.abs().cmp(1),t=i.precision,n=i.rounding,e!==-1?e===0?(r=ha(i,t+4,n).times(.5),r.s=s.s,r):new i(NaN):(i.precision=t+6,i.rounding=1,s=s.div(new i(1).minus(s.times(s)).sqrt().plus(1)).atan(),i.precision=t,i.rounding=n,s.times(2)))};Pe.inverseTangent=Pe.atan=function(){var r,e,t,n,s,i,a,u,l,f=this,h=f.constructor,m=h.precision,g=h.rounding;if(f.isFinite()){if(f.isZero())return new h(f);if(f.abs().eq(1)&&m+4<=Lb)return a=ha(h,m+4,g).times(.25),a.s=f.s,a}else{if(!f.s)return new h(NaN);if(m+4<=Lb)return a=ha(h,m+4,g).times(.5),a.s=f.s,a}for(h.precision=u=m+10,h.rounding=1,t=Math.min(28,u/At+2|0),r=t;r;--r)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(Bt=!1,e=Math.ceil(u/At),n=1,l=f.times(f),a=new h(f),s=f;r!==-1;)if(s=s.times(l),i=a.minus(s.div(n+=2)),s=s.times(l),a=i.plus(s.div(n+=2)),a.d[e]!==void 0)for(r=e;a.d[r]===i.d[r]&&r--;);return t&&(a=a.times(2<<t-1)),Bt=!0,mt(a,h.precision=m,h.rounding=g,!0)};Pe.isFinite=function(){return!!this.d};Pe.isInteger=Pe.isInt=function(){return!!this.d&&Jn(this.e/At)>this.d.length-2};Pe.isNaN=function(){return!this.s};Pe.isNegative=Pe.isNeg=function(){return this.s<0};Pe.isPositive=Pe.isPos=function(){return this.s>0};Pe.isZero=function(){return!!this.d&&this.d[0]===0};Pe.lessThan=Pe.lt=function(r){return this.cmp(r)<0};Pe.lessThanOrEqualTo=Pe.lte=function(r){return this.cmp(r)<1};Pe.logarithm=Pe.log=function(r){var e,t,n,s,i,a,u,l,f=this,h=f.constructor,m=h.precision,g=h.rounding,w=5;if(r==null)r=new h(10),e=!0;else{if(r=new h(r),t=r.d,r.s<0||!t||!t[0]||r.eq(1))return new h(NaN);e=r.eq(10)}if(t=f.d,f.s<0||!t||!t[0]||f.eq(1))return new h(t&&!t[0]?-1/0:f.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)i=!0;else{for(s=t[0];s%10===0;)s/=10;i=s!==1}if(Bt=!1,u=m+w,a=pu(f,u),n=e?Ew(h,u+10):pu(r,u),l=br(a,n,u,1),gm(l.d,s=m,g))do if(u+=10,a=pu(f,u),n=e?Ew(h,u+10):pu(r,u),l=br(a,n,u,1),!i){+Pn(l.d).slice(s+1,s+15)+1==1e14&&(l=mt(l,m+1,0));break}while(gm(l.d,s+=10,g));return Bt=!0,mt(l,m,g)};Pe.minus=Pe.sub=function(r){var e,t,n,s,i,a,u,l,f,h,m,g,w=this,y=w.constructor;if(r=new y(r),!w.d||!r.d)return!w.s||!r.s?r=new y(NaN):w.d?r.s=-r.s:r=new y(r.d||w.s!==r.s?w:NaN),r;if(w.s!=r.s)return r.s=-r.s,w.plus(r);if(f=w.d,g=r.d,u=y.precision,l=y.rounding,!f[0]||!g[0]){if(g[0])r.s=-r.s;else if(f[0])r=new y(w);else return new y(l===3?-0:0);return Bt?mt(r,u,l):r}if(t=Jn(r.e/At),h=Jn(w.e/At),f=f.slice(),i=h-t,i){for(m=i<0,m?(e=f,i=-i,a=g.length):(e=g,t=h,a=f.length),n=Math.max(Math.ceil(u/At),a)+2,i>n&&(i=n,e.length=1),e.reverse(),n=i;n--;)e.push(0);e.reverse()}else{for(n=f.length,a=g.length,m=n<a,m&&(a=n),n=0;n<a;n++)if(f[n]!=g[n]){m=f[n]<g[n];break}i=0}for(m&&(e=f,f=g,g=e,r.s=-r.s),a=f.length,n=g.length-a;n>0;--n)f[a++]=0;for(n=g.length;n>i;){if(f[--n]<g[n]){for(s=n;s&&f[--s]===0;)f[s]=Mi-1;--f[s],f[n]+=Mi}f[n]-=g[n]}for(;f[--a]===0;)f.pop();for(;f[0]===0;f.shift())--t;return f[0]?(r.d=f,r.e=Cw(f,t),Bt?mt(r,u,l):r):new y(l===3?-0:0)};Pe.modulo=Pe.mod=function(r){var e,t=this,n=t.constructor;return r=new n(r),!t.d||!r.s||r.d&&!r.d[0]?new n(NaN):!r.d||t.d&&!t.d[0]?mt(new n(t),n.precision,n.rounding):(Bt=!1,n.modulo==9?(e=br(t,r.abs(),0,3,1),e.s*=r.s):e=br(t,r,0,n.modulo,1),e=e.times(r),Bt=!0,t.minus(e))};Pe.naturalExponential=Pe.exp=function(){return Vb(this)};Pe.naturalLogarithm=Pe.ln=function(){return pu(this)};Pe.negated=Pe.neg=function(){var r=new this.constructor(this);return r.s=-r.s,mt(r)};Pe.plus=Pe.add=function(r){var e,t,n,s,i,a,u,l,f,h,m=this,g=m.constructor;if(r=new g(r),!m.d||!r.d)return!m.s||!r.s?r=new g(NaN):m.d||(r=new g(r.d||m.s===r.s?m:NaN)),r;if(m.s!=r.s)return r.s=-r.s,m.minus(r);if(f=m.d,h=r.d,u=g.precision,l=g.rounding,!f[0]||!h[0])return h[0]||(r=new g(m)),Bt?mt(r,u,l):r;if(i=Jn(m.e/At),n=Jn(r.e/At),f=f.slice(),s=i-n,s){for(s<0?(t=f,s=-s,a=h.length):(t=h,n=i,a=f.length),i=Math.ceil(u/At),a=i>a?i+1:a+1,s>a&&(s=a,t.length=1),t.reverse();s--;)t.push(0);t.reverse()}for(a=f.length,s=h.length,a-s<0&&(s=a,t=h,h=f,f=t),e=0;s;)e=(f[--s]=f[s]+h[s]+e)/Mi|0,f[s]%=Mi;for(e&&(f.unshift(e),++n),a=f.length;f[--a]==0;)f.pop();return r.d=f,r.e=Cw(f,n),Bt?mt(r,u,l):r};Pe.precision=Pe.sd=function(r){var e,t=this;if(r!==void 0&&r!==!!r&&r!==1&&r!==0)throw Error(du+r);return t.d?(e=NP(t.d),r&&t.e+1>e&&(e=t.e+1)):e=NaN,e};Pe.round=function(){var r=this,e=r.constructor;return mt(new e(r),r.e+1,e.rounding)};Pe.sine=Pe.sin=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+At,n.rounding=1,t=$K(n,DP(n,t)),n.precision=r,n.rounding=e,mt(co>2?t.neg():t,r,e,!0)):new n(NaN)};Pe.squareRoot=Pe.sqrt=function(){var r,e,t,n,s,i,a=this,u=a.d,l=a.e,f=a.s,h=a.constructor;if(f!==1||!u||!u[0])return new h(!f||f<0&&(!u||u[0])?NaN:u?a:1/0);for(Bt=!1,f=Math.sqrt(+a),f==0||f==1/0?(e=Pn(u),(e.length+l)%2==0&&(e+="0"),f=Math.sqrt(e),l=Jn((l+1)/2)-(l<0||l%2),f==1/0?e="5e"+l:(e=f.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),n=new h(e)):n=new h(f.toString()),t=(l=h.precision)+3;;)if(i=n,n=i.plus(br(a,i,t+2,1)).times(.5),Pn(i.d).slice(0,t)===(e=Pn(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!s&&e=="4999"){if(!s&&(mt(i,l+1,0),i.times(i).eq(a))){n=i;break}t+=4,s=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(mt(n,l+1,1),r=!n.times(n).eq(a));break}return Bt=!0,mt(n,l,h.rounding,r)};Pe.tangent=Pe.tan=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+10,n.rounding=1,t=t.sin(),t.s=1,t=br(t,new n(1).minus(t.times(t)).sqrt(),r+10,0),n.precision=r,n.rounding=e,mt(co==2||co==4?t.neg():t,r,e,!0)):new n(NaN)};Pe.times=Pe.mul=function(r){var e,t,n,s,i,a,u,l,f,h=this,m=h.constructor,g=h.d,w=(r=new m(r)).d;if(r.s*=h.s,!g||!g[0]||!w||!w[0])return new m(!r.s||g&&!g[0]&&!w||w&&!w[0]&&!g?NaN:!g||!w?r.s/0:r.s*0);for(t=Jn(h.e/At)+Jn(r.e/At),l=g.length,f=w.length,l<f&&(i=g,g=w,w=i,a=l,l=f,f=a),i=[],a=l+f,n=a;n--;)i.push(0);for(n=f;--n>=0;){for(e=0,s=l+n;s>n;)u=i[s]+w[n]*g[s-n-1]+e,i[s--]=u%Mi|0,e=u/Mi|0;i[s]=(i[s]+e)%Mi|0}for(;!i[--a];)i.pop();return e?++t:i.shift(),r.d=i,r.e=Cw(i,t),Bt?mt(r,m.precision,m.rounding):r};Pe.toBinary=function(r,e){return Ub(this,2,r,e)};Pe.toDecimalPlaces=Pe.toDP=function(r,e){var t=this,n=t.constructor;return t=new n(t),r===void 0?t:(Ss(r,0,mu),e===void 0?e=n.rounding:Ss(e,0,8),mt(t,r+t.e+1,e))};Pe.toExponential=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=pa(n,!0):(Ss(r,0,mu),e===void 0?e=s.rounding:Ss(e,0,8),n=mt(new s(n),r+1,e),t=pa(n,!0,r+1)),n.isNeg()&&!n.isZero()?"-"+t:t};Pe.toFixed=function(r,e){var t,n,s=this,i=s.constructor;return r===void 0?t=pa(s):(Ss(r,0,mu),e===void 0?e=i.rounding:Ss(e,0,8),n=mt(new i(s),r+s.e+1,e),t=pa(n,!1,r+n.e+1)),s.isNeg()&&!s.isZero()?"-"+t:t};Pe.toFraction=function(r){var e,t,n,s,i,a,u,l,f,h,m,g,w=this,y=w.d,S=w.constructor;if(!y)return new S(w);if(f=t=new S(1),n=l=new S(0),e=new S(n),i=e.e=NP(y)-w.e-1,a=i%At,e.d[0]=gn(10,a<0?At+a:a),r==null)r=i>0?e:f;else{if(u=new S(r),!u.isInt()||u.lt(f))throw Error(du+u);r=u.gt(e)?i>0?e:f:u}for(Bt=!1,u=new S(Pn(y)),h=S.precision,S.precision=i=y.length*At*2;m=br(u,e,0,1,1),s=t.plus(m.times(n)),s.cmp(r)!=1;)t=n,n=s,s=f,f=l.plus(m.times(s)),l=s,s=e,e=u.minus(m.times(s)),u=s;return s=br(r.minus(t),n,0,1,1),l=l.plus(s.times(f)),t=t.plus(s.times(n)),l.s=f.s=w.s,g=br(f,n,i,1).minus(w).abs().cmp(br(l,t,i,1).minus(w).abs())<1?[f,n]:[l,t],S.precision=h,Bt=!0,g};Pe.toHexadecimal=Pe.toHex=function(r,e){return Ub(this,16,r,e)};Pe.toNearest=function(r,e){var t=this,n=t.constructor;if(t=new n(t),r==null){if(!t.d)return t;r=new n(1),e=n.rounding}else{if(r=new n(r),e===void 0?e=n.rounding:Ss(e,0,8),!t.d)return r.s?t:r;if(!r.d)return r.s&&(r.s=t.s),r}return r.d[0]?(Bt=!1,t=br(t,r,0,e,1).times(r),Bt=!0,mt(t)):(r.s=t.s,t=r),t};Pe.toNumber=function(){return+this};Pe.toOctal=function(r,e){return Ub(this,8,r,e)};Pe.toPower=Pe.pow=function(r){var e,t,n,s,i,a,u=this,l=u.constructor,f=+(r=new l(r));if(!u.d||!r.d||!u.d[0]||!r.d[0])return new l(gn(+u,f));if(u=new l(u),u.eq(1))return u;if(n=l.precision,i=l.rounding,r.eq(1))return mt(u,n,i);if(e=Jn(r.e/At),e>=r.d.length-1&&(t=f<0?-f:f)<=FK)return s=TP(l,u,t,n),r.s<0?new l(1).div(s):mt(s,n,i);if(a=u.s,a<0){if(e<r.d.length-1)return new l(NaN);if((r.d[e]&1)==0&&(a=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=a,u}return t=gn(+u,f),e=t==0||!isFinite(t)?Jn(f*(Math.log("0."+Pn(u.d))/Math.LN10+u.e+1)):new l(t+"").e,e>l.maxE+1||e<l.minE-1?new l(e>0?a/0:0):(Bt=!1,l.rounding=u.s=1,t=Math.min(12,(e+"").length),s=Vb(r.times(pu(u,n+t)),n),s.d&&(s=mt(s,n+5,1),gm(s.d,n,i)&&(e=n+10,s=mt(Vb(r.times(pu(u,e+t)),e),e+5,1),+Pn(s.d).slice(n+1,n+15)+1==1e14&&(s=mt(s,n+1,0)))),s.s=a,Bt=!0,l.rounding=i,mt(s,n,i))};Pe.toPrecision=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=pa(n,n.e<=s.toExpNeg||n.e>=s.toExpPos):(Ss(r,1,mu),e===void 0?e=s.rounding:Ss(e,0,8),n=mt(new s(n),r,e),t=pa(n,r<=n.e||n.e<=s.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+t:t};Pe.toSignificantDigits=Pe.toSD=function(r,e){var t=this,n=t.constructor;return r===void 0?(r=n.precision,e=n.rounding):(Ss(r,1,mu),e===void 0?e=n.rounding:Ss(e,0,8)),mt(new n(t),r,e)};Pe.toString=function(){var r=this,e=r.constructor,t=pa(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t};Pe.truncated=Pe.trunc=function(){return mt(new this.constructor(this),this.e+1,1)};Pe.valueOf=Pe.toJSON=function(){var r=this,e=r.constructor,t=pa(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()?"-"+t:t};function Pn(r){var e,t,n,s=r.length-1,i="",a=r[0];if(s>0){for(i+=a,e=1;e<s;e++)n=r[e]+"",t=At-n.length,t&&(i+=hu(t)),i+=n;a=r[e],n=a+"",t=At-n.length,t&&(i+=hu(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return i+a}o(Pn,"digitsToString");function Ss(r,e,t){if(r!==~~r||r<e||r>t)throw Error(du+r)}o(Ss,"checkInt32");function gm(r,e,t,n){var s,i,a,u;for(i=r[0];i>=10;i/=10)--e;return--e<0?(e+=At,s=0):(s=Math.ceil((e+1)/At),e%=At),i=gn(10,At-e),u=r[s]%i|0,n==null?e<3?(e==0?u=u/100|0:e==1&&(u=u/10|0),a=t<4&&u==99999||t>3&&u==49999||u==5e4||u==0):a=(t<4&&u+1==i||t>3&&u+1==i/2)&&(r[s+1]/i/100|0)==gn(10,e-2)-1||(u==i/2||u==0)&&(r[s+1]/i/100|0)==0:e<4?(e==0?u=u/1e3|0:e==1?u=u/100|0:e==2&&(u=u/10|0),a=(n||t<4)&&u==9999||!n&&t>3&&u==4999):a=((n||t<4)&&u+1==i||!n&&t>3&&u+1==i/2)&&(r[s+1]/i/1e3|0)==gn(10,e-3)-1,a}o(gm,"checkRoundingDigits");function yw(r,e,t){for(var n,s=[0],i,a=0,u=r.length;a<u;){for(i=s.length;i--;)s[i]*=e;for(s[0]+=Ob.indexOf(r.charAt(a++)),n=0;n<s.length;n++)s[n]>t-1&&(s[n+1]===void 0&&(s[n+1]=0),s[n+1]+=s[n]/t|0,s[n]%=t)}return s.reverse()}o(yw,"convertBase");function HK(r,e){var t,n,s;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),s=(1/bw(4,t)).toString()):(t=16,s="2.3283064365386962890625e-10"),r.precision+=t,e=Uh(r,1,e.times(s),new r(1));for(var i=t;i--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return r.precision-=t,e}o(HK,"cosine");var br=(function(){function r(n,s,i){var a,u=0,l=n.length;for(n=n.slice();l--;)a=n[l]*s+u,n[l]=a%i|0,u=a/i|0;return u&&n.unshift(u),n}o(r,"multiplyInteger");function e(n,s,i,a){var u,l;if(i!=a)l=i>a?1:-1;else for(u=l=0;u<i;u++)if(n[u]!=s[u]){l=n[u]>s[u]?1:-1;break}return l}o(e,"compare");function t(n,s,i,a){for(var u=0;i--;)n[i]-=u,u=n[i]<s[i]?1:0,n[i]=u*a+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return o(t,"subtract"),function(n,s,i,a,u,l){var f,h,m,g,w,y,S,E,b,T,A,C,x,B,F,R,H,q,K,G,he=n.constructor,le=n.s==s.s?1:-1,oe=n.d,Z=s.d;if(!oe||!oe[0]||!Z||!Z[0])return new he(!n.s||!s.s||(oe?Z&&oe[0]==Z[0]:!Z)?NaN:oe&&oe[0]==0||!Z?le*0:le/0);for(l?(w=1,h=n.e-s.e):(l=Mi,w=At,h=Jn(n.e/w)-Jn(s.e/w)),K=Z.length,H=oe.length,b=new he(le),T=b.d=[],m=0;Z[m]==(oe[m]||0);m++);if(Z[m]>(oe[m]||0)&&h--,i==null?(B=i=he.precision,a=he.rounding):u?B=i+(n.e-s.e)+1:B=i,B<0)T.push(1),y=!0;else{if(B=B/w+2|0,m=0,K==1){for(g=0,Z=Z[0],B++;(m<H||g)&&B--;m++)F=g*l+(oe[m]||0),T[m]=F/Z|0,g=F%Z|0;y=g||m<H}else{for(g=l/(Z[0]+1)|0,g>1&&(Z=r(Z,g,l),oe=r(oe,g,l),K=Z.length,H=oe.length),R=K,A=oe.slice(0,K),C=A.length;C<K;)A[C++]=0;G=Z.slice(),G.unshift(0),q=Z[0],Z[1]>=l/2&&++q;do g=0,f=e(Z,A,K,C),f<0?(x=A[0],K!=C&&(x=x*l+(A[1]||0)),g=x/q|0,g>1?(g>=l&&(g=l-1),S=r(Z,g,l),E=S.length,C=A.length,f=e(S,A,E,C),f==1&&(g--,t(S,K<E?G:Z,E,l))):(g==0&&(f=g=1),S=Z.slice()),E=S.length,E<C&&S.unshift(0),t(A,S,C,l),f==-1&&(C=A.length,f=e(Z,A,K,C),f<1&&(g++,t(A,K<C?G:Z,C,l))),C=A.length):f===0&&(g++,A=[0]),T[m++]=g,f&&A[0]?A[C++]=oe[R]||0:(A=[oe[R]],C=1);while((R++<H||A[0]!==void 0)&&B--);y=A[0]!==void 0}T[0]||T.shift()}if(w==1)b.e=h,EP=y;else{for(m=1,g=T[0];g>=10;g/=10)m++;b.e=m+h*w-1,mt(b,u?i+b.e+1:i,a,y)}return b}})();function mt(r,e,t,n){var s,i,a,u,l,f,h,m,g,w=r.constructor;e:if(e!=null){if(m=r.d,!m)return r;for(s=1,u=m[0];u>=10;u/=10)s++;if(i=e-s,i<0)i+=At,a=e,h=m[g=0],l=h/gn(10,s-a-1)%10|0;else if(g=Math.ceil((i+1)/At),u=m.length,g>=u)if(n){for(;u++<=g;)m.push(0);h=l=0,s=1,i%=At,a=i-At+1}else break e;else{for(h=u=m[g],s=1;u>=10;u/=10)s++;i%=At,a=i-At+s,l=a<0?0:h/gn(10,s-a-1)%10|0}if(n=n||e<0||m[g+1]!==void 0||(a<0?h:h%gn(10,s-a-1)),f=t<4?(l||n)&&(t==0||t==(r.s<0?3:2)):l>5||l==5&&(t==4||n||t==6&&(i>0?a>0?h/gn(10,s-a):0:m[g-1])%10&1||t==(r.s<0?8:7)),e<1||!m[0])return m.length=0,f?(e-=r.e+1,m[0]=gn(10,(At-e%At)%At),r.e=-e||0):m[0]=r.e=0,r;if(i==0?(m.length=g,u=1,g--):(m.length=g+1,u=gn(10,At-i),m[g]=a>0?(h/gn(10,s-a)%gn(10,a)|0)*u:0),f)for(;;)if(g==0){for(i=1,a=m[0];a>=10;a/=10)i++;for(a=m[0]+=u,u=1;a>=10;a/=10)u++;i!=u&&(r.e++,m[0]==Mi&&(m[0]=1));break}else{if(m[g]+=u,m[g]!=Mi)break;m[g--]=0,u=1}for(i=m.length;m[--i]===0;)m.pop()}return Bt&&(r.e>w.maxE?(r.d=null,r.e=NaN):r.e<w.minE&&(r.e=0,r.d=[0])),r}o(mt,"finalise");function pa(r,e,t){if(!r.isFinite())return BP(r);var n,s=r.e,i=Pn(r.d),a=i.length;return e?(t&&(n=t-a)>0?i=i.charAt(0)+"."+i.slice(1)+hu(n):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(r.e<0?"e":"e+")+r.e):s<0?(i="0."+hu(-s-1)+i,t&&(n=t-a)>0&&(i+=hu(n))):s>=a?(i+=hu(s+1-a),t&&(n=t-s-1)>0&&(i=i+"."+hu(n))):((n=s+1)<a&&(i=i.slice(0,n)+"."+i.slice(n)),t&&(n=t-a)>0&&(s+1===a&&(i+="."),i+=hu(n))),i}o(pa,"finiteToString");function Cw(r,e){var t=r[0];for(e*=At;t>=10;t/=10)e++;return e}o(Cw,"getBase10Exponent");function Ew(r,e,t){if(e>qK)throw Bt=!0,t&&(r.precision=t),Error(AP);return mt(new r(ww),e,1,!0)}o(Ew,"getLn10");function ha(r,e,t){if(e>Lb)throw Error(AP);return mt(new r(Sw),e,t,!0)}o(ha,"getPi");function NP(r){var e=r.length-1,t=e*At+1;if(e=r[e],e){for(;e%10==0;e/=10)t--;for(e=r[0];e>=10;e/=10)t++}return t}o(NP,"getPrecision");function hu(r){for(var e="";r--;)e+="0";return e}o(hu,"getZeroString");function TP(r,e,t,n){var s,i=new r(1),a=Math.ceil(n/At+4);for(Bt=!1;;){if(t%2&&(i=i.times(e),wP(i.d,a)&&(s=!0)),t=Jn(t/2),t===0){t=i.d.length-1,s&&i.d[t]===0&&++i.d[t];break}e=e.times(e),wP(e.d,a)}return Bt=!0,i}o(TP,"intPow");function vP(r){return r.d[r.d.length-1]&1}o(vP,"isOdd");function IP(r,e,t){for(var n,s,i=new r(e[0]),a=0;++a<e.length;){if(s=new r(e[a]),!s.s){i=s;break}n=i.cmp(s),(n===t||n===0&&i.s===t)&&(i=s)}return i}o(IP,"maxOrMin");function Vb(r,e){var t,n,s,i,a,u,l,f=0,h=0,m=0,g=r.constructor,w=g.rounding,y=g.precision;if(!r.d||!r.d[0]||r.e>17)return new g(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(e==null?(Bt=!1,l=y):l=e,u=new g(.03125);r.e>-2;)r=r.times(u),m+=5;for(n=Math.log(gn(2,m))/Math.LN10*2+5|0,l+=n,t=i=a=new g(1),g.precision=l;;){if(i=mt(i.times(r),l,1),t=t.times(++h),u=a.plus(br(i,t,l,1)),Pn(u.d).slice(0,l)===Pn(a.d).slice(0,l)){for(s=m;s--;)a=mt(a.times(a),l,1);if(e==null)if(f<3&&gm(a.d,l-n,w,f))g.precision=l+=10,t=i=u=new g(1),h=0,f++;else return mt(a,g.precision=y,w,Bt=!0);else return g.precision=y,a}a=u}}o(Vb,"naturalExponential");function pu(r,e){var t,n,s,i,a,u,l,f,h,m,g,w=1,y=10,S=r,E=S.d,b=S.constructor,T=b.rounding,A=b.precision;if(S.s<0||!E||!E[0]||!S.e&&E[0]==1&&E.length==1)return new b(E&&!E[0]?-1/0:S.s!=1?NaN:E?0:S);if(e==null?(Bt=!1,h=A):h=e,b.precision=h+=y,t=Pn(E),n=t.charAt(0),Math.abs(i=S.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)S=S.times(r),t=Pn(S.d),n=t.charAt(0),w++;i=S.e,n>1?(S=new b("0."+t),i++):S=new b(n+"."+t.slice(1))}else return f=Ew(b,h+2,A).times(i+""),S=pu(new b(n+"."+t.slice(1)),h-y).plus(f),b.precision=A,e==null?mt(S,A,T,Bt=!0):S;for(m=S,l=a=S=br(S.minus(1),S.plus(1),h,1),g=mt(S.times(S),h,1),s=3;;){if(a=mt(a.times(g),h,1),f=l.plus(br(a,new b(s),h,1)),Pn(f.d).slice(0,h)===Pn(l.d).slice(0,h))if(l=l.times(2),i!==0&&(l=l.plus(Ew(b,h+2,A).times(i+""))),l=br(l,new b(w),h,1),e==null)if(gm(l.d,h-y,T,u))b.precision=h+=y,f=a=S=br(m.minus(1),m.plus(1),h,1),g=mt(S.times(S),h,1),s=u=1;else return mt(l,b.precision=A,T,Bt=!0);else return b.precision=A,l;l=f,s+=2}}o(pu,"naturalLogarithm");function BP(r){return String(r.s*r.s/0)}o(BP,"nonFiniteToString");function vw(r,e){var t,n,s;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),n=0;e.charCodeAt(n)===48;n++);for(s=e.length;e.charCodeAt(s-1)===48;--s);if(e=e.slice(n,s),e){if(s-=n,r.e=t=t-n-1,r.d=[],n=(t+1)%At,t<0&&(n+=At),n<s){for(n&&r.d.push(+e.slice(0,n)),s-=At;n<s;)r.d.push(+e.slice(n,n+=At));e=e.slice(n),n=At-e.length}else n-=s;for(;n--;)e+="0";r.d.push(+e),Bt&&(r.e>r.constructor.maxE?(r.d=null,r.e=NaN):r.e<r.constructor.minE&&(r.e=0,r.d=[0]))}else r.e=0,r.d=[0];return r}o(vw,"parseDecimal");function KK(r,e){var t,n,s,i,a,u,l,f,h;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),xP.test(e))return vw(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(MK.test(e))t=16,e=e.toLowerCase();else if(UK.test(e))t=2;else if(jK.test(e))t=8;else throw Error(du+e);for(i=e.search(/p/i),i>0?(l=+e.slice(i+1),e=e.substring(2,i)):e=e.slice(2),i=e.indexOf("."),a=i>=0,n=r.constructor,a&&(e=e.replace(".",""),u=e.length,i=u-i,s=TP(n,new n(t),i,i*2)),f=yw(e,t,Mi),h=f.length-1,i=h;f[i]===0;--i)f.pop();return i<0?new n(r.s*0):(r.e=Cw(f,h),r.d=f,Bt=!1,a&&(r=br(r,s,u*4)),l&&(r=r.times(Math.abs(l)<54?gn(2,l):Mh.pow(2,l))),Bt=!0,r)}o(KK,"parseOther");function $K(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:Uh(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/bw(5,t)),e=Uh(r,2,e,e);for(var s,i=new r(5),a=new r(16),u=new r(20);t--;)s=e.times(e),e=e.times(i.plus(s.times(a.times(s).minus(u))));return e}o($K,"sine");function Uh(r,e,t,n,s){var i,a,u,l,f=1,h=r.precision,m=Math.ceil(h/At);for(Bt=!1,l=t.times(t),u=new r(n);;){if(a=br(u.times(l),new r(e++*e++),h,1),u=s?n.plus(a):n.minus(a),n=br(a.times(l),new r(e++*e++),h,1),a=u.plus(n),a.d[m]!==void 0){for(i=m;a.d[i]===u.d[i]&&i--;);if(i==-1)break}i=u,u=n,n=a,a=i,f++}return Bt=!0,a.d.length=m+1,a}o(Uh,"taylorSeries");function bw(r,e){for(var t=r;--e;)t*=r;return t}o(bw,"tinyPow");function DP(r,e){var t,n=e.s<0,s=ha(r,r.precision,1),i=s.times(.5);if(e=e.abs(),e.lte(i))return co=n?4:1,e;if(t=e.divToInt(s),t.isZero())co=n?3:2;else{if(e=e.minus(t.times(s)),e.lte(i))return co=vP(t)?n?2:3:n?4:1,e;co=vP(t)?n?1:4:n?3:2}return e.minus(s).abs()}o(DP,"toLessThanHalfPi");function Ub(r,e,t,n){var s,i,a,u,l,f,h,m,g,w=r.constructor,y=t!==void 0;if(y?(Ss(t,1,mu),n===void 0?n=w.rounding:Ss(n,0,8)):(t=w.precision,n=w.rounding),!r.isFinite())h=BP(r);else{for(h=pa(r),a=h.indexOf("."),y?(s=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):s=e,a>=0&&(h=h.replace(".",""),g=new w(1),g.e=h.length-a,g.d=yw(pa(g),10,s),g.e=g.d.length),m=yw(h,10,s),i=l=m.length;m[--l]==0;)m.pop();if(!m[0])h=y?"0p+0":"0";else{if(a<0?i--:(r=new w(r),r.d=m,r.e=i,r=br(r,g,t,n,0,s),m=r.d,i=r.e,f=EP),a=m[t],u=s/2,f=f||m[t+1]!==void 0,f=n<4?(a!==void 0||f)&&(n===0||n===(r.s<0?3:2)):a>u||a===u&&(n===4||f||n===6&&m[t-1]&1||n===(r.s<0?8:7)),m.length=t,f)for(;++m[--t]>s-1;)m[t]=0,t||(++i,m.unshift(1));for(l=m.length;!m[l-1];--l);for(a=0,h="";a<l;a++)h+=Ob.charAt(m[a]);if(y){if(l>1)if(e==16||e==8){for(a=e==16?4:3,--l;l%a;l++)h+="0";for(m=yw(h,s,e),l=m.length;!m[l-1];--l);for(a=1,h="1.";a<l;a++)h+=Ob.charAt(m[a])}else h=h.charAt(0)+"."+h.slice(1);h=h+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)h="0"+h;h="0."+h}else if(++i>l)for(i-=l;i--;)h+="0";else i<l&&(h=h.slice(0,i)+"."+h.slice(i))}h=(e==16?"0x":e==2?"0b":e==8?"0o":"")+h}return r.s<0?"-"+h:h}o(Ub,"toStringBinary");function wP(r,e){if(r.length>e)return r.length=e,!0}o(wP,"truncate");function XK(r){return new this(r).abs()}o(XK,"abs");function GK(r){return new this(r).acos()}o(GK,"acos");function WK(r){return new this(r).acosh()}o(WK,"acosh");function JK(r,e){return new this(r).plus(e)}o(JK,"add");function zK(r){return new this(r).asin()}o(zK,"asin");function YK(r){return new this(r).asinh()}o(YK,"asinh");function QK(r){return new this(r).atan()}o(QK,"atan");function ZK(r){return new this(r).atanh()}o(ZK,"atanh");function e$(r,e){r=new this(r),e=new this(e);var t,n=this.precision,s=this.rounding,i=n+4;return!r.s||!e.s?t=new this(NaN):!r.d&&!e.d?(t=ha(this,i,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?ha(this,n,s):new this(0),t.s=r.s):!r.d||e.isZero()?(t=ha(this,i,1).times(.5),t.s=r.s):e.s<0?(this.precision=i,this.rounding=1,t=this.atan(br(r,e,i,1)),e=ha(this,i,1),this.precision=n,this.rounding=s,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(br(r,e,i,1)),t}o(e$,"atan2");function t$(r){return new this(r).cbrt()}o(t$,"cbrt");function r$(r){return mt(r=new this(r),r.e+1,2)}o(r$,"ceil");function n$(r,e,t){return new this(r).clamp(e,t)}o(n$,"clamp");function s$(r){if(!r||typeof r!="object")throw Error(Aw+"Object expected");var e,t,n,s=r.defaults===!0,i=["precision",1,mu,"rounding",0,8,"toExpNeg",-Vh,0,"toExpPos",0,Vh,"maxE",0,Vh,"minE",-Vh,0,"modulo",0,9];for(e=0;e<i.length;e+=3)if(t=i[e],s&&(this[t]=kb[t]),(n=r[t])!==void 0)if(Jn(n)===n&&n>=i[e+1]&&n<=i[e+2])this[t]=n;else throw Error(du+t+": "+n);if(t="crypto",s&&(this[t]=kb[t]),(n=r[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(CP);else this[t]=!1;else throw Error(du+t+": "+n);return this}o(s$,"config");function i$(r){return new this(r).cos()}o(i$,"cos");function a$(r){return new this(r).cosh()}o(a$,"cosh");function _P(r){var e,t,n;function s(i){var a,u,l,f=this;if(!(f instanceof s))return new s(i);if(f.constructor=s,SP(i)){f.s=i.s,Bt?!i.d||i.e>s.maxE?(f.e=NaN,f.d=null):i.e<s.minE?(f.e=0,f.d=[0]):(f.e=i.e,f.d=i.d.slice()):(f.e=i.e,f.d=i.d?i.d.slice():i.d);return}if(l=typeof i,l==="number"){if(i===0){f.s=1/i<0?-1:1,f.e=0,f.d=[0];return}if(i<0?(i=-i,f.s=-1):f.s=1,i===~~i&&i<1e7){for(a=0,u=i;u>=10;u/=10)a++;Bt?a>s.maxE?(f.e=NaN,f.d=null):a<s.minE?(f.e=0,f.d=[0]):(f.e=a,f.d=[i]):(f.e=a,f.d=[i]);return}if(i*0!==0){i||(f.s=NaN),f.e=NaN,f.d=null;return}return vw(f,i.toString())}if(l==="string")return(u=i.charCodeAt(0))===45?(i=i.slice(1),f.s=-1):(u===43&&(i=i.slice(1)),f.s=1),xP.test(i)?vw(f,i):KK(f,i);if(l==="bigint")return i<0?(i=-i,f.s=-1):f.s=1,vw(f,i.toString());throw Error(du+i)}if(o(s,"Decimal"),s.prototype=Pe,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=s$,s.clone=_P,s.isDecimal=SP,s.abs=XK,s.acos=GK,s.acosh=WK,s.add=JK,s.asin=zK,s.asinh=YK,s.atan=QK,s.atanh=ZK,s.atan2=e$,s.cbrt=t$,s.ceil=r$,s.clamp=n$,s.cos=i$,s.cosh=a$,s.div=o$,s.exp=u$,s.floor=l$,s.hypot=c$,s.ln=f$,s.log=h$,s.log10=d$,s.log2=p$,s.max=m$,s.min=g$,s.mod=y$,s.mul=v$,s.pow=w$,s.random=S$,s.round=E$,s.sign=A$,s.sin=C$,s.sinh=b$,s.sqrt=x$,s.sub=N$,s.sum=T$,s.tan=I$,s.tanh=B$,s.trunc=D$,r===void 0&&(r={}),r&&r.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)r.hasOwnProperty(t=n[e++])||(r[t]=this[t]);return s.config(r),s}o(_P,"clone");function o$(r,e){return new this(r).div(e)}o(o$,"div");function u$(r){return new this(r).exp()}o(u$,"exp");function l$(r){return mt(r=new this(r),r.e+1,3)}o(l$,"floor");function c$(){var r,e,t=new this(0);for(Bt=!1,r=0;r<arguments.length;)if(e=new this(arguments[r++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return Bt=!0,new this(1/0);t=e}return Bt=!0,t.sqrt()}o(c$,"hypot");function SP(r){return r instanceof Mh||r&&r.toStringTag===bP||!1}o(SP,"isDecimalInstance");function f$(r){return new this(r).ln()}o(f$,"ln");function h$(r,e){return new this(r).log(e)}o(h$,"log");function p$(r){return new this(r).log(2)}o(p$,"log2");function d$(r){return new this(r).log(10)}o(d$,"log10");function m$(){return IP(this,arguments,-1)}o(m$,"max");function g$(){return IP(this,arguments,1)}o(g$,"min");function y$(r,e){return new this(r).mod(e)}o(y$,"mod");function v$(r,e){return new this(r).mul(e)}o(v$,"mul");function w$(r,e){return new this(r).pow(e)}o(w$,"pow");function S$(r){var e,t,n,s,i=0,a=new this(1),u=[];if(r===void 0?r=this.precision:Ss(r,1,mu),n=Math.ceil(r/At),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));i<n;)s=e[i],s>=429e7?e[i]=crypto.getRandomValues(new Uint32Array(1))[0]:u[i++]=s%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);i<n;)s=e[i]+(e[i+1]<<8)+(e[i+2]<<16)+((e[i+3]&127)<<24),s>=214e7?crypto.randomBytes(4).copy(e,i):(u.push(s%1e7),i+=4);i=n/4}else throw Error(CP);else for(;i<n;)u[i++]=Math.random()*1e7|0;for(n=u[--i],r%=At,n&&r&&(s=gn(10,At-r),u[i]=(n/s|0)*s);u[i]===0;i--)u.pop();if(i<0)t=0,u=[0];else{for(t=-1;u[0]===0;t-=At)u.shift();for(n=1,s=u[0];s>=10;s/=10)n++;n<At&&(t-=At-n)}return a.e=t,a.d=u,a}o(S$,"random");function E$(r){return mt(r=new this(r),r.e+1,this.rounding)}o(E$,"round");function A$(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}o(A$,"sign");function C$(r){return new this(r).sin()}o(C$,"sin");function b$(r){return new this(r).sinh()}o(b$,"sinh");function x$(r){return new this(r).sqrt()}o(x$,"sqrt");function N$(r,e){return new this(r).sub(e)}o(N$,"sub");function T$(){var r=0,e=arguments,t=new this(e[r]);for(Bt=!1;t.s&&++r<e.length;)t=t.plus(e[r]);return Bt=!0,mt(t,this.precision,this.rounding)}o(T$,"sum");function I$(r){return new this(r).tan()}o(I$,"tan");function B$(r){return new this(r).tanh()}o(B$,"tanh");function D$(r){return mt(r=new this(r),r.e+1,1)}o(D$,"trunc");Pe[Symbol.for("nodejs.util.inspect.custom")]=Pe.toString;Pe[Symbol.toStringTag]="Decimal";var Mh=Pe.constructor=_P(kb);ww=new Mh(ww);Sw=new Mh(Sw);var RP=class r extends Mh{static{o(this,"Decimal")}static from(e){return new r(e)}static newOrZero(e){return e===void 0?r.from(0):r.from(e)}static newOrUndefined(e){if(e!==void 0)return r.from(e)}};var PP=class{static{o(this,"MemoryCacheAdapter")}cache=new Map;async get(e){return Promise.resolve(this.cache.get(e)??null)}has(e){return Promise.resolve(this.cache.has(e))}set(e,t){return this.cache.set(e,t),Promise.resolve(!0)}};var Sc=pw(J3(),1);import z3 from"fs";import pJ from"path";import tp from"crypto";import{NFeTsError as nS}from"@nfets/core/domain/errors/nfets-error";import{left as qx,right as sS}from"@nfets/core/shared/either";import{leftFromError as Hx}from"@nfets/core/shared/left-from-error";import{NullCacheAdapter as dJ}from"@nfets/core/infrastructure/repositories/null-cache-adapter";import{SignatureAlgorithm as mJ}from"@nfets/core/domain/entities/signer/algo";import{ASN1 as gJ}from"@nfets/core/application";var Y3=class{static{o(this,"NativeCertificateRepository")}httpClient;cache;constructor(e,t=new dJ){this.httpClient=e,this.cache=t}async read(e){try{let{password:t}=e,n=await this.getPfxBuffer(e);if(n.isLeft())return n;let s=Sc.default.asn1.fromDer(n.value.toString("binary")),i=Sc.default.pkcs12.pkcs12FromAsn1(s,t),{certBag:a,pkcs8ShroudedKeyBag:u}=Sc.default.pki.oids,l=i.getBags({bagType:a}),f=i.getBags({bagType:u}),h=l[a];if(!h?.length)return qx(new nS("Cannot read certificate"));let[{cert:m},...g]=h;if(!m)return qx(new nS("Issuer Certificate not found"));let w=f[u]?.[0].key;if(!w)return qx(new nS("Certificate Private Key not found"));let y=g.reduce((A,{cert:C})=>(C&&A.push(new tp.X509Certificate(Sc.default.pki.certificateToPem(C))),A),[]),S=Sc.default.pki.privateKeyToPem(w),E=Sc.default.pki.certificateToPem(m),b=tp.createPrivateKey(S),T=new tp.X509Certificate(E);return sS({ca:y,password:t,privateKey:b,certificate:T})}catch(t){return Hx(t)}}async sign(e,t,n=mJ.SHA1){try{let i=tp.sign(n,Buffer.from(e),{key:t,padding:tp.constants.RSA_PKCS1_PADDING}).toString("base64");return await Promise.resolve(sS(i))}catch(s){return Promise.resolve(Hx(s))}}getCertificateInfo(e){return new gJ().extractCertificateInfo(e)}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"}).toString()}catch{throw new nS("Cannot extract private key")}}async getPfxBuffer(e){let{pfxPathOrBase64:t,password:n}=e,s=this.getCacheKey(t,n),i=await this.cache.get(s);if(i)return sS(i);if(pJ.isAbsolute(t)||z3.existsSync(t))return this.hitBufferOnCache(s,z3.readFileSync(t));if(this.isValidRemoteUrl(t))try{let a=await this.httpClient.get(t,{responseType:"arraybuffer"});return await this.hitBufferOnCache(s,Buffer.from(a.data))}catch(a){return Hx(a)}return this.hitBufferOnCache(s,Buffer.from(t,"base64"))}getCacheKey(e,t){return tp.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),sS(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};var Q3=class{static{o(this,"NullCacheAdapter")}async get(e){return Promise.resolve(null)}has(e){return Promise.resolve(!1)}set(e,t){return Promise.resolve(!0)}};var z8=pw(G8(),1);import are from"path";import{constants as ore}from"crypto";import{Agent as W8}from"https";import{right as ure}from"@nfets/core/shared/either";import{leftFromError as lre}from"@nfets/core/shared/left-from-error";var J8=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:ore.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new W8({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return new W8({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}async send(e){try{let t=this.httpsAgent,n=await(0,z8.createClientAsync)(`${e.url}?wsdl`,{attributesKey:"$",wsdl_options:{httpsAgent:t}});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let s=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),i=this.toolkit.getFirstNode(s)??"",a=are.dirname(e.xsd),u=e.xsd,l=await this.toolkit.validate(i,a,u);if(l.isLeft())return l;let[f]=await n[`${e.method}Async`]({_xml:s},{httpsAgent:t});return ure(f)}catch(t){return lre(t)}}};import cre from"path";var fre=gt(cre.join(process.env.NFETS_ADDONS_DIR??"","xml_validator.node")),Y8=fre;var cae=pw(wV(),1);import oae from"fs";import uae from"path";import lae from"crypto";var SV="application/xml";var Ut;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(Ut||(Ut={}));function hre(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),s=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),i=[],a;for(;a=s.iterateNext();)i.push(a);return i}o(hre,"SelectNodesEx");function pre(r,e){let t=bp("xpath").select;return t(e,r)}o(pre,"SelectNodesNode");var EV=typeof self<"u"?hre:pre;function Ci(r){r=r.replace(/\r\n/g,`
85
- `).replace(/\r/g,`
86
- `);let e;return typeof DOMParser<"u"?e=DOMParser:e=bp("DOMParser"),new e().parseFromString(r,SV)}o(Ci,"Parse");function Ua(r){let e;return typeof XMLSerializer<"u"?e=XMLSerializer:e=bp("XMLSerializer"),new e().serializeToString(r)}o(Ua,"Stringify");function AE(r,e){let t=EV(r,e);return t&&t.length>0?t[0]:null}o(AE,"SelectSingleNode");function AV(r,e){return r&&r.nodeType===e}o(AV,"isNodeType");function Js(r){return AV(r,Ut.Element)}o(Js,"isElement");function Dc(r){return AV(r,Ut.Document)}o(Dc,"isDocument");var CV=new Map;function bV(r){for(let e in r)CV.set(e,r[e])}o(bV,"setNodeDependencies");function bp(r){let e=CV.get(r);if(!e)throw new Error(`Node dependency not found: ${r}. Please use 'setNodeDependencies' to register it.`);return e}o(bp,"getNodeDependency");var ug="element",lg="attribute",CE="content";var dre=1e9;function OT(r,...e){let t=r;for(let n=0;n<e.length;n++){let s=e[n];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=s[i])}return t}o(OT,"assign");function Mt(r){return e=>{let t=e;t.localName=r.localName||t.name,t.namespaceURI=r.namespaceURI||t.namespaceURI||null,t.prefix=r.prefix||t.prefix||null,t.parser=r.parser||t.parser,t.target!==t&&(t.items=OT({},t.items)),t.target=e}}o(Mt,"XmlElement");function Xt(r={}){return(e,t)=>{let n=e.constructor,s=t;n.items||(n.items={}),n.target!==n&&(n.items=OT({},n.items)),n.target=e;let i;r.parser?i={parser:r.parser,required:r.required||!1,maxOccurs:r.maxOccurs||dre,minOccurs:r.minOccurs===void 0?0:r.minOccurs,noRoot:r.noRoot||!1}:i={namespaceURI:r.namespaceURI||null,required:r.required||!1,prefix:r.prefix||null,defaultValue:r.defaultValue,converter:r.converter,noRoot:r.noRoot||!1},r.localName=r.localName||r.parser&&r.parser.localName||s;let a=n.items,u=r.parser&&r.parser.namespaceURI;a[s]={...i,namespaceURI:r.namespaceURI||u||null,prefix:r.prefix||r.parser&&r.parser.prefix||null,localName:r.localName,type:ug},NV(e,s,r)}}o(Xt,"XmlChildElement");function _r(r={required:!1,namespaceURI:null}){return(e,t)=>{let n=e.constructor,s=t;r.localName||(r.localName=t),n.items||(n.items={}),n.target!==n&&(n.items=OT({},n.items)),n.target=e;let i=n.items;i[t]=r,i[t].type=lg,NV(e,s,r)}}o(_r,"XmlAttribute");function NV(r,e,t){let n=`_${e}`,s={set:o(function(i){this[n]!==i&&(this.element=null,this[n]=i)},"set"),get:o(function(){if(this[n]===void 0){let i=t.defaultValue;t.parser&&(i=new t.parser,i.localName=t.localName),this[n]=i}return this[n]},"get")};Object.defineProperty(r,n,{writable:!0,enumerable:!1}),Object.defineProperty(r,e,s)}o(NV,"defineProperty");var Gu=class r{static{o(this,"Collection")}constructor(e){this.items=[],e&&(this.items=e)}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e)}Pop(){return this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e)}Clear(){this.items=[]}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new r(this.GetIterator().map(e))}Filter(e){return new r(this.GetIterator().filter(e))}Sort(e){return new r(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}};function mre(r,...e){let t=r.replace(/%([1-9]\d*)/g,(n,s)=>{let i=parseInt(s,10)-1;return e[i]!==void 0?e[i]:""});return t=t.replace(/%%/g,"%"),t}o(mre,"printf");function gre(r,e){let t=r+"";for(;t.length<e;)t="0"+t;return t}o(gre,"padNum");var Fe=class{static{o(this,"XmlError")}constructor(e,...t){this.prefix="XMLJS",this.code=e,this.name=this.constructor.name;let n=mre(an[e],...t);this.message=`${this.prefix}${gre(e,4)}: ${n}`,this.stack=new Error(this.message).stack}},Te;(function(r){r[r.NONE=0]="NONE",r[r.NULL_REFERENCE=1]="NULL_REFERENCE",r[r.NULL_PARAM=2]="NULL_PARAM",r[r.DECORATOR_NULL_PARAM=3]="DECORATOR_NULL_PARAM",r[r.COLLECTION_LIMIT=4]="COLLECTION_LIMIT",r[r.METHOD_NOT_IMPLEMENTED=5]="METHOD_NOT_IMPLEMENTED",r[r.METHOD_NOT_SUPPORTED=6]="METHOD_NOT_SUPPORTED",r[r.PARAM_REQUIRED=7]="PARAM_REQUIRED",r[r.CONVERTER_UNSUPPORTED=8]="CONVERTER_UNSUPPORTED",r[r.ELEMENT_MALFORMED=9]="ELEMENT_MALFORMED",r[r.ELEMENT_MISSING=10]="ELEMENT_MISSING",r[r.ATTRIBUTE_MISSING=11]="ATTRIBUTE_MISSING",r[r.CONTENT_MISSING=12]="CONTENT_MISSING",r[r.CRYPTOGRAPHIC=13]="CRYPTOGRAPHIC",r[r.CRYPTOGRAPHIC_NO_MODULE=14]="CRYPTOGRAPHIC_NO_MODULE",r[r.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM=15]="CRYPTOGRAPHIC_UNKNOWN_TRANSFORM",r[r.ALGORITHM_NOT_SUPPORTED=16]="ALGORITHM_NOT_SUPPORTED",r[r.ALGORITHM_WRONG_NAME=17]="ALGORITHM_WRONG_NAME",r[r.XML_EXCEPTION=18]="XML_EXCEPTION",r[r.KEY_INFO_CLAUSE_NOT_SUPPORTED=19]="KEY_INFO_CLAUSE_NOT_SUPPORTED"})(Te||(Te={}));var an={};an[Te.NONE]="No description";an[Te.NULL_REFERENCE]="Null reference";an[Te.NULL_PARAM]="'%1' has empty '%2' object";an[Te.DECORATOR_NULL_PARAM]="Decorator '%1' has empty '%2' parameter";an[Te.COLLECTION_LIMIT]="Collection of '%1' in element '%2' has wrong amount of items";an[Te.METHOD_NOT_IMPLEMENTED]="Method is not implemented";an[Te.METHOD_NOT_SUPPORTED]="Method is not supported";an[Te.PARAM_REQUIRED]="Required parameter is missing '%1'";an[Te.CONVERTER_UNSUPPORTED]="Converter is not supported";an[Te.ELEMENT_MALFORMED]="Malformed element '%1'";an[Te.ELEMENT_MISSING]="Element '%1' is missing in '%2'";an[Te.ATTRIBUTE_MISSING]="Attribute '%1' is missing in '%2'";an[Te.CONTENT_MISSING]="Content is missing in '%1'";an[Te.CRYPTOGRAPHIC]="Cryptographic error: %1";an[Te.CRYPTOGRAPHIC_NO_MODULE]="WebCrypto module is not found";an[Te.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM]="Unknown transform %1";an[Te.ALGORITHM_NOT_SUPPORTED]="Algorithm is not supported '%1'";an[Te.ALGORITHM_WRONG_NAME]="Algorithm wrong name in use '%1'";an[Te.XML_EXCEPTION]="XML exception: %1";an[Te.KEY_INFO_CLAUSE_NOT_SUPPORTED]="KeyInfoClause type '%1' is not supported";var vr=class{static{o(this,"Convert")}static ToString(e,t="utf8"){let n=new Uint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);default:throw new Fe(Te.CONVERTER_UNSUPPORTED)}}static FromString(e,t="utf8"){switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);default:throw new Fe(Te.CONVERTER_UNSUPPORTED)}}static ToBase64(e){if(typeof btoa<"u"){let t=this.ToString(e,"binary");return btoa(t)}else{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");throw new Fe(Te.CONVERTER_UNSUPPORTED)}}static FromBase64(e){if(e=e.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s/g,""),typeof atob<"u")return this.FromBinary(atob(e));if(typeof Buffer<"u")return new Uint8Array(Buffer.from(e,"base64"));throw new Fe(Te.CONVERTER_UNSUPPORTED)}static FromBase64Url(e){return this.FromBase64(this.Base64Padding(e.replace(/-/g,"+").replace(/_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static FromUtf8String(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}static ToUtf8String(e){let t=String.fromCharCode.apply(null,e);return decodeURIComponent(escape(t))}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n}static ToBinary(e){let t="";for(let n=0;n<e.length;n++)t=t+String.fromCharCode(e[n]);return t}static ToHex(e){let n=[];for(let s=0;s<e.length;s++){let i=e[s].toString(16);n.push(i.length===1?"0"+i:i)}return n.join("")}static FromHex(e){let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n=n+2){let s=e.slice(n,n+2);t[n/2]=parseInt(s,16)}return t}static ToDateTime(e){return new Date(e)}static FromDateTime(e){return e.toISOString()}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}};var bi={get:o(r=>{if(r)return vr.ToBase64(r)},"get"),set:o(r=>vr.FromBase64(r),"set")},cg={get:o(r=>r?r.toString():"0","get"),set:o(r=>Number(r),"set")};var yre="xml_root",Bs=class r{static{o(this,"XmlObject")}static LoadXml(e){let t=new this;return t.LoadXml(e),t}static GetElement(e,t,n=!0){let s=e.getElementsByTagName(t);if(n&&s.length===0)throw new Fe(Te.ELEMENT_MISSING,t,e.localName);return s[0]||null}static GetAttribute(e,t,n,s=!0){if(e.hasAttribute(t))return e.getAttribute(t);if(s)throw new Fe(Te.ATTRIBUTE_MISSING,t,e.localName);return n}static GetElementById(e,t){if(e==null||t==null)return null;let n=null;return Dc(e)&&(n=e.getElementById(t)),n==null&&(n=AE(e,`//*[@*[local-name()='Id']='${t}']`),n==null&&(n=AE(e,`//*[@*[local-name()='ID']='${t}']`),n==null&&(n=AE(e,`//*[@*[local-name()='id']='${t}']`)))),n}static CreateDocument(e=yre,t=null,n=null){if(n&&!t)throw new Fe(Te.PARAM_REQUIRED,"namespaceUri",`Prefix '${n}' requires namespaceUri`);let s="",i="",a="";n&&(s=n+":",i=":"+n),t&&(a=` xmlns${i}="${t}"`);let u=`${s}${e}`;return Ci(`<${u}${a}></${u}>`)}static GetChildren(e,t,n){e=Dc(e)?e.documentElement:e;let s=[];for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];Js(a)&&a.localName===t&&(a.namespaceURI===n||!n)&&s.push(a)}return s}static GetFirstChild(e,t,n){e=Dc(e)?e.documentElement:e;for(let s=0;s<e.childNodes.length;s++){let i=e.childNodes[s];if(Js(i)&&i.localName===t&&(i.namespaceURI===n||!n))return i}return null}static GetChild(e,t,n,s=!0){for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];if(Js(a)&&a.localName===t&&(a.namespaceURI===n||!n))return a}if(s)throw new Fe(Te.ELEMENT_MISSING,t,e.localName);return null}constructor(e={}){if(this.prefix=this.GetStatic().prefix||null,this.localName=this.GetStatic().localName,this.namespaceURI=this.GetStatic().namespaceURI,e)for(let[t,n]of Object.entries(e))n!==void 0&&(this[t]=n)}get Element(){return this.element}get Prefix(){return this.prefix}set Prefix(e){this.prefix=e}get LocalName(){return this.localName||""}get NamespaceURI(){return this.namespaceURI||null}HasChanged(){let e=this.GetStatic();if(e.items)for(let t in e.items){if(!Object.prototype.hasOwnProperty.call(e.items,t))continue;let n=e.items[t],s=this[t];if(n.parser&&s&&s.HasChanged())return!0}return this.element===null}GetXml(e){if(!(e||this.HasChanged()))return this.element||null;let t=this,n=this.CreateDocument(),s=this.CreateElement(),i=this.GetStatic(),a=this.localName||"";if(i.items)for(let u in i.items){if(!Object.prototype.hasOwnProperty.call(i.items,u))continue;let l=t[u],f=i.items[u];switch(f.type){case CE:{let h=f,m=h.converter?h.converter.get(l):l;if(h.required&&m==null)throw new Fe(Te.CONTENT_MISSING,a);(h.defaultValue!==l||h.required)&&(s.textContent=m);break}case lg:{let h=f,m=h.converter?h.converter.get(l):l;if(h.required&&m==null)throw new Fe(Te.ATTRIBUTE_MISSING,h.localName,a);(h.defaultValue!==l||h.required)&&(h.namespaceURI?s.setAttributeNS(h.namespaceURI,h.localName||"",m):s.setAttribute(h.localName||"",m));break}case ug:{let h=f,m=null;if(h.parser){if(h.required&&!l||h.minOccurs&&!l.Count){let g=l?.localName||h.localName;throw new Fe(Te.ELEMENT_MISSING,g,a)}l&&(m=l.GetXml(l.element===void 0&&(h.required||l.Count)))}else{let g=h.converter?h.converter.get(l):l;if(h.required&&g===void 0)throw new Fe(Te.ELEMENT_MISSING,h.localName,a);if(l!==h.defaultValue||h.required)if(h.namespaceURI?m=n.createElementNS(h.namespaceURI,`${h.prefix?h.prefix+":":""}${h.localName}`):m=n.createElement(`${h.prefix?h.prefix+":":""}${h.localName}`),Array.isArray(g))for(let w of g){let y=w instanceof r?w.GetXml(!0):w;y!==null&&m&&m.appendChild(y)}else if(g instanceof r){let w=g.GetXml(!0);w&&m&&m.appendChild(w)}else m&&(m.textContent=g)}if(m)if(h.noRoot){let g=[];for(let S=0;S<m.childNodes.length;S++){let E=m.childNodes.item(S);Js(E)&&g.push(E)}let w=h.minOccurs||0,y=h.maxOccurs||1/0;if(g.length<w||g.length>y)throw new Fe(Te.COLLECTION_LIMIT,l.localName,i.localName);g.forEach(S=>s.appendChild(S.cloneNode(!0)))}else{if(m.childNodes.length<(h.minOccurs||0)||m.childNodes.length>(h.maxOccurs||1/0))throw new Fe(Te.COLLECTION_LIMIT,l.localName,i.localName);s.appendChild(m)}break}}}return this.OnGetXml(s),this.element=s,s}LoadXml(e){let t,n=this;if(typeof e=="string"?t=Ci(e).documentElement:t=e,!t)throw new Fe(Te.PARAM_REQUIRED,"element");let s=this.GetStatic(),i=this.localName||"";if(!(t.localName===i&&t.namespaceURI==this.NamespaceURI))throw new Fe(Te.ELEMENT_MALFORMED,i);if(s.items)for(let a in s.items){if(!Object.prototype.hasOwnProperty.call(s.items,a))continue;let u=s.items[a];switch(u.type){case CE:{let l=u;if(l.required&&!t.textContent)throw new Fe(Te.CONTENT_MISSING,i);if(!t.textContent)n[a]=l.defaultValue;else{let f=l.converter?l.converter.set(t.textContent):t.textContent;n[a]=f}break}case lg:{let l=u,f,h;if(!l.localName)throw new Fe(Te.PARAM_REQUIRED,"localName");if(l.namespaceURI?(f=t.hasAttributeNS.bind(t,l.namespaceURI,l.localName),h=t.getAttributeNS.bind(t,l.namespaceURI,l.localName)):(f=t.hasAttribute.bind(t,l.localName),h=t.getAttribute.bind(t,l.localName)),l.required&&!f())throw new Fe(Te.ATTRIBUTE_MISSING,l.localName,i);if(!f())n[a]=l.defaultValue;else{let m=h(),g=l.converter&&m?l.converter.set(m):m;n[a]=g}break}case ug:{let l=u;if(l.noRoot){if(!l.parser)throw new Fe(Te.XML_EXCEPTION,`Schema for '${l.localName}' with flag noRoot must have 'parser'`);let h=new l.parser;if(!(h instanceof xp))throw new Fe(Te.XML_EXCEPTION,`Schema for '${l.localName}' with flag noRoot must have 'parser' like instance of XmlCollection`);h.OnLoadXml(t),delete h.element;let m=l.minOccurs||0,g=l.maxOccurs||1/0;if(h.Count<m||h.Count>g)throw new Fe(Te.COLLECTION_LIMIT,l.parser.localName,i);n[a]=h;continue}let f=null;for(let h=0;h<t.childNodes.length;h++){let m=t.childNodes.item(h);if(!Js(m))continue;let g=m;if(g.localName===l.localName&&g.namespaceURI==l.namespaceURI){f=g;break}}if(l.required&&!f)throw new Fe(Te.ELEMENT_MISSING,l.parser?l.parser.localName:l.localName,i);if(l.parser){if(f){let h=new l.parser;h.localName=l.localName,h.namespaceURI=l.namespaceURI,n[a]=h,h.LoadXml(f)}}else if(!f)n[a]=l.defaultValue;else{let h=f.textContent||"",m=l.converter?l.converter.set(h):h;n[a]=m}break}}}this.OnLoadXml(t),this.prefix=t.prefix||"",this.element=t}toString(){let e=this.GetXml();return e?Ua(e):""}GetElement(e,t=!0){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetElement(this.element,e,t)}GetChildren(e,t){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetChildren(this.element,e,t||this.NamespaceURI||void 0)}GetChild(e,t=!0){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetChild(this.element,e,this.NamespaceURI||void 0,t)}GetFirstChild(e,t){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetFirstChild(this.element,e,t)}GetAttribute(e,t,n=!0){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetAttribute(this.element,e,t,n)}IsEmpty(){return this.Element===void 0}OnLoadXml(e){}GetStatic(){return this.constructor}GetPrefix(){return this.Prefix?this.prefix+":":""}OnGetXml(e){}CreateElement(e,t,n=null,s=null){if(!e){let u=this.CreateDocument();if(u)e=u;else throw new Fe(Te.XML_EXCEPTION,"Document not created")}t=t||this.localName,n=n||this.NamespaceURI,s=s||this.prefix;let i=(s?`${s}:`:"")+t,a=n&&e?e.createElementNS(n,i):e?.createElement(i);return e&&a&&e.importNode(a,!0),a}CreateDocument(){return r.CreateDocument(this.localName,this.NamespaceURI,this.Prefix)}};var xp=class extends Bs{static{o(this,"XmlCollection")}constructor(){super(...arguments),this.MaxOccurs=Number.MAX_VALUE,this.MinOccurs=0,this.items=[]}HasChanged(){let e=super.HasChanged(),t=this.Some(n=>n.HasChanged());return e||t}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e),this.element=null}Pop(){return this.element=null,this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e),this.element=null}Clear(){this.items=[],this.element=null}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new Gu(this.GetIterator().map(e))}Filter(e){return new Gu(this.GetIterator().filter(e))}Sort(e){return new Gu(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}OnGetXml(e){for(let t of this.GetIterator()){let n=t.GetXml();n&&e.appendChild(n)}}OnLoadXml(e){let t=this.GetStatic();if(!t.parser)throw new Fe(Te.XML_EXCEPTION,`${t.localName} doesn't have required 'parser' in @XmlElement`);for(let n=0;n<e.childNodes.length;n++){let s=e.childNodes.item(n);if(!(Js(s)&&s.localName===t.parser.localName&&s.namespaceURI==t.namespaceURI))continue;let i=s,a=new t.parser;a.LoadXml(i),this.Add(a)}}};var Np=class extends Gu{static{o(this,"NamespaceManager")}Add(e){e.prefix=e.prefix||"",e.namespace=e.namespace||"",super.Add(e)}GetPrefix(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.prefix===e)return i}return null}GetNamespace(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.namespace===e)return i}return null}};var vre="[object ArrayBuffer]",dt=class VT{static{o(this,"BufferSourceConverter")}static isArrayBuffer(e){return Object.prototype.toString.call(e)===vre}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=VT.toUint8Array(e),s=VT.toUint8Array(t);if(n.length!==s.byteLength)return!1;for(let i=0;i<n.length;i++)if(n[i]!==s[i])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let a of t)n+=a.byteLength;let s=new Uint8Array(n),i=0;for(let a of t){let u=this.toUint8Array(a);s.set(u,i),i+=u.length}return e[e.length-1]instanceof Function?this.toView(s,e[e.length-1]):s.buffer}},LT="string",wre=/^[0-9a-f\s]+$/i,Sre=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Ere=/^[a-zA-Z0-9-_]+$/,TV=class{static{o(this,"Utf8Converter")}static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n.buffer}static toString(e){let t=dt.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return decodeURIComponent(escape(n))}},Ma=class{static{o(this,"Utf16Converter")}static toString(e,t=!1){let n=dt.toArrayBuffer(e),s=new DataView(n),i="";for(let a=0;a<n.byteLength;a+=2){let u=s.getUint16(a,t);i+=String.fromCharCode(u)}return i}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),s=new DataView(n);for(let i=0;i<e.length;i++)s.setUint16(i*2,e.charCodeAt(i),t);return n}},Ct=class Tp{static{o(this,"Convert")}static isHex(e){return typeof e===LT&&wre.test(e)}static isBase64(e){return typeof e===LT&&Sre.test(e)}static isBase64Url(e){return typeof e===LT&&Ere.test(e)}static ToString(e,t="utf8"){let n=dt.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return Ma.toString(n,!0);case"utf16":case"utf16be":return Ma.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return Ma.fromString(e,!0);case"utf16":case"utf16be":return Ma.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=dt.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!Tp.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!Tp.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=Tp.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return TV.fromString(e);case"utf16":case"utf16be":return Ma.fromString(e);case"utf16le":case"usc2":return Ma.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=Tp.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return TV.toString(e);case"utf16":case"utf16be":return Ma.toString(e);case"utf16le":case"usc2":return Ma.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n.buffer}static ToBinary(e){let t=dt.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return n}static ToHex(e){let t=dt.toUint8Array(e),n="",s=t.length;for(let i=0;i<s;i++){let a=t[i];a<16&&(n+="0"),n+=a.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!Tp.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let s=0;s<t.length;s=s+2){let i=t.slice(s,s+2);n[s/2]=parseInt(i,16)}return n.buffer}static ToUtf16String(e,t=!1){return Ma.toString(e,t)}static FromUtf16String(e,t=!1){return Ma.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Ct.DEFAULT_UTF8_ENCODING="utf8";function D(r,e,t){var n;return r instanceof Object&&(n=r[e])!==null&&n!==void 0?n:t}o(D,"getParametersValue");function bE(r,e=0,t=r.byteLength-e,n=!1){let s="";for(let i of new Uint8Array(r,e,t)){let a=i.toString(16).toUpperCase();a.length===1&&(s+="0"),s+=a,n&&(s+=" ")}return s.trim()}o(bE,"bufferToHexCodes");function xo(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}o(xo,"utilFromBase");function Xi(r,e,t=-1){let n=t,s=r,i=0,a=Math.pow(2,e);for(let u=1;u<8;u++){if(r<a){let l;if(n<0)l=new ArrayBuffer(u),i=u;else{if(n<u)return new ArrayBuffer(0);l=new ArrayBuffer(n),i=n}let f=new Uint8Array(l);for(let h=u-1;h>=0;h--){let m=Math.pow(2,h*e);f[i-h-1]=Math.floor(s/m),s-=f[i-h-1]*m}return l}a*=Math.pow(2,e)}return new ArrayBuffer(0)}o(Xi,"utilToBase");function _c(...r){let e=0,t=0;for(let i of r)e+=i.byteLength;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(new Uint8Array(i),t),t+=i.byteLength;return n}o(_c,"utilConcatBuf");function xE(...r){let e=0,t=0;for(let i of r)e+=i.length;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(i,t),t+=i.length;return s}o(xE,"utilConcatView");function UT(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let u=r[0]===255&&r[1]&128,l=r[0]===0&&(r[1]&128)===0;(u||l)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;let n=xo(t,8),s=new ArrayBuffer(this.valueHex.byteLength),i=new Uint8Array(s);for(let u=0;u<this.valueHex.byteLength;u++)i[u]=r[u];return i[0]&=127,xo(i,8)-n}o(UT,"utilDecodeTC");function BV(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let a=t-e,u=Xi(a,8,n),l=new Uint8Array(u);return l[0]|=128,u}let s=Xi(e,8,n),i=new Uint8Array(s);if(i[0]&128){let a=s.slice(0),u=new Uint8Array(a);s=new ArrayBuffer(s.byteLength+1),i=new Uint8Array(s);for(let l=0;l<a.byteLength;l++)i[l+1]=u[l];i[0]=0}return s}t*=Math.pow(2,8)}return new ArrayBuffer(0)}o(BV,"utilEncodeTC");function Wu(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let s=0;s<t.length;s++)if(t[s]!==n[s])return!1;return!0}o(Wu,"isEqualBuffer");function Ds(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,s=new Array(n);for(let a=0;a<n;a++)s[a]="0";return s.join("").concat(t)}o(Ds,"padNumber");var DV="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function NE(r,e=!1,t=!1,n=!1){let s=0,i=0,a=0,u="",l=e?_V:DV;if(n){let f=0;for(let h=0;h<r.length;h++)if(r.charCodeAt(h)!==0){f=h;break}r=r.slice(f)}for(;s<r.length;){let f=r.charCodeAt(s++);s>=r.length&&(i=1);let h=r.charCodeAt(s++);s>=r.length&&(a=1);let m=r.charCodeAt(s++),g=f>>2,w=(f&3)<<4|h>>4,y=(h&15)<<2|m>>6,S=m&63;i===1?y=S=64:a===1&&(S=64),t?y===64?u+=`${l.charAt(g)}${l.charAt(w)}`:S===64?u+=`${l.charAt(g)}${l.charAt(w)}${l.charAt(y)}`:u+=`${l.charAt(g)}${l.charAt(w)}${l.charAt(y)}${l.charAt(S)}`:u+=`${l.charAt(g)}${l.charAt(w)}${l.charAt(y)}${l.charAt(S)}`}return u}o(NE,"toBase64");function Ip(r,e=!1,t=!1){let n=e?_V:DV;function s(l){for(let f=0;f<64;f++)if(n.charAt(f)===l)return f;return 64}o(s,"indexOf");function i(l){return l===64?0:l}o(i,"test");let a=0,u="";for(;a<r.length;){let l=s(r.charAt(a++)),f=a>=r.length?0:s(r.charAt(a++)),h=a>=r.length?0:s(r.charAt(a++)),m=a>=r.length?0:s(r.charAt(a++)),g=i(l)<<2|i(f)>>4,w=(i(f)&15)<<4|i(h)>>2,y=(i(h)&3)<<6|i(m);u+=String.fromCharCode(g),h!==64&&(u+=String.fromCharCode(w)),m!==64&&(u+=String.fromCharCode(y))}if(t){let l=u.length,f=-1;for(let h=l-1;h>=0;h--)if(u.charCodeAt(h)!==0){f=h;break}f!==-1?u=u.slice(0,f+1):u=""}return u}o(Ip,"fromBase64");function fg(r){let e="",t=new Uint8Array(r);for(let n of t)e+=String.fromCharCode(n);return e}o(fg,"arrayBufferToString");function Rc(r){let e=r.length,t=new ArrayBuffer(e),n=new Uint8Array(t);for(let s=0;s<e;s++)n[s]=r.charCodeAt(s);return t}o(Rc,"stringToArrayBuffer");var Are=Math.log(2);function RV(r){let e=Math.log(r)/Are,t=Math.floor(e),n=Math.round(e);return t===n?t:n}o(RV,"nearestPowerOf2");function _e(r,e){for(let t of e)delete r[t]}o(_e,"clearProps");function TE(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}o(TE,"assertBigInt");function qT(r){let e=0,t=0;for(let s=0;s<r.length;s++){let i=r[s];e+=i.byteLength}let n=new Uint8Array(e);for(let s=0;s<r.length;s++){let i=r[s];n.set(new Uint8Array(i),t),t+=i.byteLength}return n.buffer}o(qT,"concat");function No(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}o(No,"checkBufferParams");var HT=class{static{o(this,"ViewWriter")}constructor(){this.items=[]}write(e){this.items.push(e)}final(){return qT(this.items)}},hg=[new Uint8Array([1])],OV="0123456789",MT="name",kV="valueHexView",Cre="isHexOnly",bre="idBlock",xre="tagClass",Nre="tagNumber",Tre="isConstructed",Ire="fromBER",Bre="toBER",Dre="local",_s="",Gi=new ArrayBuffer(0),IE=new Uint8Array(0),dg="EndOfContent",VV="OCTET STRING",UV="BIT STRING";function To(r){var e;return e=class extends r{static{o(this,"Some")}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}constructor(...n){var s;super(...n);let i=n[0]||{};this.isHexOnly=(s=i.isHexOnly)!==null&&s!==void 0?s:!1,this.valueHexView=i.valueHex?dt.toUint8Array(i.valueHex):IE}fromBER(n,s,i){let a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!No(this,a,s,i))return-1;let u=s+i;return this.valueHexView=a.subarray(s,u),this.valueHexView.length?(this.blockLength=i,u):(this.warnings.push("Zero buffer length"),s)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Gi)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:Ct.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}o(To,"HexBlock");var Pc=class{static{o(this,"LocalBaseBlock")}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=_s,warnings:n=[],valueBeforeDecode:s=IE}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=dt.toUint8Array(s)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:Ct.ToHex(this.valueBeforeDecodeView)}}};Pc.NAME="baseBlock";var Rs=class extends Pc{static{o(this,"ValueBlock")}fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};Rs.NAME="valueBlock";var MV=class extends To(Pc){static{o(this,"LocalIdentificationBlock")}constructor({idBlock:e={}}={}){var t,n,s,i;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?dt.toUint8Array(e.valueHex):IE,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(s=e.tagNumber)!==null&&s!==void 0?s:-1,this.isConstructed=(i=e.isConstructed)!==null&&i!==void 0?i:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",Gi}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let s=new Uint8Array(1);if(!e){let i=this.tagNumber;i&=31,t|=i,s[0]=t}return s.buffer}if(!this.isHexOnly){let s=Xi(this.tagNumber,7),i=new Uint8Array(s),a=s.byteLength,u=new Uint8Array(a+1);if(u[0]=t|31,!e){for(let l=0;l<a-1;l++)u[l+1]=i[l]|128;u[a]=i[a-1]}return u.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let s=this.valueHexView;for(let i=0;i<s.length-1;i++)n[i+1]=s[i]|128;n[this.valueHexView.byteLength]=s[s.length-1]}return n.buffer}fromBER(e,t,n){let s=dt.toUint8Array(e);if(!No(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;switch(i[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(i[0]&32)===32,this.isHexOnly=!1;let u=i[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let l=1,f=this.valueHexView=new Uint8Array(255),h=255;for(;i[l]&128;){if(f[l-1]=i[l]&127,l++,l>=i.length)return this.error="End of input reached before message was fully decoded",-1;if(l===h){h+=255;let g=new Uint8Array(h);for(let w=0;w<f.length;w++)g[w]=f[w];f=this.valueHexView=new Uint8Array(h)}}this.blockLength=l+1,f[l-1]=i[l]&127;let m=new Uint8Array(l);for(let g=0;g<l;g++)m[g]=f[g];f=this.valueHexView=new Uint8Array(l),f.set(m),this.blockLength<=9?this.tagNumber=xo(f,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};MV.NAME="identificationBlock";var jV=class extends Pc{static{o(this,"LocalLengthBlock")}constructor({lenBlock:e={}}={}){var t,n,s;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(s=e.length)!==null&&s!==void 0?s:0}fromBER(e,t,n){let s=dt.toUint8Array(e);if(!No(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;if(i[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=i[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(i[0]&128),this.longFormUsed===!1)return this.length=i[0],this.blockLength=1,t+this.blockLength;let a=i[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>i.length)return this.error="End of input reached before message was fully decoded",-1;let u=t+1,l=s.subarray(u,u+a);return l[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=xo(l,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let s=Xi(this.length,8);if(s.byteLength>127)return this.error="Too big length",Gi;if(t=new ArrayBuffer(s.byteLength+1),e)return t;let i=new Uint8Array(s);n=new Uint8Array(t),n[0]=s.byteLength|128;for(let a=0;a<s.byteLength;a++)n[a+1]=i[a];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};jV.NAME="lengthBlock";var ot={},ps=class extends Pc{static{o(this,"BaseBlock")}constructor({name:e=_s,optional:t=!1,primitiveSchema:n,...s}={},i){super(s),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new MV(s),this.lenBlock=new jV(s),this.valueBlock=i?new i(s):new Rs(s)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}toBER(e,t){let n=t||new HT;t||FV(this);let s=this.idBlock.toBER(e);if(n.write(s),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let i=this.valueBlock.toBER(e);this.lenBlock.length=i.byteLength;let a=this.lenBlock.toBER(e);n.write(a),n.write(i)}return t?Gi:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():Ct.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=Ct.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return Wu(t,n)}};ps.NAME="BaseBlock";function FV(r){var e;if(r instanceof ot.Constructed)for(let t of r.valueBlock.value)FV(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}o(FV,"prepareIndefiniteForm");var qV=class extends ps{static{o(this,"BaseStringBlock")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=_s,...t}={},n){super(t,n),e&&this.fromString(e)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};qV.NAME="BaseStringBlock";var HV=class extends To(Rs){static{o(this,"LocalPrimitiveValueBlock")}constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};HV.NAME="PrimitiveValueBlock";var KV,yt=class extends ps{static{o(this,"Primitive")}constructor(e={}){super(e,HV),this.idBlock.isConstructed=!1}};KV=yt;ot.Primitive=KV;yt.NAME="PRIMITIVE";function _re(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}o(_re,"localChangeType");function mg(r,e=0,t=r.length){let n=e,s=new ps({},Rs),i=new Pc;if(!No(i,r,e,t))return s.error=i.error,{offset:-1,result:s};if(!r.subarray(e,e+t).length)return s.error="Zero buffer length",{offset:-1,result:s};let u=s.idBlock.fromBER(r,e,t);if(s.idBlock.warnings.length&&s.warnings.concat(s.idBlock.warnings),u===-1)return s.error=s.idBlock.error,{offset:-1,result:s};if(e=u,t-=s.idBlock.blockLength,u=s.lenBlock.fromBER(r,e,t),s.lenBlock.warnings.length&&s.warnings.concat(s.lenBlock.warnings),u===-1)return s.error=s.lenBlock.error,{offset:-1,result:s};if(e=u,t-=s.lenBlock.blockLength,!s.idBlock.isConstructed&&s.lenBlock.isIndefiniteForm)return s.error="Indefinite length form used for primitive encoding form",{offset:-1,result:s};let l=ps;switch(s.idBlock.tagClass){case 1:if(s.idBlock.tagNumber>=37&&s.idBlock.isHexOnly===!1)return s.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:s};switch(s.idBlock.tagNumber){case 0:if(s.idBlock.isConstructed&&s.lenBlock.length>0)return s.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:s};l=ot.EndOfContent;break;case 1:l=ot.Boolean;break;case 2:l=ot.Integer;break;case 3:l=ot.BitString;break;case 4:l=ot.OctetString;break;case 5:l=ot.Null;break;case 6:l=ot.ObjectIdentifier;break;case 10:l=ot.Enumerated;break;case 12:l=ot.Utf8String;break;case 13:l=ot.RelativeObjectIdentifier;break;case 14:l=ot.TIME;break;case 15:return s.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:s};case 16:l=ot.Sequence;break;case 17:l=ot.Set;break;case 18:l=ot.NumericString;break;case 19:l=ot.PrintableString;break;case 20:l=ot.TeletexString;break;case 21:l=ot.VideotexString;break;case 22:l=ot.IA5String;break;case 23:l=ot.UTCTime;break;case 24:l=ot.GeneralizedTime;break;case 25:l=ot.GraphicString;break;case 26:l=ot.VisibleString;break;case 27:l=ot.GeneralString;break;case 28:l=ot.UniversalString;break;case 29:l=ot.CharacterString;break;case 30:l=ot.BmpString;break;case 31:l=ot.DATE;break;case 32:l=ot.TimeOfDay;break;case 33:l=ot.DateTime;break;case 34:l=ot.Duration;break;default:{let f=s.idBlock.isConstructed?new ot.Constructed:new ot.Primitive;f.idBlock=s.idBlock,f.lenBlock=s.lenBlock,f.warnings=s.warnings,s=f}}break;case 2:case 3:case 4:default:l=s.idBlock.isConstructed?ot.Constructed:ot.Primitive}return s=_re(s,l),u=s.fromBER(r,e,s.lenBlock.isIndefiniteForm?t:s.lenBlock.length),s.valueBeforeDecodeView=r.subarray(n,n+s.blockLength),{offset:u,result:s}}o(mg,"localFromBER");function Hr(r){if(!r.byteLength){let e=new ps({},Rs);return e.error="Input buffer has zero length",{offset:-1,result:e}}return mg(dt.toUint8Array(r).slice(),0,r.byteLength)}o(Hr,"fromBER");function Rre(r,e){return r?1:e}o(Rre,"checkLen");var Ju=class extends Rs{static{o(this,"LocalConstructedValueBlock")}constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let s=dt.toUint8Array(e);if(!No(this,s,t,n))return-1;if(this.valueBeforeDecodeView=s.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let i=t;for(;Rre(this.isIndefiniteForm,n)>0;){let a=mg(s,i,n);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(i=a.offset,this.blockLength+=a.result.blockLength,n-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===dg)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===dg?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(e,t){let n=t||new HT;for(let s=0;s<this.value.length;s++)this.value[s].toBER(e,n);return t?Gi:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};Ju.NAME="ConstructedValueBlock";var $V,ae=class extends ps{static{o(this,"Constructed")}constructor(e={}){super(e,Ju),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
87
- `).map(s=>` ${s}`).join(`
88
- `));let t=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} :
89
- ${e.join(`
90
- `)}`:`${t} :`}};$V=ae;ot.Constructed=$V;ae.NAME="CONSTRUCTED";var XV=class extends Rs{static{o(this,"LocalEndOfContentValueBlock")}fromBER(e,t,n){return t}toBER(e){return Gi}};XV.override="EndOfContentValueBlock";var GV,WV=class extends ps{static{o(this,"EndOfContent")}constructor(e={}){super(e,XV),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};GV=WV;ot.EndOfContent=GV;WV.NAME=dg;var JV,Kr=class extends ps{static{o(this,"Null")}constructor(e={}){super(e,Rs),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,n){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=n,t+n>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+n}toBER(e,t){let n=new ArrayBuffer(2);if(!e){let s=new Uint8Array(n);s[0]=5,s[1]=0}return t&&t.write(n),n}onAsciiEncoding(){return`${this.constructor.NAME}`}};JV=Kr;ot.Null=JV;Kr.NAME="NULL";var zV=class extends To(Rs){static{o(this,"LocalBooleanValueBlock")}get value(){for(let e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=dt.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,t,n){let s=dt.toUint8Array(e);return No(this,s,t,n)?(this.valueHexView=s.subarray(t,t+n),n>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,UT.call(this),this.blockLength=n,t+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}};zV.NAME="BooleanValueBlock";var YV,Wi=class extends ps{static{o(this,"Boolean")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,zV),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};YV=Wi;ot.Boolean=YV;Wi.NAME="BOOLEAN";var QV=class extends To(Ju){static{o(this,"LocalOctetStringValueBlock")}constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,n){let s=0;if(this.isConstructed){if(this.isHexOnly=!1,s=Ju.prototype.fromBER.call(this,e,t,n),s===-1)return s;for(let i=0;i<this.value.length;i++){let a=this.value[i].constructor.NAME;if(a===dg){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==VV)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,s=super.fromBER(e,t,n),this.blockLength=n;return s}toBER(e,t){return this.isConstructed?Ju.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}};QV.NAME="OctetStringValueBlock";var KT,Ve=class extends ps{static{o(this,"OctetString")}constructor({idBlock:e={},lenBlock:t={},...n}={}){var s,i;(s=n.isConstructed)!==null&&s!==void 0||(n.isConstructed=!!(!((i=n.value)===null||i===void 0)&&i.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},QV),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,n){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,n===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),t;if(!this.valueBlock.isConstructed){let i=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+n);try{if(i.byteLength){let a=mg(i,0,i.byteLength);a.offset!==-1&&a.offset===n&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(e,t,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return ae.prototype.onAsciiEncoding.call(this);let e=this.constructor.NAME,t=Ct.ToHex(this.valueBlock.valueHexView);return`${e} : ${t}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;let e=[];for(let t of this.valueBlock.value)t instanceof KT&&e.push(t.valueBlock.valueHexView);return dt.concat(e)}};KT=Ve;ot.OctetString=KT;Ve.NAME=VV;var ZV=class extends To(Ju){static{o(this,"LocalBitStringValueBlock")}constructor({unusedBits:e=0,isConstructed:t=!1,...n}={}){super(n),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,n){if(!n)return t;let s=-1;if(this.isConstructed){if(s=Ju.prototype.fromBER.call(this,e,t,n),s===-1)return s;for(let u of this.value){let l=u.constructor.NAME;if(l===dg){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==UV)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let f=u.valueBlock;if(this.unusedBits>0&&f.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=f.unusedBits}return s}let i=dt.toUint8Array(e);if(!No(this,i,t,n))return-1;let a=i.subarray(t,t+n);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){let u=a.subarray(1);try{if(u.byteLength){let l=mg(u,0,u.byteLength);l.offset!==-1&&l.offset===n-1&&(this.value=[l.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,t+n}toBER(e,t){if(this.isConstructed)return Ju.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return Gi;let n=new Uint8Array(this.valueHexView.length+1);return n[0]=this.unusedBits,n.set(this.valueHexView,1),n.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}};ZV.NAME="BitStringValueBlock";var e6,qt=class extends ps{static{o(this,"BitString")}constructor({idBlock:e={},lenBlock:t={},...n}={}){var s,i;(s=n.isConstructed)!==null&&s!==void 0||(n.isConstructed=!!(!((i=n.value)===null||i===void 0)&&i.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},ZV),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return ae.prototype.onAsciiEncoding.call(this);{let e=[],t=this.valueBlock.valueHexView;for(let a of t)e.push(a.toString(2).padStart(8,"0"));let n=e.join(""),s=this.constructor.NAME,i=n.substring(0,n.length-this.valueBlock.unusedBits);return`${s} : ${i}`}}};e6=qt;ot.BitString=e6;qt.NAME=UV;var t6;function Pre(r,e){let t=new Uint8Array([0]),n=new Uint8Array(r),s=new Uint8Array(e),i=n.slice(0),a=i.length-1,u=s.slice(0),l=u.length-1,f=0,h=l<a?a:l,m=0;for(let g=h;g>=0;g--,m++){switch(!0){case m<u.length:f=i[a-m]+u[l-m]+t[0];break;default:f=i[a-m]+t[0]}switch(t[0]=f/10,!0){case m>=i.length:i=xE(new Uint8Array([f%10]),i);break;default:i[a-m]=f%10}}return t[0]>0&&(i=xE(t,i)),i}o(Pre,"viewAdd");function LV(r){if(r>=hg.length)for(let e=hg.length;e<=r;e++){let t=new Uint8Array([0]),n=hg[e-1].slice(0);for(let s=n.length-1;s>=0;s--){let i=new Uint8Array([(n[s]<<1)+t[0]]);t[0]=i[0]/10,n[s]=i[0]%10}t[0]>0&&(n=xE(t,n)),hg.push(n)}return hg[r]}o(LV,"power2");function Ore(r,e){let t=0,n=new Uint8Array(r),s=new Uint8Array(e),i=n.slice(0),a=i.length-1,u=s.slice(0),l=u.length-1,f,h=0;for(let m=l;m>=0;m--,h++)switch(f=i[a-h]-u[l-h]-t,!0){case f<0:t=1,i[a-h]=f+10;break;default:t=0,i[a-h]=f}if(t>0)for(let m=a-l+1;m>=0;m--,h++)if(f=i[a-h]-t,f<0)t=1,i[a-h]=f+10;else{t=0,i[a-h]=f;break}return i.slice()}o(Ore,"viewSub");var $T=class extends To(Rs){static{o(this,"LocalIntegerValueBlock")}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=UT.call(this)))}constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(BV(e))}get valueDec(){return this._valueDec}fromDER(e,t,n,s=0){let i=this.fromBER(e,t,n);if(i===-1)return i;let a=this.valueHexView;return a[0]===0&&(a[1]&128)!==0?this.valueHexView=a.subarray(1):s!==0&&a.length<s&&(s-a.length>1&&(s=a.length+1),this.valueHexView=a.subarray(s-a.length)),i}toDER(e=!1){let t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{let n=new Uint8Array(this.valueHexView.length+1);n[0]=0,n.set(t,1),this.valueHexView=n}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,n){let s=super.fromBER(e,t,n);return s===-1||this.setValueHex(),s}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){let e=this.valueHexView.length*8-1,t=new Uint8Array(this.valueHexView.length*8/3),n=0,s,i=this.valueHexView,a="",u=!1;for(let l=i.byteLength-1;l>=0;l--){s=i[l];for(let f=0;f<8;f++){if((s&1)===1)switch(n){case e:t=Ore(LV(n),t),a="-";break;default:t=Pre(t,LV(n))}n++,s>>=1}}for(let l=0;l<t.length;l++)t[l]&&(u=!0),u&&(a+=OV.charAt(t[l]));return u===!1&&(a+=OV.charAt(0)),a}};t6=$T;$T.NAME="IntegerValueBlock";Object.defineProperty(t6.prototype,"valueHex",{set:o(function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},"set"),get:o(function(){return this.valueHexView.slice().buffer},"get")});var pg,me=class extends ps{static{o(this,"Integer")}constructor(e={}){super(e,$T),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return TE(),BigInt(this.valueBlock.toString())}static fromBigInt(e){TE();let t=BigInt(e),n=new HT,s=t.toString(16).replace(/^-/,""),i=new Uint8Array(Ct.FromHex(s));if(t<0){let u=new Uint8Array(i.length+(i[0]&128?1:0));u[0]|=128;let f=BigInt(`0x${Ct.ToHex(u)}`)+t,h=dt.toUint8Array(Ct.FromHex(f.toString(16)));h[0]|=128,n.write(h)}else i[0]&128&&n.write(new Uint8Array([0])),n.write(i);return new pg({valueHex:n.final()})}convertToDER(){let e=new pg({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new pg({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}};pg=me;ot.Integer=pg;me.NAME="INTEGER";var r6,zu=class extends me{static{o(this,"Enumerated")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}};r6=zu;ot.Enumerated=r6;zu.NAME="ENUMERATED";var jT=class extends To(Rs){static{o(this,"LocalSidValueBlock")}constructor({valueDec:e=-1,isFirstSid:t=!1,...n}={}){super(n),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,n){if(!n)return t;let s=dt.toUint8Array(e);if(!No(this,s,t,n))return-1;let i=s.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let u=0;u<n&&(this.valueHexView[u]=i[u]&127,this.blockLength++,(i[u]&128)!==0);u++);let a=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)a[u]=this.valueHexView[u];return this.valueHexView=a,(i[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=xo(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){TE();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;let n=new Uint8Array(t.length/7);for(let s=0;s<n.length;s++)n[s]=parseInt(t.slice(s*7,s*7+7),2)+(s+1<n.length?128:0);this.fromBER(n.buffer,0,n.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let s=this.valueHexView,i=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)i[a]=s[a]|128;return i[this.blockLength-1]=s[this.blockLength-1],i.buffer}let t=Xi(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Gi;let n=new Uint8Array(t.byteLength);if(!e){let s=new Uint8Array(t),i=t.byteLength-1;for(let a=0;a<i;a++)n[a]=s[a]|128;n[i]=s[i]}return n}toString(){let e="";if(this.isHexOnly)e=Ct.ToHex(this.valueHexView);else if(this.isFirstSid){let t=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",t-=40):(e="2.",t-=80),e+=t.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}};jT.NAME="sidBlock";var n6=class extends Rs{static{o(this,"LocalObjectIdentifierValueBlock")}constructor({value:e=_s,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let s=t;for(;n>0;){let i=new jT;if(s=i.fromBER(e,s,n),s===-1)return this.blockLength=0,this.error=i.error,s;this.value.length===0&&(i.isFirstSid=!0),this.blockLength+=i.blockLength,n-=i.blockLength,this.value.push(i)}return s}toBER(e){let t=[];for(let n=0;n<this.value.length;n++){let s=this.value[n].toBER(e);if(s.byteLength===0)return this.error=this.value[n].error,Gi;t.push(s)}return qT(t)}fromString(e){this.value=[];let t=0,n=0,s="",i=!1;do if(n=e.indexOf(".",t),n===-1?s=e.substring(t):s=e.substring(t,n),t=n+1,i){let a=this.value[0],u=0;switch(a.valueDec){case 0:break;case 1:u=40;break;case 2:u=80;break;default:this.value=[];return}let l=parseInt(s,10);if(isNaN(l))return;a.valueDec=l+u,i=!1}else{let a=new jT;if(s>Number.MAX_SAFE_INTEGER){TE();let u=BigInt(s);a.valueBigInt=u}else if(a.valueDec=parseInt(s,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,i=!0),this.value.push(a)}while(n!==-1)}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let s=this.value[n].toString();n!==0&&(e=`${e}.`),t?(s=`{${s}}`,this.value[n].isFirstSid?e=`2.{${s} - 80}`:e+=s):e+=s}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};n6.NAME="ObjectIdentifierValueBlock";var s6,rt=class extends ps{static{o(this,"ObjectIdentifier")}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,n6),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};s6=rt;ot.ObjectIdentifier=s6;rt.NAME="OBJECT IDENTIFIER";var FT=class extends To(Pc){static{o(this,"LocalRelativeSidValueBlock")}constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,n){if(n===0)return t;let s=dt.toUint8Array(e);if(!No(this,s,t,n))return-1;let i=s.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let u=0;u<n&&(this.valueHexView[u]=i[u]&127,this.blockLength++,(i[u]&128)!==0);u++);let a=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)a[u]=this.valueHexView[u];return this.valueHexView=a,(i[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=xo(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let s=this.valueHexView,i=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)i[a]=s[a]|128;return i[this.blockLength-1]=s[this.blockLength-1],i.buffer}let t=Xi(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Gi;let n=new Uint8Array(t.byteLength);if(!e){let s=new Uint8Array(t),i=t.byteLength-1;for(let a=0;a<i;a++)n[a]=s[a]|128;n[i]=s[i]}return n.buffer}toString(){let e="";return this.isHexOnly?e=Ct.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}};FT.NAME="relativeSidBlock";var i6=class extends Rs{static{o(this,"LocalRelativeObjectIdentifierValueBlock")}constructor({value:e=_s,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let s=t;for(;n>0;){let i=new FT;if(s=i.fromBER(e,s,n),s===-1)return this.blockLength=0,this.error=i.error,s;this.blockLength+=i.blockLength,n-=i.blockLength,this.value.push(i)}return s}toBER(e,t){let n=[];for(let s=0;s<this.value.length;s++){let i=this.value[s].toBER(e);if(i.byteLength===0)return this.error=this.value[s].error,Gi;n.push(i)}return qT(n)}fromString(e){this.value=[];let t=0,n=0,s="";do{n=e.indexOf(".",t),n===-1?s=e.substring(t):s=e.substring(t,n),t=n+1;let i=new FT;if(i.valueDec=parseInt(s,10),isNaN(i.valueDec))return!0;this.value.push(i)}while(n!==-1);return!0}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let s=this.value[n].toString();n!==0&&(e=`${e}.`),t&&(s=`{${s}}`),e+=s}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};i6.NAME="RelativeObjectIdentifierValueBlock";var a6,o6=class extends ps{static{o(this,"RelativeObjectIdentifier")}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,i6),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};a6=o6;ot.RelativeObjectIdentifier=a6;o6.NAME="RelativeObjectIdentifier";var u6,W=class extends ae{static{o(this,"Sequence")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}};u6=W;ot.Sequence=u6;W.NAME="SEQUENCE";var l6,$r=class extends ae{static{o(this,"Set")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};l6=$r;ot.Set=l6;$r.NAME="SET";var c6=class extends To(Rs){static{o(this,"LocalStringValueBlock")}constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=_s}toJSON(){return{...super.toJSON(),value:this.value}}};c6.NAME="StringValueBlock";var f6=class extends c6{static{o(this,"LocalSimpleStringValueBlock")}};f6.NAME="SimpleStringValueBlock";var zs=class extends qV{static{o(this,"LocalSimpleStringBlock")}constructor({...e}={}){super(e,f6)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,dt.toUint8Array(e))}fromString(e){let t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);this.valueBlock.value=e}};zs.NAME="SIMPLE STRING";var h6=class extends zs{static{o(this,"LocalUtf8StringValueBlock")}fromBuffer(e){this.valueBlock.valueHexView=dt.toUint8Array(e);try{this.valueBlock.value=Ct.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=Ct.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(Ct.FromUtf8String(e)),this.valueBlock.value=e}};h6.NAME="Utf8StringValueBlock";var p6,xi=class extends h6{static{o(this,"Utf8String")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}};p6=xi;ot.Utf8String=p6;xi.NAME="UTF8String";var d6=class extends zs{static{o(this,"LocalBmpStringValueBlock")}fromBuffer(e){this.valueBlock.value=Ct.ToUtf16String(e),this.valueBlock.valueHexView=dt.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(Ct.FromUtf16String(e))}};d6.NAME="BmpStringValueBlock";var m6,Bp=class extends d6{static{o(this,"BmpString")}constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}};m6=Bp;ot.BmpString=m6;Bp.NAME="BMPString";var g6=class extends zs{static{o(this,"LocalUniversalStringValueBlock")}fromBuffer(e){let t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),n=new Uint8Array(t);for(let s=0;s<n.length;s+=4)n[s]=n[s+3],n[s+1]=n[s+2],n[s+2]=0,n[s+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){let t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let s=0;s<t;s++){let i=Xi(e.charCodeAt(s),8),a=new Uint8Array(i);if(a.length>4)continue;let u=4-a.length;for(let l=a.length-1;l>=0;l--)n[s*4+l+u]=a[l]}this.valueBlock.value=e}};g6.NAME="UniversalStringValueBlock";var y6,Dp=class extends g6{static{o(this,"UniversalString")}constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};y6=Dp;ot.UniversalString=y6;Dp.NAME="UniversalString";var v6,Oc=class extends zs{static{o(this,"NumericString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};v6=Oc;ot.NumericString=v6;Oc.NAME="NumericString";var w6,Ni=class extends zs{static{o(this,"PrintableString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};w6=Ni;ot.PrintableString=w6;Ni.NAME="PrintableString";var S6,_p=class extends zs{static{o(this,"TeletexString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};S6=_p;ot.TeletexString=S6;_p.NAME="TeletexString";var E6,BE=class extends zs{static{o(this,"VideotexString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};E6=BE;ot.VideotexString=E6;BE.NAME="VideotexString";var A6,gg=class extends zs{static{o(this,"IA5String")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};A6=gg;ot.IA5String=A6;gg.NAME="IA5String";var C6,DE=class extends zs{static{o(this,"GraphicString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};C6=DE;ot.GraphicString=C6;DE.NAME="GraphicString";var b6,yg=class extends zs{static{o(this,"VisibleString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};b6=yg;ot.VisibleString=b6;yg.NAME="VisibleString";var x6,_E=class extends zs{static{o(this,"GeneralString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};x6=_E;ot.GeneralString=x6;_E.NAME="GeneralString";var N6,RE=class extends zs{static{o(this,"CharacterString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};N6=RE;ot.CharacterString=N6;RE.NAME="CharacterString";var T6,kc=class extends yg{static{o(this,"UTCTime")}constructor({value:e,valueDate:t,...n}={}){if(super(n),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let s=0;s<e.length;s++)this.valueBlock.valueHexView[s]=e.charCodeAt(s)}t&&(this.fromDate(t),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,dt.toUint8Array(e)))}toBuffer(){let e=this.toString(),t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let s=0;s<e.length;s++)n[s]=e.charCodeAt(s);return t}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){let n=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(n===null){this.error="Wrong input string for conversion";return}let s=parseInt(n[1],10);s>=50?this.year=1900+s:this.year=2e3+s,this.month=parseInt(n[2],10),this.day=parseInt(n[3],10),this.hour=parseInt(n[4],10),this.minute=parseInt(n[5],10),this.second=parseInt(n[6],10)}toString(e="iso"){if(e==="iso"){let t=new Array(7);return t[0]=Ds(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=Ds(this.month,2),t[2]=Ds(this.day,2),t[3]=Ds(this.hour,2),t[4]=Ds(this.minute,2),t[5]=Ds(this.second,2),t[6]="Z",t.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}};T6=kc;ot.UTCTime=T6;kc.NAME="UTCTime";var I6,Rr=class extends kc{static{o(this,"GeneralizedTime")}constructor(e={}){var t;super(e),(t=this.millisecond)!==null&&t!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){let e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)}fromString(e){let t=!1,n="",s="",i=0,a,u=0,l=0;if(e[e.length-1]==="Z")n=e.substring(0,e.length-1),t=!0;else{let m=new Number(e[e.length-1]);if(isNaN(m.valueOf()))throw new Error("Wrong input string for conversion");n=e}if(t){if(n.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(n.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let m=1,g=n.indexOf("+"),w="";if(g===-1&&(g=n.indexOf("-"),m=-1),g!==-1){if(w=n.substring(g+1),n=n.substring(0,g),w.length!==2&&w.length!==4)throw new Error("Wrong input string for conversion");let y=parseInt(w.substring(0,2),10);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");if(u=m*y,w.length===4){if(y=parseInt(w.substring(2,4),10),isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");l=m*y}}}let f=n.indexOf(".");if(f===-1&&(f=n.indexOf(",")),f!==-1){let m=new Number(`0${n.substring(f)}`);if(isNaN(m.valueOf()))throw new Error("Wrong input string for conversion");i=m.valueOf(),s=n.substring(0,f)}else s=n;switch(!0){case s.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,f!==-1)throw new Error("Wrong input string for conversion");break;case s.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let m=60*i;this.minute=Math.floor(m),m=60*(m-this.minute),this.second=Math.floor(m),m=1e3*(m-this.second),this.millisecond=Math.floor(m)}break;case s.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let m=60*i;this.second=Math.floor(m),m=1e3*(m-this.second),this.millisecond=Math.floor(m)}break;case s.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let m=1e3*i;this.millisecond=Math.floor(m)}break;default:throw new Error("Wrong input string for conversion")}let h=a.exec(s);if(h===null)throw new Error("Wrong input string for conversion");for(let m=1;m<h.length;m++)switch(m){case 1:this.year=parseInt(h[m],10);break;case 2:this.month=parseInt(h[m],10);break;case 3:this.day=parseInt(h[m],10);break;case 4:this.hour=parseInt(h[m],10)+u;break;case 5:this.minute=parseInt(h[m],10)+l;break;case 6:this.second=parseInt(h[m],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){let m=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=m.getUTCFullYear(),this.month=m.getUTCMonth(),this.day=m.getUTCDay(),this.hour=m.getUTCHours(),this.minute=m.getUTCMinutes(),this.second=m.getUTCSeconds(),this.millisecond=m.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){let t=[];return t.push(Ds(this.year,4)),t.push(Ds(this.month,2)),t.push(Ds(this.day,2)),t.push(Ds(this.hour,2)),t.push(Ds(this.minute,2)),t.push(Ds(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(Ds(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}};I6=Rr;ot.GeneralizedTime=I6;Rr.NAME="GeneralizedTime";var B6,D6=class extends xi{static{o(this,"DATE")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}};B6=D6;ot.DATE=B6;D6.NAME="DATE";var _6,R6=class extends xi{static{o(this,"TimeOfDay")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}};_6=R6;ot.TimeOfDay=_6;R6.NAME="TimeOfDay";var P6,O6=class extends xi{static{o(this,"DateTime")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}};P6=O6;ot.DateTime=P6;O6.NAME="DateTime";var k6,L6=class extends xi{static{o(this,"Duration")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}};k6=L6;ot.Duration=k6;L6.NAME="Duration";var V6,U6=class extends xi{static{o(this,"TIME")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}};V6=U6;ot.TIME=V6;U6.NAME="TIME";var St=class{static{o(this,"Any")}constructor({name:e=_s,optional:t=!1}={}){this.name=e,this.optional=t}},Pr=class extends St{static{o(this,"Choice")}constructor({value:e=[],...t}={}){super(t),this.value=e}},Tt=class extends St{static{o(this,"Repeated")}constructor({value:e=new St,local:t=!1,...n}={}){super(n),this.value=e,this.local=t}},vg=class{static{o(this,"RawData")}get data(){return this.dataView.slice().buffer}set data(e){this.dataView=dt.toUint8Array(e)}constructor({data:e=IE}={}){this.dataView=dt.toUint8Array(e)}fromBER(e,t,n){let s=t+n;return this.dataView=dt.toUint8Array(e).subarray(t,s),s}toBER(e){return this.dataView.slice().buffer}};function Ie(r,e,t){if(t instanceof Pr){for(let i of t.value)if(Ie(r,e,i).verified)return{verified:!0,result:r};{let i={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(MT)&&(i.name=t.name),i}}if(t instanceof St)return t.hasOwnProperty(MT)&&(r[t.name]=e),{verified:!0,result:r};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(bre in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Ire in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Bre in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let n=t.idBlock.toBER(!1);if(n.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(t.idBlock.fromBER(n,0,n.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(t.idBlock.hasOwnProperty(xre)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(Nre)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(Tre)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(Cre in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:r};if(t.idBlock.isHexOnly){if(!(kV in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let i=t.idBlock.valueHexView,a=e.idBlock.valueHexView;if(i.length!==a.length)return{verified:!1,result:r};for(let u=0;u<i.length;u++)if(i[u]!==a[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_s),t.name&&(r[t.name]=e)),t instanceof ot.Constructed){let i=0,a={verified:!1,result:{error:"Unknown error"}},u=t.valueBlock.value.length;if(u>0&&t.valueBlock.value[0]instanceof Tt&&(u=e.valueBlock.value.length),u===0)return{verified:!0,result:r};if(e.valueBlock.value.length===0&&t.valueBlock.value.length!==0){let l=!0;for(let f=0;f<t.valueBlock.value.length;f++)l=l&&(t.valueBlock.value[f].optional||!1);return l?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_s),t.name&&delete r[t.name]),r.error="Inconsistent object length",{verified:!1,result:r})}for(let l=0;l<u;l++)if(l-i>=e.valueBlock.value.length){if(t.valueBlock.value[l].optional===!1){let f={verified:!1,result:r};return r.error="Inconsistent length between ASN.1 data and schema",t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_s),t.name&&(delete r[t.name],f.name=t.name)),f}}else if(t.valueBlock.value[0]instanceof Tt){if(a=Ie(r,e.valueBlock.value[l],t.valueBlock.value[0].value),a.verified===!1)if(t.valueBlock.value[0].optional)i++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_s),t.name&&delete r[t.name]),a;if(MT in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let f={};Dre in t.valueBlock.value[0]&&t.valueBlock.value[0].local?f=e:f=r,typeof f[t.valueBlock.value[0].name]>"u"&&(f[t.valueBlock.value[0].name]=[]),f[t.valueBlock.value[0].name].push(e.valueBlock.value[l])}}else if(a=Ie(r,e.valueBlock.value[l-i],t.valueBlock.value[l]),a.verified===!1)if(t.valueBlock.value[l].optional)i++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_s),t.name&&delete r[t.name]),a;if(a.verified===!1){let l={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_s),t.name&&(delete r[t.name],l.name=t.name)),l}return{verified:!0,result:r}}if(t.primitiveSchema&&kV in e.valueBlock){let i=mg(e.valueBlock.valueHexView);if(i.offset===-1){let a={verified:!1,result:i.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_s),t.name&&(delete r[t.name],a.name=t.name)),a}return Ie(r,i.result,t.primitiveSchema)}return{verified:!0,result:r}}o(Ie,"compareSchema");var Un=class r{static{o(this,"ByteStream")}constructor(e={}){if("view"in e)this.fromUint8Array(e.view);else if("buffer"in e)this.fromArrayBuffer(e.buffer);else if("string"in e)this.fromString(e.string);else if("hexstring"in e)this.fromHexString(e.hexstring);else if("length"in e&&e.length>0){if(this.length=e.length,e.stub)for(let t=0;t<this._view.length;t++)this._view[t]=e.stub}else this.length=0}set buffer(e){this._buffer=e,this._view=new Uint8Array(this._buffer)}get buffer(){return this._buffer}set view(e){this._buffer=new ArrayBuffer(e.length),this._view=new Uint8Array(this._buffer),this._view.set(e)}get view(){return this._view}get length(){return this.view.byteLength}set length(e){this._buffer=new ArrayBuffer(e),this._view=new Uint8Array(this._buffer)}clear(){this._buffer=new ArrayBuffer(0),this._view=new Uint8Array(this._buffer)}fromArrayBuffer(e){this._buffer=e,this._view=new Uint8Array(this._buffer)}fromUint8Array(e){this.fromArrayBuffer(new Uint8Array(e).buffer)}fromString(e){let t=e.length;this.length=t;for(let n=0;n<t;n++)this.view[n]=e.charCodeAt(n)}toString(e=0,t=this.view.length-e){let n="";(e>=this.view.length||e<0)&&(e=0),(t>=this.view.length||t<0)&&(t=this.view.length-e);for(let s=e;s<e+t;s++)n+=String.fromCharCode(this.view[s]);return n}fromHexString(e){let t=e.length;this.buffer=new ArrayBuffer(t>>1),this.view=new Uint8Array(this.buffer);let n=new Map;n.set("0",0),n.set("1",1),n.set("2",2),n.set("3",3),n.set("4",4),n.set("5",5),n.set("6",6),n.set("7",7),n.set("8",8),n.set("9",9),n.set("A",10),n.set("a",10),n.set("B",11),n.set("b",11),n.set("C",12),n.set("c",12),n.set("D",13),n.set("d",13),n.set("E",14),n.set("e",14),n.set("F",15),n.set("f",15);let s=0,i=0;for(let a=0;a<t;a++)a%2?(i|=n.get(e.charAt(a)),this.view[s]=i,s++):i=n.get(e.charAt(a))<<4}toHexString(e=0,t=this.view.length-e){let n="";(e>=this.view.length||e<0)&&(e=0),(t>=this.view.length||t<0)&&(t=this.view.length-e);for(let s=e;s<e+t;s++){let i=this.view[s].toString(16).toUpperCase();n=n+(i.length==1?"0":"")+i}return n}copy(e=0,t=this.length-e){if(!e&&!this.length)return new r;if(e<0||e>this.length-1)throw new Error(`Wrong start position: ${e}`);return new r({buffer:this._buffer.slice(e,e+t)})}slice(e=0,t=this.length){if(!e&&!this.length)return new r;if(e<0||e>this.length-1)throw new Error(`Wrong start position: ${e}`);return new r({buffer:this._buffer.slice(e,t)})}realloc(e){let t=new ArrayBuffer(e),n=new Uint8Array(t);e>this._view.length?n.set(this._view):n.set(new Uint8Array(this._buffer,0,e)),this._buffer=t,this._view=new Uint8Array(this._buffer)}append(e){let t=this.length,n=e.length,s=e._view.subarray();this.realloc(t+n),this._view.set(s,t)}insert(e,t=0,n=this.length-t){return t>this.length-1?!1:(n>this.length-t&&(n=this.length-t),n>e.length&&(n=e.length),n==e.length?this._view.set(e._view,t):this._view.set(e._view.subarray(0,n),t),!0)}isEqual(e){if(this.length!=e.length)return!1;for(let t=0;t<e.length;t++)if(this.view[t]!=e.view[t])return!1;return!0}isEqualView(e){if(e.length!=this.view.length)return!1;for(let t=0;t<e.length;t++)if(this.view[t]!=e[t])return!1;return!0}findPattern(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l=e.length;if(l>a)return-1;let f=[];for(let h=0;h<l;h++)f.push(e.view[h]);for(let h=0;h<=a-l;h++){let m=!0,g=u?i-l-h:i+h;for(let w=0;w<l;w++)if(this.view[w+g]!=f[w]){m=!1;break}if(m)return u?i-l-h:i+l+h}return-1}findFirstIn(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l={id:-1,position:u?0:i+a,length:0};for(let f=0;f<e.length;f++){let h=this.findPattern(e[f],i,a,u);if(h!=-1){let m=!1,g=e[f].length;u?h-g>=l.position-l.length&&(m=!0):h-g<=l.position-l.length&&(m=!0),m&&(l.position=h,l.id=f,l.length=g)}}return l}findAllIn(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],u={id:-1,position:s};do{let l=u.position;if(u=this.findFirstIn(e,u.position,i),u.id==-1)break;i-=u.position-l,a.push({id:u.id,position:u.position})}while(!0);return a}findAllPatternIn(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],u=e.length;if(u>i)return-1;let l=Array.from(e.view);for(let f=0;f<=i-u;f++){let h=!0,m=s+f;for(let g=0;g<u;g++)if(this.view[g+m]!=l[g]){h=!1;break}h&&(a.push(s+u+f),f+=u-1)}return a}findFirstNotIn(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l={left:{id:-1,position:i},right:{id:-1,position:0},value:new r},f=a;for(;f>0;){if(l.right=this.findFirstIn(e,u?i-a+f:i+a-f,f,u),l.right.id==-1){a=f,u?i-=a:i=l.left.position,l.value=new r({buffer:this._buffer.slice(i,i+a)});break}if(l.right.position!=(u?l.left.position-e[l.right.id].length:l.left.position+e[l.right.id].length)){u?(i=l.right.position+e[l.right.id].length,a=l.left.position-l.right.position-e[l.right.id].length):(i=l.left.position,a=l.right.position-l.left.position-e[l.right.id].length),l.value=new r({buffer:this._buffer.slice(i,i+a)});break}l.left=l.right,f-=e[l.right.id].length}if(u){let h=l.right;l.right=l.left,l.left=h}return l}findAllNotIn(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],u={left:{id:-1,position:s},right:{id:-1,position:s},value:new r};do{let l=u.right.position;u=this.findFirstNotIn(e,u.right.position,i),i-=u.right.position-l,a.push({left:{id:u.left.id,position:u.left.position},right:{id:u.right.id,position:u.right.position},value:u.value})}while(u.right.id!=-1);return a}findFirstSequence(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l=this.skipNotPatterns(e,i,a,u);if(l==-1)return{position:-1,value:new r};let f=this.skipPatterns(e,l,a-(u?i-l:l-i),u);u?(i=f,a=l-f):(i=l,a=f-l);let h=new r({buffer:this._buffer.slice(i,i+a)});return{position:f,value:h}}findAllSequences(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],u={position:s,value:new r};do{let l=u.position;u=this.findFirstSequence(e,u.position,i),u.position!=-1&&(i-=u.position-l,a.push({position:u.position,value:u.value}))}while(u.position!=-1);return a}findPairedPatterns(e,t,n,s){let i=[];if(e.isEqual(t))return i;let{start:a,length:u}=this.prepareFindParameters(n,s),l=0,f=this.findAllPatternIn(e,a,u);if(!Array.isArray(f)||f.length==0)return i;let h=this.findAllPatternIn(t,a,u);if(!Array.isArray(h)||h.length==0)return i;for(;l<f.length&&h.length!=0;){if(f[0]==h[0]){i.push({left:f[0],right:h[0]}),f.splice(0,1),h.splice(0,1);continue}if(f[l]>h[0])break;for(;f[l]<h[0]&&(l++,!(l>=f.length)););i.push({left:f[l-1],right:h[0]}),f.splice(l-1,1),h.splice(0,1),l=0}return i.sort((m,g)=>m.left-g.left),i}findPairedArrays(e,t,n,s){let{start:i,length:a}=this.prepareFindParameters(n,s),u=[],l=0,f=this.findAllIn(e,i,a);if(f.length==0)return u;let h=this.findAllIn(t,i,a);if(h.length==0)return u;for(;l<f.length&&h.length!=0;){if(f[0].position==h[0].position){u.push({left:f[0],right:h[0]}),f.splice(0,1),h.splice(0,1);continue}if(f[l].position>h[0].position)break;for(;f[l].position<h[0].position&&(l++,!(l>=f.length)););u.push({left:f[l-1],right:h[0]}),f.splice(l-1,1),h.splice(0,1),l=0}return u.sort((m,g)=>m.left.position-g.left.position),u}replacePattern(e,t,n,s,i=null){let a=[],u,l={status:-1,searchPatternPositions:[],replacePatternPositions:[]},{start:f,length:h}=this.prepareFindParameters(n,s);if(i==null){if(a=this.findAllIn([e],f,h),a.length==0)return l}else a=i;l.searchPatternPositions.push(...Array.from(a,y=>y.position));let m=e.length-t.length,g=new ArrayBuffer(this.view.length-a.length*m),w=new Uint8Array(g);for(w.set(new Uint8Array(this.buffer,0,f)),u=0;u<a.length;u++){let y=u==0?f:a[u-1].position;w.set(new Uint8Array(this.buffer,y,a[u].position-e.length-y),y-u*m),w.set(t.view,a[u].position-e.length-u*m),l.replacePatternPositions.push(a[u].position-e.length-u*m)}return u--,w.set(new Uint8Array(this.buffer,a[u].position,this.length-a[u].position),a[u].position-e.length+t.length-u*m),this.buffer=g,this.view=new Uint8Array(this.buffer),l.status=1,l}skipPatterns(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l=i;for(let f=0;f<e.length;f++){let h=e[f].length,m=u?l-h:l,g=!0;for(let w=0;w<h;w++)if(this.view[w+m]!=e[f].view[w]){g=!1;break}if(g){if(f=-1,u){if(l-=h,l<=0)return l}else if(l+=h,l>=i+a)return l}}return l}skipNotPatterns(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l=-1;for(let f=0;f<a;f++){for(let h=0;h<e.length;h++){let m=e[h].length,g=u?i-f-m:i+f,w=!0;for(let y=0;y<m;y++)if(this.view[y+g]!=e[h].view[y]){w=!1;break}if(w){l=u?i-f:i+f;break}}if(l!=-1)break}return l}prepareFindParameters(e=null,t=null,n=!1){return e===null&&(e=n?this.length:0),e>this.length&&(e=this.length),n?(t===null&&(t=e),t>e&&(t=e)):(t===null&&(t=this.length-e),t>this.length-e&&(t=this.length-e)),{start:e,length:t,backward:n}}};var kre=16777216,Io=class r{static{o(this,"SeqStream")}constructor(e={}){this._stream=new Un,this._length=0,this._start=0,this.backward=!1,this.appendBlock=0,this.prevLength=0,this.prevStart=0,"view"in e?this.stream=new Un({view:e.view}):"buffer"in e?this.stream=new Un({buffer:e.buffer}):"string"in e?this.stream=new Un({string:e.string}):"hexstring"in e?this.stream=new Un({hexstring:e.hexstring}):"stream"in e?this.stream=e.stream.slice():this.stream=new Un,"backward"in e&&e.backward&&(this.backward=e.backward,this._start=this.stream.length),"length"in e&&e.length>0&&(this._length=e.length),"start"in e&&e.start&&e.start>0&&(this._start=e.start),"appendBlock"in e&&e.appendBlock&&e.appendBlock>0&&(this.appendBlock=e.appendBlock)}set stream(e){this._stream=e,this.prevLength=this._length,this._length=e.length,this.prevStart=this._start,this._start=0}get stream(){return this._stream}set length(e){this.prevLength=this._length,this._length=e}get length(){return this.appendBlock?this.start:this._length}set start(e){e>this.stream.length||(this.prevStart=this._start,this.prevLength=this._length,this._length-=this.backward?this._start-e:e-this._start,this._start=e)}get start(){return this._start}get buffer(){return this._stream.buffer.slice(0,this._length)}resetPosition(){this._start=this.prevStart,this._length=this.prevLength}findPattern(e,t=null){(t==null||t>this.length)&&(t=this.length);let n=this.stream.findPattern(e,this.start,this.length,this.backward);if(n==-1)return n;if(this.backward){if(n<this.start-e.length-t)return-1}else if(n>this.start+e.length+t)return-1;return this.start=n,n}findFirstIn(e,t=null){(t==null||t>this.length)&&(t=this.length);let n=this.stream.findFirstIn(e,this.start,this.length,this.backward);if(n.id==-1)return n;if(this.backward){if(n.position<this.start-e[n.id].length-t)return{id:-1,position:this.backward?0:this.start+this.length}}else if(n.position>this.start+e[n.id].length+t)return{id:-1,position:this.backward?0:this.start+this.length};return this.start=n.position,n}findAllIn(e){let t=this.backward?this.start-this.length:this.start;return this.stream.findAllIn(e,t,this.length)}findFirstNotIn(e,t=null){(t==null||t>this._length)&&(t=this._length);let n=this._stream.findFirstNotIn(e,this._start,this._length,this.backward);if(n.left.id==-1&&n.right.id==-1)return n;if(this.backward){if(n.right.id!=-1&&n.right.position<this._start-e[n.right.id].length-t)return{left:{id:-1,position:this._start},right:{id:-1,position:0},value:new Un}}else if(n.left.id!=-1&&n.left.position>this._start+e[n.left.id].length+t)return{left:{id:-1,position:this._start},right:{id:-1,position:0},value:new Un};return this.backward?n.left.id==-1?this.start=0:this.start=n.left.position:n.right.id==-1?this.start=this._start+this._length:this.start=n.right.position,n}findAllNotIn(e){let t=this.backward?this._start-this._length:this._start;return this._stream.findAllNotIn(e,t,this._length)}findFirstSequence(e,t=null,n=null){(t==null||t>this._length)&&(t=this._length),(n==null||n>t)&&(n=t);let s=this._stream.findFirstSequence(e,this._start,t,this.backward);if(s.value.length==0)return s;if(this.backward){if(s.position<this._start-s.value.length-n)return{position:-1,value:new Un}}else if(s.position>this._start+s.value.length+n)return{position:-1,value:new Un};return this.start=s.position,s}findAllSequences(e){let t=this.backward?this.start-this.length:this.start;return this.stream.findAllSequences(e,t,this.length)}findPairedPatterns(e,t,n=null){(n==null||n>this.length)&&(n=this.length);let s=this.backward?this.start-this.length:this.start,i=this.stream.findPairedPatterns(e,t,s,this.length);if(i.length){if(this.backward){if(i[0].right<this.start-t.length-n)return[]}else if(i[0].left>this.start+e.length+n)return[]}return i}findPairedArrays(e,t,n=null){(n==null||n>this.length)&&(n=this.length);let s=this.backward?this.start-this.length:this.start,i=this.stream.findPairedArrays(e,t,s,this.length);if(i.length){if(this.backward){if(i[0].right.position<this.start-t[i[0].right.id].length-n)return[]}else if(i[0].left.position>this.start+e[i[0].left.id].length+n)return[]}return i}replacePattern(e,t){let n=this.backward?this.start-this.length:this.start;return this.stream.replacePattern(e,t,n,this.length)}skipPatterns(e){let t=this.stream.skipPatterns(e,this.start,this.length,this.backward);return this.start=t,t}skipNotPatterns(e){let t=this.stream.skipNotPatterns(e,this.start,this.length,this.backward);return t==-1?-1:(this.start=t,t)}append(e){this.beforeAppend(e.length),this._stream.view.set(e.view,this._start),this._length+=e.length*2,this.start=this._start+e.length,this.prevLength-=e.length*2}appendView(e){this.beforeAppend(e.length),this._stream.view.set(e,this._start),this._length+=e.length*2,this.start=this._start+e.length,this.prevLength-=e.length*2}appendChar(e){this.beforeAppend(1),this._stream.view[this._start]=e,this._length+=2,this.start=this._start+1,this.prevLength-=2}appendUint16(e){this.beforeAppend(2);let t=new Uint16Array([e]),n=new Uint8Array(t.buffer);this.stream.view[this._start]=n[1],this._stream.view[this._start+1]=n[0],this._length+=4,this.start=this._start+2,this.prevLength-=4}appendUint24(e){this.beforeAppend(3);let t=new Uint32Array([e]),n=new Uint8Array(t.buffer);this._stream.view[this._start]=n[2],this._stream.view[this._start+1]=n[1],this._stream.view[this._start+2]=n[0],this._length+=6,this.start=this._start+3,this.prevLength-=6}appendUint32(e){this.beforeAppend(4);let t=new Uint32Array([e]),n=new Uint8Array(t.buffer);this._stream.view[this._start]=n[3],this._stream.view[this._start+1]=n[2],this._stream.view[this._start+2]=n[1],this._stream.view[this._start+3]=n[0],this._length+=8,this.start=this._start+4,this.prevLength-=8}appendInt16(e){this.beforeAppend(2);let t=new Int16Array([e]),n=new Uint8Array(t.buffer);this._stream.view[this._start]=n[1],this._stream.view[this._start+1]=n[0],this._length+=4,this.start=this._start+2,this.prevLength-=4}appendInt32(e){this.beforeAppend(4);let t=new Int32Array([e]),n=new Uint8Array(t.buffer);this._stream.view[this._start]=n[3],this._stream.view[this._start+1]=n[2],this._stream.view[this._start+2]=n[1],this._stream.view[this._start+3]=n[0],this._length+=8,this.start=this._start+4,this.prevLength-=8}getBlock(e,t=!0){if(this._length<=0)return new Uint8Array(0);this._length<e&&(e=this._length);let n;if(this.backward){let s=this._stream.view.subarray(this._length-e,this._length);n=new Uint8Array(e);for(let i=0;i<e;i++)n[e-1-i]=s[i]}else n=this._stream.view.subarray(this._start,this._start+e);return t&&(this.start+=this.backward?-1*e:e),n}getUint16(e=!0){let t=this.getBlock(2,e);return t.length<2?0:t[0]<<8|t[1]}getInt16(e=!0){let t=this.getUint16(e),n=32768;return t&n?-(n-(t^n)):t}getUint24(e=!0){let t=this.getBlock(4,e);return t.length<3?0:t[0]<<16|t[1]<<8|t[2]}getUint32(e=!0){let t=this.getBlock(4,e);return t.length<4?0:t[0]*kre+(t[1]<<16)+(t[2]<<8)+t[3]}getInt32(e=!0){let t=this.getUint32(e),n=2147483648;return t&n?-(n-(t^n)):t}beforeAppend(e){this._start+e>this._stream.length&&(e>this.appendBlock&&(this.appendBlock=e+r.APPEND_BLOCK),this._stream.realloc(this._stream.length+this.appendBlock))}};Io.APPEND_BLOCK=1e3;function Vre(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}o(Vre,"isBytes");function XT(r,...e){if(!Vre(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${r.length}`)}o(XT,"bytes");function GT(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}o(GT,"exists");function j6(r,e){XT(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}o(j6,"output");var OE=o(r=>new DataView(r.buffer,r.byteOffset,r.byteLength),"createView"),Ji=o((r,e)=>r<<32-e|r>>>e,"rotr"),kE=o((r,e)=>r<<e|r>>>32-e>>>0,"rotl"),o1e=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Ure(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}o(Ure,"utf8ToBytes");function WT(r){return typeof r=="string"&&(r=Ure(r)),XT(r),r}o(WT,"toBytes");var PE=class{static{o(this,"Hash")}clone(){return this._cloneInto()}},u1e={}.toString;function Lc(r){let e=o(n=>r().update(WT(n)).digest(),"hashC"),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}o(Lc,"wrapConstructor");function Mre(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let s=BigInt(32),i=BigInt(4294967295),a=Number(t>>s&i),u=Number(t&i),l=n?4:0,f=n?0:4;r.setUint32(e+l,a,n),r.setUint32(e+f,u,n)}o(Mre,"setBigUint64");var LE=o((r,e,t)=>r&e^~r&t,"Chi"),VE=o((r,e,t)=>r&e^r&t^e&t,"Maj"),Yu=class extends PE{static{o(this,"HashMD")}constructor(e,t,n,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=OE(this.buffer)}update(e){GT(this);let{view:t,buffer:n,blockLen:s}=this;e=WT(e);let i=e.length;for(let a=0;a<i;){let u=Math.min(s-this.pos,i-a);if(u===s){let l=OE(e);for(;s<=i-a;a+=s)this.process(l,a);continue}n.set(e.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){GT(this),j6(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:s,isLE:i}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(n,0),a=0);for(let m=a;m<s;m++)t[m]=0;Mre(n,s-8,BigInt(this.length*8),i),this.process(n,0);let u=OE(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let f=l/4,h=this.get();if(f>h.length)throw new Error("_sha2: outputLen bigger than state");for(let m=0;m<f;m++)u.setUint32(4*m,h[m],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:s,finished:i,destroyed:a,pos:u}=this;return e.length=s,e.pos=u,e.finished=i,e.destroyed=a,s%t&&e.buffer.set(n),e}};var wg=new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),Qu=new Uint32Array(80),jre=class extends Yu{static{o(this,"SHA1")}constructor(){super(64,20,8,!1),this.A=wg[0]|0,this.B=wg[1]|0,this.C=wg[2]|0,this.D=wg[3]|0,this.E=wg[4]|0}get(){let{A:e,B:t,C:n,D:s,E:i}=this;return[e,t,n,s,i]}set(e,t,n,s,i){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=i|0}process(e,t){for(let l=0;l<16;l++,t+=4)Qu[l]=e.getUint32(t,!1);for(let l=16;l<80;l++)Qu[l]=kE(Qu[l-3]^Qu[l-8]^Qu[l-14]^Qu[l-16],1);let{A:n,B:s,C:i,D:a,E:u}=this;for(let l=0;l<80;l++){let f,h;l<20?(f=LE(s,i,a),h=1518500249):l<40?(f=s^i^a,h=1859775393):l<60?(f=VE(s,i,a),h=2400959708):(f=s^i^a,h=3395469782);let m=kE(n,5)+f+u+h+Qu[l]|0;u=a,a=i,i=kE(s,30),s=n,n=m}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,a=a+this.D|0,u=u+this.E|0,this.set(n,s,i,a,u)}roundClean(){Qu.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}},F6=Lc(()=>new jre);var Fre=new Uint32Array([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]),Zu=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),el=new Uint32Array(64),qre=class extends Yu{static{o(this,"SHA256")}constructor(){super(64,32,8,!1),this.A=Zu[0]|0,this.B=Zu[1]|0,this.C=Zu[2]|0,this.D=Zu[3]|0,this.E=Zu[4]|0,this.F=Zu[5]|0,this.G=Zu[6]|0,this.H=Zu[7]|0}get(){let{A:e,B:t,C:n,D:s,E:i,F:a,G:u,H:l}=this;return[e,t,n,s,i,a,u,l]}set(e,t,n,s,i,a,u,l){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=i|0,this.F=a|0,this.G=u|0,this.H=l|0}process(e,t){for(let m=0;m<16;m++,t+=4)el[m]=e.getUint32(t,!1);for(let m=16;m<64;m++){let g=el[m-15],w=el[m-2],y=Ji(g,7)^Ji(g,18)^g>>>3,S=Ji(w,17)^Ji(w,19)^w>>>10;el[m]=S+el[m-7]+y+el[m-16]|0}let{A:n,B:s,C:i,D:a,E:u,F:l,G:f,H:h}=this;for(let m=0;m<64;m++){let g=Ji(u,6)^Ji(u,11)^Ji(u,25),w=h+g+LE(u,l,f)+Fre[m]+el[m]|0,S=(Ji(n,2)^Ji(n,13)^Ji(n,22))+VE(n,s,i)|0;h=f,f=l,l=u,u=a+w|0,a=i,i=s,s=n,n=w+S|0}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,a=a+this.D|0,u=u+this.E|0,l=l+this.F|0,f=f+this.G|0,h=h+this.H|0,this.set(n,s,i,a,u,l,f,h)}roundClean(){el.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var JT=Lc(()=>new qre);var UE=BigInt(4294967295),zT=BigInt(32);function q6(r,e=!1){return e?{h:Number(r&UE),l:Number(r>>zT&UE)}:{h:Number(r>>zT&UE)|0,l:Number(r&UE)|0}}o(q6,"fromBig");function Hre(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let s=0;s<r.length;s++){let{h:i,l:a}=q6(r[s],e);[t[s],n[s]]=[i,a]}return[t,n]}o(Hre,"split");var Kre=o((r,e)=>BigInt(r>>>0)<<zT|BigInt(e>>>0),"toBig"),$re=o((r,e,t)=>r>>>t,"shrSH"),Xre=o((r,e,t)=>r<<32-t|e>>>t,"shrSL"),Gre=o((r,e,t)=>r>>>t|e<<32-t,"rotrSH"),Wre=o((r,e,t)=>r<<32-t|e>>>t,"rotrSL"),Jre=o((r,e,t)=>r<<64-t|e>>>t-32,"rotrBH"),zre=o((r,e,t)=>r>>>t-32|e<<64-t,"rotrBL"),Yre=o((r,e)=>e,"rotr32H"),Qre=o((r,e)=>r,"rotr32L"),Zre=o((r,e,t)=>r<<t|e>>>32-t,"rotlSH"),ene=o((r,e,t)=>e<<t|r>>>32-t,"rotlSL"),tne=o((r,e,t)=>e<<t-32|r>>>64-t,"rotlBH"),rne=o((r,e,t)=>r<<t-32|e>>>64-t,"rotlBL");function nne(r,e,t,n){let s=(e>>>0)+(n>>>0);return{h:r+t+(s/2**32|0)|0,l:s|0}}o(nne,"add");var sne=o((r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0),"add3L"),ine=o((r,e,t,n)=>e+t+n+(r/2**32|0)|0,"add3H"),ane=o((r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0),"add4L"),one=o((r,e,t,n,s)=>e+t+n+s+(r/2**32|0)|0,"add4H"),une=o((r,e,t,n,s)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0),"add5L"),lne=o((r,e,t,n,s,i)=>e+t+n+s+i+(r/2**32|0)|0,"add5H");var cne={fromBig:q6,split:Hre,toBig:Kre,shrSH:$re,shrSL:Xre,rotrSH:Gre,rotrSL:Wre,rotrBH:Jre,rotrBL:zre,rotr32H:Yre,rotr32L:Qre,rotlSH:Zre,rotlSL:ene,rotlBH:tne,rotlBL:rne,add:nne,add3L:sne,add3H:ine,add4L:ane,add4H:one,add5H:lne,add5L:une},Ht=cne;var[fne,hne]=Ht.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),tl=new Uint32Array(80),rl=new Uint32Array(80),ME=class extends Yu{static{o(this,"SHA512")}constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:n,Bl:s,Ch:i,Cl:a,Dh:u,Dl:l,Eh:f,El:h,Fh:m,Fl:g,Gh:w,Gl:y,Hh:S,Hl:E}=this;return[e,t,n,s,i,a,u,l,f,h,m,g,w,y,S,E]}set(e,t,n,s,i,a,u,l,f,h,m,g,w,y,S,E){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=s|0,this.Ch=i|0,this.Cl=a|0,this.Dh=u|0,this.Dl=l|0,this.Eh=f|0,this.El=h|0,this.Fh=m|0,this.Fl=g|0,this.Gh=w|0,this.Gl=y|0,this.Hh=S|0,this.Hl=E|0}process(e,t){for(let A=0;A<16;A++,t+=4)tl[A]=e.getUint32(t),rl[A]=e.getUint32(t+=4);for(let A=16;A<80;A++){let C=tl[A-15]|0,x=rl[A-15]|0,B=Ht.rotrSH(C,x,1)^Ht.rotrSH(C,x,8)^Ht.shrSH(C,x,7),F=Ht.rotrSL(C,x,1)^Ht.rotrSL(C,x,8)^Ht.shrSL(C,x,7),R=tl[A-2]|0,H=rl[A-2]|0,q=Ht.rotrSH(R,H,19)^Ht.rotrBH(R,H,61)^Ht.shrSH(R,H,6),K=Ht.rotrSL(R,H,19)^Ht.rotrBL(R,H,61)^Ht.shrSL(R,H,6),G=Ht.add4L(F,K,rl[A-7],rl[A-16]),he=Ht.add4H(G,B,q,tl[A-7],tl[A-16]);tl[A]=he|0,rl[A]=G|0}let{Ah:n,Al:s,Bh:i,Bl:a,Ch:u,Cl:l,Dh:f,Dl:h,Eh:m,El:g,Fh:w,Fl:y,Gh:S,Gl:E,Hh:b,Hl:T}=this;for(let A=0;A<80;A++){let C=Ht.rotrSH(m,g,14)^Ht.rotrSH(m,g,18)^Ht.rotrBH(m,g,41),x=Ht.rotrSL(m,g,14)^Ht.rotrSL(m,g,18)^Ht.rotrBL(m,g,41),B=m&w^~m&S,F=g&y^~g&E,R=Ht.add5L(T,x,F,hne[A],rl[A]),H=Ht.add5H(R,b,C,B,fne[A],tl[A]),q=R|0,K=Ht.rotrSH(n,s,28)^Ht.rotrBH(n,s,34)^Ht.rotrBH(n,s,39),G=Ht.rotrSL(n,s,28)^Ht.rotrBL(n,s,34)^Ht.rotrBL(n,s,39),he=n&i^n&u^i&u,le=s&a^s&l^a&l;b=S|0,T=E|0,S=w|0,E=y|0,w=m|0,y=g|0,{h:m,l:g}=Ht.add(f|0,h|0,H|0,q|0),f=u|0,h=l|0,u=i|0,l=a|0,i=n|0,a=s|0;let oe=Ht.add3L(q,G,le);n=Ht.add3H(oe,H,K,he),s=oe|0}({h:n,l:s}=Ht.add(this.Ah|0,this.Al|0,n|0,s|0)),{h:i,l:a}=Ht.add(this.Bh|0,this.Bl|0,i|0,a|0),{h:u,l}=Ht.add(this.Ch|0,this.Cl|0,u|0,l|0),{h:f,l:h}=Ht.add(this.Dh|0,this.Dl|0,f|0,h|0),{h:m,l:g}=Ht.add(this.Eh|0,this.El|0,m|0,g|0),{h:w,l:y}=Ht.add(this.Fh|0,this.Fl|0,w|0,y|0),{h:S,l:E}=Ht.add(this.Gh|0,this.Gl|0,S|0,E|0),{h:b,l:T}=Ht.add(this.Hh|0,this.Hl|0,b|0,T|0),this.set(n,s,i,a,u,l,f,h,m,g,w,y,S,E,b,T)}roundClean(){tl.fill(0),rl.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var pne=class extends ME{static{o(this,"SHA384")}constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},YT=Lc(()=>new ME);var QT=Lc(()=>new pne);var Qr=new ArrayBuffer(0),L="",Er=class II extends TypeError{static{o(this,"ArgumentError")}constructor(){super(...arguments),this.name=II.NAME}static isType(e,t){if(typeof t=="string"){if(t==="Array"&&Array.isArray(e))return!0;if(t==="ArrayBuffer"&&e instanceof ArrayBuffer)return!0;if(t==="ArrayBufferView"&&ArrayBuffer.isView(e))return!0;if(typeof e===t)return!0}else if(e instanceof t)return!0;return!1}static assert(e,t,...n){for(let i of n)if(this.isType(e,i))return;let s=n.map(i=>i instanceof Function&&"name"in i?i.name:`${i}`);throw new II(`Parameter '${t}' is not of type ${s.length>1?`(${s.join(" or ")})`:s[0]}`)}};Er.NAME="ArgumentError";var fr=class hA extends TypeError{static{o(this,"ParameterError")}static assert(...e){let t=null,n,s;typeof e[0]=="string"?(t=e[0],n=e[1],s=e.slice(2)):(n=e[0],s=e.slice(1)),Er.assert(n,"parameters","object");for(let i of s){let a=n[i];if(a==null)throw new hA(i,t)}}static assertEmpty(e,t,n){if(e==null)throw new hA(t,n)}constructor(e,t=null,n){super(),this.name=hA.NAME,this.field=e,t&&(this.target=t),n?this.message=n:this.message=`Absent mandatory parameter '${e}' ${t?` in '${t}'`:L}`}};fr.NAME="ParameterError";var Ae=class pU extends Error{static{o(this,"AsnError")}static assertSchema(e,t){if(!e.verified)throw new Error(`Object's schema was not verified against input data for ${t}`)}static assert(e,t){if(e.offset===-1)throw new pU(`Error during parsing of ASN.1 data. Data is not correct for '${t}'.`)}constructor(e){super(e),this.name="AsnError"}},Be=class{static{o(this,"PkiObject")}static blockName(){return this.CLASS_NAME}static fromBER(e){let t=Hr(e);Ae.assert(t,this.name);try{return new this({schema:t.result})}catch{throw new Ae(`Cannot create '${this.CLASS_NAME}' from ASN.1 object`)}}static defaultValues(e){throw new Error(`Invalid member name for ${this.CLASS_NAME} class: ${e}`)}static schema(e={}){throw new Error(`Method '${this.CLASS_NAME}.schema' should be overridden`)}get className(){return this.constructor.CLASS_NAME}toString(e="hex"){let t;try{t=this.toSchema()}catch{t=this.toSchema(!0)}return Ct.ToString(t.toBER(),e)}};Be.CLASS_NAME="PkiObject";function Jl(r){let e=!1,t=L,n=r.trim();for(let s=0;s<n.length;s++)n.charCodeAt(s)===32?e===!1&&(e=!0):(e&&(t+=" ",e=!1),t+=n[s]);return t.toLowerCase()}o(Jl,"stringPrep");var Sg="type",ZT="value",BI=class Pg extends Be{static{o(this,"AttributeTypeAndValue")}constructor(e={}){super(),this.type=D(e,Sg,Pg.defaultValues(Sg)),this.value=D(e,ZT,Pg.defaultValues(ZT)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Sg:return L;case ZT:return{};default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.type||L}),new St({name:t.value||L})]})}fromSchema(e){_e(e,[Sg,"typeValue"]);let t=Ie(e,e,Pg.schema({names:{type:Sg,value:"typeValue"}}));Ae.assertSchema(t,this.className),this.type=t.result.type.valueBlock.toString(),this.value=t.result.typeValue}toSchema(){return new W({value:[new rt({value:this.type}),this.value]})}toJSON(){let e={type:this.type};return Object.keys(this.value).length!==0?e.value=this.value.toJSON():e.value=this.value,e}isEqual(e){let t=[xi.blockName(),Bp.blockName(),Dp.blockName(),Oc.blockName(),Ni.blockName(),_p.blockName(),BE.blockName(),gg.blockName(),DE.blockName(),yg.blockName(),_E.blockName(),RE.blockName()];if(e instanceof ArrayBuffer)return dt.isEqual(this.value.valueBeforeDecodeView,e);if(e.constructor.blockName()===Pg.blockName()){if(this.type!==e.type)return!1;let n=[!1,!1],s=this.value.constructor.blockName();for(let a of t)s===a&&(n[0]=!0),e.value.constructor.blockName()===a&&(n[1]=!0);if(n[0]!==n[1])return!1;if(n[0]&&n[1]){let a=Jl(this.value.valueBlock.value),u=Jl(e.value.valueBlock.value);if(a.localeCompare(u)!==0)return!1}else if(!dt.isEqual(this.value.valueBeforeDecodeView,e.value.valueBeforeDecodeView))return!1;return!0}return!1}};BI.CLASS_NAME="AttributeTypeAndValue";var Vc="typesAndValues",jE="valueBeforeDecode",H6="RDN",Or=class Og extends Be{static{o(this,"RelativeDistinguishedNames")}constructor(e={}){super(),this.typesAndValues=D(e,Vc,Og.defaultValues(Vc)),this.valueBeforeDecode=D(e,jE,Og.defaultValues(jE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Vc:return[];case jE:return Qr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Vc:return t.length===0;case jE:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.repeatedSequence||L,value:new $r({value:[new Tt({name:t.repeatedSet||L,value:BI.schema(t.typeAndValue||{})})]})})]})}fromSchema(e){_e(e,[H6,Vc]);let t=Ie(e,e,Og.schema({names:{blockName:H6,repeatedSet:Vc}}));Ae.assertSchema(t,this.className),Vc in t.result&&(this.typesAndValues=Array.from(t.result.typesAndValues,n=>new BI({schema:n}))),this.valueBeforeDecode=t.result.RDN.valueBeforeDecodeView.slice().buffer}toSchema(){if(this.valueBeforeDecode.byteLength===0)return new W({value:[new $r({value:Array.from(this.typesAndValues,t=>t.toSchema())})]});let e=Hr(this.valueBeforeDecode);if(Ae.assert(e,"RelativeDistinguishedNames"),!(e.result instanceof W))throw new Error("ASN.1 result should be SEQUENCE");return e.result}toJSON(){return{typesAndValues:Array.from(this.typesAndValues,e=>e.toJSON())}}isEqual(e){if(e instanceof Og){if(this.typesAndValues.length!==e.typesAndValues.length)return!1;for(let[t,n]of this.typesAndValues.entries())if(n.isEqual(e.typesAndValues[t])===!1)return!1;return!0}return e instanceof ArrayBuffer?Wu(this.valueBeforeDecode,e):!1}};Or.CLASS_NAME="RelativeDistinguishedNames";var kg="type",Lg="value";function dne(r={},e=!1){let t=D(r,"names",{});return new W({optional:e,value:[new ae({optional:!0,idBlock:{tagClass:2,tagNumber:1},name:t.country_name||L,value:[new Pr({value:[new Oc,new Ni]})]}),new ae({optional:!0,idBlock:{tagClass:2,tagNumber:2},name:t.administration_domain_name||L,value:[new Pr({value:[new Oc,new Ni]})]}),new yt({optional:!0,idBlock:{tagClass:3,tagNumber:0},name:t.network_address||L,isHexOnly:!0}),new yt({optional:!0,idBlock:{tagClass:3,tagNumber:1},name:t.terminal_identifier||L,isHexOnly:!0}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:2},name:t.private_domain_name||L,value:[new Pr({value:[new Oc,new Ni]})]}),new yt({optional:!0,idBlock:{tagClass:3,tagNumber:3},name:t.organization_name||L,isHexOnly:!0}),new yt({optional:!0,name:t.numeric_user_identifier||L,idBlock:{tagClass:3,tagNumber:4},isHexOnly:!0}),new ae({optional:!0,name:t.personal_name||L,idBlock:{tagClass:3,tagNumber:5},value:[new yt({idBlock:{tagClass:3,tagNumber:0},isHexOnly:!0}),new yt({optional:!0,idBlock:{tagClass:3,tagNumber:1},isHexOnly:!0}),new yt({optional:!0,idBlock:{tagClass:3,tagNumber:2},isHexOnly:!0}),new yt({optional:!0,idBlock:{tagClass:3,tagNumber:3},isHexOnly:!0})]}),new ae({optional:!0,name:t.organizational_unit_names||L,idBlock:{tagClass:3,tagNumber:6},value:[new Tt({value:new Ni})]})]})}o(dne,"builtInStandardAttributes");function mne(r=!1){return new W({optional:r,value:[new Ni,new Ni]})}o(mne,"builtInDomainDefinedAttributes");function gne(r=!1){return new $r({optional:r,value:[new yt({optional:!0,idBlock:{tagClass:3,tagNumber:0},isHexOnly:!0}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new St]})]})}o(gne,"extensionAttributes");var Ar=class Mp extends Be{static{o(this,"GeneralName")}constructor(e={}){super(),this.type=D(e,kg,Mp.defaultValues(kg)),this.value=D(e,Lg,Mp.defaultValues(Lg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case kg:return 9;case Lg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case kg:return t===Mp.defaultValues(e);case Lg:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Pr({value:[new ae({idBlock:{tagClass:3,tagNumber:0},name:t.blockName||L,value:[new rt,new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St]})]}),new yt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:1}}),new yt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:2}}),new ae({idBlock:{tagClass:3,tagNumber:3},name:t.blockName||L,value:[dne(t.builtInStandardAttributes||{},!1),mne(!0),gne(!0)]}),new ae({idBlock:{tagClass:3,tagNumber:4},name:t.blockName||L,value:[Or.schema(t.directoryName||{})]}),new ae({idBlock:{tagClass:3,tagNumber:5},name:t.blockName||L,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Pr({value:[new _p,new Ni,new Dp,new xi,new Bp]})]}),new ae({idBlock:{tagClass:3,tagNumber:1},value:[new Pr({value:[new _p,new Ni,new Dp,new xi,new Bp]})]})]}),new yt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:6}}),new yt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:7}}),new yt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:8}})]})}fromSchema(e){_e(e,["blockName","otherName","rfc822Name","dNSName","x400Address","directoryName","ediPartyName","uniformResourceIdentifier","iPAddress","registeredID"]);let t=Ie(e,e,Mp.schema({names:{blockName:"blockName",otherName:"otherName",rfc822Name:"rfc822Name",dNSName:"dNSName",x400Address:"x400Address",directoryName:{names:{blockName:"directoryName"}},ediPartyName:"ediPartyName",uniformResourceIdentifier:"uniformResourceIdentifier",iPAddress:"iPAddress",registeredID:"registeredID"}}));switch(Ae.assertSchema(t,this.className),this.type=t.result.blockName.idBlock.tagNumber,this.type){case 0:this.value=t.result.blockName;break;case 1:case 2:case 6:{let n=t.result.blockName;n.idBlock.tagClass=1,n.idBlock.tagNumber=22;let s=n.toBER(!1),i=Hr(s);Ae.assert(i,"GeneralName value"),this.value=i.result.valueBlock.value}break;case 3:this.value=t.result.blockName;break;case 4:this.value=new Or({schema:t.result.directoryName});break;case 5:this.value=t.result.ediPartyName;break;case 7:this.value=new Ve({valueHex:t.result.blockName.valueBlock.valueHex});break;case 8:{let n=t.result.blockName;n.idBlock.tagClass=1,n.idBlock.tagNumber=6;let s=n.toBER(!1),i=Hr(s);Ae.assert(i,"GeneralName registeredID"),this.value=i.result.valueBlock.toString()}break}}toSchema(){switch(this.type){case 0:case 3:case 5:return new ae({idBlock:{tagClass:3,tagNumber:this.type},value:[this.value]});case 1:case 2:case 6:{let e=new gg({value:this.value});return e.idBlock.tagClass=3,e.idBlock.tagNumber=this.type,e}case 4:return new ae({idBlock:{tagClass:3,tagNumber:4},value:[this.value.toSchema()]});case 7:{let e=this.value;return e.idBlock.tagClass=3,e.idBlock.tagNumber=this.type,e}case 8:{let e=new rt({value:this.value});return e.idBlock.tagClass=3,e.idBlock.tagNumber=this.type,e}default:return Mp.schema()}}toJSON(){let e={type:this.type,value:L};if(typeof this.value=="string")e.value=this.value;else try{e.value=this.value.toJSON()}catch{}return e}};Ar.CLASS_NAME="GeneralName";var Vg="accessMethod",Ug="accessLocation",yne=[Vg,Ug],DI=class pA extends Be{static{o(this,"AccessDescription")}constructor(e={}){super(),this.accessMethod=D(e,Vg,pA.defaultValues(Vg)),this.accessLocation=D(e,Ug,pA.defaultValues(Ug)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Vg:return L;case Ug:return new Ar;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.accessMethod||L}),Ar.schema(t.accessLocation||{})]})}fromSchema(e){_e(e,yne);let t=Ie(e,e,pA.schema({names:{accessMethod:Vg,accessLocation:{names:{blockName:Ug}}}}));Ae.assertSchema(t,this.className),this.accessMethod=t.result.accessMethod.valueBlock.toString(),this.accessLocation=new Ar({schema:t.result.accessLocation})}toSchema(){return new W({value:[new rt({value:this.accessMethod}),this.accessLocation.toSchema()]})}toJSON(){return{accessMethod:this.accessMethod,accessLocation:this.accessLocation.toJSON()}}};DI.CLASS_NAME="AccessDescription";var sl="seconds",il="millis",al="micros",Fc=class jp extends Be{static{o(this,"Accuracy")}constructor(e={}){super(),sl in e&&(this.seconds=D(e,sl,jp.defaultValues(sl))),il in e&&(this.millis=D(e,il,jp.defaultValues(il))),al in e&&(this.micros=D(e,al,jp.defaultValues(al))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case sl:case il:case al:return 0;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case sl:case il:case al:return t===jp.defaultValues(e);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,optional:!0,value:[new me({optional:!0,name:t.seconds||L}),new yt({name:t.millis||L,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new yt({name:t.micros||L,optional:!0,idBlock:{tagClass:3,tagNumber:1}})]})}fromSchema(e){_e(e,[sl,il,al]);let t=Ie(e,e,jp.schema({names:{seconds:sl,millis:il,micros:al}}));if(Ae.assertSchema(t,this.className),"seconds"in t.result&&(this.seconds=t.result.seconds.valueBlock.valueDec),"millis"in t.result){let n=new me({valueHex:t.result.millis.valueBlock.valueHex});this.millis=n.valueBlock.valueDec}if("micros"in t.result){let n=new me({valueHex:t.result.micros.valueBlock.valueHex});this.micros=n.valueBlock.valueDec}}toSchema(){let e=[];if(this.seconds!==void 0&&e.push(new me({value:this.seconds})),this.millis!==void 0){let t=new me({value:this.millis});e.push(new yt({idBlock:{tagClass:3,tagNumber:0},valueHex:t.valueBlock.valueHexView}))}if(this.micros!==void 0){let t=new me({value:this.micros});e.push(new yt({idBlock:{tagClass:3,tagNumber:1},valueHex:t.valueBlock.valueHexView}))}return new W({value:e})}toJSON(){let e={};return this.seconds!==void 0&&(e.seconds=this.seconds),this.millis!==void 0&&(e.millis=this.millis),this.micros!==void 0&&(e.micros=this.micros),e}};Fc.CLASS_NAME="Accuracy";var FE="algorithmId",Eg="algorithmParams",dU="algorithm",_I="params",vne=[dU,_I],ge=class Mg extends Be{static{o(this,"AlgorithmIdentifier")}constructor(e={}){super(),this.algorithmId=D(e,FE,Mg.defaultValues(FE)),Eg in e&&(this.algorithmParams=D(e,Eg,Mg.defaultValues(Eg))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case FE:return L;case Eg:return new St;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case FE:return t===L;case Eg:return t instanceof St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,optional:t.optional||!1,value:[new rt({name:t.algorithmIdentifier||L}),new St({name:t.algorithmParams||L,optional:!0})]})}fromSchema(e){_e(e,vne);let t=Ie(e,e,Mg.schema({names:{algorithmIdentifier:dU,algorithmParams:_I}}));Ae.assertSchema(t,this.className),this.algorithmId=t.result.algorithm.valueBlock.toString(),_I in t.result&&(this.algorithmParams=t.result.params)}toSchema(){let e=[];return e.push(new rt({value:this.algorithmId})),this.algorithmParams&&!(this.algorithmParams instanceof St)&&e.push(this.algorithmParams),new W({value:e})}toJSON(){let e={algorithmId:this.algorithmId};return this.algorithmParams&&!(this.algorithmParams instanceof St)&&(e.algorithmParams=this.algorithmParams.toJSON()),e}isEqual(e){return!(e instanceof Mg)||this.algorithmId!==e.algorithmId?!1:this.algorithmParams?e.algorithmParams?JSON.stringify(this.algorithmParams)===JSON.stringify(e.algorithmParams):!1:!e.algorithmParams}};ge.CLASS_NAME="AlgorithmIdentifier";var Fp="altNames",wne=[Fp],RI=class PI extends Be{static{o(this,"AltName")}constructor(e={}){super(),this.altNames=D(e,Fp,PI.defaultValues(Fp)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Fp:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.altNames||L,value:Ar.schema()})]})}fromSchema(e){_e(e,wne);let t=Ie(e,e,PI.schema({names:{altNames:Fp}}));Ae.assertSchema(t,this.className),Fp in t.result&&(this.altNames=Array.from(t.result.altNames,n=>new Ar({schema:n})))}toSchema(){return new W({value:Array.from(this.altNames,e=>e.toSchema())})}toJSON(){return{altNames:Array.from(this.altNames,e=>e.toJSON())}}};RI.CLASS_NAME="AltName";var qp="type",Hp="values",Sne=[qp,Hp],Zr=class dA extends Be{static{o(this,"Attribute")}constructor(e={}){super(),this.type=D(e,qp,dA.defaultValues(qp)),this.values=D(e,Hp,dA.defaultValues(Hp)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case qp:return L;case Hp:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case qp:return t===L;case Hp:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.type||L}),new $r({name:t.setName||L,value:[new Tt({name:t.values||L,value:new St})]})]})}fromSchema(e){_e(e,Sne);let t=Ie(e,e,dA.schema({names:{type:qp,values:Hp}}));Ae.assertSchema(t,this.className),this.type=t.result.type.valueBlock.toString(),this.values=t.result.values}toSchema(){return new W({value:[new rt({value:this.type}),new $r({value:this.values})]})}toJSON(){return{type:this.type,values:Array.from(this.values,e=>e.toJSON())}}};Zr.CLASS_NAME="Attribute";var jg="notBeforeTime",Fg="notAfterTime",Ene=[jg,Fg],nh=class mA extends Be{static{o(this,"AttCertValidityPeriod")}constructor(e={}){super(),this.notBeforeTime=D(e,jg,mA.defaultValues(jg)),this.notAfterTime=D(e,Fg,mA.defaultValues(Fg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case jg:case Fg:return new Date(0,0,0);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Rr({name:t.notBeforeTime||L}),new Rr({name:t.notAfterTime||L})]})}fromSchema(e){_e(e,Ene);let t=Ie(e,e,mA.schema({names:{notBeforeTime:jg,notAfterTime:Fg}}));Ae.assertSchema(t,this.className),this.notBeforeTime=t.result.notBeforeTime.toDate(),this.notAfterTime=t.result.notAfterTime.toDate()}toSchema(){return new W({value:[new Rr({valueDate:this.notBeforeTime}),new Rr({valueDate:this.notAfterTime})]})}toJSON(){return{notBeforeTime:this.notBeforeTime,notAfterTime:this.notAfterTime}}};nh.CLASS_NAME="AttCertValidityPeriod";var Ag="names",K6="generalNames",Mn=class OI extends Be{static{o(this,"GeneralNames")}constructor(e={}){super(),this.names=D(e,Ag,OI.defaultValues(Ag)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case"names":return[];default:return super.defaultValues(e)}}static schema(e={},t=!1){let n=D(e,Ag,{});return new W({optional:t,name:n.blockName||L,value:[new Tt({name:n.generalNames||L,value:Ar.schema()})]})}fromSchema(e){_e(e,[Ag,K6]);let t=Ie(e,e,OI.schema({names:{blockName:Ag,generalNames:K6}}));Ae.assertSchema(t,this.className),this.names=Array.from(t.result.generalNames,n=>new Ar({schema:n}))}toSchema(){return new W({value:Array.from(this.names,e=>e.toSchema())})}toJSON(){return{names:Array.from(this.names,e=>e.toJSON())}}};Mn.CLASS_NAME="GeneralNames";var Ane="2.5.29.9",Cne="2.5.29.14",bne="2.5.29.15",xne="2.5.29.16",mU="2.5.29.17",gU="2.5.29.18",kB="2.5.29.19",Nne="2.5.29.20",Tne="2.5.29.27",Ine="2.5.29.21",Bne="2.5.29.24",yU="2.5.29.28",vU="2.5.29.29",wU="2.5.29.30",SU="2.5.29.31",LB="2.5.29.46",EU="2.5.29.32",Ti="2.5.29.32.0",Dne="1.3.6.1.4.1.311.21.10",AU="2.5.29.33",VB="2.5.29.35",CU="2.5.29.36",_ne="2.5.29.37",Rne="2.5.29.54",UB="1.3.6.1.5.5.7.1.1",Pne="1.3.6.1.5.5.7.1.11",One="1.3.6.1.4.1.11129.2.4.2";var kne="1.3.6.1.4.1.311.21.7",Lne="1.3.6.1.4.1.311.21.1",Vne="1.3.6.1.5.5.7.1.3",MB="1.2.840.113549.1.7.1",bU="1.2.840.113549.1.7.2",xU="1.2.840.113549.1.7.3",NU="1.2.840.113549.1.7.6",Une="1.2.840.113549.1.9.16.1.4",$6="1.2.840.113549.1.9.22.1",Mne="1.2.840.113549.1.9.22.2",X6="1.2.840.113549.1.9.22.3",G6="1.2.840.113549.1.9.23.1",jne="1.3.6.1.5.5.7",jB=`${jne}.48`,gA=`${jB}.1.1`,H1e=`${jB}.2`,K1e=`${jB}.1`;var qc="keyIdentifier",Hc="authorityCertIssuer",Kc="authorityCertSerialNumber",Fne=[qc,Hc,Kc],FB=class qg extends Be{static{o(this,"AuthorityKeyIdentifier")}constructor(e={}){super(),qc in e&&(this.keyIdentifier=D(e,qc,qg.defaultValues(qc))),Hc in e&&(this.authorityCertIssuer=D(e,Hc,qg.defaultValues(Hc))),Kc in e&&(this.authorityCertSerialNumber=D(e,Kc,qg.defaultValues(Kc))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case qc:return new Ve;case Hc:return[];case Kc:return new me;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new yt({name:t.keyIdentifier||L,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Tt({name:t.authorityCertIssuer||L,value:Ar.schema()})]}),new yt({name:t.authorityCertSerialNumber||L,optional:!0,idBlock:{tagClass:3,tagNumber:2}})]})}fromSchema(e){_e(e,Fne);let t=Ie(e,e,qg.schema({names:{keyIdentifier:qc,authorityCertIssuer:Hc,authorityCertSerialNumber:Kc}}));Ae.assertSchema(t,this.className),qc in t.result&&(this.keyIdentifier=new Ve({valueHex:t.result.keyIdentifier.valueBlock.valueHex})),Hc in t.result&&(this.authorityCertIssuer=Array.from(t.result.authorityCertIssuer,n=>new Ar({schema:n}))),Kc in t.result&&(this.authorityCertSerialNumber=new me({valueHex:t.result.authorityCertSerialNumber.valueBlock.valueHex}))}toSchema(){let e=[];return this.keyIdentifier&&e.push(new yt({idBlock:{tagClass:3,tagNumber:0},valueHex:this.keyIdentifier.valueBlock.valueHexView})),this.authorityCertIssuer&&e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.authorityCertIssuer,t=>t.toSchema())})),this.authorityCertSerialNumber&&e.push(new yt({idBlock:{tagClass:3,tagNumber:2},valueHex:this.authorityCertSerialNumber.valueBlock.valueHexView})),new W({value:e})}toJSON(){let e={};return this.keyIdentifier&&(e.keyIdentifier=this.keyIdentifier.toJSON()),this.authorityCertIssuer&&(e.authorityCertIssuer=Array.from(this.authorityCertIssuer,t=>t.toJSON())),this.authorityCertSerialNumber&&(e.authorityCertSerialNumber=this.authorityCertSerialNumber.toJSON()),e}};FB.CLASS_NAME="AuthorityKeyIdentifier";var Uc="pathLenConstraint",Mc="cA",qB=class yA extends Be{static{o(this,"BasicConstraints")}constructor(e={}){super(),this.cA=D(e,Mc,!1),Uc in e&&(this.pathLenConstraint=D(e,Uc,0)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Mc:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Wi({optional:!0,name:t.cA||L}),new me({optional:!0,name:t.pathLenConstraint||L})]})}fromSchema(e){_e(e,[Mc,Uc]);let t=Ie(e,e,yA.schema({names:{cA:Mc,pathLenConstraint:Uc}}));Ae.assertSchema(t,this.className),Mc in t.result&&(this.cA=t.result.cA.valueBlock.value),Uc in t.result&&(t.result.pathLenConstraint.valueBlock.isHexOnly?this.pathLenConstraint=t.result.pathLenConstraint:this.pathLenConstraint=t.result.pathLenConstraint.valueBlock.valueDec)}toSchema(){let e=[];return this.cA!==yA.defaultValues(Mc)&&e.push(new Wi({value:this.cA})),Uc in this&&(this.pathLenConstraint instanceof me?e.push(this.pathLenConstraint):e.push(new me({value:this.pathLenConstraint}))),new W({value:e})}toJSON(){let e={};return this.cA!==yA.defaultValues(Mc)&&(e.cA=this.cA),Uc in this&&(this.pathLenConstraint instanceof me?e.pathLenConstraint=this.pathLenConstraint.toJSON():e.pathLenConstraint=this.pathLenConstraint),e}};qB.CLASS_NAME="BasicConstraints";var eI="certificateIndex",tI="keyIndex",TU=class kI extends Be{static{o(this,"CAVersion")}constructor(e={}){super(),this.certificateIndex=D(e,eI,kI.defaultValues(eI)),this.keyIndex=D(e,tI,kI.defaultValues(tI)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case eI:case tI:return 0;default:return super.defaultValues(e)}}static schema(){return new me}fromSchema(e){if(e.constructor.blockName()!==me.blockName())throw new Error("Object's schema was not verified against input data for CAVersion");let t=e.valueBlock.valueHex.slice(0),n=new Uint8Array(t);switch(!0){case t.byteLength<4:{let m=new ArrayBuffer(4);new Uint8Array(m).set(n,4-t.byteLength),t=m.slice(0)}break;case t.byteLength>4:{let m=new ArrayBuffer(4);new Uint8Array(m).set(n.slice(0,4)),t=m.slice(0)}break}let s=t.slice(0,2),i=new Uint8Array(s),a=i[0];i[0]=i[1],i[1]=a;let u=new Uint16Array(s);this.keyIndex=u[0];let l=t.slice(2),f=new Uint8Array(l);a=f[0],f[0]=f[1],f[1]=a;let h=new Uint16Array(l);this.certificateIndex=h[0]}toSchema(){let e=new ArrayBuffer(2),t=new Uint16Array(e);t[0]=this.certificateIndex;let n=new Uint8Array(e),s=n[0];n[0]=n[1],n[1]=s;let i=new ArrayBuffer(2),a=new Uint16Array(i);a[0]=this.keyIndex;let u=new Uint8Array(i);return s=u[0],u[0]=u[1],u[1]=s,new me({valueHex:_c(i,e)})}toJSON(){return{certificateIndex:this.certificateIndex,keyIndex:this.keyIndex}}};TU.CLASS_NAME="CAVersion";var Hg="policyQualifierId",Kg="qualifier",qne=[Hg,Kg],LI=class vA extends Be{static{o(this,"PolicyQualifierInfo")}constructor(e={}){super(),this.policyQualifierId=D(e,Hg,vA.defaultValues(Hg)),this.qualifier=D(e,Kg,vA.defaultValues(Kg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Hg:return L;case Kg:return new St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.policyQualifierId||L}),new St({name:t.qualifier||L})]})}fromSchema(e){_e(e,qne);let t=Ie(e,e,vA.schema({names:{policyQualifierId:Hg,qualifier:Kg}}));Ae.assertSchema(t,this.className),this.policyQualifierId=t.result.policyQualifierId.valueBlock.toString(),this.qualifier=t.result.qualifier}toSchema(){return new W({value:[new rt({value:this.policyQualifierId}),this.qualifier]})}toJSON(){return{policyQualifierId:this.policyQualifierId,qualifier:this.qualifier.toJSON()}}};LI.CLASS_NAME="PolicyQualifierInfo";var $g="policyIdentifier",$c="policyQualifiers",Hne=[$g,$c],VI=class wA extends Be{static{o(this,"PolicyInformation")}constructor(e={}){super(),this.policyIdentifier=D(e,$g,wA.defaultValues($g)),$c in e&&(this.policyQualifiers=D(e,$c,wA.defaultValues($c))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case $g:return L;case $c:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.policyIdentifier||L}),new W({optional:!0,value:[new Tt({name:t.policyQualifiers||L,value:LI.schema()})]})]})}fromSchema(e){_e(e,Hne);let t=Ie(e,e,wA.schema({names:{policyIdentifier:$g,policyQualifiers:$c}}));Ae.assertSchema(t,this.className),this.policyIdentifier=t.result.policyIdentifier.valueBlock.toString(),$c in t.result&&(this.policyQualifiers=Array.from(t.result.policyQualifiers,n=>new LI({schema:n})))}toSchema(){let e=[];return e.push(new rt({value:this.policyIdentifier})),this.policyQualifiers&&e.push(new W({value:Array.from(this.policyQualifiers,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={policyIdentifier:this.policyIdentifier};return this.policyQualifiers&&(e.policyQualifiers=Array.from(this.policyQualifiers,t=>t.toJSON())),e}};VI.CLASS_NAME="PolicyInformation";var Xg="certificatePolicies",Kne=[Xg],UI=class MI extends Be{static{o(this,"CertificatePolicies")}constructor(e={}){super(),this.certificatePolicies=D(e,Xg,MI.defaultValues(Xg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Xg:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.certificatePolicies||L,value:VI.schema()})]})}fromSchema(e){_e(e,Kne);let t=Ie(e,e,MI.schema({names:{certificatePolicies:Xg}}));Ae.assertSchema(t,this.className),this.certificatePolicies=Array.from(t.result.certificatePolicies,n=>new VI({schema:n}))}toSchema(){return new W({value:Array.from(this.certificatePolicies,e=>e.toSchema())})}toJSON(){return{certificatePolicies:Array.from(this.certificatePolicies,e=>e.toJSON())}}};UI.CLASS_NAME="CertificatePolicies";var Gg="templateID",Do="templateMajorVersion",_o="templateMinorVersion",$ne=[Gg,Do,_o],Xne=class Wg extends Be{static{o(this,"CertificateTemplate")}constructor(e={}){super(),this.templateID=D(e,Gg,Wg.defaultValues(Gg)),Do in e&&(this.templateMajorVersion=D(e,Do,Wg.defaultValues(Do))),_o in e&&(this.templateMinorVersion=D(e,_o,Wg.defaultValues(_o))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Gg:return L;case Do:case _o:return 0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.templateID||L}),new me({name:t.templateMajorVersion||L,optional:!0}),new me({name:t.templateMinorVersion||L,optional:!0})]})}fromSchema(e){_e(e,$ne);let t=Ie(e,e,Wg.schema({names:{templateID:Gg,templateMajorVersion:Do,templateMinorVersion:_o}}));Ae.assertSchema(t,this.className),this.templateID=t.result.templateID.valueBlock.toString(),Do in t.result&&(this.templateMajorVersion=t.result.templateMajorVersion.valueBlock.valueDec),_o in t.result&&(this.templateMinorVersion=t.result.templateMinorVersion.valueBlock.valueDec)}toSchema(){let e=[];return e.push(new rt({value:this.templateID})),Do in this&&e.push(new me({value:this.templateMajorVersion})),_o in this&&e.push(new me({value:this.templateMinorVersion})),new W({value:e})}toJSON(){let e={templateID:this.templateID};return Do in this&&(e.templateMajorVersion=this.templateMajorVersion),_o in this&&(e.templateMinorVersion=this.templateMinorVersion),e}},Xc="distributionPoint",IU="distributionPointNames",Gc="reasons",Wc="cRLIssuer",BU="cRLIssuerNames",Gne=[Xc,IU,Gc,Wc,BU],jI=class Jg extends Be{static{o(this,"DistributionPoint")}constructor(e={}){super(),Xc in e&&(this.distributionPoint=D(e,Xc,Jg.defaultValues(Xc))),Gc in e&&(this.reasons=D(e,Gc,Jg.defaultValues(Gc))),Wc in e&&(this.cRLIssuer=D(e,Wc,Jg.defaultValues(Wc))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Xc:return[];case Gc:return new qt;case Wc:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Pr({value:[new ae({name:t.distributionPoint||L,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({name:t.distributionPointNames||L,value:Ar.schema()})]}),new ae({name:t.distributionPoint||L,optional:!0,idBlock:{tagClass:3,tagNumber:1},value:Or.schema().valueBlock.value})]})]}),new yt({name:t.reasons||L,optional:!0,idBlock:{tagClass:3,tagNumber:1}}),new ae({name:t.cRLIssuer||L,optional:!0,idBlock:{tagClass:3,tagNumber:2},value:[new Tt({name:t.cRLIssuerNames||L,value:Ar.schema()})]})]})}fromSchema(e){_e(e,Gne);let t=Ie(e,e,Jg.schema({names:{distributionPoint:Xc,distributionPointNames:IU,reasons:Gc,cRLIssuer:Wc,cRLIssuerNames:BU}}));Ae.assertSchema(t,this.className),Xc in t.result&&(t.result.distributionPoint.idBlock.tagNumber===0&&(this.distributionPoint=Array.from(t.result.distributionPointNames,n=>new Ar({schema:n}))),t.result.distributionPoint.idBlock.tagNumber===1&&(this.distributionPoint=new Or({schema:new W({value:t.result.distributionPoint.valueBlock.value})}))),Gc in t.result&&(this.reasons=new qt({valueHex:t.result.reasons.valueBlock.valueHex})),Wc in t.result&&(this.cRLIssuer=Array.from(t.result.cRLIssuerNames,n=>new Ar({schema:n})))}toSchema(){let e=[];if(this.distributionPoint){let t;this.distributionPoint instanceof Array?t=new ae({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.distributionPoint,n=>n.toSchema())}):t=new ae({idBlock:{tagClass:3,tagNumber:1},value:[this.distributionPoint.toSchema()]}),e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[t]}))}return this.reasons&&e.push(new yt({idBlock:{tagClass:3,tagNumber:1},valueHex:this.reasons.valueBlock.valueHexView})),this.cRLIssuer&&e.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:Array.from(this.cRLIssuer,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={};return this.distributionPoint&&(this.distributionPoint instanceof Array?e.distributionPoint=Array.from(this.distributionPoint,t=>t.toJSON()):e.distributionPoint=this.distributionPoint.toJSON()),this.reasons&&(e.reasons=this.reasons.toJSON()),this.cRLIssuer&&(e.cRLIssuer=Array.from(this.cRLIssuer,t=>t.toJSON())),e}};jI.CLASS_NAME="DistributionPoint";var zg="distributionPoints",Wne=[zg],FI=class qI extends Be{static{o(this,"CRLDistributionPoints")}constructor(e={}){super(),this.distributionPoints=D(e,zg,qI.defaultValues(zg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case zg:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.distributionPoints||L,value:jI.schema()})]})}fromSchema(e){_e(e,Wne);let t=Ie(e,e,qI.schema({names:{distributionPoints:zg}}));Ae.assertSchema(t,this.className),this.distributionPoints=Array.from(t.result.distributionPoints,n=>new jI({schema:n}))}toSchema(){return new W({value:Array.from(this.distributionPoints,e=>e.toSchema())})}toJSON(){return{distributionPoints:Array.from(this.distributionPoints,e=>e.toJSON())}}};FI.CLASS_NAME="CRLDistributionPoints";var Yg="keyPurposes",Jne=[Yg],DU=class HI extends Be{static{o(this,"ExtKeyUsage")}constructor(e={}){super(),this.keyPurposes=D(e,Yg,HI.defaultValues(Yg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Yg:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.keyPurposes||L,value:new rt})]})}fromSchema(e){_e(e,Jne);let t=Ie(e,e,HI.schema({names:{keyPurposes:Yg}}));Ae.assertSchema(t,this.className),this.keyPurposes=Array.from(t.result.keyPurposes,n=>n.valueBlock.toString())}toSchema(){return new W({value:Array.from(this.keyPurposes,e=>new rt({value:e}))})}toJSON(){return{keyPurposes:Array.from(this.keyPurposes)}}};DU.CLASS_NAME="ExtKeyUsage";var Cg="accessDescriptions",KI=class $I extends Be{static{o(this,"InfoAccess")}constructor(e={}){super(),this.accessDescriptions=D(e,Cg,$I.defaultValues(Cg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Cg:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.accessDescriptions||L,value:DI.schema()})]})}fromSchema(e){_e(e,[Cg]);let t=Ie(e,e,$I.schema({names:{accessDescriptions:Cg}}));Ae.assertSchema(t,this.className),this.accessDescriptions=Array.from(t.result.accessDescriptions,n=>new DI({schema:n}))}toSchema(){return new W({value:Array.from(this.accessDescriptions,e=>e.toSchema())})}toJSON(){return{accessDescriptions:Array.from(this.accessDescriptions,e=>e.toJSON())}}};KI.CLASS_NAME="InfoAccess";var Jc="distributionPoint",_U="distributionPointNames",ol="onlyContainsUserCerts",ul="onlyContainsCACerts",ll="onlySomeReasons",cl="indirectCRL",fl="onlyContainsAttributeCerts",zne=[Jc,_U,ol,ul,ll,cl,fl],RU=class Zn extends Be{static{o(this,"IssuingDistributionPoint")}constructor(e={}){super(),Jc in e&&(this.distributionPoint=D(e,Jc,Zn.defaultValues(Jc))),this.onlyContainsUserCerts=D(e,ol,Zn.defaultValues(ol)),this.onlyContainsCACerts=D(e,ul,Zn.defaultValues(ul)),ll in e&&(this.onlySomeReasons=D(e,ll,Zn.defaultValues(ll))),this.indirectCRL=D(e,cl,Zn.defaultValues(cl)),this.onlyContainsAttributeCerts=D(e,fl,Zn.defaultValues(fl)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Jc:return[];case ol:return!1;case ul:return!1;case ll:return 0;case cl:return!1;case fl:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Pr({value:[new ae({name:t.distributionPoint||L,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({name:t.distributionPointNames||L,value:Ar.schema()})]}),new ae({name:t.distributionPoint||L,idBlock:{tagClass:3,tagNumber:1},value:Or.schema().valueBlock.value})]})]}),new yt({name:t.onlyContainsUserCerts||L,optional:!0,idBlock:{tagClass:3,tagNumber:1}}),new yt({name:t.onlyContainsCACerts||L,optional:!0,idBlock:{tagClass:3,tagNumber:2}}),new yt({name:t.onlySomeReasons||L,optional:!0,idBlock:{tagClass:3,tagNumber:3}}),new yt({name:t.indirectCRL||L,optional:!0,idBlock:{tagClass:3,tagNumber:4}}),new yt({name:t.onlyContainsAttributeCerts||L,optional:!0,idBlock:{tagClass:3,tagNumber:5}})]})}fromSchema(e){_e(e,zne);let t=Ie(e,e,Zn.schema({names:{distributionPoint:Jc,distributionPointNames:_U,onlyContainsUserCerts:ol,onlyContainsCACerts:ul,onlySomeReasons:ll,indirectCRL:cl,onlyContainsAttributeCerts:fl}}));if(Ae.assertSchema(t,this.className),Jc in t.result)switch(!0){case t.result.distributionPoint.idBlock.tagNumber===0:this.distributionPoint=Array.from(t.result.distributionPointNames,n=>new Ar({schema:n}));break;case t.result.distributionPoint.idBlock.tagNumber===1:this.distributionPoint=new Or({schema:new W({value:t.result.distributionPoint.valueBlock.value})});break;default:throw new Error("Unknown tagNumber for distributionPoint: {$asn1.result.distributionPoint.idBlock.tagNumber}")}if(ol in t.result){let n=new Uint8Array(t.result.onlyContainsUserCerts.valueBlock.valueHex);this.onlyContainsUserCerts=n[0]!==0}if(ul in t.result){let n=new Uint8Array(t.result.onlyContainsCACerts.valueBlock.valueHex);this.onlyContainsCACerts=n[0]!==0}if(ll in t.result){let n=new Uint8Array(t.result.onlySomeReasons.valueBlock.valueHex);this.onlySomeReasons=n[0]}if(cl in t.result){let n=new Uint8Array(t.result.indirectCRL.valueBlock.valueHex);this.indirectCRL=n[0]!==0}if(fl in t.result){let n=new Uint8Array(t.result.onlyContainsAttributeCerts.valueBlock.valueHex);this.onlyContainsAttributeCerts=n[0]!==0}}toSchema(){let e=[];if(this.distributionPoint){let t;this.distributionPoint instanceof Array?t=new ae({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.distributionPoint,n=>n.toSchema())}):(t=this.distributionPoint.toSchema(),t.idBlock.tagClass=3,t.idBlock.tagNumber=1),e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[t]}))}if(this.onlyContainsUserCerts!==Zn.defaultValues(ol)&&e.push(new yt({idBlock:{tagClass:3,tagNumber:1},valueHex:new Uint8Array([255]).buffer})),this.onlyContainsCACerts!==Zn.defaultValues(ul)&&e.push(new yt({idBlock:{tagClass:3,tagNumber:2},valueHex:new Uint8Array([255]).buffer})),this.onlySomeReasons!==void 0){let t=new ArrayBuffer(1),n=new Uint8Array(t);n[0]=this.onlySomeReasons,e.push(new yt({idBlock:{tagClass:3,tagNumber:3},valueHex:t}))}return this.indirectCRL!==Zn.defaultValues(cl)&&e.push(new yt({idBlock:{tagClass:3,tagNumber:4},valueHex:new Uint8Array([255]).buffer})),this.onlyContainsAttributeCerts!==Zn.defaultValues(fl)&&e.push(new yt({idBlock:{tagClass:3,tagNumber:5},valueHex:new Uint8Array([255]).buffer})),new W({value:e})}toJSON(){let e={};return this.distributionPoint&&(this.distributionPoint instanceof Array?e.distributionPoint=Array.from(this.distributionPoint,t=>t.toJSON()):e.distributionPoint=this.distributionPoint.toJSON()),this.onlyContainsUserCerts!==Zn.defaultValues(ol)&&(e.onlyContainsUserCerts=this.onlyContainsUserCerts),this.onlyContainsCACerts!==Zn.defaultValues(ul)&&(e.onlyContainsCACerts=this.onlyContainsCACerts),ll in this&&(e.onlySomeReasons=this.onlySomeReasons),this.indirectCRL!==Zn.defaultValues(cl)&&(e.indirectCRL=this.indirectCRL),this.onlyContainsAttributeCerts!==Zn.defaultValues(fl)&&(e.onlyContainsAttributeCerts=this.onlyContainsAttributeCerts),e}};RU.CLASS_NAME="IssuingDistributionPoint";var Qg="base",Kp="minimum",hl="maximum",Yne=[Qg,Kp,hl],Zg=class e1 extends Be{static{o(this,"GeneralSubtree")}constructor(e={}){super(),this.base=D(e,Qg,e1.defaultValues(Qg)),this.minimum=D(e,Kp,e1.defaultValues(Kp)),hl in e&&(this.maximum=D(e,hl,e1.defaultValues(hl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Qg:return new Ar;case Kp:return 0;case hl:return 0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Ar.schema(t.base||{}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new me({name:t.minimum||L})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new me({name:t.maximum||L})]})]})}fromSchema(e){_e(e,Yne);let t=Ie(e,e,e1.schema({names:{base:{names:{blockName:Qg}},minimum:Kp,maximum:hl}}));Ae.assertSchema(t,this.className),this.base=new Ar({schema:t.result.base}),Kp in t.result&&(t.result.minimum.valueBlock.isHexOnly?this.minimum=t.result.minimum:this.minimum=t.result.minimum.valueBlock.valueDec),hl in t.result&&(t.result.maximum.valueBlock.isHexOnly?this.maximum=t.result.maximum:this.maximum=t.result.maximum.valueBlock.valueDec)}toSchema(){let e=[];if(e.push(this.base.toSchema()),this.minimum!==0){let t=0;this.minimum instanceof me?t=this.minimum:t=new me({value:this.minimum}),e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[t]}))}if(hl in this){let t=0;this.maximum instanceof me?t=this.maximum:t=new me({value:this.maximum}),e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[t]}))}return new W({value:e})}toJSON(){let e={base:this.base.toJSON()};return this.minimum!==0&&(typeof this.minimum=="number"?e.minimum=this.minimum:e.minimum=this.minimum.toJSON()),this.maximum!==void 0&&(typeof this.maximum=="number"?e.maximum=this.maximum:e.maximum=this.maximum.toJSON()),e}};Zg.CLASS_NAME="GeneralSubtree";var zc="permittedSubtrees",Yc="excludedSubtrees",Qne=[zc,Yc],PU=class SA extends Be{static{o(this,"NameConstraints")}constructor(e={}){super(),zc in e&&(this.permittedSubtrees=D(e,zc,SA.defaultValues(zc))),Yc in e&&(this.excludedSubtrees=D(e,Yc,SA.defaultValues(Yc))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case zc:case Yc:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({name:t.permittedSubtrees||L,value:Zg.schema()})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Tt({name:t.excludedSubtrees||L,value:Zg.schema()})]})]})}fromSchema(e){_e(e,Qne);let t=Ie(e,e,SA.schema({names:{permittedSubtrees:zc,excludedSubtrees:Yc}}));Ae.assertSchema(t,this.className),zc in t.result&&(this.permittedSubtrees=Array.from(t.result.permittedSubtrees,n=>new Zg({schema:n}))),Yc in t.result&&(this.excludedSubtrees=Array.from(t.result.excludedSubtrees,n=>new Zg({schema:n})))}toSchema(){let e=[];return this.permittedSubtrees&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.permittedSubtrees,t=>t.toSchema())})),this.excludedSubtrees&&e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.excludedSubtrees,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={};return this.permittedSubtrees&&(e.permittedSubtrees=Array.from(this.permittedSubtrees,t=>t.toJSON())),this.excludedSubtrees&&(e.excludedSubtrees=Array.from(this.excludedSubtrees,t=>t.toJSON())),e}};PU.CLASS_NAME="NameConstraints";var Ro="requireExplicitPolicy",Po="inhibitPolicyMapping",Zne=[Ro,Po],OU=class EA extends Be{static{o(this,"PolicyConstraints")}constructor(e={}){super(),Ro in e&&(this.requireExplicitPolicy=D(e,Ro,EA.defaultValues(Ro))),Po in e&&(this.inhibitPolicyMapping=D(e,Po,EA.defaultValues(Po))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ro:return 0;case Po:return 0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new yt({name:t.requireExplicitPolicy||L,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new yt({name:t.inhibitPolicyMapping||L,optional:!0,idBlock:{tagClass:3,tagNumber:1}})]})}fromSchema(e){_e(e,Zne);let t=Ie(e,e,EA.schema({names:{requireExplicitPolicy:Ro,inhibitPolicyMapping:Po}}));if(Ae.assertSchema(t,this.className),Ro in t.result){let n=t.result.requireExplicitPolicy;n.idBlock.tagClass=1,n.idBlock.tagNumber=2;let s=n.toBER(!1),i=Hr(s);Ae.assert(i,"Integer"),this.requireExplicitPolicy=i.result.valueBlock.valueDec}if(Po in t.result){let n=t.result.inhibitPolicyMapping;n.idBlock.tagClass=1,n.idBlock.tagNumber=2;let s=n.toBER(!1),i=Hr(s);Ae.assert(i,"Integer"),this.inhibitPolicyMapping=i.result.valueBlock.valueDec}}toSchema(){let e=[];if(Ro in this){let t=new me({value:this.requireExplicitPolicy});t.idBlock.tagClass=3,t.idBlock.tagNumber=0,e.push(t)}if(Po in this){let t=new me({value:this.inhibitPolicyMapping});t.idBlock.tagClass=3,t.idBlock.tagNumber=1,e.push(t)}return new W({value:e})}toJSON(){let e={};return Ro in this&&(e.requireExplicitPolicy=this.requireExplicitPolicy),Po in this&&(e.inhibitPolicyMapping=this.inhibitPolicyMapping),e}};OU.CLASS_NAME="PolicyConstraints";var t1="issuerDomainPolicy",r1="subjectDomainPolicy",ese=[t1,r1],XI=class AA extends Be{static{o(this,"PolicyMapping")}constructor(e={}){super(),this.issuerDomainPolicy=D(e,t1,AA.defaultValues(t1)),this.subjectDomainPolicy=D(e,r1,AA.defaultValues(r1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case t1:return L;case r1:return L;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.issuerDomainPolicy||L}),new rt({name:t.subjectDomainPolicy||L})]})}fromSchema(e){_e(e,ese);let t=Ie(e,e,AA.schema({names:{issuerDomainPolicy:t1,subjectDomainPolicy:r1}}));Ae.assertSchema(t,this.className),this.issuerDomainPolicy=t.result.issuerDomainPolicy.valueBlock.toString(),this.subjectDomainPolicy=t.result.subjectDomainPolicy.valueBlock.toString()}toSchema(){return new W({value:[new rt({value:this.issuerDomainPolicy}),new rt({value:this.subjectDomainPolicy})]})}toJSON(){return{issuerDomainPolicy:this.issuerDomainPolicy,subjectDomainPolicy:this.subjectDomainPolicy}}};XI.CLASS_NAME="PolicyMapping";var n1="mappings",tse=[n1],kU=class GI extends Be{static{o(this,"PolicyMappings")}constructor(e={}){super(),this.mappings=D(e,n1,GI.defaultValues(n1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case n1:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.mappings||L,value:XI.schema()})]})}fromSchema(e){_e(e,tse);let t=Ie(e,e,GI.schema({names:{mappings:n1}}));Ae.assertSchema(t,this.className),this.mappings=Array.from(t.result.mappings,n=>new XI({schema:n}))}toSchema(){return new W({value:Array.from(this.mappings,e=>e.toSchema())})}toJSON(){return{mappings:Array.from(this.mappings,e=>e.toJSON())}}};kU.CLASS_NAME="PolicyMappings";var pl="notBefore",dl="notAfter",rse=[pl,dl],LU=class CA extends Be{static{o(this,"PrivateKeyUsagePeriod")}constructor(e={}){super(),pl in e&&(this.notBefore=D(e,pl,CA.defaultValues(pl))),dl in e&&(this.notAfter=D(e,dl,CA.defaultValues(dl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case pl:return new Date;case dl:return new Date;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new yt({name:t.notBefore||L,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new yt({name:t.notAfter||L,optional:!0,idBlock:{tagClass:3,tagNumber:1}})]})}fromSchema(e){_e(e,rse);let t=Ie(e,e,CA.schema({names:{notBefore:pl,notAfter:dl}}));if(Ae.assertSchema(t,this.className),pl in t.result){let n=new Rr;n.fromBuffer(t.result.notBefore.valueBlock.valueHex),this.notBefore=n.toDate()}if(dl in t.result){let n=new Rr({valueHex:t.result.notAfter.valueBlock.valueHex});n.fromBuffer(t.result.notAfter.valueBlock.valueHex),this.notAfter=n.toDate()}}toSchema(){let e=[];return pl in this&&e.push(new yt({idBlock:{tagClass:3,tagNumber:0},valueHex:new Rr({valueDate:this.notBefore}).valueBlock.valueHexView})),dl in this&&e.push(new yt({idBlock:{tagClass:3,tagNumber:1},valueHex:new Rr({valueDate:this.notAfter}).valueBlock.valueHexView})),new W({value:e})}toJSON(){let e={};return this.notBefore&&(e.notBefore=this.notBefore),this.notAfter&&(e.notAfter=this.notAfter),e}};LU.CLASS_NAME="PrivateKeyUsagePeriod";var $p="id",Oo="type",Xp="values",nse=[$p,Oo],sse=[Xp],WI=class bA extends Be{static{o(this,"QCStatement")}constructor(e={}){super(),this.id=D(e,$p,bA.defaultValues($p)),Oo in e&&(this.type=D(e,Oo,bA.defaultValues(Oo))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case $p:return L;case Oo:return new Kr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case $p:return t===L;case Oo:return t instanceof Kr;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.id||L}),new St({name:t.type||L,optional:!0})]})}fromSchema(e){_e(e,nse);let t=Ie(e,e,bA.schema({names:{id:$p,type:Oo}}));Ae.assertSchema(t,this.className),this.id=t.result.id.valueBlock.toString(),Oo in t.result&&(this.type=t.result.type)}toSchema(){let e=[new rt({value:this.id})];return Oo in this&&e.push(this.type),new W({value:e})}toJSON(){let e={id:this.id};return this.type&&(e.type=this.type.toJSON()),e}};WI.CLASS_NAME="QCStatement";var VU=class JI extends Be{static{o(this,"QCStatements")}constructor(e={}){super(),this.values=D(e,Xp,JI.defaultValues(Xp)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Xp:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Xp:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.values||L,value:WI.schema(t.value||{})})]})}fromSchema(e){_e(e,sse);let t=Ie(e,e,JI.schema({names:{values:Xp}}));Ae.assertSchema(t,this.className),this.values=Array.from(t.result.values,n=>new WI({schema:n}))}toSchema(){return new W({value:Array.from(this.values,e=>e.toSchema())})}toJSON(){return{values:Array.from(this.values,e=>e.toJSON())}}};VU.CLASS_NAME="QCStatements";var Qc,Yl=class{static{o(this,"ECNamedCurves")}static register(e,t,n){this.namedCurves[e.toLowerCase()]=this.namedCurves[t]={name:e,id:t,size:n}}static find(e){return this.namedCurves[e.toLowerCase()]||null}};Qc=Yl;Yl.namedCurves={};Qc.register("P-256","1.2.840.10045.3.1.7",32),Qc.register("P-384","1.3.132.0.34",48),Qc.register("P-521","1.3.132.0.35",66),Qc.register("brainpoolP256r1","1.3.36.3.3.2.8.1.1.7",32),Qc.register("brainpoolP384r1","1.3.36.3.3.2.8.1.1.11",48),Qc.register("brainpoolP512r1","1.3.36.3.3.2.8.1.1.13",64);var qE="x",HE="y",KE="namedCurve",Wo=class Gp extends Be{static{o(this,"ECPublicKey")}constructor(e={}){super(),this.x=D(e,qE,Gp.defaultValues(qE)),this.y=D(e,HE,Gp.defaultValues(HE)),this.namedCurve=D(e,KE,Gp.defaultValues(KE)),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case qE:case HE:return Qr;case KE:return L;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case qE:case HE:return t instanceof ArrayBuffer&&Wu(t,Gp.defaultValues(e));case KE:return typeof t=="string"&&t===Gp.defaultValues(e);default:return super.defaultValues(e)}}static schema(){return new vg}fromSchema(e){let t=dt.toUint8Array(e);if(t[0]!==4)throw new Error("Object's schema was not verified against input data for ECPublicKey");let n=Yl.find(this.namedCurve);if(!n)throw new Error(`Incorrect curve OID: ${this.namedCurve}`);let s=n.size;if(t.byteLength!==s*2+1)throw new Error("Object's schema was not verified against input data for ECPublicKey");this.namedCurve=n.name,this.x=t.slice(1,s+1).buffer,this.y=t.slice(1+s,s*2+1).buffer}toSchema(){return new vg({data:_c(new Uint8Array([4]).buffer,this.x,this.y)})}toJSON(){let e=Yl.find(this.namedCurve);return{crv:e?e.name:this.namedCurve,x:NE(fg(this.x),!0,!0,!1),y:NE(fg(this.y),!0,!0,!1)}}fromJSON(e){fr.assert("json",e,"crv","x","y");let t=0,n=Yl.find(e.crv);n&&(this.namedCurve=n.id,t=n.size);let s=Rc(Ip(e.x,!0));if(s.byteLength<t){this.x=new ArrayBuffer(t);let a=new Uint8Array(this.x),u=new Uint8Array(s);a.set(u,1)}else this.x=s.slice(0,t);let i=Rc(Ip(e.y,!0));if(i.byteLength<t){this.y=new ArrayBuffer(t);let a=new Uint8Array(this.y),u=new Uint8Array(i);a.set(u,1)}else this.y=i.slice(0,t)}};Wo.CLASS_NAME="ECPublicKey";var s1="modulus",i1="publicExponent",ise=[s1,i1],zI=class xA extends Be{static{o(this,"RSAPublicKey")}constructor(e={}){super(),this.modulus=D(e,s1,xA.defaultValues(s1)),this.publicExponent=D(e,i1,xA.defaultValues(i1)),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case s1:return new me;case i1:return new me;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.modulus||L}),new me({name:t.publicExponent||L})]})}fromSchema(e){_e(e,ise);let t=Ie(e,e,xA.schema({names:{modulus:s1,publicExponent:i1}}));Ae.assertSchema(t,this.className),this.modulus=t.result.modulus.convertFromDER(256),this.publicExponent=t.result.publicExponent}toSchema(){return new W({value:[this.modulus.convertToDER(),this.publicExponent]})}toJSON(){return{n:Ct.ToBase64Url(this.modulus.valueBlock.valueHexView),e:Ct.ToBase64Url(this.publicExponent.valueBlock.valueHexView)}}fromJSON(e){fr.assert("json",e,"n","e");let t=Rc(Ip(e.n,!0));this.modulus=new me({valueHex:t.slice(0,Math.pow(2,RV(t.byteLength)))}),this.publicExponent=new me({valueHex:Rc(Ip(e.e,!0)).slice(0,3)})}};zI.CLASS_NAME="RSAPublicKey";var a1="algorithm",o1="subjectPublicKey",ase=[a1,o1],na=class NA extends Be{static{o(this,"PublicKeyInfo")}get parsedKey(){if(this._parsedKey===void 0){switch(this.algorithm.algorithmId){case"1.2.840.10045.2.1":if("algorithmParams"in this.algorithm&&this.algorithm.algorithmParams.constructor.blockName()===rt.blockName())try{this._parsedKey=new Wo({namedCurve:this.algorithm.algorithmParams.valueBlock.toString(),schema:this.subjectPublicKey.valueBlock.valueHexView})}catch{}break;case"1.2.840.113549.1.1.1":{let e=Hr(this.subjectPublicKey.valueBlock.valueHexView);if(e.offset!==-1)try{this._parsedKey=new zI({schema:e.result})}catch{}}break}this._parsedKey||(this._parsedKey=null)}return this._parsedKey||void 0}set parsedKey(e){this._parsedKey=e}constructor(e={}){super(),this.algorithm=D(e,a1,NA.defaultValues(a1)),this.subjectPublicKey=D(e,o1,NA.defaultValues(o1));let t=D(e,"parsedKey",null);t&&(this.parsedKey=t),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case a1:return new ge;case o1:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.algorithm||{}),new qt({name:t.subjectPublicKey||L})]})}fromSchema(e){_e(e,ase);let t=Ie(e,e,NA.schema({names:{algorithm:{names:{blockName:a1}},subjectPublicKey:o1}}));Ae.assertSchema(t,this.className),this.algorithm=new ge({schema:t.result.algorithm}),this.subjectPublicKey=t.result.subjectPublicKey}toSchema(){return new W({value:[this.algorithm.toSchema(),this.subjectPublicKey]})}toJSON(){if(!this.parsedKey)return{algorithm:this.algorithm.toJSON(),subjectPublicKey:this.subjectPublicKey.toJSON()};let e={};switch(this.algorithm.algorithmId){case"1.2.840.10045.2.1":e.kty="EC";break;case"1.2.840.113549.1.1.1":e.kty="RSA";break}let t=this.parsedKey.toJSON();return Object.assign(e,t),e}fromJSON(e){if("kty"in e){switch(e.kty.toUpperCase()){case"EC":this.parsedKey=new Wo({json:e}),this.algorithm=new ge({algorithmId:"1.2.840.10045.2.1",algorithmParams:new rt({value:this.parsedKey.namedCurve})});break;case"RSA":this.parsedKey=new zI({json:e}),this.algorithm=new ge({algorithmId:"1.2.840.113549.1.1.1",algorithmParams:new Kr});break;default:throw new Error(`Invalid value for "kty" parameter: ${e.kty}`)}this.subjectPublicKey=new qt({valueHex:this.parsedKey.toSchema().toBER(!1)})}}async importKey(e,t=_t(!0)){try{if(!e)throw new Error("Need to provide publicKey input parameter");let n=await t.exportKey("spki",e),s=Hr(n);try{this.fromSchema(s.result)}catch{throw new Error("Error during initializing object from schema")}}catch(n){let s=n instanceof Error?n.message:`${n}`;throw new Error(`Error during exporting public key: ${s}`)}}};na.CLASS_NAME="PublicKeyInfo";var Wp="version",Jp="privateKey",zi="namedCurve",ml="publicKey",ose=[Wp,Jp,zi,ml],YI=class ko extends Be{static{o(this,"ECPrivateKey")}constructor(e={}){super(),this.version=D(e,Wp,ko.defaultValues(Wp)),this.privateKey=D(e,Jp,ko.defaultValues(Jp)),zi in e&&(this.namedCurve=D(e,zi,ko.defaultValues(zi))),ml in e&&(this.publicKey=D(e,ml,ko.defaultValues(ml))),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Wp:return 1;case Jp:return new Ve;case zi:return L;case ml:return new Wo;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Wp:return t===ko.defaultValues(e);case Jp:return t.isEqual(ko.defaultValues(e));case zi:return t===L;case ml:return Wo.compareWithDefault(zi,t.namedCurve)&&Wo.compareWithDefault("x",t.x)&&Wo.compareWithDefault("y",t.y);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new Ve({name:t.privateKey||L}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new rt({name:t.namedCurve||L})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new qt({name:t.publicKey||L})]})]})}fromSchema(e){_e(e,ose);let t=Ie(e,e,ko.schema({names:{version:Wp,privateKey:Jp,namedCurve:zi,publicKey:ml}}));if(Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.privateKey=t.result.privateKey,zi in t.result&&(this.namedCurve=t.result.namedCurve.valueBlock.toString()),ml in t.result){let n={schema:t.result.publicKey.valueBlock.valueHex};zi in this&&(n.namedCurve=this.namedCurve),this.publicKey=new Wo(n)}}toSchema(){let e=[new me({value:this.version}),this.privateKey];return this.namedCurve&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[new rt({value:this.namedCurve})]})),this.publicKey&&e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[new qt({valueHex:this.publicKey.toSchema().toBER(!1)})]})),new W({value:e})}toJSON(){if(!this.namedCurve||ko.compareWithDefault(zi,this.namedCurve))throw new Error('Not enough information for making JSON: absent "namedCurve" value');let e=Yl.find(this.namedCurve),t={crv:e?e.name:this.namedCurve,d:Ct.ToBase64Url(this.privateKey.valueBlock.valueHexView)};if(this.publicKey){let n=this.publicKey.toJSON();t.x=n.x,t.y=n.y}return t}fromJSON(e){fr.assert("json",e,"crv","d");let t=0,n=Yl.find(e.crv);n&&(this.namedCurve=n.id,t=n.size);let s=Ct.FromBase64Url(e.d);if(s.byteLength<t){let i=new ArrayBuffer(t),a=new Uint8Array(i),u=new Uint8Array(s);a.set(u,1),this.privateKey=new Ve({valueHex:i})}else this.privateKey=new Ve({valueHex:s.slice(0,t)});e.x&&e.y&&(this.publicKey=new Wo({json:e}))}};YI.CLASS_NAME="ECPrivateKey";var u1="prime",l1="exponent",c1="coefficient",use=[u1,l1,c1],TA=class f1 extends Be{static{o(this,"OtherPrimeInfo")}constructor(e={}){super(),this.prime=D(e,u1,f1.defaultValues(u1)),this.exponent=D(e,l1,f1.defaultValues(l1)),this.coefficient=D(e,c1,f1.defaultValues(c1)),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case u1:return new me;case l1:return new me;case c1:return new me;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.prime||L}),new me({name:t.exponent||L}),new me({name:t.coefficient||L})]})}fromSchema(e){_e(e,use);let t=Ie(e,e,f1.schema({names:{prime:u1,exponent:l1,coefficient:c1}}));Ae.assertSchema(t,this.className),this.prime=t.result.prime.convertFromDER(),this.exponent=t.result.exponent.convertFromDER(),this.coefficient=t.result.coefficient.convertFromDER()}toSchema(){return new W({value:[this.prime.convertToDER(),this.exponent.convertToDER(),this.coefficient.convertToDER()]})}toJSON(){return{r:Ct.ToBase64Url(this.prime.valueBlock.valueHexView),d:Ct.ToBase64Url(this.exponent.valueBlock.valueHexView),t:Ct.ToBase64Url(this.coefficient.valueBlock.valueHexView)}}fromJSON(e){fr.assert("json",e,"r","d","r"),this.prime=new me({valueHex:Ct.FromBase64Url(e.r)}),this.exponent=new me({valueHex:Ct.FromBase64Url(e.d)}),this.coefficient=new me({valueHex:Ct.FromBase64Url(e.t)})}};TA.CLASS_NAME="OtherPrimeInfo";var h1="version",p1="modulus",d1="publicExponent",m1="privateExponent",g1="prime1",y1="prime2",v1="exponent1",w1="exponent2",S1="coefficient",Zc="otherPrimeInfos",lse=[h1,p1,d1,m1,g1,y1,v1,w1,S1,Zc],QI=class Ii extends Be{static{o(this,"RSAPrivateKey")}constructor(e={}){super(),this.version=D(e,h1,Ii.defaultValues(h1)),this.modulus=D(e,p1,Ii.defaultValues(p1)),this.publicExponent=D(e,d1,Ii.defaultValues(d1)),this.privateExponent=D(e,m1,Ii.defaultValues(m1)),this.prime1=D(e,g1,Ii.defaultValues(g1)),this.prime2=D(e,y1,Ii.defaultValues(y1)),this.exponent1=D(e,v1,Ii.defaultValues(v1)),this.exponent2=D(e,w1,Ii.defaultValues(w1)),this.coefficient=D(e,S1,Ii.defaultValues(S1)),Zc in e&&(this.otherPrimeInfos=D(e,Zc,Ii.defaultValues(Zc))),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case h1:return 0;case p1:return new me;case d1:return new me;case m1:return new me;case g1:return new me;case y1:return new me;case v1:return new me;case w1:return new me;case S1:return new me;case Zc:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new me({name:t.modulus||L}),new me({name:t.publicExponent||L}),new me({name:t.privateExponent||L}),new me({name:t.prime1||L}),new me({name:t.prime2||L}),new me({name:t.exponent1||L}),new me({name:t.exponent2||L}),new me({name:t.coefficient||L}),new W({optional:!0,value:[new Tt({name:t.otherPrimeInfosName||L,value:TA.schema(t.otherPrimeInfo||{})})]})]})}fromSchema(e){_e(e,lse);let t=Ie(e,e,Ii.schema({names:{version:h1,modulus:p1,publicExponent:d1,privateExponent:m1,prime1:g1,prime2:y1,exponent1:v1,exponent2:w1,coefficient:S1,otherPrimeInfo:{names:{blockName:Zc}}}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.modulus=t.result.modulus.convertFromDER(256),this.publicExponent=t.result.publicExponent,this.privateExponent=t.result.privateExponent.convertFromDER(256),this.prime1=t.result.prime1.convertFromDER(128),this.prime2=t.result.prime2.convertFromDER(128),this.exponent1=t.result.exponent1.convertFromDER(128),this.exponent2=t.result.exponent2.convertFromDER(128),this.coefficient=t.result.coefficient.convertFromDER(128),Zc in t.result&&(this.otherPrimeInfos=Array.from(t.result.otherPrimeInfos,n=>new TA({schema:n})))}toSchema(){let e=[];return e.push(new me({value:this.version})),e.push(this.modulus.convertToDER()),e.push(this.publicExponent),e.push(this.privateExponent.convertToDER()),e.push(this.prime1.convertToDER()),e.push(this.prime2.convertToDER()),e.push(this.exponent1.convertToDER()),e.push(this.exponent2.convertToDER()),e.push(this.coefficient.convertToDER()),this.otherPrimeInfos&&e.push(new W({value:Array.from(this.otherPrimeInfos,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={n:Ct.ToBase64Url(this.modulus.valueBlock.valueHexView),e:Ct.ToBase64Url(this.publicExponent.valueBlock.valueHexView),d:Ct.ToBase64Url(this.privateExponent.valueBlock.valueHexView),p:Ct.ToBase64Url(this.prime1.valueBlock.valueHexView),q:Ct.ToBase64Url(this.prime2.valueBlock.valueHexView),dp:Ct.ToBase64Url(this.exponent1.valueBlock.valueHexView),dq:Ct.ToBase64Url(this.exponent2.valueBlock.valueHexView),qi:Ct.ToBase64Url(this.coefficient.valueBlock.valueHexView)};return this.otherPrimeInfos&&(e.oth=Array.from(this.otherPrimeInfos,t=>t.toJSON())),e}fromJSON(e){fr.assert("json",e,"n","e","d","p","q","dp","dq","qi"),this.modulus=new me({valueHex:Ct.FromBase64Url(e.n)}),this.publicExponent=new me({valueHex:Ct.FromBase64Url(e.e)}),this.privateExponent=new me({valueHex:Ct.FromBase64Url(e.d)}),this.prime1=new me({valueHex:Ct.FromBase64Url(e.p)}),this.prime2=new me({valueHex:Ct.FromBase64Url(e.q)}),this.exponent1=new me({valueHex:Ct.FromBase64Url(e.dp)}),this.exponent2=new me({valueHex:Ct.FromBase64Url(e.dq)}),this.coefficient=new me({valueHex:Ct.FromBase64Url(e.qi)}),e.oth&&(this.otherPrimeInfos=Array.from(e.oth,t=>new TA({json:t})))}};QI.CLASS_NAME="RSAPrivateKey";var E1="version",A1="privateKeyAlgorithm",C1="privateKey",ef="attributes",$E="parsedKey",cse=[E1,A1,C1,ef],cv=class tf extends Be{static{o(this,"PrivateKeyInfo")}constructor(e={}){super(),this.version=D(e,E1,tf.defaultValues(E1)),this.privateKeyAlgorithm=D(e,A1,tf.defaultValues(A1)),this.privateKey=D(e,C1,tf.defaultValues(C1)),ef in e&&(this.attributes=D(e,ef,tf.defaultValues(ef))),$E in e&&(this.parsedKey=D(e,$E,tf.defaultValues($E))),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case E1:return 0;case A1:return new ge;case C1:return new Ve;case ef:return[];case $E:return{};default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),ge.schema(t.privateKeyAlgorithm||{}),new Ve({name:t.privateKey||L}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({name:t.attributes||L,value:Zr.schema()})]})]})}fromSchema(e){_e(e,cse);let t=Ie(e,e,tf.schema({names:{version:E1,privateKeyAlgorithm:{names:{blockName:A1}},privateKey:C1,attributes:ef}}));switch(Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.privateKeyAlgorithm=new ge({schema:t.result.privateKeyAlgorithm}),this.privateKey=t.result.privateKey,ef in t.result&&(this.attributes=Array.from(t.result.attributes,n=>new Zr({schema:n}))),this.privateKeyAlgorithm.algorithmId){case"1.2.840.113549.1.1.1":{let n=Hr(this.privateKey.valueBlock.valueHexView);n.offset!==-1&&(this.parsedKey=new QI({schema:n.result}))}break;case"1.2.840.10045.2.1":if("algorithmParams"in this.privateKeyAlgorithm&&this.privateKeyAlgorithm.algorithmParams instanceof rt){let n=Hr(this.privateKey.valueBlock.valueHexView);n.offset!==-1&&(this.parsedKey=new YI({namedCurve:this.privateKeyAlgorithm.algorithmParams.valueBlock.toString(),schema:n.result}))}break}}toSchema(){let e=[new me({value:this.version}),this.privateKeyAlgorithm.toSchema(),this.privateKey];return this.attributes&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.attributes,t=>t.toSchema())})),new W({value:e})}toJSON(){if(!this.parsedKey){let n={version:this.version,privateKeyAlgorithm:this.privateKeyAlgorithm.toJSON(),privateKey:this.privateKey.toJSON()};return this.attributes&&(n.attributes=Array.from(this.attributes,s=>s.toJSON())),n}let e={};switch(this.privateKeyAlgorithm.algorithmId){case"1.2.840.10045.2.1":e.kty="EC";break;case"1.2.840.113549.1.1.1":e.kty="RSA";break}let t=this.parsedKey.toJSON();return Object.assign(e,t),e}fromJSON(e){if("kty"in e){switch(e.kty.toUpperCase()){case"EC":this.parsedKey=new YI({json:e}),this.privateKeyAlgorithm=new ge({algorithmId:"1.2.840.10045.2.1",algorithmParams:new rt({value:this.parsedKey.namedCurve})});break;case"RSA":this.parsedKey=new QI({json:e}),this.privateKeyAlgorithm=new ge({algorithmId:"1.2.840.113549.1.1.1",algorithmParams:new Kr});break;default:throw new Error(`Invalid value for "kty" parameter: ${e.kty}`)}this.privateKey=new Ve({valueHex:this.parsedKey.toSchema().toBER(!1)})}}};cv.CLASS_NAME="PrivateKeyInfo";var zp="contentType",Yp="contentEncryptionAlgorithm",rf="encryptedContent",fse=[zp,Yp,rf],W6=1024,es=class b1 extends Be{static{o(this,"EncryptedContentInfo")}constructor(e={}){if(super(),this.contentType=D(e,zp,b1.defaultValues(zp)),this.contentEncryptionAlgorithm=D(e,Yp,b1.defaultValues(Yp)),rf in e&&e.encryptedContent&&(this.encryptedContent=e.encryptedContent,this.encryptedContent.idBlock.tagClass===1&&this.encryptedContent.idBlock.tagNumber===4&&this.encryptedContent.idBlock.isConstructed===!1&&!e.disableSplit)){let t=new Ve({idBlock:{isConstructed:!0},isConstructed:!0}),n=0,s=this.encryptedContent.valueBlock.valueHexView.slice().buffer,i=s.byteLength;for(;i>0;){let a=new Uint8Array(s,n,n+W6>s.byteLength?s.byteLength-n:W6),u=new ArrayBuffer(a.length),l=new Uint8Array(u);for(let f=0;f<l.length;f++)l[f]=a[f];t.valueBlock.value.push(new Ve({valueHex:u})),i-=a.length,n+=a.length}this.encryptedContent=t}e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case zp:return L;case Yp:return new ge;case rf:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case zp:return t===L;case Yp:return t.algorithmId===L&&!("algorithmParams"in t);case rf:return t.isEqual(b1.defaultValues(rf));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.contentType||L}),ge.schema(t.contentEncryptionAlgorithm||{}),new Pr({value:[new ae({name:t.encryptedContent||L,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({value:new Ve})]}),new yt({name:t.encryptedContent||L,idBlock:{tagClass:3,tagNumber:0}})]})]})}fromSchema(e){_e(e,fse);let t=Ie(e,e,b1.schema({names:{contentType:zp,contentEncryptionAlgorithm:{names:{blockName:Yp}},encryptedContent:rf}}));Ae.assertSchema(t,this.className),this.contentType=t.result.contentType.valueBlock.toString(),this.contentEncryptionAlgorithm=new ge({schema:t.result.contentEncryptionAlgorithm}),rf in t.result&&(this.encryptedContent=t.result.encryptedContent,this.encryptedContent.idBlock.tagClass=1,this.encryptedContent.idBlock.tagNumber=4)}toSchema(){let e={isIndefiniteForm:!1},t=[];if(t.push(new rt({value:this.contentType})),t.push(this.contentEncryptionAlgorithm.toSchema()),this.encryptedContent){e.isIndefiniteForm=this.encryptedContent.idBlock.isConstructed;let n=this.encryptedContent;n.idBlock.tagClass=3,n.idBlock.tagNumber=0,n.lenBlock.isIndefiniteForm=this.encryptedContent.idBlock.isConstructed,t.push(n)}return new W({lenBlock:e,value:t})}toJSON(){let e={contentType:this.contentType,contentEncryptionAlgorithm:this.contentEncryptionAlgorithm.toJSON()};return this.encryptedContent&&(e.encryptedContent=this.encryptedContent.toJSON()),e}getEncryptedContent(){if(!this.encryptedContent)throw new Error("Parameter 'encryptedContent' is undefined");return Ve.prototype.getValue.call(this.encryptedContent)}};es.CLASS_NAME="EncryptedContentInfo";var gl="hashAlgorithm",yl="maskGenAlgorithm",vl="saltLength",wl="trailerField",hse=[gl,yl,vl,wl],IA=class Ps extends Be{static{o(this,"RSASSAPSSParams")}constructor(e={}){super(),this.hashAlgorithm=D(e,gl,Ps.defaultValues(gl)),this.maskGenAlgorithm=D(e,yl,Ps.defaultValues(yl)),this.saltLength=D(e,vl,Ps.defaultValues(vl)),this.trailerField=D(e,wl,Ps.defaultValues(wl)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case gl:return new ge({algorithmId:"1.3.14.3.2.26",algorithmParams:new Kr});case yl:return new ge({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:new ge({algorithmId:"1.3.14.3.2.26",algorithmParams:new Kr}).toSchema()});case vl:return 20;case wl:return 1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({idBlock:{tagClass:3,tagNumber:0},optional:!0,value:[ge.schema(t.hashAlgorithm||{})]}),new ae({idBlock:{tagClass:3,tagNumber:1},optional:!0,value:[ge.schema(t.maskGenAlgorithm||{})]}),new ae({idBlock:{tagClass:3,tagNumber:2},optional:!0,value:[new me({name:t.saltLength||L})]}),new ae({idBlock:{tagClass:3,tagNumber:3},optional:!0,value:[new me({name:t.trailerField||L})]})]})}fromSchema(e){_e(e,hse);let t=Ie(e,e,Ps.schema({names:{hashAlgorithm:{names:{blockName:gl}},maskGenAlgorithm:{names:{blockName:yl}},saltLength:vl,trailerField:wl}}));Ae.assertSchema(t,this.className),gl in t.result&&(this.hashAlgorithm=new ge({schema:t.result.hashAlgorithm})),yl in t.result&&(this.maskGenAlgorithm=new ge({schema:t.result.maskGenAlgorithm})),vl in t.result&&(this.saltLength=t.result.saltLength.valueBlock.valueDec),wl in t.result&&(this.trailerField=t.result.trailerField.valueBlock.valueDec)}toSchema(){let e=[];return this.hashAlgorithm.isEqual(Ps.defaultValues(gl))||e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.hashAlgorithm.toSchema()]})),this.maskGenAlgorithm.isEqual(Ps.defaultValues(yl))||e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[this.maskGenAlgorithm.toSchema()]})),this.saltLength!==Ps.defaultValues(vl)&&e.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:[new me({value:this.saltLength})]})),this.trailerField!==Ps.defaultValues(wl)&&e.push(new ae({idBlock:{tagClass:3,tagNumber:3},value:[new me({value:this.trailerField})]})),new W({value:e})}toJSON(){let e={};return this.hashAlgorithm.isEqual(Ps.defaultValues(gl))||(e.hashAlgorithm=this.hashAlgorithm.toJSON()),this.maskGenAlgorithm.isEqual(Ps.defaultValues(yl))||(e.maskGenAlgorithm=this.maskGenAlgorithm.toJSON()),this.saltLength!==Ps.defaultValues(vl)&&(e.saltLength=this.saltLength),this.trailerField!==Ps.defaultValues(wl)&&(e.trailerField=this.trailerField),e}};IA.CLASS_NAME="RSASSAPSSParams";var Qp="salt",x1="iterationCount",Yi="keyLength",Lo="prf",pse=[Qp,x1,Yi,Lo],v0=class ja extends Be{static{o(this,"PBKDF2Params")}constructor(e={}){super(),this.salt=D(e,Qp,ja.defaultValues(Qp)),this.iterationCount=D(e,x1,ja.defaultValues(x1)),Yi in e&&(this.keyLength=D(e,Yi,ja.defaultValues(Yi))),Lo in e&&(this.prf=D(e,Lo,ja.defaultValues(Lo))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Qp:return{};case x1:return-1;case Yi:return 0;case Lo:return new ge({algorithmId:"1.3.14.3.2.26",algorithmParams:new Kr});default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Pr({value:[new Ve({name:t.saltPrimitive||L}),ge.schema(t.saltConstructed||{})]}),new me({name:t.iterationCount||L}),new me({name:t.keyLength||L,optional:!0}),ge.schema(t.prf||{names:{optional:!0}})]})}fromSchema(e){_e(e,pse);let t=Ie(e,e,ja.schema({names:{saltPrimitive:Qp,saltConstructed:{names:{blockName:Qp}},iterationCount:x1,keyLength:Yi,prf:{names:{blockName:Lo,optional:!0}}}}));Ae.assertSchema(t,this.className),this.salt=t.result.salt,this.iterationCount=t.result.iterationCount.valueBlock.valueDec,Yi in t.result&&(this.keyLength=t.result.keyLength.valueBlock.valueDec),Lo in t.result&&(this.prf=new ge({schema:t.result.prf}))}toSchema(){let e=[];return e.push(this.salt),e.push(new me({value:this.iterationCount})),Yi in this&&ja.defaultValues(Yi)!==this.keyLength&&e.push(new me({value:this.keyLength})),this.prf&&ja.defaultValues(Lo).isEqual(this.prf)===!1&&e.push(this.prf.toSchema()),new W({value:e})}toJSON(){let e={salt:this.salt.toJSON(),iterationCount:this.iterationCount};return Yi in this&&ja.defaultValues(Yi)!==this.keyLength&&(e.keyLength=this.keyLength),this.prf&&ja.defaultValues(Lo).isEqual(this.prf)===!1&&(e.prf=this.prf.toJSON()),e}};v0.CLASS_NAME="PBKDF2Params";var N1="keyDerivationFunc",T1="encryptionScheme",dse=[N1,T1],ZI=class BA extends Be{static{o(this,"PBES2Params")}constructor(e={}){super(),this.keyDerivationFunc=D(e,N1,BA.defaultValues(N1)),this.encryptionScheme=D(e,T1,BA.defaultValues(T1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case N1:return new ge;case T1:return new ge;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.keyDerivationFunc||{}),ge.schema(t.encryptionScheme||{})]})}fromSchema(e){_e(e,dse);let t=Ie(e,e,BA.schema({names:{keyDerivationFunc:{names:{blockName:N1}},encryptionScheme:{names:{blockName:T1}}}}));Ae.assertSchema(t,this.className),this.keyDerivationFunc=new ge({schema:t.result.keyDerivationFunc}),this.encryptionScheme=new ge({schema:t.result.encryptionScheme})}toSchema(){return new W({value:[this.keyDerivationFunc.toSchema(),this.encryptionScheme.toSchema()]})}toJSON(){return{keyDerivationFunc:this.keyDerivationFunc.toJSON(),encryptionScheme:this.encryptionScheme.toJSON()}}};ZI.CLASS_NAME="PBES2Params";var mse=class{static{o(this,"AbstractCryptoEngine")}constructor(e){this.crypto=e.crypto,this.subtle="webkitSubtle"in e.crypto?e.crypto.webkitSubtle:e.crypto.subtle,this.name=D(e,"name",L)}async encrypt(...e){return this.subtle.encrypt(...e)}async decrypt(...e){return this.subtle.decrypt(...e)}sign(...e){return this.subtle.sign(...e)}async verify(...e){return this.subtle.verify(...e)}async digest(...e){return this.subtle.digest(...e)}async generateKey(...e){return this.subtle.generateKey(...e)}async deriveKey(...e){return this.subtle.deriveKey(...e)}async deriveBits(...e){return this.subtle.deriveBits(...e)}async wrapKey(...e){return this.subtle.wrapKey(...e)}async unwrapKey(...e){return this.subtle.unwrapKey(...e)}exportKey(...e){return this.subtle.exportKey(...e)}importKey(...e){return this.subtle.importKey(...e)}getRandomValues(e){if(e===null)throw new Error('Argument "array" must not be null');return this.crypto.getRandomValues(e)}};async function J6(r,e,t,n,s){let i,a,u;switch(r.toUpperCase()){case"SHA-1":i=20,a=64,u=F6;break;case"SHA-256":i=32,a=64,u=JT;break;case"SHA-384":i=48,a=128,u=QT;break;case"SHA-512":i=64,a=128,u=YT;break;default:throw new Error("Unsupported hashing algorithm")}let l=new Uint8Array(t),f=new TextDecoder().decode(t);new TextEncoder().encode(f).some((C,x)=>C!==l[x])&&(f=String.fromCharCode(...l));let m=new Uint8Array(f.length*2+2),g=new DataView(m.buffer);for(let C=0;C<f.length;C++)g.setUint16(C*2,f.charCodeAt(C),!1);g.setUint16(f.length*2,0,!1);let w=new Uint8Array(a).fill(3),y=new Uint8Array(n),S=new Uint8Array(a*Math.ceil(y.length/a)).map((C,x)=>y[x%y.length]),E=new Uint8Array(a*Math.ceil(m.length/a)).map((C,x)=>m[x%m.length]),b=new Uint8Array(S.length+E.length);b.set(S),b.set(E,S.length);let T=Math.ceil((e>>3)/i),A=[];for(let C=0;C<T;C++){let x=new Uint8Array(w.length+b.length);x.set(w),x.set(b,w.length);for(let H=0;H<s;H++)x=u(x);let B=new Uint8Array(a).map((H,q)=>x[q%x.length]),F=Math.ceil(y.length/a)+Math.ceil(m.length/a),R=[];for(let H=0;H<F;H++){let q=Array.from(b.slice(H*a,(H+1)*a)),K=511;for(let G=B.length-1;G>=0;G--)K>>=8,K+=B[G]+(q[G]||0),q[G]=K&255;R.push(...q)}b=new Uint8Array(R),A.push(...x)}return new Uint8Array(A.slice(0,e>>3)).buffer}o(J6,"makePKCS12B2Key");function UU(r){let e=typeof r=="string"?{name:r}:r;return"hash"in e?{...e,hash:UU(e.hash)}:e}o(UU,"prepareAlgorithm");var S0=class extends mse{static{o(this,"CryptoEngine")}async importKey(e,t,n,s,i){var a,u,l,f,h,m;let g={},w=UU(n);switch(e.toLowerCase()){case"raw":return this.subtle.importKey("raw",t,n,s,i);case"spki":{let y=Hr(dt.toArrayBuffer(t));Ae.assert(y,"keyData");let S=new na;try{S.fromSchema(y.result)}catch{throw new Er("Incorrect keyData")}switch(w.name.toUpperCase()){case"RSA-PSS":{if(!w.hash)throw new fr("hash","algorithm.hash","Incorrect hash algorithm: Hash algorithm is missed");switch(w.hash.name.toUpperCase()){case"SHA-1":g.alg="PS1";break;case"SHA-256":g.alg="PS256";break;case"SHA-384":g.alg="PS384";break;case"SHA-512":g.alg="PS512";break;default:throw new Error(`Incorrect hash algorithm: ${w.hash.name.toUpperCase()}`)}}case"RSASSA-PKCS1-V1_5":{if(i=["verify"],g.kty="RSA",g.ext=s,g.key_ops=i,S.algorithm.algorithmId!=="1.2.840.113549.1.1.1")throw new Error(`Incorrect public key algorithm: ${S.algorithm.algorithmId}`);if(!g.alg){if(!w.hash)throw new fr("hash","algorithm.hash","Incorrect hash algorithm: Hash algorithm is missed");switch(w.hash.name.toUpperCase()){case"SHA-1":g.alg="RS1";break;case"SHA-256":g.alg="RS256";break;case"SHA-384":g.alg="RS384";break;case"SHA-512":g.alg="RS512";break;default:throw new Error(`Incorrect hash algorithm: ${w.hash.name.toUpperCase()}`)}}let E=S.toJSON();Object.assign(g,E)}break;case"ECDSA":i=["verify"];case"ECDH":{if(g={kty:"EC",ext:s,key_ops:i},S.algorithm.algorithmId!=="1.2.840.10045.2.1")throw new Error(`Incorrect public key algorithm: ${S.algorithm.algorithmId}`);let E=S.toJSON();Object.assign(g,E)}break;case"RSA-OAEP":{if(g.kty="RSA",g.ext=s,g.key_ops=i,this.name.toLowerCase()==="safari")g.alg="RSA-OAEP";else{if(!w.hash)throw new fr("hash","algorithm.hash","Incorrect hash algorithm: Hash algorithm is missed");switch(w.hash.name.toUpperCase()){case"SHA-1":g.alg="RSA-OAEP";break;case"SHA-256":g.alg="RSA-OAEP-256";break;case"SHA-384":g.alg="RSA-OAEP-384";break;case"SHA-512":g.alg="RSA-OAEP-512";break;default:throw new Error(`Incorrect hash algorithm: ${w.hash.name.toUpperCase()}`)}}let E=S.toJSON();Object.assign(g,E)}break;case"RSAES-PKCS1-V1_5":{g.kty="RSA",g.ext=s,g.key_ops=i,g.alg="PS1";let E=S.toJSON();Object.assign(g,E)}break;default:throw new Error(`Incorrect algorithm name: ${w.name.toUpperCase()}`)}}break;case"pkcs8":{let y=new cv,S=Hr(dt.toArrayBuffer(t));Ae.assert(S,"keyData");try{y.fromSchema(S.result)}catch{throw new Error("Incorrect keyData")}if(!y.parsedKey)throw new Error("Incorrect keyData");switch(w.name.toUpperCase()){case"RSA-PSS":switch((a=w.hash)===null||a===void 0?void 0:a.name.toUpperCase()){case"SHA-1":g.alg="PS1";break;case"SHA-256":g.alg="PS256";break;case"SHA-384":g.alg="PS384";break;case"SHA-512":g.alg="PS512";break;default:throw new Error(`Incorrect hash algorithm: ${(u=w.hash)===null||u===void 0?void 0:u.name.toUpperCase()}`)}case"RSASSA-PKCS1-V1_5":{if(i=["sign"],g.kty="RSA",g.ext=s,g.key_ops=i,y.privateKeyAlgorithm.algorithmId!=="1.2.840.113549.1.1.1")throw new Error(`Incorrect private key algorithm: ${y.privateKeyAlgorithm.algorithmId}`);if(!("alg"in g))switch((l=w.hash)===null||l===void 0?void 0:l.name.toUpperCase()){case"SHA-1":g.alg="RS1";break;case"SHA-256":g.alg="RS256";break;case"SHA-384":g.alg="RS384";break;case"SHA-512":g.alg="RS512";break;default:throw new Error(`Incorrect hash algorithm: ${(f=w.hash)===null||f===void 0?void 0:f.name.toUpperCase()}`)}let E=y.toJSON();Object.assign(g,E)}break;case"ECDSA":i=["sign"];case"ECDH":{if(g={kty:"EC",ext:s,key_ops:i},y.privateKeyAlgorithm.algorithmId!=="1.2.840.10045.2.1")throw new Error(`Incorrect algorithm: ${y.privateKeyAlgorithm.algorithmId}`);let E=y.toJSON();Object.assign(g,E)}break;case"RSA-OAEP":{if(g.kty="RSA",g.ext=s,g.key_ops=i,this.name.toLowerCase()==="safari")g.alg="RSA-OAEP";else switch((h=w.hash)===null||h===void 0?void 0:h.name.toUpperCase()){case"SHA-1":g.alg="RSA-OAEP";break;case"SHA-256":g.alg="RSA-OAEP-256";break;case"SHA-384":g.alg="RSA-OAEP-384";break;case"SHA-512":g.alg="RSA-OAEP-512";break;default:throw new Error(`Incorrect hash algorithm: ${(m=w.hash)===null||m===void 0?void 0:m.name.toUpperCase()}`)}let E=y.toJSON();Object.assign(g,E)}break;case"RSAES-PKCS1-V1_5":{i=["decrypt"],g.kty="RSA",g.ext=s,g.key_ops=i,g.alg="PS1";let E=y.toJSON();Object.assign(g,E)}break;default:throw new Error(`Incorrect algorithm name: ${w.name.toUpperCase()}`)}}break;case"jwk":g=t;break;default:throw new Error(`Incorrect format: ${e}`)}if(this.name.toLowerCase()==="safari")try{return this.subtle.importKey("jwk",Rc(JSON.stringify(g)),n,s,i)}catch{return this.subtle.importKey("jwk",g,n,s,i)}return this.subtle.importKey("jwk",g,n,s,i)}async exportKey(e,t){let n=await this.subtle.exportKey("jwk",t);switch(this.name.toLowerCase()==="safari"&&n instanceof ArrayBuffer&&(n=JSON.parse(fg(n))),e.toLowerCase()){case"raw":return this.subtle.exportKey("raw",t);case"spki":{let s=new na;try{s.fromJSON(n)}catch{throw new Error("Incorrect key data")}return s.toSchema().toBER(!1)}case"pkcs8":{let s=new cv;try{s.fromJSON(n)}catch{throw new Error("Incorrect key data")}return s.toSchema().toBER(!1)}case"jwk":return n;default:throw new Error(`Incorrect format: ${e}`)}}async convert(e,t,n,s,i,a){if(e.toLowerCase()===t.toLowerCase())return n;let u=await this.importKey(e,n,s,i,a);return this.exportKey(t,u)}getAlgorithmByOID(e,t=!1,n){switch(e){case"1.2.840.113549.1.1.1":return{name:"RSAES-PKCS1-v1_5"};case"1.2.840.113549.1.1.5":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case"1.2.840.113549.1.1.11":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"1.2.840.113549.1.1.12":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case"1.2.840.113549.1.1.13":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case"1.2.840.113549.1.1.10":return{name:"RSA-PSS"};case"1.2.840.113549.1.1.7":return{name:"RSA-OAEP"};case"1.2.840.10045.2.1":case"1.2.840.10045.4.1":return{name:"ECDSA",hash:{name:"SHA-1"}};case"1.2.840.10045.4.3.2":return{name:"ECDSA",hash:{name:"SHA-256"}};case"1.2.840.10045.4.3.3":return{name:"ECDSA",hash:{name:"SHA-384"}};case"1.2.840.10045.4.3.4":return{name:"ECDSA",hash:{name:"SHA-512"}};case"1.3.133.16.840.63.0.2":return{name:"ECDH",kdf:"SHA-1"};case"1.3.132.1.11.1":return{name:"ECDH",kdf:"SHA-256"};case"1.3.132.1.11.2":return{name:"ECDH",kdf:"SHA-384"};case"1.3.132.1.11.3":return{name:"ECDH",kdf:"SHA-512"};case"2.16.840.1.101.3.4.1.2":return{name:"AES-CBC",length:128};case"2.16.840.1.101.3.4.1.22":return{name:"AES-CBC",length:192};case"2.16.840.1.101.3.4.1.42":return{name:"AES-CBC",length:256};case"2.16.840.1.101.3.4.1.6":return{name:"AES-GCM",length:128};case"2.16.840.1.101.3.4.1.26":return{name:"AES-GCM",length:192};case"2.16.840.1.101.3.4.1.46":return{name:"AES-GCM",length:256};case"2.16.840.1.101.3.4.1.4":return{name:"AES-CFB",length:128};case"2.16.840.1.101.3.4.1.24":return{name:"AES-CFB",length:192};case"2.16.840.1.101.3.4.1.44":return{name:"AES-CFB",length:256};case"2.16.840.1.101.3.4.1.5":return{name:"AES-KW",length:128};case"2.16.840.1.101.3.4.1.25":return{name:"AES-KW",length:192};case"2.16.840.1.101.3.4.1.45":return{name:"AES-KW",length:256};case"1.2.840.113549.2.7":return{name:"HMAC",hash:{name:"SHA-1"}};case"1.2.840.113549.2.9":return{name:"HMAC",hash:{name:"SHA-256"}};case"1.2.840.113549.2.10":return{name:"HMAC",hash:{name:"SHA-384"}};case"1.2.840.113549.2.11":return{name:"HMAC",hash:{name:"SHA-512"}};case"1.2.840.113549.1.9.16.3.5":return{name:"DH"};case"1.3.14.3.2.26":return{name:"SHA-1"};case"2.16.840.1.101.3.4.2.1":return{name:"SHA-256"};case"2.16.840.1.101.3.4.2.2":return{name:"SHA-384"};case"2.16.840.1.101.3.4.2.3":return{name:"SHA-512"};case"1.2.840.113549.1.5.12":return{name:"PBKDF2"};case"1.2.840.10045.3.1.7":return{name:"P-256"};case"1.3.132.0.34":return{name:"P-384"};case"1.3.132.0.35":return{name:"P-521"}}if(t)throw new Error(`Unsupported algorithm identifier ${n?`for ${n} `:L}: ${e}`);return{}}getOIDByAlgorithm(e,t=!1,n){let s=L;switch(e.name.toUpperCase()){case"RSAES-PKCS1-V1_5":s="1.2.840.113549.1.1.1";break;case"RSASSA-PKCS1-V1_5":switch(e.hash.name.toUpperCase()){case"SHA-1":s="1.2.840.113549.1.1.5";break;case"SHA-256":s="1.2.840.113549.1.1.11";break;case"SHA-384":s="1.2.840.113549.1.1.12";break;case"SHA-512":s="1.2.840.113549.1.1.13";break}break;case"RSA-PSS":s="1.2.840.113549.1.1.10";break;case"RSA-OAEP":s="1.2.840.113549.1.1.7";break;case"ECDSA":switch(e.hash.name.toUpperCase()){case"SHA-1":s="1.2.840.10045.4.1";break;case"SHA-256":s="1.2.840.10045.4.3.2";break;case"SHA-384":s="1.2.840.10045.4.3.3";break;case"SHA-512":s="1.2.840.10045.4.3.4";break}break;case"ECDH":switch(e.kdf.toUpperCase()){case"SHA-1":s="1.3.133.16.840.63.0.2";break;case"SHA-256":s="1.3.132.1.11.1";break;case"SHA-384":s="1.3.132.1.11.2";break;case"SHA-512":s="1.3.132.1.11.3";break}break;case"AES-CTR":break;case"AES-CBC":switch(e.length){case 128:s="2.16.840.1.101.3.4.1.2";break;case 192:s="2.16.840.1.101.3.4.1.22";break;case 256:s="2.16.840.1.101.3.4.1.42";break}break;case"AES-CMAC":break;case"AES-GCM":switch(e.length){case 128:s="2.16.840.1.101.3.4.1.6";break;case 192:s="2.16.840.1.101.3.4.1.26";break;case 256:s="2.16.840.1.101.3.4.1.46";break}break;case"AES-CFB":switch(e.length){case 128:s="2.16.840.1.101.3.4.1.4";break;case 192:s="2.16.840.1.101.3.4.1.24";break;case 256:s="2.16.840.1.101.3.4.1.44";break}break;case"AES-KW":switch(e.length){case 128:s="2.16.840.1.101.3.4.1.5";break;case 192:s="2.16.840.1.101.3.4.1.25";break;case 256:s="2.16.840.1.101.3.4.1.45";break}break;case"HMAC":switch(e.hash.name.toUpperCase()){case"SHA-1":s="1.2.840.113549.2.7";break;case"SHA-256":s="1.2.840.113549.2.9";break;case"SHA-384":s="1.2.840.113549.2.10";break;case"SHA-512":s="1.2.840.113549.2.11";break}break;case"DH":s="1.2.840.113549.1.9.16.3.5";break;case"SHA-1":s="1.3.14.3.2.26";break;case"SHA-256":s="2.16.840.1.101.3.4.2.1";break;case"SHA-384":s="2.16.840.1.101.3.4.2.2";break;case"SHA-512":s="2.16.840.1.101.3.4.2.3";break;case"CONCAT":break;case"HKDF":break;case"PBKDF2":s="1.2.840.113549.1.5.12";break;case"P-256":s="1.2.840.10045.3.1.7";break;case"P-384":s="1.3.132.0.34";break;case"P-521":s="1.3.132.0.35";break}if(!s&&t)throw new Error(`Unsupported algorithm ${n?`for ${n} `:L}: ${e.name}`);return s}getAlgorithmParameters(e,t){let n={algorithm:{},usages:[]};switch(e.toUpperCase()){case"RSAES-PKCS1-V1_5":case"RSASSA-PKCS1-V1_5":switch(t.toLowerCase()){case"generatekey":n={algorithm:{name:"RSASSA-PKCS1-v1_5",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},usages:["sign","verify"]};break;case"verify":case"sign":case"importkey":n={algorithm:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},usages:["verify"]};break;case"exportkey":default:return{algorithm:{name:"RSASSA-PKCS1-v1_5"},usages:[]}}break;case"RSA-PSS":switch(t.toLowerCase()){case"sign":case"verify":n={algorithm:{name:"RSA-PSS",hash:{name:"SHA-1"},saltLength:20},usages:["sign","verify"]};break;case"generatekey":n={algorithm:{name:"RSA-PSS",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-1"}},usages:["sign","verify"]};break;case"importkey":n={algorithm:{name:"RSA-PSS",hash:{name:"SHA-1"}},usages:["verify"]};break;case"exportkey":default:return{algorithm:{name:"RSA-PSS"},usages:[]}}break;case"RSA-OAEP":switch(t.toLowerCase()){case"encrypt":case"decrypt":n={algorithm:{name:"RSA-OAEP"},usages:["encrypt","decrypt"]};break;case"generatekey":n={algorithm:{name:"RSA-OAEP",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;case"importkey":n={algorithm:{name:"RSA-OAEP",hash:{name:"SHA-256"}},usages:["encrypt"]};break;case"exportkey":default:return{algorithm:{name:"RSA-OAEP"},usages:[]}}break;case"ECDSA":switch(t.toLowerCase()){case"generatekey":n={algorithm:{name:"ECDSA",namedCurve:"P-256"},usages:["sign","verify"]};break;case"importkey":n={algorithm:{name:"ECDSA",namedCurve:"P-256"},usages:["verify"]};break;case"verify":case"sign":n={algorithm:{name:"ECDSA",hash:{name:"SHA-256"}},usages:["sign"]};break;default:return{algorithm:{name:"ECDSA"},usages:[]}}break;case"ECDH":switch(t.toLowerCase()){case"exportkey":case"importkey":case"generatekey":n={algorithm:{name:"ECDH",namedCurve:"P-256"},usages:["deriveKey","deriveBits"]};break;case"derivekey":case"derivebits":n={algorithm:{name:"ECDH",namedCurve:"P-256",public:[]},usages:["encrypt","decrypt"]};break;default:return{algorithm:{name:"ECDH"},usages:[]}}break;case"AES-CTR":switch(t.toLowerCase()){case"importkey":case"exportkey":case"generatekey":n={algorithm:{name:"AES-CTR",length:256},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;case"decrypt":case"encrypt":n={algorithm:{name:"AES-CTR",counter:new Uint8Array(16),length:10},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;default:return{algorithm:{name:"AES-CTR"},usages:[]}}break;case"AES-CBC":switch(t.toLowerCase()){case"importkey":case"exportkey":case"generatekey":n={algorithm:{name:"AES-CBC",length:256},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;case"decrypt":case"encrypt":n={algorithm:{name:"AES-CBC",iv:this.getRandomValues(new Uint8Array(16))},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;default:return{algorithm:{name:"AES-CBC"},usages:[]}}break;case"AES-GCM":switch(t.toLowerCase()){case"importkey":case"exportkey":case"generatekey":n={algorithm:{name:"AES-GCM",length:256},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;case"decrypt":case"encrypt":n={algorithm:{name:"AES-GCM",iv:this.getRandomValues(new Uint8Array(16))},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;default:return{algorithm:{name:"AES-GCM"},usages:[]}}break;case"AES-KW":switch(t.toLowerCase()){case"importkey":case"exportkey":case"generatekey":case"wrapkey":case"unwrapkey":n={algorithm:{name:"AES-KW",length:256},usages:["wrapKey","unwrapKey"]};break;default:return{algorithm:{name:"AES-KW"},usages:[]}}break;case"HMAC":switch(t.toLowerCase()){case"sign":case"verify":n={algorithm:{name:"HMAC"},usages:["sign","verify"]};break;case"importkey":case"exportkey":case"generatekey":n={algorithm:{name:"HMAC",length:32,hash:{name:"SHA-256"}},usages:["sign","verify"]};break;default:return{algorithm:{name:"HMAC"},usages:[]}}break;case"HKDF":switch(t.toLowerCase()){case"derivekey":n={algorithm:{name:"HKDF",hash:"SHA-256",salt:new Uint8Array([]),info:new Uint8Array([])},usages:["encrypt","decrypt"]};break;default:return{algorithm:{name:"HKDF"},usages:[]}}break;case"PBKDF2":switch(t.toLowerCase()){case"derivekey":n={algorithm:{name:"PBKDF2",hash:{name:"SHA-256"},salt:new Uint8Array([]),iterations:1e4},usages:["encrypt","decrypt"]};break;default:return{algorithm:{name:"PBKDF2"},usages:[]}}break}return n}getHashAlgorithm(e){let t=L;switch(e.algorithmId){case"1.2.840.10045.4.1":case"1.2.840.113549.1.1.5":t="SHA-1";break;case"1.2.840.10045.4.3.2":case"1.2.840.113549.1.1.11":t="SHA-256";break;case"1.2.840.10045.4.3.3":case"1.2.840.113549.1.1.12":t="SHA-384";break;case"1.2.840.10045.4.3.4":case"1.2.840.113549.1.1.13":t="SHA-512";break;case"1.2.840.113549.1.1.10":try{let n=new IA({schema:e.algorithmParams});if(n.hashAlgorithm){let s=this.getAlgorithmByOID(n.hashAlgorithm.algorithmId);if("name"in s)t=s.name;else return L}else t="SHA-1"}catch{}break}return t}async encryptEncryptedContentInfo(e){fr.assert(e,"password","contentEncryptionAlgorithm","hmacHashAlgorithm","iterationCount","contentToEncrypt","contentToEncrypt","contentType");let t=this.getOIDByAlgorithm(e.contentEncryptionAlgorithm,!0,"contentEncryptionAlgorithm"),n=this.getOIDByAlgorithm({name:"PBKDF2"},!0,"PBKDF2"),s=this.getOIDByAlgorithm({name:"HMAC",hash:{name:e.hmacHashAlgorithm}},!0,"hmacHashAlgorithm"),i=new ArrayBuffer(16),a=new Uint8Array(i);this.getRandomValues(a);let u=new ArrayBuffer(64),l=new Uint8Array(u);this.getRandomValues(l);let f=new Uint8Array(e.contentToEncrypt),h=new v0({salt:new Ve({valueHex:u}),iterationCount:e.iterationCount,prf:new ge({algorithmId:s,algorithmParams:new Kr})}),m=new Uint8Array(e.password),g=await this.importKey("raw",m,"PBKDF2",!1,["deriveKey"]),w=await this.deriveKey({name:"PBKDF2",hash:{name:e.hmacHashAlgorithm},salt:l,iterations:e.iterationCount},g,e.contentEncryptionAlgorithm,!1,["encrypt"]),y=await this.encrypt({name:e.contentEncryptionAlgorithm.name,iv:a},w,f),S=new ZI({keyDerivationFunc:new ge({algorithmId:n,algorithmParams:h.toSchema()}),encryptionScheme:new ge({algorithmId:t,algorithmParams:new Ve({valueHex:i})})});return new es({contentType:e.contentType,contentEncryptionAlgorithm:new ge({algorithmId:"1.2.840.113549.1.5.13",algorithmParams:S.toSchema()}),encryptedContent:new Ve({valueHex:y})})}async decryptEncryptedContentInfo(e){if(fr.assert(e,"password","encryptedContentInfo"),e.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId!=="1.2.840.113549.1.5.13")throw new Error(`Unknown "contentEncryptionAlgorithm": ${e.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId}`);let t;try{t=new ZI({schema:e.encryptedContentInfo.contentEncryptionAlgorithm.algorithmParams})}catch{throw new Error('Incorrectly encoded "pbes2Parameters"')}let n;try{n=new v0({schema:t.keyDerivationFunc.algorithmParams})}catch{throw new Error('Incorrectly encoded "pbkdf2Params"')}let s=this.getAlgorithmByOID(t.encryptionScheme.algorithmId,!0),i=t.encryptionScheme.algorithmParams.valueBlock.valueHex,a=new Uint8Array(i),u=n.salt.valueBlock.valueHex,l=new Uint8Array(u),f=n.iterationCount,h="SHA-1";n.prf&&(h=this.getAlgorithmByOID(n.prf.algorithmId,!0).hash.name);let m=await this.importKey("raw",e.password,"PBKDF2",!1,["deriveKey"]),g=await this.deriveKey({name:"PBKDF2",hash:{name:h},salt:l,iterations:f},m,s,!1,["decrypt"]),w=e.encryptedContentInfo.getEncryptedContent();return this.decrypt({name:s.name,iv:a},g,w)}async stampDataWithPassword(e){if(!(e instanceof Object))throw new Error('Parameters must have type "Object"');fr.assert(e,"password","hashAlgorithm","iterationCount","salt","contentToStamp");let t;switch(e.hashAlgorithm.toLowerCase()){case"sha-1":t=160;break;case"sha-256":t=256;break;case"sha-384":t=384;break;case"sha-512":t=512;break;default:throw new Error(`Incorrect "parameters.hashAlgorithm" parameter: ${e.hashAlgorithm}`)}let n={name:"HMAC",length:t,hash:{name:e.hashAlgorithm}},s=await J6(e.hashAlgorithm,t,e.password,e.salt,e.iterationCount),i=await this.importKey("raw",new Uint8Array(s),n,!1,["sign"]);return this.sign(n,i,new Uint8Array(e.contentToStamp))}async verifyDataStampedWithPassword(e){fr.assert(e,"password","hashAlgorithm","salt","iterationCount","contentToVerify","signatureToVerify");let t=0;switch(e.hashAlgorithm.toLowerCase()){case"sha-1":t=160;break;case"sha-256":t=256;break;case"sha-384":t=384;break;case"sha-512":t=512;break;default:throw new Error(`Incorrect "parameters.hashAlgorithm" parameter: ${e.hashAlgorithm}`)}let n={name:"HMAC",length:t,hash:{name:e.hashAlgorithm}},s=await J6(e.hashAlgorithm,t,e.password,e.salt,e.iterationCount),i=await this.importKey("raw",new Uint8Array(s),n,!1,["verify"]);return this.verify(n,i,new Uint8Array(e.signatureToVerify),new Uint8Array(e.contentToVerify))}async getSignatureParameters(e,t="SHA-1"){this.getOIDByAlgorithm({name:t},!0,"hashAlgorithm");let n=new ge,s=this.getAlgorithmParameters(e.algorithm.name,"sign");if(!Object.keys(s.algorithm).length)throw new Error("Parameter 'algorithm' is empty");let i=s.algorithm;switch("hash"in e.algorithm&&e.algorithm.hash&&e.algorithm.hash.name?i.hash.name=e.algorithm.hash.name:i.hash.name=t,e.algorithm.name.toUpperCase()){case"RSASSA-PKCS1-V1_5":case"ECDSA":n.algorithmId=this.getOIDByAlgorithm(i,!0);break;case"RSA-PSS":{switch(i.hash.name.toUpperCase()){case"SHA-256":i.saltLength=32;break;case"SHA-384":i.saltLength=48;break;case"SHA-512":i.saltLength=64;break}let a={};if(i.hash.name.toUpperCase()!=="SHA-1"){let l=this.getOIDByAlgorithm({name:i.hash.name},!0,"hashAlgorithm");a.hashAlgorithm=new ge({algorithmId:l,algorithmParams:new Kr}),a.maskGenAlgorithm=new ge({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:a.hashAlgorithm.toSchema()})}i.saltLength!==20&&(a.saltLength=i.saltLength);let u=new IA(a);n.algorithmId="1.2.840.113549.1.1.10",n.algorithmParams=u.toSchema()}break;default:throw new Error(`Unsupported signature algorithm: ${e.algorithm.name}`)}return{signatureAlgorithm:n,parameters:s}}async signWithPrivateKey(e,t,n){let s=await this.sign(n.algorithm,t,e);return n.algorithm.name==="ECDSA"?yse(s):s}fillPublicKeyParameters(e,t){let n={},s=this.getHashAlgorithm(t);if(s===L)throw new Error(`Unsupported signature algorithm: ${t.algorithmId}`);let i;t.algorithmId==="1.2.840.113549.1.1.10"?i=t.algorithmId:i=e.algorithm.algorithmId;let a=this.getAlgorithmByOID(i,!0);if(n.algorithm=this.getAlgorithmParameters(a.name,"importKey"),"hash"in n.algorithm.algorithm&&(n.algorithm.algorithm.hash.name=s),a.name==="ECDSA"){let u=e.algorithm;if(!u.algorithmParams)throw new Error("Algorithm parameters for ECDSA public key are missed");let l=u.algorithmParams;if("idBlock"in u.algorithmParams&&!(l.idBlock.tagClass===1&&l.idBlock.tagNumber===6))throw new Error("Incorrect type for ECDSA public key parameters");let f=this.getAlgorithmByOID(l.valueBlock.toString(),!0);n.algorithm.algorithm.namedCurve=f.name}return n}async getPublicKey(e,t,n){n||(n=this.fillPublicKeyParameters(e,t));let s=e.toSchema().toBER(!1);return this.importKey("spki",s,n.algorithm.algorithm,!0,n.algorithm.usages)}async verifyWithPublicKey(e,t,n,s,i){let a;if(i){let f={},h;s.algorithmId==="1.2.840.113549.1.1.10"?h=s.algorithmId:h=n.algorithm.algorithmId;let m=this.getAlgorithmByOID(h,!0);if(f.algorithm=this.getAlgorithmParameters(m.name,"importKey"),"hash"in f.algorithm.algorithm&&(f.algorithm.algorithm.hash.name=i),m.name==="ECDSA"){let g=!1;if("algorithmParams"in n.algorithm&&"idBlock"in n.algorithm.algorithmParams&&n.algorithm.algorithmParams.idBlock.tagClass===1&&n.algorithm.algorithmParams.idBlock.tagNumber===6&&(g=!0),g===!1)throw new Error("Incorrect type for ECDSA public key parameters");let w=this.getAlgorithmByOID(n.algorithm.algorithmParams.valueBlock.toString(),!0);f.algorithm.algorithm.namedCurve=w.name}a=await this.getPublicKey(n,null,f)}else{if(i=this.getHashAlgorithm(s),!i)throw new Error(`Unsupported signature algorithm: ${s.algorithmId}`);a=await this.getPublicKey(n,s)}let u=this.getAlgorithmParameters(a.algorithm.name,"verify");"hash"in u.algorithm&&(u.algorithm.hash.name=i);let l=t.valueBlock.valueHexView;if(a.algorithm.name==="ECDSA"){let f=Yl.find(a.algorithm.namedCurve);if(!f)throw new Error("Unsupported named curve in use");let h=Hr(l);Ae.assert(h,"Signature value"),l=vse(h.result,f.size)}if(a.algorithm.name==="RSA-PSS"){let f=new IA({schema:s.algorithmParams});"saltLength"in f?u.algorithm.saltLength=f.saltLength:u.algorithm.saltLength=20;let h="SHA-1";"hashAlgorithm"in f&&(h=this.getAlgorithmByOID(f.hashAlgorithm.algorithmId,!0).name),u.algorithm.hash.name=h}return this.verify(u.algorithm,a,l,e)}},MU={name:"none",crypto:null};function z6(r){return!!(r&&typeof r=="object"&&"crypto"in r)}o(z6,"isCryptoEngine");function NC(r,...e){let t=null;if(e.length<2)e.length?t=e[0]:t=typeof self<"u"&&self.crypto?new S0({name:"browser",crypto:self.crypto}):null;else{let n=e[0],s=e[1];z6(s)?t=s:z6(n)?t=n:"subtle"in n&&"getRandomValues"in n&&(t=new S0({crypto:n}))}if(typeof process<"u"&&"pid"in process&&typeof global<"u"&&typeof window>"u"){if(typeof global[process.pid]>"u")global[process.pid]={};else if(typeof global[process.pid]!="object")throw new Error(`Name global.${process.pid} already exists and it is not an object`);if(typeof global[process.pid].pkijs>"u")global[process.pid].pkijs={};else if(typeof global[process.pid].pkijs!="object")throw new Error(`Name global.${process.pid}.pkijs already exists and it is not an object`);global[process.pid].pkijs.engine={name:r,crypto:t}}else MU={name:r,crypto:t}}o(NC,"setEngine");function gse(){if(typeof process<"u"&&"pid"in process&&typeof global<"u"&&typeof window>"u"){let r;try{r=global[process.pid].pkijs.engine}catch{throw new Error("Please call 'setEngine' before call to 'getEngine'")}return r}return MU}o(gse,"getEngine");function _t(r=!1){let e=gse();if(!e.crypto&&r)throw new Error("Unable to create WebCrypto object");return e.crypto}o(_t,"getCrypto");function yse(r){if(r.byteLength%2!==0)return Qr;let e=r.byteLength/2,t=new ArrayBuffer(e);new Uint8Array(t).set(new Uint8Array(r,0,e));let s=new me({valueHex:t}),i=new ArrayBuffer(e);new Uint8Array(i).set(new Uint8Array(r,e,e));let u=new me({valueHex:i});return new W({value:[s.convertToDER(),u.convertToDER()]}).toBER(!1)}o(yse,"createCMSECDSASignature");function vse(r,e){if(!(r instanceof W&&r.valueBlock.value.length===2&&r.valueBlock.value[0]instanceof me&&r.valueBlock.value[1]instanceof me))return Qr;let t=r.valueBlock.value[0].convertFromDER().valueBlock.valueHexView,n=r.valueBlock.value[1].convertFromDER().valueBlock.valueHexView,s=new Uint8Array(e*2);return s.set(t,e-t.byteLength),s.set(n,2*e-n.byteLength),s.buffer}o(vse,"createECDSASignatureFromCMS");async function wse(r,e,t,n,s){switch(r.toUpperCase()){case"SHA-1":case"SHA-256":case"SHA-384":case"SHA-512":break;default:throw new Er(`Unknown hash function: ${r}`)}if(Er.assert(e,"zBuffer","ArrayBuffer"),e.byteLength===0)throw new Er("'zBuffer' has zero length, error");if(Er.assert(n,"SharedInfo","ArrayBuffer"),t>255)throw new Er("Please set 'Counter' argument to value less or equal to 255");let i=new ArrayBuffer(4),a=new Uint8Array(i);a[0]=0,a[1]=0,a[2]=0,a[3]=t;let u=Qr;u=_c(u,e),u=_c(u,i),u=_c(u,n);let l=await s.digest({name:r},u);return{counter:t,result:l}}o(wse,"kdfWithCounter");async function Y6(r,e,t,n,s=_t(!0)){let i=0,a=1;switch(r.toUpperCase()){case"SHA-1":i=160;break;case"SHA-256":i=256;break;case"SHA-384":i=384;break;case"SHA-512":i=512;break;default:throw new Er(`Unknown hash function: ${r}`)}if(Er.assert(e,"Zbuffer","ArrayBuffer"),e.byteLength===0)throw new Er("'Zbuffer' has zero length, error");Er.assert(n,"SharedInfo","ArrayBuffer");let u=t/i;Math.floor(u)>0&&(a=Math.floor(u),u-a>0&&a++);let l=[];for(let g=1;g<=a;g++)l.push(await wse(r,e,g,n,s));let f=Qr,h=1,m=!0;for(;m;){m=!1;for(let g of l)if(g.counter===h){f=_c(f,g.result),m=!0;break}h++}if(t>>=3,f.byteLength>t){let g=new ArrayBuffer(t),w=new Uint8Array(g),y=new Uint8Array(f);for(let S=0;S<t;S++)w[S]=y[S];return g}return f}o(Y6,"kdf");var rI="version",nI="logID",sI="extensions",iI="timestamp",aI="hashAlgorithm",oI="signatureAlgorithm",uI="signature",Q6="none",Z6="md5",eU="sha1",tU="sha224",rU="sha256",nU="sha384",sU="sha512",iU="anonymous",aU="rsa",oU="dsa",uU="ecdsa",jU=class Sl extends Be{static{o(this,"SignedCertificateTimestamp")}constructor(e={}){super(),this.version=D(e,rI,Sl.defaultValues(rI)),this.logID=D(e,nI,Sl.defaultValues(nI)),this.timestamp=D(e,iI,Sl.defaultValues(iI)),this.extensions=D(e,sI,Sl.defaultValues(sI)),this.hashAlgorithm=D(e,aI,Sl.defaultValues(aI)),this.signatureAlgorithm=D(e,oI,Sl.defaultValues(oI)),this.signature=D(e,uI,Sl.defaultValues(uI)),"stream"in e&&e.stream&&this.fromStream(e.stream),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case rI:return 0;case nI:case sI:return Qr;case iI:return new Date(0);case aI:case oI:return L;case uI:return Qr;default:return super.defaultValues(e)}}fromSchema(e){if(!(e instanceof vg))throw new Error("Object's schema was not verified against input data for SignedCertificateTimestamp");let t=new Io({stream:new Un({buffer:e.data})});this.fromStream(t)}fromStream(e){let t=e.getUint16();if(this.version=e.getBlock(1)[0],this.version===0){this.logID=new Uint8Array(e.getBlock(32)).buffer.slice(0),this.timestamp=new Date(xo(new Uint8Array(e.getBlock(8)),8));let n=e.getUint16();switch(this.extensions=new Uint8Array(e.getBlock(n)).buffer.slice(0),e.getBlock(1)[0]){case 0:this.hashAlgorithm=Q6;break;case 1:this.hashAlgorithm=Z6;break;case 2:this.hashAlgorithm=eU;break;case 3:this.hashAlgorithm=tU;break;case 4:this.hashAlgorithm=rU;break;case 5:this.hashAlgorithm=nU;break;case 6:this.hashAlgorithm=sU;break;default:throw new Error("Object's stream was not correct for SignedCertificateTimestamp")}switch(e.getBlock(1)[0]){case 0:this.signatureAlgorithm=iU;break;case 1:this.signatureAlgorithm=aU;break;case 2:this.signatureAlgorithm=oU;break;case 3:this.signatureAlgorithm=uU;break;default:throw new Error("Object's stream was not correct for SignedCertificateTimestamp")}let s=e.getUint16();if(this.signature=new Uint8Array(e.getBlock(s)).buffer.slice(0),t!==47+n+s)throw new Error("Object's stream was not correct for SignedCertificateTimestamp")}}toSchema(){let e=this.toStream();return new vg({data:e.stream.buffer})}toStream(){let e=new Io;e.appendUint16(47+this.extensions.byteLength+this.signature.byteLength),e.appendChar(this.version),e.appendView(new Uint8Array(this.logID));let t=new ArrayBuffer(8),n=new Uint8Array(t),s=Xi(this.timestamp.valueOf(),8);n.set(new Uint8Array(s),8-s.byteLength),e.appendView(n),e.appendUint16(this.extensions.byteLength),this.extensions.byteLength&&e.appendView(new Uint8Array(this.extensions));let i;switch(this.hashAlgorithm.toLowerCase()){case Q6:i=0;break;case Z6:i=1;break;case eU:i=2;break;case tU:i=3;break;case rU:i=4;break;case nU:i=5;break;case sU:i=6;break;default:throw new Error(`Incorrect data for hashAlgorithm: ${this.hashAlgorithm}`)}e.appendChar(i);let a;switch(this.signatureAlgorithm.toLowerCase()){case iU:a=0;break;case aU:a=1;break;case oU:a=2;break;case uU:a=3;break;default:throw new Error(`Incorrect data for signatureAlgorithm: ${this.signatureAlgorithm}`)}return e.appendChar(a),e.appendUint16(this.signature.byteLength),e.appendView(new Uint8Array(this.signature)),e}toJSON(){return{version:this.version,logID:bE(this.logID),timestamp:this.timestamp,extensions:bE(this.extensions),hashAlgorithm:this.hashAlgorithm,signatureAlgorithm:this.signatureAlgorithm,signature:bE(this.signature)}}async verify(e,t,n=0,s=_t(!0)){let i=NE(fg(this.logID)),a=null,u=new Io;for(let w of e)if(w.log_id===i){a=w.key;break}if(!a)throw new Error(`Public key not found for CT with logId: ${i}`);let l=Rc(Ip(a)),f=na.fromBER(l);u.appendChar(0),u.appendChar(0);let h=new ArrayBuffer(8),m=new Uint8Array(h),g=Xi(this.timestamp.valueOf(),8);return m.set(new Uint8Array(g),8-g.byteLength),u.appendView(m),u.appendUint16(n),n===0&&u.appendUint24(t.byteLength),u.appendView(new Uint8Array(t)),u.appendUint16(this.extensions.byteLength),this.extensions.byteLength!==0&&u.appendView(new Uint8Array(this.extensions)),s.verifyWithPublicKey(u.buffer.slice(0,u.length),new Ve({valueHex:this.signature}),f,{algorithmId:L},"SHA-256")}};jU.CLASS_NAME="SignedCertificateTimestamp";var XE="timestamps",FU=class qU extends Be{static{o(this,"SignedCertificateTimestampList")}constructor(e={}){super(),this.timestamps=D(e,XE,qU.defaultValues(XE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case XE:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case XE:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){var t;let n=D(e,"names",{});return(t=n.optional)!==null&&t!==void 0||(n.optional=!1),new Ve({name:n.blockName||"SignedCertificateTimestampList",optional:n.optional})}fromSchema(e){if(!(e instanceof Ve))throw new Error("Object's schema was not verified against input data for SignedCertificateTimestampList");let t=new Io({stream:new Un({buffer:e.valueBlock.valueHex})});if(t.getUint16()!==t.length)throw new Error("Object's schema was not verified against input data for SignedCertificateTimestampList");for(;t.length;)this.timestamps.push(new jU({stream:t}))}toSchema(){let e=new Io,t=0,n=[];for(let s of this.timestamps){let i=s.toStream();n.push(i),t+=i.stream.buffer.byteLength}e.appendUint16(t);for(let s of n)e.appendView(s.stream.view);return new Ve({valueHex:e.stream.buffer.slice(0)})}toJSON(){return{timestamps:Array.from(this.timestamps,e=>e.toJSON())}}};FU.CLASS_NAME="SignedCertificateTimestampList";var I1="attributes",Sse=[I1],HU=class eB extends Be{static{o(this,"SubjectDirectoryAttributes")}constructor(e={}){super(),this.attributes=D(e,I1,eB.defaultValues(I1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case I1:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.attributes||L,value:Zr.schema()})]})}fromSchema(e){_e(e,Sse);let t=Ie(e,e,eB.schema({names:{attributes:I1}}));Ae.assertSchema(t,this.className),this.attributes=Array.from(t.result.attributes,n=>new Zr({schema:n}))}toSchema(){return new W({value:Array.from(this.attributes,e=>e.toSchema())})}toJSON(){return{attributes:Array.from(this.attributes,e=>e.toJSON())}}};HU.CLASS_NAME="SubjectDirectoryAttributes";var Ese=class Xr{static{o(this,"ExtensionValueFactory")}static getItems(){return this.types||(this.types={},Xr.register(mU,"SubjectAltName",RI),Xr.register(gU,"IssuerAltName",RI),Xr.register(VB,"AuthorityKeyIdentifier",FB),Xr.register(kB,"BasicConstraints",qB),Xr.register(Lne,"MicrosoftCaVersion",TU),Xr.register(EU,"CertificatePolicies",UI),Xr.register(Dne,"CertificatePoliciesMicrosoft",UI),Xr.register(kne,"MicrosoftCertTemplateV2",Xne),Xr.register(SU,"CRLDistributionPoints",FI),Xr.register(LB,"FreshestCRL",FI),Xr.register(_ne,"ExtKeyUsage",DU),Xr.register(vU,"CertificateIssuer",Mn),Xr.register(UB,"AuthorityInfoAccess",KI),Xr.register(Pne,"SubjectInfoAccess",KI),Xr.register(yU,"IssuingDistributionPoint",RU),Xr.register(wU,"NameConstraints",PU),Xr.register(CU,"PolicyConstraints",OU),Xr.register(AU,"PolicyMappings",kU),Xr.register(xne,"PrivateKeyUsagePeriod",LU),Xr.register(Vne,"QCStatements",VU),Xr.register(One,"SignedCertificateTimestampList",FU),Xr.register(Ane,"SubjectDirectoryAttributes",HU)),this.types}static fromBER(e,t){let n=Hr(t);if(n.offset===-1)return null;let s=this.find(e);if(s)try{return new s.type({schema:n.result})}catch{let i=new s.type;return i.parsingError=`Incorrectly formatted value of extension ${s.name} (${e})`,i}return n.result}static find(e){return this.getItems()[e]||null}static register(e,t,n){this.getItems()[e]={name:t,type:n}}},B1="extnID",El="critical",D1="extnValue",GE="parsedValue",Ase=[B1,El,D1],_i=class Al extends Be{static{o(this,"Extension")}get parsedValue(){if(this._parsedValue===void 0){let e=Ese.fromBER(this.extnID,this.extnValue.valueBlock.valueHexView);this._parsedValue=e}return this._parsedValue||void 0}set parsedValue(e){this._parsedValue=e}constructor(e={}){super(),this.extnID=D(e,B1,Al.defaultValues(B1)),this.critical=D(e,El,Al.defaultValues(El)),D1 in e?this.extnValue=new Ve({valueHex:e.extnValue}):this.extnValue=Al.defaultValues(D1),GE in e&&(this.parsedValue=D(e,GE,Al.defaultValues(GE))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case B1:return L;case El:return!1;case D1:return new Ve;case GE:return{};default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.extnID||L}),new Wi({name:t.critical||L,optional:!0}),new Ve({name:t.extnValue||L})]})}fromSchema(e){_e(e,Ase);let t=Ie(e,e,Al.schema({names:{extnID:B1,critical:El,extnValue:D1}}));Ae.assertSchema(t,this.className),this.extnID=t.result.extnID.valueBlock.toString(),El in t.result&&(this.critical=t.result.critical.valueBlock.value),this.extnValue=t.result.extnValue}toSchema(){let e=[];return e.push(new rt({value:this.extnID})),this.critical!==Al.defaultValues(El)&&e.push(new Wi({value:this.critical})),e.push(this.extnValue),new W({value:e})}toJSON(){let e={extnID:this.extnID,extnValue:this.extnValue.toJSON()};return this.critical!==Al.defaultValues(El)&&(e.critical=this.critical),this.parsedValue&&this.parsedValue.toJSON&&(e.parsedValue=this.parsedValue.toJSON()),e}};_i.CLASS_NAME="Extension";var _1="extensions",Cse=[_1],wn=class tB extends Be{static{o(this,"Extensions")}constructor(e={}){super(),this.extensions=D(e,_1,tB.defaultValues(_1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case _1:return[];default:return super.defaultValues(e)}}static schema(e={},t=!1){let n=D(e,"names",{});return new W({optional:t,name:n.blockName||L,value:[new Tt({name:n.extensions||L,value:_i.schema(n.extension||{})})]})}fromSchema(e){_e(e,Cse);let t=Ie(e,e,tB.schema({names:{extensions:_1}}));Ae.assertSchema(t,this.className),this.extensions=Array.from(t.result.extensions,n=>new _i({schema:n}))}toSchema(){return new W({value:Array.from(this.extensions,e=>e.toSchema())})}toJSON(){return{extensions:this.extensions.map(e=>e.toJSON())}}};wn.CLASS_NAME="Extensions";var R1="issuer",P1="serialNumber",nf="issuerUID",bse=[R1,P1,nf],Xa=class O1 extends Be{static{o(this,"IssuerSerial")}constructor(e={}){super(),this.issuer=D(e,R1,O1.defaultValues(R1)),this.serialNumber=D(e,P1,O1.defaultValues(P1)),nf in e&&(this.issuerUID=D(e,nf,O1.defaultValues(nf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case R1:return new Mn;case P1:return new me;case nf:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Mn.schema(t.issuer||{}),new me({name:t.serialNumber||L}),new qt({optional:!0,name:t.issuerUID||L})]})}fromSchema(e){_e(e,bse);let t=Ie(e,e,O1.schema({names:{issuer:{names:{blockName:R1}},serialNumber:P1,issuerUID:nf}}));Ae.assertSchema(t,this.className),this.issuer=new Mn({schema:t.result.issuer}),this.serialNumber=t.result.serialNumber,nf in t.result&&(this.issuerUID=t.result.issuerUID)}toSchema(){let e=new W({value:[this.issuer.toSchema(),this.serialNumber]});return this.issuerUID&&e.valueBlock.value.push(this.issuerUID),e}toJSON(){let e={issuer:this.issuer.toJSON(),serialNumber:this.serialNumber.toJSON()};return this.issuerUID&&(e.issuerUID=this.issuerUID.toJSON()),e}};Xa.CLASS_NAME="IssuerSerial";var k1="version",sf="baseCertificateID",af="subjectName",L1="issuer",V1="signature",U1="serialNumber",M1="attrCertValidityPeriod",j1="attributes",of="issuerUniqueID",uf="extensions",xse=[k1,sf,af,L1,V1,U1,M1,j1,of,uf],DA=class Bi extends Be{static{o(this,"AttributeCertificateInfoV1")}constructor(e={}){super(),this.version=D(e,k1,Bi.defaultValues(k1)),sf in e&&(this.baseCertificateID=D(e,sf,Bi.defaultValues(sf))),af in e&&(this.subjectName=D(e,af,Bi.defaultValues(af))),this.issuer=D(e,L1,Bi.defaultValues(L1)),this.signature=D(e,V1,Bi.defaultValues(V1)),this.serialNumber=D(e,U1,Bi.defaultValues(U1)),this.attrCertValidityPeriod=D(e,M1,Bi.defaultValues(M1)),this.attributes=D(e,j1,Bi.defaultValues(j1)),of in e&&(this.issuerUniqueID=D(e,of,Bi.defaultValues(of))),uf in e&&(this.extensions=D(e,uf,Bi.defaultValues(uf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case k1:return 0;case sf:return new Xa;case af:return new Mn;case L1:return new Mn;case V1:return new ge;case U1:return new me;case M1:return new nh;case j1:return[];case of:return new qt;case uf:return new wn;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new Pr({value:[new ae({name:t.baseCertificateID||L,idBlock:{tagClass:3,tagNumber:0},value:Xa.schema().valueBlock.value}),new ae({name:t.subjectName||L,idBlock:{tagClass:3,tagNumber:1},value:Mn.schema().valueBlock.value})]}),Mn.schema({names:{blockName:t.issuer||L}}),ge.schema(t.signature||{}),new me({name:t.serialNumber||L}),nh.schema(t.attrCertValidityPeriod||{}),new W({name:t.attributes||L,value:[new Tt({value:Zr.schema()})]}),new qt({optional:!0,name:t.issuerUniqueID||L}),wn.schema(t.extensions||{},!0)]})}fromSchema(e){_e(e,xse);let t=Ie(e,e,Bi.schema({names:{version:k1,baseCertificateID:sf,subjectName:af,issuer:L1,signature:{names:{blockName:V1}},serialNumber:U1,attrCertValidityPeriod:{names:{blockName:M1}},attributes:j1,issuerUniqueID:of,extensions:{names:{blockName:uf}}}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,sf in t.result&&(this.baseCertificateID=new Xa({schema:new W({value:t.result.baseCertificateID.valueBlock.value})})),af in t.result&&(this.subjectName=new Mn({schema:new W({value:t.result.subjectName.valueBlock.value})})),this.issuer=t.result.issuer,this.signature=new ge({schema:t.result.signature}),this.serialNumber=t.result.serialNumber,this.attrCertValidityPeriod=new nh({schema:t.result.attrCertValidityPeriod}),this.attributes=Array.from(t.result.attributes.valueBlock.value,n=>new Zr({schema:n})),of in t.result&&(this.issuerUniqueID=t.result.issuerUniqueID),uf in t.result&&(this.extensions=new wn({schema:t.result.extensions}))}toSchema(){let e=new W({value:[new me({value:this.version})]});return this.baseCertificateID&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:this.baseCertificateID.toSchema().valueBlock.value})),this.subjectName&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:this.subjectName.toSchema().valueBlock.value})),e.valueBlock.value.push(this.issuer.toSchema()),e.valueBlock.value.push(this.signature.toSchema()),e.valueBlock.value.push(this.serialNumber),e.valueBlock.value.push(this.attrCertValidityPeriod.toSchema()),e.valueBlock.value.push(new W({value:Array.from(this.attributes,t=>t.toSchema())})),this.issuerUniqueID&&e.valueBlock.value.push(this.issuerUniqueID),this.extensions&&e.valueBlock.value.push(this.extensions.toSchema()),e}toJSON(){let e={version:this.version};return this.baseCertificateID&&(e.baseCertificateID=this.baseCertificateID.toJSON()),this.subjectName&&(e.subjectName=this.subjectName.toJSON()),e.issuer=this.issuer.toJSON(),e.signature=this.signature.toJSON(),e.serialNumber=this.serialNumber.toJSON(),e.attrCertValidityPeriod=this.attrCertValidityPeriod.toJSON(),e.attributes=Array.from(this.attributes,t=>t.toJSON()),this.issuerUniqueID&&(e.issuerUniqueID=this.issuerUniqueID.toJSON()),this.extensions&&(e.extensions=this.extensions.toJSON()),e}};DA.CLASS_NAME="AttributeCertificateInfoV1";var F1="acinfo",q1="signatureAlgorithm",H1="signatureValue",Nse=[F1,H1,q1],TC=class K1 extends Be{static{o(this,"AttributeCertificateV1")}constructor(e={}){super(),this.acinfo=D(e,F1,K1.defaultValues(F1)),this.signatureAlgorithm=D(e,q1,K1.defaultValues(q1)),this.signatureValue=D(e,H1,K1.defaultValues(H1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case F1:return new DA;case q1:return new ge;case H1:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[DA.schema(t.acinfo||{}),ge.schema(t.signatureAlgorithm||{}),new qt({name:t.signatureValue||L})]})}fromSchema(e){_e(e,Nse);let t=Ie(e,e,K1.schema({names:{acinfo:{names:{blockName:F1}},signatureAlgorithm:{names:{blockName:q1}},signatureValue:H1}}));Ae.assertSchema(t,this.className),this.acinfo=new DA({schema:t.result.acinfo}),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}toSchema(){return new W({value:[this.acinfo.toSchema(),this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){return{acinfo:this.acinfo.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()}}};TC.CLASS_NAME="AttributeCertificateV1";var $1="digestedObjectType",lf="otherObjectTypeID",X1="digestAlgorithm",G1="objectDigest",Tse=[$1,lf,X1,G1],sh=class Zp extends Be{static{o(this,"ObjectDigestInfo")}constructor(e={}){super(),this.digestedObjectType=D(e,$1,Zp.defaultValues($1)),lf in e&&(this.otherObjectTypeID=D(e,lf,Zp.defaultValues(lf))),this.digestAlgorithm=D(e,X1,Zp.defaultValues(X1)),this.objectDigest=D(e,G1,Zp.defaultValues(G1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case $1:return new zu;case lf:return new rt;case X1:return new ge;case G1:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new zu({name:t.digestedObjectType||L}),new rt({optional:!0,name:t.otherObjectTypeID||L}),ge.schema(t.digestAlgorithm||{}),new qt({name:t.objectDigest||L})]})}fromSchema(e){_e(e,Tse);let t=Ie(e,e,Zp.schema({names:{digestedObjectType:$1,otherObjectTypeID:lf,digestAlgorithm:{names:{blockName:X1}},objectDigest:G1}}));Ae.assertSchema(t,this.className),this.digestedObjectType=t.result.digestedObjectType,lf in t.result&&(this.otherObjectTypeID=t.result.otherObjectTypeID),this.digestAlgorithm=new ge({schema:t.result.digestAlgorithm}),this.objectDigest=t.result.objectDigest}toSchema(){let e=new W({value:[this.digestedObjectType]});return this.otherObjectTypeID&&e.valueBlock.value.push(this.otherObjectTypeID),e.valueBlock.value.push(this.digestAlgorithm.toSchema()),e.valueBlock.value.push(this.objectDigest),e}toJSON(){let e={digestedObjectType:this.digestedObjectType.toJSON(),digestAlgorithm:this.digestAlgorithm.toJSON(),objectDigest:this.objectDigest.toJSON()};return this.otherObjectTypeID&&(e.otherObjectTypeID=this.otherObjectTypeID.toJSON()),e}};sh.CLASS_NAME="ObjectDigestInfo";var cf="issuerName",ff="baseCertificateID",hf="objectDigestInfo",Ise=[cf,ff,hf],rB=class W1 extends Be{static{o(this,"V2Form")}constructor(e={}){super(),cf in e&&(this.issuerName=D(e,cf,W1.defaultValues(cf))),ff in e&&(this.baseCertificateID=D(e,ff,W1.defaultValues(ff))),hf in e&&(this.objectDigestInfo=D(e,hf,W1.defaultValues(hf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case cf:return new Mn;case ff:return new Xa;case hf:return new sh;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Mn.schema({names:{blockName:t.issuerName}},!0),new ae({optional:!0,name:t.baseCertificateID||L,idBlock:{tagClass:3,tagNumber:0},value:Xa.schema().valueBlock.value}),new ae({optional:!0,name:t.objectDigestInfo||L,idBlock:{tagClass:3,tagNumber:1},value:sh.schema().valueBlock.value})]})}fromSchema(e){_e(e,Ise);let t=Ie(e,e,W1.schema({names:{issuerName:cf,baseCertificateID:ff,objectDigestInfo:hf}}));Ae.assertSchema(t,this.className),cf in t.result&&(this.issuerName=new Mn({schema:t.result.issuerName})),ff in t.result&&(this.baseCertificateID=new Xa({schema:new W({value:t.result.baseCertificateID.valueBlock.value})})),hf in t.result&&(this.objectDigestInfo=new sh({schema:new W({value:t.result.objectDigestInfo.valueBlock.value})}))}toSchema(){let e=new W;return this.issuerName&&e.valueBlock.value.push(this.issuerName.toSchema()),this.baseCertificateID&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:this.baseCertificateID.toSchema().valueBlock.value})),this.objectDigestInfo&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:this.objectDigestInfo.toSchema().valueBlock.value})),e}toJSON(){let e={};return this.issuerName&&(e.issuerName=this.issuerName.toJSON()),this.baseCertificateID&&(e.baseCertificateID=this.baseCertificateID.toJSON()),this.objectDigestInfo&&(e.objectDigestInfo=this.objectDigestInfo.toJSON()),e}};rB.CLASS_NAME="V2Form";var pf="baseCertificateID",df="entityName",mf="objectDigestInfo",Bse=[pf,df,mf],_A=class J1 extends Be{static{o(this,"Holder")}constructor(e={}){super(),pf in e&&(this.baseCertificateID=D(e,pf,J1.defaultValues(pf))),df in e&&(this.entityName=D(e,df,J1.defaultValues(df))),mf in e&&(this.objectDigestInfo=D(e,mf,J1.defaultValues(mf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case pf:return new Xa;case df:return new Mn;case mf:return new sh;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({optional:!0,name:t.baseCertificateID||L,idBlock:{tagClass:3,tagNumber:0},value:Xa.schema().valueBlock.value}),new ae({optional:!0,name:t.entityName||L,idBlock:{tagClass:3,tagNumber:1},value:Mn.schema().valueBlock.value}),new ae({optional:!0,name:t.objectDigestInfo||L,idBlock:{tagClass:3,tagNumber:2},value:sh.schema().valueBlock.value})]})}fromSchema(e){_e(e,Bse);let t=Ie(e,e,J1.schema({names:{baseCertificateID:pf,entityName:df,objectDigestInfo:mf}}));Ae.assertSchema(t,this.className),pf in t.result&&(this.baseCertificateID=new Xa({schema:new W({value:t.result.baseCertificateID.valueBlock.value})})),df in t.result&&(this.entityName=new Mn({schema:new W({value:t.result.entityName.valueBlock.value})})),mf in t.result&&(this.objectDigestInfo=new sh({schema:new W({value:t.result.objectDigestInfo.valueBlock.value})}))}toSchema(){let e=new W;return this.baseCertificateID&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:this.baseCertificateID.toSchema().valueBlock.value})),this.entityName&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:this.entityName.toSchema().valueBlock.value})),this.objectDigestInfo&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:this.objectDigestInfo.toSchema().valueBlock.value})),e}toJSON(){let e={};return this.baseCertificateID&&(e.baseCertificateID=this.baseCertificateID.toJSON()),this.entityName&&(e.entityName=this.entityName.toJSON()),this.objectDigestInfo&&(e.objectDigestInfo=this.objectDigestInfo.toJSON()),e}};_A.CLASS_NAME="Holder";var z1="version",Y1="holder",Q1="issuer",Z1="signature",ey="serialNumber",ty="attrCertValidityPeriod",ry="attributes",gf="issuerUniqueID",yf="extensions",Dse=[z1,Y1,Q1,Z1,ey,ty,ry,gf,yf],RA=class Qi extends Be{static{o(this,"AttributeCertificateInfoV2")}constructor(e={}){super(),this.version=D(e,z1,Qi.defaultValues(z1)),this.holder=D(e,Y1,Qi.defaultValues(Y1)),this.issuer=D(e,Q1,Qi.defaultValues(Q1)),this.signature=D(e,Z1,Qi.defaultValues(Z1)),this.serialNumber=D(e,ey,Qi.defaultValues(ey)),this.attrCertValidityPeriod=D(e,ty,Qi.defaultValues(ty)),this.attributes=D(e,ry,Qi.defaultValues(ry)),gf in e&&(this.issuerUniqueID=D(e,gf,Qi.defaultValues(gf))),yf in e&&(this.extensions=D(e,yf,Qi.defaultValues(yf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case z1:return 1;case Y1:return new _A;case Q1:return{};case Z1:return new ge;case ey:return new me;case ty:return new nh;case ry:return[];case gf:return new qt;case yf:return new wn;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),_A.schema(t.holder||{}),new Pr({value:[Mn.schema({names:{blockName:t.issuer||L}}),new ae({name:t.issuer||L,idBlock:{tagClass:3,tagNumber:0},value:rB.schema().valueBlock.value})]}),ge.schema(t.signature||{}),new me({name:t.serialNumber||L}),nh.schema(t.attrCertValidityPeriod||{}),new W({name:t.attributes||L,value:[new Tt({value:Zr.schema()})]}),new qt({optional:!0,name:t.issuerUniqueID||L}),wn.schema(t.extensions||{},!0)]})}fromSchema(e){_e(e,Dse);let t=Ie(e,e,Qi.schema({names:{version:z1,holder:{names:{blockName:Y1}},issuer:Q1,signature:{names:{blockName:Z1}},serialNumber:ey,attrCertValidityPeriod:{names:{blockName:ty}},attributes:ry,issuerUniqueID:gf,extensions:{names:{blockName:yf}}}}));switch(Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.holder=new _A({schema:t.result.holder}),t.result.issuer.idBlock.tagClass){case 3:this.issuer=new rB({schema:new W({value:t.result.issuer.valueBlock.value})});break;case 1:default:throw new Error("Incorrect value for 'issuer' in AttributeCertificateInfoV2")}this.signature=new ge({schema:t.result.signature}),this.serialNumber=t.result.serialNumber,this.attrCertValidityPeriod=new nh({schema:t.result.attrCertValidityPeriod}),this.attributes=Array.from(t.result.attributes.valueBlock.value,n=>new Zr({schema:n})),gf in t.result&&(this.issuerUniqueID=t.result.issuerUniqueID),yf in t.result&&(this.extensions=new wn({schema:t.result.extensions}))}toSchema(){let e=new W({value:[new me({value:this.version}),this.holder.toSchema(),new ae({idBlock:{tagClass:3,tagNumber:0},value:this.issuer.toSchema().valueBlock.value}),this.signature.toSchema(),this.serialNumber,this.attrCertValidityPeriod.toSchema(),new W({value:Array.from(this.attributes,t=>t.toSchema())})]});return this.issuerUniqueID&&e.valueBlock.value.push(this.issuerUniqueID),this.extensions&&e.valueBlock.value.push(this.extensions.toSchema()),e}toJSON(){let e={version:this.version,holder:this.holder.toJSON(),issuer:this.issuer.toJSON(),signature:this.signature.toJSON(),serialNumber:this.serialNumber.toJSON(),attrCertValidityPeriod:this.attrCertValidityPeriod.toJSON(),attributes:Array.from(this.attributes,t=>t.toJSON())};return this.issuerUniqueID&&(e.issuerUniqueID=this.issuerUniqueID.toJSON()),this.extensions&&(e.extensions=this.extensions.toJSON()),e}};RA.CLASS_NAME="AttributeCertificateInfoV2";var ny="acinfo",sy="signatureAlgorithm",iy="signatureValue",_se=[ny,sy,iy],zl=class ay extends Be{static{o(this,"AttributeCertificateV2")}constructor(e={}){super(),this.acinfo=D(e,ny,ay.defaultValues(ny)),this.signatureAlgorithm=D(e,sy,ay.defaultValues(sy)),this.signatureValue=D(e,iy,ay.defaultValues(iy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case ny:return new RA;case sy:return new ge;case iy:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[RA.schema(t.acinfo||{}),ge.schema(t.signatureAlgorithm||{}),new qt({name:t.signatureValue||L})]})}fromSchema(e){_e(e,_se);let t=Ie(e,e,ay.schema({names:{acinfo:{names:{blockName:ny}},signatureAlgorithm:{names:{blockName:sy}},signatureValue:iy}}));Ae.assertSchema(t,this.className),this.acinfo=new RA({schema:t.result.acinfo}),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}toSchema(){return new W({value:[this.acinfo.toSchema(),this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){return{acinfo:this.acinfo.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()}}};zl.CLASS_NAME="AttributeCertificateV2";var vf="contentType",ed="content",Rse=[vf,ed],Gr=class PA extends Be{static{o(this,"ContentInfo")}constructor(e={}){super(),this.contentType=D(e,vf,PA.defaultValues(vf)),this.content=D(e,ed,PA.defaultValues(ed)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case vf:return L;case ed:return new St;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case vf:return typeof t=="string"&&t===this.defaultValues(vf);case ed:return t instanceof St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return"optional"in t||(t.optional=!1),new W({name:t.blockName||"ContentInfo",optional:t.optional,value:[new rt({name:t.contentType||vf}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.content||ed})]})]})}fromSchema(e){_e(e,Rse);let t=Ie(e,e,PA.schema());Ae.assertSchema(t,this.className),this.contentType=t.result.contentType.valueBlock.toString(),this.content=t.result.content}toSchema(){return new W({value:[new rt({value:this.contentType}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.content]})]})}toJSON(){let e={contentType:this.contentType};return this.content instanceof St||(e.content=this.content.toJSON()),e}};Gr.CLASS_NAME="ContentInfo";Gr.DATA=MB;Gr.SIGNED_DATA=bU;Gr.ENVELOPED_DATA=xU;Gr.ENCRYPTED_DATA=NU;var lI="type",cI="value",nB="utcTimeName",sB="generalTimeName",Pse=[nB,sB],lU;(function(r){r[r.UTCTime=0]="UTCTime",r[r.GeneralizedTime=1]="GeneralizedTime",r[r.empty=2]="empty"})(lU||(lU={}));var jn=class OA extends Be{static{o(this,"Time")}constructor(e={}){super(),this.type=D(e,lI,OA.defaultValues(lI)),this.value=D(e,cI,OA.defaultValues(cI)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case lI:return 0;case cI:return new Date(0,0,0);default:return super.defaultValues(e)}}static schema(e={},t=!1){let n=D(e,"names",{});return new Pr({optional:t,value:[new kc({name:n.utcTimeName||L}),new Rr({name:n.generalTimeName||L})]})}fromSchema(e){_e(e,Pse);let t=Ie(e,e,OA.schema({names:{utcTimeName:nB,generalTimeName:sB}}));Ae.assertSchema(t,this.className),nB in t.result&&(this.type=0,this.value=t.result.utcTimeName.toDate()),sB in t.result&&(this.type=1,this.value=t.result.generalTimeName.toDate())}toSchema(){return this.type===0?new kc({valueDate:this.value}):this.type===1?new Rr({valueDate:this.value}):{}}toJSON(){return{type:this.type,value:this.value}}};jn.CLASS_NAME="Time";var fI="tbs",Cl="version",kA="serialNumber",LA="signature",VA="issuer",UA="notBefore",MA="notAfter",jA="subject",FA="subjectPublicKeyInfo",oy="issuerUniqueID",uy="subjectUniqueID",ly="extensions",cy="signatureAlgorithm",fy="signatureValue",Qs="tbsCertificate",IC=`${Qs}.${Cl}`,HB=`${Qs}.${kA}`,KB=`${Qs}.${LA}`,$B=`${Qs}.${VA}`,BC=`${Qs}.${UA}`,DC=`${Qs}.${MA}`,XB=`${Qs}.${jA}`,GB=`${Qs}.${FA}`,_C=`${Qs}.${oy}`,RC=`${Qs}.${uy}`,nv=`${Qs}.${ly}`,Ose=[Qs,IC,HB,KB,$B,BC,DC,XB,GB,_C,RC,nv,cy,fy];function kse(r={}){let e=D(r,"names",{});return new W({name:e.blockName||Qs,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new me({name:e.tbsCertificateVersion||IC})]}),new me({name:e.tbsCertificateSerialNumber||HB}),ge.schema(e.signature||{names:{blockName:KB}}),Or.schema(e.issuer||{names:{blockName:$B}}),new W({name:e.tbsCertificateValidity||"tbsCertificate.validity",value:[jn.schema(e.notBefore||{names:{utcTimeName:BC,generalTimeName:BC}}),jn.schema(e.notAfter||{names:{utcTimeName:DC,generalTimeName:DC}})]}),Or.schema(e.subject||{names:{blockName:XB}}),na.schema(e.subjectPublicKeyInfo||{names:{blockName:GB}}),new yt({name:e.tbsCertificateIssuerUniqueID||_C,optional:!0,idBlock:{tagClass:3,tagNumber:1}}),new yt({name:e.tbsCertificateSubjectUniqueID||RC,optional:!0,idBlock:{tagClass:3,tagNumber:2}}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:3},value:[wn.schema(e.extensions||{names:{blockName:nv}})]})]})}o(kse,"tbsCertificate");var ts=class vn extends Be{static{o(this,"Certificate")}get tbs(){return dt.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(D(e,fI,vn.defaultValues(fI))),this.version=D(e,Cl,vn.defaultValues(Cl)),this.serialNumber=D(e,kA,vn.defaultValues(kA)),this.signature=D(e,LA,vn.defaultValues(LA)),this.issuer=D(e,VA,vn.defaultValues(VA)),this.notBefore=D(e,UA,vn.defaultValues(UA)),this.notAfter=D(e,MA,vn.defaultValues(MA)),this.subject=D(e,jA,vn.defaultValues(jA)),this.subjectPublicKeyInfo=D(e,FA,vn.defaultValues(FA)),oy in e&&(this.issuerUniqueID=D(e,oy,vn.defaultValues(oy))),uy in e&&(this.subjectUniqueID=D(e,uy,vn.defaultValues(uy))),ly in e&&(this.extensions=D(e,ly,vn.defaultValues(ly))),this.signatureAlgorithm=D(e,cy,vn.defaultValues(cy)),this.signatureValue=D(e,fy,vn.defaultValues(fy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case fI:return Qr;case Cl:return 0;case kA:return new me;case LA:return new ge;case VA:return new Or;case UA:return new jn;case MA:return new jn;case jA:return new Or;case FA:return new na;case oy:return Qr;case uy:return Qr;case ly:return[];case cy:return new ge;case fy:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[kse(t.tbsCertificate),ge.schema(t.signatureAlgorithm||{names:{blockName:cy}}),new qt({name:t.signatureValue||fy})]})}fromSchema(e){_e(e,Ose);let t=Ie(e,e,vn.schema({names:{tbsCertificate:{names:{extensions:{names:{extensions:nv}}}}}}));Ae.assertSchema(t,this.className),this.tbsView=t.result.tbsCertificate.valueBeforeDecodeView,IC in t.result&&(this.version=t.result[IC].valueBlock.valueDec),this.serialNumber=t.result[HB],this.signature=new ge({schema:t.result[KB]}),this.issuer=new Or({schema:t.result[$B]}),this.notBefore=new jn({schema:t.result[BC]}),this.notAfter=new jn({schema:t.result[DC]}),this.subject=new Or({schema:t.result[XB]}),this.subjectPublicKeyInfo=new na({schema:t.result[GB]}),_C in t.result&&(this.issuerUniqueID=t.result[_C].valueBlock.valueHex),RC in t.result&&(this.subjectUniqueID=t.result[RC].valueBlock.valueHex),nv in t.result&&(this.extensions=Array.from(t.result[nv],n=>new _i({schema:n}))),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}encodeTBS(){let e=[];return Cl in this&&this.version!==vn.defaultValues(Cl)&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new me({value:this.version})]})),e.push(this.serialNumber),e.push(this.signature.toSchema()),e.push(this.issuer.toSchema()),e.push(new W({value:[this.notBefore.toSchema(),this.notAfter.toSchema()]})),e.push(this.subject.toSchema()),e.push(this.subjectPublicKeyInfo.toSchema()),this.issuerUniqueID&&e.push(new yt({optional:!0,idBlock:{tagClass:3,tagNumber:1},valueHex:this.issuerUniqueID})),this.subjectUniqueID&&e.push(new yt({optional:!0,idBlock:{tagClass:3,tagNumber:2},valueHex:this.subjectUniqueID})),this.extensions&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:3},value:[new W({value:Array.from(this.extensions,t=>t.toSchema())})]})),new W({value:e})}toSchema(e=!1){let t;if(e===!1){if(!this.tbsView.byteLength)return vn.schema().value[0];let n=Hr(this.tbsView);Ae.assert(n,"TBS Certificate"),t=n.result}else t=this.encodeTBS();return new W({value:[t,this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){let e={tbs:Ct.ToHex(this.tbsView),version:this.version,serialNumber:this.serialNumber.toJSON(),signature:this.signature.toJSON(),issuer:this.issuer.toJSON(),notBefore:this.notBefore.toJSON(),notAfter:this.notAfter.toJSON(),subject:this.subject.toJSON(),subjectPublicKeyInfo:this.subjectPublicKeyInfo.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()};return Cl in this&&this.version!==vn.defaultValues(Cl)&&(e.version=this.version),this.issuerUniqueID&&(e.issuerUniqueID=Ct.ToHex(this.issuerUniqueID)),this.subjectUniqueID&&(e.subjectUniqueID=Ct.ToHex(this.subjectUniqueID)),this.extensions&&(e.extensions=Array.from(this.extensions,t=>t.toJSON())),e}async getPublicKey(e,t=_t(!0)){return t.getPublicKey(this.subjectPublicKeyInfo,this.signatureAlgorithm,e)}async getKeyHash(e="SHA-1",t=_t(!0)){return t.digest({name:e},this.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView)}async sign(e,t="SHA-1",n=_t(!0)){if(!e)throw new Error("Need to provide a private key for signing");let s=await n.getSignatureParameters(e,t),i=s.parameters;this.signature=s.signatureAlgorithm,this.signatureAlgorithm=s.signatureAlgorithm,this.tbsView=new Uint8Array(this.encodeTBS().toBER());let a=await n.signWithPrivateKey(this.tbsView,e,i);this.signatureValue=new qt({valueHex:a})}async verify(e,t=_t(!0)){let n;if(e?n=e.subjectPublicKeyInfo:this.issuer.isEqual(this.subject)&&(n=this.subjectPublicKeyInfo),!(n instanceof na))throw new Error("Please provide issuer certificate as a parameter");return t.verifyWithPublicKey(this.tbsView,this.signatureValue,n,this.signatureAlgorithm)}};ts.CLASS_NAME="Certificate";function KU(r,e=null){if(e&&r.issuer.isEqual(e.issuer)&&r.serialNumber.isEqual(e.serialNumber))return null;let t=!1;if(r.extensions){for(let n of r.extensions)if(n.extnID===kB&&n.parsedValue instanceof qB&&n.parsedValue.cA){t=!0;break}}return t?r:null}o(KU,"checkCA");var td="certId",rd="certValue",Rp="parsedValue",Lse=[td,rd],$U=class hy extends Be{static{o(this,"CertBag")}constructor(e={}){super(),this.certId=D(e,td,hy.defaultValues(td)),this.certValue=D(e,rd,hy.defaultValues(rd)),Rp in e&&(this.parsedValue=D(e,Rp,hy.defaultValues(Rp))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case td:return L;case rd:return new St;case Rp:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case td:return t===L;case rd:return t instanceof St;case Rp:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.id||"id"}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.value||"value"})]})]})}fromSchema(e){_e(e,Lse);let t=Ie(e,e,hy.schema({names:{id:td,value:rd}}));Ae.assertSchema(t,this.className),this.certId=t.result.certId.valueBlock.toString(),this.certValue=t.result.certValue;let n=this.certValue.valueBlock.valueHexView;switch(this.certId){case $6:try{this.parsedValue=ts.fromBER(n)}catch{zl.fromBER(n)}break;case X6:this.parsedValue=zl.fromBER(n);break;case Mne:default:throw new Error(`Incorrect CERT_ID value in CertBag: ${this.certId}`)}}toSchema(){return Rp in this&&("acinfo"in this.parsedValue?this.certId=X6:this.certId=$6,this.certValue=new Ve({valueHex:this.parsedValue.toSchema().toBER(!1)})),new W({value:[new rt({value:this.certId}),new ae({idBlock:{tagClass:3,tagNumber:0},value:["toSchema"in this.certValue?this.certValue.toSchema():this.certValue]})]})}toJSON(){return{certId:this.certId,certValue:this.certValue.toJSON()}}};$U.CLASS_NAME="CertBag";var py="userCertificate",nd="revocationDate",wf="crlEntryExtensions",Vse=[py,nd,wf],XU=class dy extends Be{static{o(this,"RevokedCertificate")}constructor(e={}){super(),this.userCertificate=D(e,py,dy.defaultValues(py)),this.revocationDate=D(e,nd,dy.defaultValues(nd)),wf in e&&(this.crlEntryExtensions=D(e,wf,dy.defaultValues(wf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case py:return new me;case nd:return new jn;case wf:return new wn;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.userCertificate||py}),jn.schema({names:{utcTimeName:t.revocationDate||nd,generalTimeName:t.revocationDate||nd}}),wn.schema({names:{blockName:t.crlEntryExtensions||wf}},!0)]})}fromSchema(e){_e(e,Vse);let t=Ie(e,e,dy.schema());Ae.assertSchema(t,this.className),this.userCertificate=t.result.userCertificate,this.revocationDate=new jn({schema:t.result.revocationDate}),wf in t.result&&(this.crlEntryExtensions=new wn({schema:t.result.crlEntryExtensions}))}toSchema(){let e=[this.userCertificate,this.revocationDate.toSchema()];return this.crlEntryExtensions&&e.push(this.crlEntryExtensions.toSchema()),new W({value:e})}toJSON(){let e={userCertificate:this.userCertificate.toJSON(),revocationDate:this.revocationDate.toJSON()};return this.crlEntryExtensions&&(e.crlEntryExtensions=this.crlEntryExtensions.toJSON()),e}};XU.CLASS_NAME="RevokedCertificate";var hI="tbs",bg="version",pI="signature",dI="issuer",mI="thisUpdate",WE="nextUpdate",JE="revokedCertificates",zE="crlExtensions",my="signatureAlgorithm",gy="signatureValue",Jo="tbsCertList",PC=`${Jo}.version`,WB=`${Jo}.signature`,JB=`${Jo}.issuer`,OC=`${Jo}.thisUpdate`,fv=`${Jo}.nextUpdate`,kC=`${Jo}.revokedCertificates`,LC=`${Jo}.extensions`,Use=[Jo,PC,WB,JB,OC,fv,kC,LC,my,gy];function Mse(r={}){let e=D(r,"names",{});return new W({name:e.blockName||Jo,value:[new me({optional:!0,name:e.tbsCertListVersion||PC,value:2}),ge.schema(e.signature||{names:{blockName:WB}}),Or.schema(e.issuer||{names:{blockName:JB}}),jn.schema(e.tbsCertListThisUpdate||{names:{utcTimeName:OC,generalTimeName:OC}}),jn.schema(e.tbsCertListNextUpdate||{names:{utcTimeName:fv,generalTimeName:fv}},!0),new W({optional:!0,value:[new Tt({name:e.tbsCertListRevokedCertificates||kC,value:new W({value:[new me,jn.schema(),wn.schema({},!0)]})})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[wn.schema(e.crlExtensions||{names:{blockName:LC}})]})]})}o(Mse,"tbsCertList");var jse=[VB,gU,Nne,Tne,yU,LB,UB,Ine,Bne,vU],hv=class ds extends Be{static{o(this,"CertificateRevocationList")}get tbs(){return dt.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(D(e,hI,ds.defaultValues(hI))),this.version=D(e,bg,ds.defaultValues(bg)),this.signature=D(e,pI,ds.defaultValues(pI)),this.issuer=D(e,dI,ds.defaultValues(dI)),this.thisUpdate=D(e,mI,ds.defaultValues(mI)),WE in e&&(this.nextUpdate=D(e,WE,ds.defaultValues(WE))),JE in e&&(this.revokedCertificates=D(e,JE,ds.defaultValues(JE))),zE in e&&(this.crlExtensions=D(e,zE,ds.defaultValues(zE))),this.signatureAlgorithm=D(e,my,ds.defaultValues(my)),this.signatureValue=D(e,gy,ds.defaultValues(gy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case hI:return Qr;case bg:return 0;case pI:return new ge;case dI:return new Or;case mI:return new jn;case WE:return new jn;case JE:return[];case zE:return new wn;case my:return new ge;case gy:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||"CertificateList",value:[Mse(e),ge.schema(t.signatureAlgorithm||{names:{blockName:my}}),new qt({name:t.signatureValue||gy})]})}fromSchema(e){_e(e,Use);let t=Ie(e,e,ds.schema());Ae.assertSchema(t,this.className),this.tbsView=t.result.tbsCertList.valueBeforeDecodeView,PC in t.result&&(this.version=t.result[PC].valueBlock.valueDec),this.signature=new ge({schema:t.result[WB]}),this.issuer=new Or({schema:t.result[JB]}),this.thisUpdate=new jn({schema:t.result[OC]}),fv in t.result&&(this.nextUpdate=new jn({schema:t.result[fv]})),kC in t.result&&(this.revokedCertificates=Array.from(t.result[kC],n=>new XU({schema:n}))),LC in t.result&&(this.crlExtensions=new wn({schema:t.result[LC]})),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}encodeTBS(){let e=[];return this.version!==ds.defaultValues(bg)&&e.push(new me({value:this.version})),e.push(this.signature.toSchema()),e.push(this.issuer.toSchema()),e.push(this.thisUpdate.toSchema()),this.nextUpdate&&e.push(this.nextUpdate.toSchema()),this.revokedCertificates&&e.push(new W({value:Array.from(this.revokedCertificates,t=>t.toSchema())})),this.crlExtensions&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.crlExtensions.toSchema()]})),new W({value:e})}toSchema(e=!1){let t;if(e)t=this.encodeTBS();else{if(!this.tbsView.byteLength)return ds.schema();let n=Hr(this.tbsView);Ae.assert(n,"TBS Certificate Revocation List"),t=n.result}return new W({value:[t,this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){let e={tbs:Ct.ToHex(this.tbsView),version:this.version,signature:this.signature.toJSON(),issuer:this.issuer.toJSON(),thisUpdate:this.thisUpdate.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()};return this.version!==ds.defaultValues(bg)&&(e.version=this.version),this.nextUpdate&&(e.nextUpdate=this.nextUpdate.toJSON()),this.revokedCertificates&&(e.revokedCertificates=Array.from(this.revokedCertificates,t=>t.toJSON())),this.crlExtensions&&(e.crlExtensions=this.crlExtensions.toJSON()),e}isCertificateRevoked(e){if(!this.issuer.isEqual(e.issuer)||!this.revokedCertificates)return!1;for(let t of this.revokedCertificates)if(t.userCertificate.isEqual(e.serialNumber))return!0;return!1}async sign(e,t="SHA-1",n=_t(!0)){if(!e)throw new Error("Need to provide a private key for signing");let s=await n.getSignatureParameters(e,t),{parameters:i}=s;this.signature=s.signatureAlgorithm,this.signatureAlgorithm=s.signatureAlgorithm,this.tbsView=new Uint8Array(this.encodeTBS().toBER());let a=await n.signWithPrivateKey(this.tbsView,e,i);this.signatureValue=new qt({valueHex:a})}async verify(e={},t=_t(!0)){let n;if(e.issuerCertificate&&(n=e.issuerCertificate.subjectPublicKeyInfo,!this.issuer.isEqual(e.issuerCertificate.subject)))return!1;if(e.publicKeyInfo&&(n=e.publicKeyInfo),!n)throw new Error("Issuer's certificate must be provided as an input parameter");if(this.crlExtensions){for(let s of this.crlExtensions.extensions)if(s.critical&&!jse.includes(s.extnID))return!1}return t.verifyWithPublicKey(this.tbsView,this.signatureValue,n,this.signatureAlgorithm)}};hv.CLASS_NAME="CertificateRevocationList";var sd="crlId",id="crlValue",xg="parsedValue",Fse=[sd,id],GU=class yy extends Be{static{o(this,"CRLBag")}constructor(e={}){super(),this.crlId=D(e,sd,yy.defaultValues(sd)),this.crlValue=D(e,id,yy.defaultValues(id)),xg in e&&(this.parsedValue=D(e,xg,yy.defaultValues(xg))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case sd:return L;case id:return new St;case xg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case sd:return t===L;case id:return t instanceof St;case xg:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.id||"id"}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.value||"value"})]})]})}fromSchema(e){_e(e,Fse);let t=Ie(e,e,yy.schema({names:{id:sd,value:id}}));switch(Ae.assertSchema(t,this.className),this.crlId=t.result.crlId.valueBlock.toString(),this.crlValue=t.result.crlValue,this.crlId){case G6:this.parsedValue=hv.fromBER(this.certValue.valueBlock.valueHex);break;default:throw new Error(`Incorrect CRL_ID value in CRLBag: ${this.crlId}`)}}toSchema(){return this.parsedValue&&(this.crlId=G6,this.crlValue=new Ve({valueHex:this.parsedValue.toSchema().toBER(!1)})),new W({value:[new rt({value:this.crlId}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.crlValue.toSchema()]})]})}toJSON(){return{crlId:this.crlId,crlValue:this.crlValue.toJSON()}}};GU.CLASS_NAME="CRLBag";var ad="version",od="encryptedContentInfo",bl="unprotectedAttrs",qse=[ad,od,bl],pv=class vy extends Be{static{o(this,"EncryptedData")}constructor(e={}){super(),this.version=D(e,ad,vy.defaultValues(ad)),this.encryptedContentInfo=D(e,od,vy.defaultValues(od)),bl in e&&(this.unprotectedAttrs=D(e,bl,vy.defaultValues(bl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case ad:return 0;case od:return new es;case bl:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case ad:return t===0;case od:return es.compareWithDefault("contentType",t.contentType)&&es.compareWithDefault("contentEncryptionAlgorithm",t.contentEncryptionAlgorithm)&&es.compareWithDefault("encryptedContent",t.encryptedContent);case bl:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),es.schema(t.encryptedContentInfo||{}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Tt({name:t.unprotectedAttrs||L,value:Zr.schema()})]})]})}fromSchema(e){_e(e,qse);let t=Ie(e,e,vy.schema({names:{version:ad,encryptedContentInfo:{names:{blockName:od}},unprotectedAttrs:bl}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.encryptedContentInfo=new es({schema:t.result.encryptedContentInfo}),bl in t.result&&(this.unprotectedAttrs=Array.from(t.result.unprotectedAttrs,n=>new Zr({schema:n})))}toSchema(){let e=[];return e.push(new me({value:this.version})),e.push(this.encryptedContentInfo.toSchema()),this.unprotectedAttrs&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.unprotectedAttrs,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={version:this.version,encryptedContentInfo:this.encryptedContentInfo.toJSON()};return this.unprotectedAttrs&&(e.unprotectedAttrs=Array.from(this.unprotectedAttrs,t=>t.toJSON())),e}async encrypt(e,t=_t(!0)){Er.assert(e,"parameters","object");let n={...e,contentType:"1.2.840.113549.1.7.1"};this.encryptedContentInfo=await t.encryptEncryptedContentInfo(n)}async decrypt(e,t=_t(!0)){Er.assert(e,"parameters","object");let n={...e,encryptedContentInfo:this.encryptedContentInfo};return t.decryptEncryptedContentInfo(n)}};pv.CLASS_NAME="EncryptedData";var Sf="encryptionAlgorithm",xl="encryptedData",Ng="parsedValue",Hse=[Sf,xl],WU=class ud extends Be{static{o(this,"PKCS8ShroudedKeyBag")}constructor(e={}){super(),this.encryptionAlgorithm=D(e,Sf,ud.defaultValues(Sf)),this.encryptedData=D(e,xl,ud.defaultValues(xl)),Ng in e&&(this.parsedValue=D(e,Ng,ud.defaultValues(Ng))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Sf:return new ge;case xl:return new Ve;case Ng:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Sf:return ge.compareWithDefault("algorithmId",t.algorithmId)&&!("algorithmParams"in t);case xl:return t.isEqual(ud.defaultValues(e));case Ng:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.encryptionAlgorithm||{names:{blockName:Sf}}),new Pr({value:[new Ve({name:t.encryptedData||xl}),new Ve({idBlock:{isConstructed:!0},name:t.encryptedData||xl})]})]})}fromSchema(e){_e(e,Hse);let t=Ie(e,e,ud.schema({names:{encryptionAlgorithm:{names:{blockName:Sf}},encryptedData:xl}}));Ae.assertSchema(t,this.className),this.encryptionAlgorithm=new ge({schema:t.result.encryptionAlgorithm}),this.encryptedData=t.result.encryptedData}toSchema(){return new W({value:[this.encryptionAlgorithm.toSchema(),this.encryptedData]})}toJSON(){return{encryptionAlgorithm:this.encryptionAlgorithm.toJSON(),encryptedData:this.encryptedData.toJSON()}}async parseInternalValues(e,t=_t(!0)){let s=await new pv({encryptedContentInfo:new es({contentEncryptionAlgorithm:this.encryptionAlgorithm,encryptedContent:this.encryptedData})}).decrypt(e,t);this.parsedValue=cv.fromBER(s)}async makeInternalValues(e,t=_t(!0)){if(!this.parsedValue)throw new Error('Please initialize "parsedValue" first');let n=new pv,s={...e,contentToEncrypt:this.parsedValue.toSchema().toBER(!1)};if(await n.encrypt(s,t),!n.encryptedContentInfo.encryptedContent)throw new Error("The filed `encryptedContent` in EncryptedContentInfo is empty");this.encryptionAlgorithm=n.encryptedContentInfo.contentEncryptionAlgorithm,this.encryptedData=n.encryptedContentInfo.encryptedContent}};WU.CLASS_NAME="PKCS8ShroudedKeyBag";var ld="secretTypeId",cd="secretValue",Kse=[ld,cd],JU=class qA extends Be{static{o(this,"SecretBag")}constructor(e={}){super(),this.secretTypeId=D(e,ld,qA.defaultValues(ld)),this.secretValue=D(e,cd,qA.defaultValues(cd)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case ld:return L;case cd:return new St;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case ld:return t===L;case cd:return t instanceof St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.id||"id"}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.value||"value"})]})]})}fromSchema(e){_e(e,Kse);let t=Ie(e,e,qA.schema({names:{id:ld,value:cd}}));Ae.assertSchema(t,this.className),this.secretTypeId=t.result.secretTypeId.valueBlock.toString(),this.secretValue=t.result.secretValue}toSchema(){return new W({value:[new rt({value:this.secretTypeId}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.secretValue.toSchema()]})]})}toJSON(){return{secretTypeId:this.secretTypeId,secretValue:this.secretValue.toJSON()}}};JU.CLASS_NAME="SecretBag";var $se=class Ef{static{o(this,"SafeBagValueFactory")}static getItems(){return this.items||(this.items={},Ef.register("1.2.840.113549.1.12.10.1.1",cv),Ef.register("1.2.840.113549.1.12.10.1.2",WU),Ef.register("1.2.840.113549.1.12.10.1.3",$U),Ef.register("1.2.840.113549.1.12.10.1.4",GU),Ef.register("1.2.840.113549.1.12.10.1.5",JU),Ef.register("1.2.840.113549.1.12.10.1.6",y0)),this.items}static register(e,t){this.getItems()[e]=t}static find(e){return this.getItems()[e]||null}},Af="bagId",Cf="bagValue",Vo="bagAttributes",Xse=[Af,Cf,Vo],iB=class wy extends Be{static{o(this,"SafeBag")}constructor(e={}){super(),this.bagId=D(e,Af,wy.defaultValues(Af)),this.bagValue=D(e,Cf,wy.defaultValues(Cf)),Vo in e&&(this.bagAttributes=D(e,Vo,wy.defaultValues(Vo))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Af:return L;case Cf:return new St;case Vo:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Af:return t===L;case Cf:return t instanceof St;case Vo:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.bagId||Af}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.bagValue||Cf})]}),new $r({optional:!0,value:[new Tt({name:t.bagAttributes||Vo,value:Zr.schema()})]})]})}fromSchema(e){_e(e,Xse);let t=Ie(e,e,wy.schema({names:{bagId:Af,bagValue:Cf,bagAttributes:Vo}}));Ae.assertSchema(t,this.className),this.bagId=t.result.bagId.valueBlock.toString();let n=$se.find(this.bagId);if(!n)throw new Error(`Invalid BAG_ID for SafeBag: ${this.bagId}`);this.bagValue=new n({schema:t.result.bagValue}),Vo in t.result&&(this.bagAttributes=Array.from(t.result.bagAttributes,s=>new Zr({schema:s})))}toSchema(){let e=[new rt({value:this.bagId}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.bagValue.toSchema()]})];return this.bagAttributes&&e.push(new $r({value:Array.from(this.bagAttributes,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={bagId:this.bagId,bagValue:this.bagValue.toJSON()};return this.bagAttributes&&(e.bagAttributes=Array.from(this.bagAttributes,t=>t.toJSON())),e}};iB.CLASS_NAME="SafeBag";var Pp="safeBags",y0=class aB extends Be{static{o(this,"SafeContents")}constructor(e={}){super(),this.safeBags=D(e,Pp,aB.defaultValues(Pp)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Pp:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Pp:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.safeBags||L,value:iB.schema()})]})}fromSchema(e){_e(e,[Pp]);let t=Ie(e,e,aB.schema({names:{safeBags:Pp}}));Ae.assertSchema(t,this.className),this.safeBags=Array.from(t.result.safeBags,n=>new iB({schema:n}))}toSchema(){return new W({value:Array.from(this.safeBags,e=>e.toSchema())})}toJSON(){return{safeBags:Array.from(this.safeBags,e=>e.toJSON())}}};y0.CLASS_NAME="SafeContents";var Sy="otherCertFormat",Ey="otherCert",Gse=[Sy,Ey],HA=class KA extends Be{static{o(this,"OtherCertificateFormat")}constructor(e={}){super(),this.otherCertFormat=D(e,Sy,KA.defaultValues(Sy)),this.otherCert=D(e,Ey,KA.defaultValues(Ey)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Sy:return L;case Ey:return new St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.otherCertFormat||Sy}),new St({name:t.otherCert||Ey})]})}fromSchema(e){_e(e,Gse);let t=Ie(e,e,KA.schema());Ae.assertSchema(t,this.className),this.otherCertFormat=t.result.otherCertFormat.valueBlock.toString(),this.otherCert=t.result.otherCert}toSchema(){return new W({value:[new rt({value:this.otherCertFormat}),this.otherCert]})}toJSON(){let e={otherCertFormat:this.otherCertFormat};return this.otherCert instanceof St||(e.otherCert=this.otherCert.toJSON()),e}},Ay="certificates",Wse=[Ay],ih=class oB extends Be{static{o(this,"CertificateSet")}constructor(e={}){super(),this.certificates=D(e,Ay,oB.defaultValues(Ay)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ay:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new $r({name:t.blockName||L,value:[new Tt({name:t.certificates||Ay,value:new Pr({value:[ts.schema(),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St]}),new ae({idBlock:{tagClass:3,tagNumber:1},value:[new W]}),new ae({idBlock:{tagClass:3,tagNumber:2},value:zl.schema().valueBlock.value}),new ae({idBlock:{tagClass:3,tagNumber:3},value:HA.schema().valueBlock.value})]})})]})}fromSchema(e){_e(e,Wse);let t=Ie(e,e,oB.schema());Ae.assertSchema(t,this.className),this.certificates=Array.from(t.result.certificates||[],n=>{let s=n.idBlock.tagNumber;if(n.idBlock.tagClass===1)return new ts({schema:n});let i=new W({value:n.valueBlock.value});switch(s){case 1:return i.valueBlock.value[0].valueBlock.value[0].valueBlock.valueDec===1?new zl({schema:i}):new TC({schema:i});case 2:return new zl({schema:i});case 3:return new HA({schema:i})}return n})}toSchema(){return new $r({value:Array.from(this.certificates,e=>{switch(!0){case e instanceof ts:return e.toSchema();case e instanceof TC:return new ae({idBlock:{tagClass:3,tagNumber:1},value:e.toSchema().valueBlock.value});case e instanceof zl:return new ae({idBlock:{tagClass:3,tagNumber:2},value:e.toSchema().valueBlock.value});case e instanceof HA:return new ae({idBlock:{tagClass:3,tagNumber:3},value:e.toSchema().valueBlock.value})}return e.toSchema()})})}toJSON(){return{certificates:Array.from(this.certificates,e=>e.toJSON())}}};ih.CLASS_NAME="CertificateSet";var Cy="otherRevInfoFormat",by="otherRevInfo",Jse=[Cy,by],sv=class $A extends Be{static{o(this,"OtherRevocationInfoFormat")}constructor(e={}){super(),this.otherRevInfoFormat=D(e,Cy,$A.defaultValues(Cy)),this.otherRevInfo=D(e,by,$A.defaultValues(by)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Cy:return L;case by:return new St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.otherRevInfoFormat||Cy}),new St({name:t.otherRevInfo||by})]})}fromSchema(e){_e(e,Jse);let t=Ie(e,e,$A.schema());Ae.assertSchema(t,this.className),this.otherRevInfoFormat=t.result.otherRevInfoFormat.valueBlock.toString(),this.otherRevInfo=t.result.otherRevInfo}toSchema(){return new W({value:[new rt({value:this.otherRevInfoFormat}),this.otherRevInfo]})}toJSON(){let e={otherRevInfoFormat:this.otherRevInfoFormat};return this.otherRevInfo instanceof St||(e.otherRevInfo=this.otherRevInfo.toJSON()),e}};sv.CLASS_NAME="OtherRevocationInfoFormat";var xy="crls",gI="otherRevocationInfos",zse=[xy],iv=class XA extends Be{static{o(this,"RevocationInfoChoices")}constructor(e={}){super(),this.crls=D(e,xy,XA.defaultValues(xy)),this.otherRevocationInfos=D(e,gI,XA.defaultValues(gI)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case xy:return[];case gI:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new $r({name:t.blockName||L,value:[new Tt({name:t.crls||L,value:new Pr({value:[hv.schema(),new ae({idBlock:{tagClass:3,tagNumber:1},value:[new rt,new St]})]})})]})}fromSchema(e){_e(e,zse);let t=Ie(e,e,XA.schema({names:{crls:xy}}));if(Ae.assertSchema(t,this.className),t.result.crls)for(let n of t.result.crls)n.idBlock.tagClass===1?this.crls.push(new hv({schema:n})):this.otherRevocationInfos.push(new sv({schema:n}))}toSchema(){let e=[];return e.push(...Array.from(this.crls,t=>t.toSchema())),e.push(...Array.from(this.otherRevocationInfos,t=>{let n=t.toSchema();return n.idBlock.tagClass=3,n.idBlock.tagNumber=1,n})),new $r({value:e})}toJSON(){return{crls:Array.from(this.crls,e=>e.toJSON()),otherRevocationInfos:Array.from(this.otherRevocationInfos,e=>e.toJSON())}}};iv.CLASS_NAME="RevocationInfoChoices";var Ny="certs",bf="crls",Yse=[Ny,bf],GA=class uB extends Be{static{o(this,"OriginatorInfo")}constructor(e={}){super(),this.crls=D(e,bf,uB.defaultValues(bf)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ny:return new ih;case bf:return new iv;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Ny:return t.certificates.length===0;case bf:return t.crls.length===0&&t.otherRevocationInfos.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({name:t.certs||L,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:ih.schema().valueBlock.value}),new ae({name:t.crls||L,optional:!0,idBlock:{tagClass:3,tagNumber:1},value:iv.schema().valueBlock.value})]})}fromSchema(e){_e(e,Yse);let t=Ie(e,e,uB.schema({names:{certs:Ny,crls:bf}}));Ae.assertSchema(t,this.className),Ny in t.result&&(this.certs=new ih({schema:new $r({value:t.result.certs.valueBlock.value})})),bf in t.result&&(this.crls=new iv({schema:new $r({value:t.result.crls.valueBlock.value})}))}toSchema(){let e=[];return this.certs&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:this.certs.toSchema().valueBlock.value})),this.crls&&e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:this.crls.toSchema().valueBlock.value})),new W({value:e})}toJSON(){let e={};return this.certs&&(e.certs=this.certs.toJSON()),this.crls&&(e.crls=this.crls.toJSON()),e}};GA.CLASS_NAME="OriginatorInfo";var Ty="issuer",Iy="serialNumber",Qse=[Ty,Iy],Fn=class WA extends Be{static{o(this,"IssuerAndSerialNumber")}constructor(e={}){super(),this.issuer=D(e,Ty,WA.defaultValues(Ty)),this.serialNumber=D(e,Iy,WA.defaultValues(Iy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ty:return new Or;case Iy:return new me;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Or.schema(t.issuer||{}),new me({name:t.serialNumber||L})]})}fromSchema(e){_e(e,Qse);let t=Ie(e,e,WA.schema({names:{issuer:{names:{blockName:Ty}},serialNumber:Iy}}));Ae.assertSchema(t,this.className),this.issuer=new Or({schema:t.result.issuer}),this.serialNumber=t.result.serialNumber}toSchema(){return new W({value:[this.issuer.toSchema(),this.serialNumber]})}toJSON(){return{issuer:this.issuer.toJSON(),serialNumber:this.serialNumber.toJSON()}}};Fn.CLASS_NAME="IssuerAndSerialNumber";var YE="variant",Tg="value",Zse=["blockName"],zU=class JA extends Be{static{o(this,"RecipientIdentifier")}constructor(e={}){super(),this.variant=D(e,YE,JA.defaultValues(YE)),Tg in e&&(this.value=D(e,Tg,JA.defaultValues(Tg))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case YE:return-1;case Tg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case YE:return t===-1;case Tg:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Pr({value:[Fn.schema({names:{blockName:t.blockName||L}}),new yt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:0}})]})}fromSchema(e){_e(e,Zse);let t=Ie(e,e,JA.schema({names:{blockName:"blockName"}}));Ae.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1?(this.variant=1,this.value=new Fn({schema:t.result.blockName})):(this.variant=2,this.value=new Ve({valueHex:t.result.blockName.valueBlock.valueHex}))}toSchema(){switch(this.variant){case 1:if(!(this.value instanceof Fn))throw new Error("Incorrect type of RecipientIdentifier.value. It should be IssuerAndSerialNumber.");return this.value.toSchema();case 2:if(!(this.value instanceof Ve))throw new Error("Incorrect type of RecipientIdentifier.value. It should be ASN.1 OctetString.");return new yt({idBlock:{tagClass:3,tagNumber:0},valueHex:this.value.valueBlock.valueHexView});default:return new St}}toJSON(){let e={variant:this.variant};return(this.variant===1||this.variant===2)&&this.value&&(e.value=this.value.toJSON()),e}};zU.CLASS_NAME="RecipientIdentifier";var xf="version",fd="rid",hd="keyEncryptionAlgorithm",pd="encryptedKey",QE="recipientCertificate",eie=[xf,fd,hd,pd],VC=class Uo extends Be{static{o(this,"KeyTransRecipientInfo")}constructor(e={}){super(),this.version=D(e,xf,Uo.defaultValues(xf)),this.rid=D(e,fd,Uo.defaultValues(fd)),this.keyEncryptionAlgorithm=D(e,hd,Uo.defaultValues(hd)),this.encryptedKey=D(e,pd,Uo.defaultValues(pd)),this.recipientCertificate=D(e,QE,Uo.defaultValues(QE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case xf:return-1;case fd:return{};case hd:return new ge;case pd:return new Ve;case QE:return new ts;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case xf:return t===Uo.defaultValues(xf);case fd:return Object.keys(t).length===0;case hd:case pd:return t.isEqual(Uo.defaultValues(e));case QE:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),zU.schema(t.rid||{}),ge.schema(t.keyEncryptionAlgorithm||{}),new Ve({name:t.encryptedKey||L})]})}fromSchema(e){_e(e,eie);let t=Ie(e,e,Uo.schema({names:{version:xf,rid:{names:{blockName:fd}},keyEncryptionAlgorithm:{names:{blockName:hd}},encryptedKey:pd}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,t.result.rid.idBlock.tagClass===3?this.rid=new Ve({valueHex:t.result.rid.valueBlock.valueHex}):this.rid=new Fn({schema:t.result.rid}),this.keyEncryptionAlgorithm=new ge({schema:t.result.keyEncryptionAlgorithm}),this.encryptedKey=t.result.encryptedKey}toSchema(){let e=[];return this.rid instanceof Fn?(this.version=0,e.push(new me({value:this.version})),e.push(this.rid.toSchema())):(this.version=2,e.push(new me({value:this.version})),e.push(new yt({idBlock:{tagClass:3,tagNumber:0},valueHex:this.rid.valueBlock.valueHexView}))),e.push(this.keyEncryptionAlgorithm.toSchema()),e.push(this.encryptedKey),new W({value:e})}toJSON(){return{version:this.version,rid:this.rid.toJSON(),keyEncryptionAlgorithm:this.keyEncryptionAlgorithm.toJSON(),encryptedKey:this.encryptedKey.toJSON()}}};VC.CLASS_NAME="KeyTransRecipientInfo";var dd="algorithm",md="publicKey",tie=[dd,md],UC=class By extends Be{static{o(this,"OriginatorPublicKey")}constructor(e={}){super(),this.algorithm=D(e,dd,By.defaultValues(dd)),this.publicKey=D(e,md,By.defaultValues(md)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case dd:return new ge;case md:return new qt;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case dd:case md:return t.isEqual(By.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.algorithm||{}),new qt({name:t.publicKey||L})]})}fromSchema(e){_e(e,tie);let t=Ie(e,e,By.schema({names:{algorithm:{names:{blockName:dd}},publicKey:md}}));Ae.assertSchema(t,this.className),this.algorithm=new ge({schema:t.result.algorithm}),this.publicKey=t.result.publicKey}toSchema(){return new W({value:[this.algorithm.toSchema(),this.publicKey]})}toJSON(){return{algorithm:this.algorithm.toJSON(),publicKey:this.publicKey.toJSON()}}};UC.CLASS_NAME="OriginatorPublicKey";var ZE="variant",Ig="value",rie=["blockName"],av=class zA extends Be{static{o(this,"OriginatorIdentifierOrKey")}constructor(e={}){super(),this.variant=D(e,ZE,zA.defaultValues(ZE)),Ig in e&&(this.value=D(e,Ig,zA.defaultValues(Ig))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case ZE:return-1;case Ig:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case ZE:return t===-1;case Ig:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Pr({value:[Fn.schema({names:{blockName:t.blockName||L}}),new yt({idBlock:{tagClass:3,tagNumber:0},name:t.blockName||L}),new ae({idBlock:{tagClass:3,tagNumber:1},name:t.blockName||L,value:UC.schema().valueBlock.value})]})}fromSchema(e){_e(e,rie);let t=Ie(e,e,zA.schema({names:{blockName:"blockName"}}));Ae.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1?(this.variant=1,this.value=new Fn({schema:t.result.blockName})):t.result.blockName.idBlock.tagNumber===0?(t.result.blockName.idBlock.tagClass=1,t.result.blockName.idBlock.tagNumber=4,this.variant=2,this.value=t.result.blockName):(this.variant=3,this.value=new UC({schema:new W({value:t.result.blockName.valueBlock.value})}))}toSchema(){switch(this.variant){case 1:return this.value.toSchema();case 2:return this.value.idBlock.tagClass=3,this.value.idBlock.tagNumber=0,this.value;case 3:{let e=this.value.toSchema();return e.idBlock.tagClass=3,e.idBlock.tagNumber=1,e}default:return new St}}toJSON(){let e={variant:this.variant};return(this.variant===1||this.variant===2||this.variant===3)&&(e.value=this.value.toJSON()),e}};av.CLASS_NAME="OriginatorIdentifierOrKey";var gd="keyAttrId",Fa="keyAttr",nie=[gd,Fa],ah=class YA extends Be{static{o(this,"OtherKeyAttribute")}constructor(e={}){super(),this.keyAttrId=D(e,gd,YA.defaultValues(gd)),Fa in e&&(this.keyAttr=D(e,Fa,YA.defaultValues(Fa))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case gd:return L;case Fa:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case gd:return typeof t=="string"&&t===L;case Fa:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({optional:t.optional||!0,name:t.blockName||L,value:[new rt({name:t.keyAttrId||L}),new St({optional:!0,name:t.keyAttr||L})]})}fromSchema(e){_e(e,nie);let t=Ie(e,e,YA.schema({names:{keyAttrId:gd,keyAttr:Fa}}));Ae.assertSchema(t,this.className),this.keyAttrId=t.result.keyAttrId.valueBlock.toString(),Fa in t.result&&(this.keyAttr=t.result.keyAttr)}toSchema(){let e=[];return e.push(new rt({value:this.keyAttrId})),Fa in this&&e.push(this.keyAttr),new W({value:e})}toJSON(){let e={keyAttrId:this.keyAttrId};return Fa in this&&(e.keyAttr=this.keyAttr.toJSON()),e}};ah.CLASS_NAME="OtherKeyAttribute";var Nf="subjectKeyIdentifier",Nl="date",Tl="other",sie=[Nf,Nl,Tl],MC=class yd extends Be{static{o(this,"RecipientKeyIdentifier")}constructor(e={}){super(),this.subjectKeyIdentifier=D(e,Nf,yd.defaultValues(Nf)),Nl in e&&(this.date=D(e,Nl,yd.defaultValues(Nl))),Tl in e&&(this.other=D(e,Tl,yd.defaultValues(Tl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Nf:return new Ve;case Nl:return new Rr;case Tl:return new ah;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Nf:return t.isEqual(yd.defaultValues(Nf));case Nl:return t.year===0&&t.month===0&&t.day===0&&t.hour===0&&t.minute===0&&t.second===0&&t.millisecond===0;case Tl:return t.keyAttrId===L&&!("keyAttr"in t);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Ve({name:t.subjectKeyIdentifier||L}),new Rr({optional:!0,name:t.date||L}),ah.schema(t.other||{})]})}fromSchema(e){_e(e,sie);let t=Ie(e,e,yd.schema({names:{subjectKeyIdentifier:Nf,date:Nl,other:{names:{blockName:Tl}}}}));Ae.assertSchema(t,this.className),this.subjectKeyIdentifier=t.result.subjectKeyIdentifier,Nl in t.result&&(this.date=t.result.date),Tl in t.result&&(this.other=new ah({schema:t.result.other}))}toSchema(){let e=[];return e.push(this.subjectKeyIdentifier),this.date&&e.push(this.date),this.other&&e.push(this.other.toSchema()),new W({value:e})}toJSON(){let e={subjectKeyIdentifier:this.subjectKeyIdentifier.toJSON()};return this.date&&(e.date=this.date.toJSON()),this.other&&(e.other=this.other.toJSON()),e}};MC.CLASS_NAME="RecipientKeyIdentifier";var eA="variant",tA="value",iie=["blockName"],w0=class QA extends Be{static{o(this,"KeyAgreeRecipientIdentifier")}constructor(e={}){super(),this.variant=D(e,eA,QA.defaultValues(eA)),this.value=D(e,tA,QA.defaultValues(tA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case eA:return-1;case tA:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case eA:return t===-1;case tA:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Pr({value:[Fn.schema(t.issuerAndSerialNumber||{names:{blockName:t.blockName||L}}),new ae({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:0},value:MC.schema(t.rKeyId||{names:{blockName:t.blockName||L}}).valueBlock.value})]})}fromSchema(e){_e(e,iie);let t=Ie(e,e,QA.schema({names:{blockName:"blockName"}}));Ae.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1?(this.variant=1,this.value=new Fn({schema:t.result.blockName})):(this.variant=2,this.value=new MC({schema:new W({value:t.result.blockName.valueBlock.value})}))}toSchema(){switch(this.variant){case 1:return this.value.toSchema();case 2:return new ae({idBlock:{tagClass:3,tagNumber:0},value:this.value.toSchema().valueBlock.value});default:return new St}}toJSON(){let e={variant:this.variant};return(this.variant===1||this.variant===2)&&(e.value=this.value.toJSON()),e}};w0.CLASS_NAME="KeyAgreeRecipientIdentifier";var vd="rid",Tf="encryptedKey",aie=[vd,Tf],jC=class Dy extends Be{static{o(this,"RecipientEncryptedKey")}constructor(e={}){super(),this.rid=D(e,vd,Dy.defaultValues(vd)),this.encryptedKey=D(e,Tf,Dy.defaultValues(Tf)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case vd:return new w0;case Tf:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case vd:return t.variant===-1&&!("value"in t);case Tf:return t.isEqual(Dy.defaultValues(Tf));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[w0.schema(t.rid||{}),new Ve({name:t.encryptedKey||L})]})}fromSchema(e){_e(e,aie);let t=Ie(e,e,Dy.schema({names:{rid:{names:{blockName:vd}},encryptedKey:Tf}}));Ae.assertSchema(t,this.className),this.rid=new w0({schema:t.result.rid}),this.encryptedKey=t.result.encryptedKey}toSchema(){return new W({value:[this.rid.toSchema(),this.encryptedKey]})}toJSON(){return{rid:this.rid.toJSON(),encryptedKey:this.encryptedKey.toJSON()}}};jC.CLASS_NAME="RecipientEncryptedKey";var rA="encryptedKeys",YU="RecipientEncryptedKeys",oie=[YU],ov=class lB extends Be{static{o(this,"RecipientEncryptedKeys")}constructor(e={}){super(),this.encryptedKeys=D(e,rA,lB.defaultValues(rA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case rA:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case rA:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.RecipientEncryptedKeys||L,value:jC.schema()})]})}fromSchema(e){_e(e,oie);let t=Ie(e,e,lB.schema({names:{RecipientEncryptedKeys:YU}}));Ae.assertSchema(t,this.className),this.encryptedKeys=Array.from(t.result.RecipientEncryptedKeys,n=>new jC({schema:n}))}toSchema(){return new W({value:Array.from(this.encryptedKeys,e=>e.toSchema())})}toJSON(){return{encryptedKeys:Array.from(this.encryptedKeys,e=>e.toJSON())}}};ov.CLASS_NAME="RecipientEncryptedKeys";var wd="version",Sd="originator",Mo="ukm",Ed="keyEncryptionAlgorithm",Ad="recipientEncryptedKeys",nA="recipientCertificate",sA="recipientPublicKey",uie=[wd,Sd,Mo,Ed,Ad],FC=class qa extends Be{static{o(this,"KeyAgreeRecipientInfo")}constructor(e={}){super(),this.version=D(e,wd,qa.defaultValues(wd)),this.originator=D(e,Sd,qa.defaultValues(Sd)),Mo in e&&(this.ukm=D(e,Mo,qa.defaultValues(Mo))),this.keyEncryptionAlgorithm=D(e,Ed,qa.defaultValues(Ed)),this.recipientEncryptedKeys=D(e,Ad,qa.defaultValues(Ad)),this.recipientCertificate=D(e,nA,qa.defaultValues(nA)),this.recipientPublicKey=D(e,sA,qa.defaultValues(sA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case wd:return 0;case Sd:return new av;case Mo:return new Ve;case Ed:return new ge;case Ad:return new ov;case nA:return new ts;case sA:return null;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case wd:return t===0;case Sd:return t.variant===-1&&!("value"in t);case Mo:return t.isEqual(qa.defaultValues(Mo));case Ed:return t.algorithmId===L&&!("algorithmParams"in t);case Ad:return t.encryptedKeys.length===0;case nA:return!1;case sA:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[av.schema(t.originator||{})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Ve({name:t.ukm||L})]}),ge.schema(t.keyEncryptionAlgorithm||{}),ov.schema(t.recipientEncryptedKeys||{})]})}fromSchema(e){_e(e,uie);let t=Ie(e,e,qa.schema({names:{version:wd,originator:{names:{blockName:Sd}},ukm:Mo,keyEncryptionAlgorithm:{names:{blockName:Ed}},recipientEncryptedKeys:{names:{blockName:Ad}}}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.originator=new av({schema:t.result.originator}),Mo in t.result&&(this.ukm=t.result.ukm),this.keyEncryptionAlgorithm=new ge({schema:t.result.keyEncryptionAlgorithm}),this.recipientEncryptedKeys=new ov({schema:t.result.recipientEncryptedKeys})}toSchema(){let e=[];return e.push(new me({value:this.version})),e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.originator.toSchema()]})),this.ukm&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[this.ukm]})),e.push(this.keyEncryptionAlgorithm.toSchema()),e.push(this.recipientEncryptedKeys.toSchema()),new W({value:e})}toJSON(){let e={version:this.version,originator:this.originator.toJSON(),keyEncryptionAlgorithm:this.keyEncryptionAlgorithm.toJSON(),recipientEncryptedKeys:this.recipientEncryptedKeys.toJSON()};return this.ukm&&(e.ukm=this.ukm.toJSON()),e}};FC.CLASS_NAME="KeyAgreeRecipientInfo";var If="keyIdentifier",Il="date",Bl="other",lie=[If,Il,Bl],uv=class Cd extends Be{static{o(this,"KEKIdentifier")}constructor(e={}){super(),this.keyIdentifier=D(e,If,Cd.defaultValues(If)),Il in e&&(this.date=D(e,Il,Cd.defaultValues(Il))),Bl in e&&(this.other=D(e,Bl,Cd.defaultValues(Bl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case If:return new Ve;case Il:return new Rr;case Bl:return new ah;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case If:return t.isEqual(Cd.defaultValues(If));case Il:return t.year===0&&t.month===0&&t.day===0&&t.hour===0&&t.minute===0&&t.second===0&&t.millisecond===0;case Bl:return t.compareWithDefault("keyAttrId",t.keyAttrId)&&!("keyAttr"in t);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Ve({name:t.keyIdentifier||L}),new Rr({optional:!0,name:t.date||L}),ah.schema(t.other||{})]})}fromSchema(e){_e(e,lie);let t=Ie(e,e,Cd.schema({names:{keyIdentifier:If,date:Il,other:{names:{blockName:Bl}}}}));Ae.assertSchema(t,this.className),this.keyIdentifier=t.result.keyIdentifier,Il in t.result&&(this.date=t.result.date),Bl in t.result&&(this.other=new ah({schema:t.result.other}))}toSchema(){let e=[];return e.push(this.keyIdentifier),this.date&&e.push(this.date),this.other&&e.push(this.other.toSchema()),new W({value:e})}toJSON(){let e={keyIdentifier:this.keyIdentifier.toJSON()};return this.date&&(e.date=this.date),this.other&&(e.other=this.other.toJSON()),e}};uv.CLASS_NAME="KEKIdentifier";var bd="version",xd="kekid",Nd="keyEncryptionAlgorithm",Bf="encryptedKey",iA="preDefinedKEK",cie=[bd,xd,Nd,Bf],qC=class jo extends Be{static{o(this,"KEKRecipientInfo")}constructor(e={}){super(),this.version=D(e,bd,jo.defaultValues(bd)),this.kekid=D(e,xd,jo.defaultValues(xd)),this.keyEncryptionAlgorithm=D(e,Nd,jo.defaultValues(Nd)),this.encryptedKey=D(e,Bf,jo.defaultValues(Bf)),this.preDefinedKEK=D(e,iA,jo.defaultValues(iA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case bd:return 0;case xd:return new uv;case Nd:return new ge;case Bf:return new Ve;case iA:return Qr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case"KEKRecipientInfo":return t===jo.defaultValues(bd);case xd:return t.compareWithDefault("keyIdentifier",t.keyIdentifier)&&!("date"in t)&&!("other"in t);case Nd:return t.algorithmId===L&&!("algorithmParams"in t);case Bf:return t.isEqual(jo.defaultValues(Bf));case iA:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),uv.schema(t.kekid||{}),ge.schema(t.keyEncryptionAlgorithm||{}),new Ve({name:t.encryptedKey||L})]})}fromSchema(e){_e(e,cie);let t=Ie(e,e,jo.schema({names:{version:bd,kekid:{names:{blockName:xd}},keyEncryptionAlgorithm:{names:{blockName:Nd}},encryptedKey:Bf}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.kekid=new uv({schema:t.result.kekid}),this.keyEncryptionAlgorithm=new ge({schema:t.result.keyEncryptionAlgorithm}),this.encryptedKey=t.result.encryptedKey}toSchema(){return new W({value:[new me({value:this.version}),this.kekid.toSchema(),this.keyEncryptionAlgorithm.toSchema(),this.encryptedKey]})}toJSON(){return{version:this.version,kekid:this.kekid.toJSON(),keyEncryptionAlgorithm:this.keyEncryptionAlgorithm.toJSON(),encryptedKey:this.encryptedKey.toJSON()}}};qC.CLASS_NAME="KEKRecipientInfo";var Td="version",Dl="keyDerivationAlgorithm",Id="keyEncryptionAlgorithm",Df="encryptedKey",aA="password",fie=[Td,Dl,Id,Df],HC=class _l extends Be{static{o(this,"PasswordRecipientinfo")}constructor(e={}){super(),this.version=D(e,Td,_l.defaultValues(Td)),Dl in e&&(this.keyDerivationAlgorithm=D(e,Dl,_l.defaultValues(Dl))),this.keyEncryptionAlgorithm=D(e,Id,_l.defaultValues(Id)),this.encryptedKey=D(e,Df,_l.defaultValues(Df)),this.password=D(e,aA,_l.defaultValues(aA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Td:return-1;case Dl:return new ge;case Id:return new ge;case Df:return new Ve;case aA:return Qr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Td:return t===-1;case Dl:case Id:return t.algorithmId===L&&!("algorithmParams"in t);case Df:return t.isEqual(_l.defaultValues(Df));case aA:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new ae({name:t.keyDerivationAlgorithm||L,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:ge.schema().valueBlock.value}),ge.schema(t.keyEncryptionAlgorithm||{}),new Ve({name:t.encryptedKey||L})]})}fromSchema(e){_e(e,fie);let t=Ie(e,e,_l.schema({names:{version:Td,keyDerivationAlgorithm:Dl,keyEncryptionAlgorithm:{names:{blockName:Id}},encryptedKey:Df}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,Dl in t.result&&(this.keyDerivationAlgorithm=new ge({schema:new W({value:t.result.keyDerivationAlgorithm.valueBlock.value})})),this.keyEncryptionAlgorithm=new ge({schema:t.result.keyEncryptionAlgorithm}),this.encryptedKey=t.result.encryptedKey}toSchema(){let e=[];return e.push(new me({value:this.version})),this.keyDerivationAlgorithm&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:this.keyDerivationAlgorithm.toSchema().valueBlock.value})),e.push(this.keyEncryptionAlgorithm.toSchema()),e.push(this.encryptedKey),new W({value:e})}toJSON(){let e={version:this.version,keyEncryptionAlgorithm:this.keyEncryptionAlgorithm.toJSON(),encryptedKey:this.encryptedKey.toJSON()};return this.keyDerivationAlgorithm&&(e.keyDerivationAlgorithm=this.keyDerivationAlgorithm.toJSON()),e}};HC.CLASS_NAME="PasswordRecipientInfo";var Bd="oriType",_f="oriValue",hie=[Bd,_f],cB=class _y extends Be{static{o(this,"OtherRecipientInfo")}constructor(e={}){super(),this.oriType=D(e,Bd,_y.defaultValues(Bd)),this.oriValue=D(e,_f,_y.defaultValues(_f)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Bd:return L;case _f:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Bd:return t===L;case _f:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.oriType||L}),new St({name:t.oriValue||L})]})}fromSchema(e){_e(e,hie);let t=Ie(e,e,_y.schema({names:{oriType:Bd,oriValue:_f}}));Ae.assertSchema(t,this.className),this.oriType=t.result.oriType.valueBlock.toString(),this.oriValue=t.result.oriValue}toSchema(){return new W({value:[new rt({value:this.oriType}),this.oriValue]})}toJSON(){let e={oriType:this.oriType};return _y.compareWithDefault(_f,this.oriValue)||(e.oriValue=this.oriValue.toJSON()),e}};cB.CLASS_NAME="OtherRecipientInfo";var oA="variant",Bg="value",pie=["blockName"],Rf=class Ry extends Be{static{o(this,"RecipientInfo")}constructor(e={}){super(),this.variant=D(e,oA,Ry.defaultValues(oA)),Bg in e&&(this.value=D(e,Bg,Ry.defaultValues(Bg))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case oA:return-1;case Bg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case oA:return t===Ry.defaultValues(e);case Bg:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Pr({value:[VC.schema({names:{blockName:t.blockName||L}}),new ae({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:1},value:FC.schema().valueBlock.value}),new ae({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:2},value:qC.schema().valueBlock.value}),new ae({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:3},value:HC.schema().valueBlock.value}),new ae({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:4},value:cB.schema().valueBlock.value})]})}fromSchema(e){_e(e,pie);let t=Ie(e,e,Ry.schema({names:{blockName:"blockName"}}));if(Ae.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1)this.variant=1,this.value=new VC({schema:t.result.blockName});else{let n=new W({value:t.result.blockName.valueBlock.value});switch(t.result.blockName.idBlock.tagNumber){case 1:this.variant=2,this.value=new FC({schema:n});break;case 2:this.variant=3,this.value=new qC({schema:n});break;case 3:this.variant=4,this.value=new HC({schema:n});break;case 4:this.variant=5,this.value=new cB({schema:n});break;default:throw new Error("Incorrect structure of RecipientInfo block")}}}toSchema(){fr.assertEmpty(this.value,"value","RecipientInfo");let e=this.value.toSchema();switch(this.variant){case 1:return e;case 2:case 3:case 4:return e.idBlock.tagClass=3,e.idBlock.tagNumber=this.variant-1,e;default:return new St}}toJSON(){let e={variant:this.variant};return this.value&&this.variant>=1&&this.variant<=4&&(e.value=this.value.toJSON()),e}};Rf.CLASS_NAME="RecipientInfo";var Rl="hashAlgorithm",Pl="maskGenAlgorithm",Ol="pSourceAlgorithm",die=[Rl,Pl,Ol],ZA=class Zi extends Be{static{o(this,"RSAESOAEPParams")}constructor(e={}){super(),this.hashAlgorithm=D(e,Rl,Zi.defaultValues(Rl)),this.maskGenAlgorithm=D(e,Pl,Zi.defaultValues(Pl)),this.pSourceAlgorithm=D(e,Ol,Zi.defaultValues(Ol)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Rl:return new ge({algorithmId:"1.3.14.3.2.26",algorithmParams:new Kr});case Pl:return new ge({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:new ge({algorithmId:"1.3.14.3.2.26",algorithmParams:new Kr}).toSchema()});case Ol:return new ge({algorithmId:"1.2.840.113549.1.1.9",algorithmParams:new Ve({valueHex:new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer})});default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({idBlock:{tagClass:3,tagNumber:0},optional:!0,value:[ge.schema(t.hashAlgorithm||{})]}),new ae({idBlock:{tagClass:3,tagNumber:1},optional:!0,value:[ge.schema(t.maskGenAlgorithm||{})]}),new ae({idBlock:{tagClass:3,tagNumber:2},optional:!0,value:[ge.schema(t.pSourceAlgorithm||{})]})]})}fromSchema(e){_e(e,die);let t=Ie(e,e,Zi.schema({names:{hashAlgorithm:{names:{blockName:Rl}},maskGenAlgorithm:{names:{blockName:Pl}},pSourceAlgorithm:{names:{blockName:Ol}}}}));Ae.assertSchema(t,this.className),Rl in t.result&&(this.hashAlgorithm=new ge({schema:t.result.hashAlgorithm})),Pl in t.result&&(this.maskGenAlgorithm=new ge({schema:t.result.maskGenAlgorithm})),Ol in t.result&&(this.pSourceAlgorithm=new ge({schema:t.result.pSourceAlgorithm}))}toSchema(){let e=[];return this.hashAlgorithm.isEqual(Zi.defaultValues(Rl))||e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.hashAlgorithm.toSchema()]})),this.maskGenAlgorithm.isEqual(Zi.defaultValues(Pl))||e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[this.maskGenAlgorithm.toSchema()]})),this.pSourceAlgorithm.isEqual(Zi.defaultValues(Ol))||e.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:[this.pSourceAlgorithm.toSchema()]})),new W({value:e})}toJSON(){let e={};return this.hashAlgorithm.isEqual(Zi.defaultValues(Rl))||(e.hashAlgorithm=this.hashAlgorithm.toJSON()),this.maskGenAlgorithm.isEqual(Zi.defaultValues(Pl))||(e.maskGenAlgorithm=this.maskGenAlgorithm.toJSON()),this.pSourceAlgorithm.isEqual(Zi.defaultValues(Ol))||(e.pSourceAlgorithm=this.pSourceAlgorithm.toJSON()),e}};ZA.CLASS_NAME="RSAESOAEPParams";var Dd="keyInfo",kl="entityUInfo",_d="suppPubInfo",mie=[Dd,kl,_d],fB=class Rd extends Be{static{o(this,"ECCCMSSharedInfo")}constructor(e={}){super(),this.keyInfo=D(e,Dd,Rd.defaultValues(Dd)),kl in e&&(this.entityUInfo=D(e,kl,Rd.defaultValues(kl))),this.suppPubInfo=D(e,_d,Rd.defaultValues(_d)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Dd:return new ge;case kl:return new Ve;case _d:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Dd:case kl:case _d:return t.isEqual(Rd.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.keyInfo||{}),new ae({name:t.entityUInfo||L,idBlock:{tagClass:3,tagNumber:0},optional:!0,value:[new Ve]}),new ae({name:t.suppPubInfo||L,idBlock:{tagClass:3,tagNumber:2},value:[new Ve]})]})}fromSchema(e){_e(e,mie);let t=Ie(e,e,Rd.schema({names:{keyInfo:{names:{blockName:Dd}},entityUInfo:kl,suppPubInfo:_d}}));Ae.assertSchema(t,this.className),this.keyInfo=new ge({schema:t.result.keyInfo}),kl in t.result&&(this.entityUInfo=t.result.entityUInfo.valueBlock.value[0]),this.suppPubInfo=t.result.suppPubInfo.valueBlock.value[0]}toSchema(){let e=[];return e.push(this.keyInfo.toSchema()),this.entityUInfo&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.entityUInfo]})),e.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:[this.suppPubInfo]})),new W({value:e})}toJSON(){let e={keyInfo:this.keyInfo.toJSON(),suppPubInfo:this.suppPubInfo.toJSON()};return this.entityUInfo&&(e.entityUInfo=this.entityUInfo.toJSON()),e}};fB.CLASS_NAME="ECCCMSSharedInfo";var Pd="version",Ll="originatorInfo",Od="recipientInfos",kd="encryptedContentInfo",Vl="unprotectedAttrs",gie=[Pd,Ll,Od,kd,Vl],cU={kdfAlgorithm:"SHA-512",kekEncryptionLength:256},yie={"P-256":256,"P-384":384,"P-521":528},hB=class Ul extends Be{static{o(this,"EnvelopedData")}constructor(e={}){super(),this.version=D(e,Pd,Ul.defaultValues(Pd)),Ll in e&&(this.originatorInfo=D(e,Ll,Ul.defaultValues(Ll))),this.recipientInfos=D(e,Od,Ul.defaultValues(Od)),this.encryptedContentInfo=D(e,kd,Ul.defaultValues(kd)),Vl in e&&(this.unprotectedAttrs=D(e,Vl,Ul.defaultValues(Vl))),this.policy={disableSplit:!!e.disableSplit},e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Pd:return 0;case Ll:return new GA;case Od:return[];case kd:return new es;case Vl:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Pd:return t===Ul.defaultValues(e);case Ll:return t.certs.certificates.length===0&&t.crls.crls.length===0;case Od:case Vl:return t.length===0;case kd:return es.compareWithDefault("contentType",t.contentType)&&es.compareWithDefault("contentEncryptionAlgorithm",t.contentEncryptionAlgorithm)&&es.compareWithDefault("encryptedContent",t.encryptedContent);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new ae({name:t.originatorInfo||L,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:GA.schema().valueBlock.value}),new $r({value:[new Tt({name:t.recipientInfos||L,value:Rf.schema()})]}),es.schema(t.encryptedContentInfo||{}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Tt({name:t.unprotectedAttrs||L,value:Zr.schema()})]})]})}fromSchema(e){_e(e,gie);let t=Ie(e,e,Ul.schema({names:{version:Pd,originatorInfo:Ll,recipientInfos:Od,encryptedContentInfo:{names:{blockName:kd}},unprotectedAttrs:Vl}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,Ll in t.result&&(this.originatorInfo=new GA({schema:new W({value:t.result.originatorInfo.valueBlock.value})})),this.recipientInfos=Array.from(t.result.recipientInfos,n=>new Rf({schema:n})),this.encryptedContentInfo=new es({schema:t.result.encryptedContentInfo}),Vl in t.result&&(this.unprotectedAttrs=Array.from(t.result.unprotectedAttrs,n=>new Zr({schema:n})))}toSchema(){let e=[];return e.push(new me({value:this.version})),this.originatorInfo&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:this.originatorInfo.toSchema().valueBlock.value})),e.push(new $r({value:Array.from(this.recipientInfos,t=>t.toSchema())})),e.push(this.encryptedContentInfo.toSchema()),this.unprotectedAttrs&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.unprotectedAttrs,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={version:this.version,recipientInfos:Array.from(this.recipientInfos,t=>t.toJSON()),encryptedContentInfo:this.encryptedContentInfo.toJSON()};return this.originatorInfo&&(e.originatorInfo=this.originatorInfo.toJSON()),this.unprotectedAttrs&&(e.unprotectedAttrs=Array.from(this.unprotectedAttrs,t=>t.toJSON())),e}addRecipientByCertificate(e,t,n,s=_t(!0)){let i=Object.assign({useOAEP:!0,oaepHashAlgorithm:"SHA-512"},cU,t||{});if(e.subjectPublicKeyInfo.algorithm.algorithmId.indexOf("1.2.840.113549")!==-1)n=1;else if(e.subjectPublicKeyInfo.algorithm.algorithmId.indexOf("1.2.840.10045")!==-1)n=2;else throw new Error(`Unknown type of certificate's public key: ${e.subjectPublicKeyInfo.algorithm.algorithmId}`);switch(n){case 1:{let a,u;if(i.useOAEP===!0){a=s.getOIDByAlgorithm({name:"RSA-OAEP"},!0,"keyEncryptionAlgorithm");let f=s.getOIDByAlgorithm({name:i.oaepHashAlgorithm},!0,"RSAES-OAEP-params"),h=new ge({algorithmId:f,algorithmParams:new Kr});u=new ZA({hashAlgorithm:h,maskGenAlgorithm:new ge({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:h.toSchema()})}).toSchema()}else{if(a=s.getOIDByAlgorithm({name:"RSAES-PKCS1-v1_5"}),a===L)throw new Error("Can not find OID for RSAES-PKCS1-v1_5");u=new Kr}let l=new VC({version:0,rid:new Fn({issuer:e.issuer,serialNumber:e.serialNumber}),keyEncryptionAlgorithm:new ge({algorithmId:a,algorithmParams:u}),recipientCertificate:e});this.recipientInfos.push(new Rf({variant:1,value:l}))}break;case 2:{let a=new w0({variant:1,value:new Fn({issuer:e.issuer,serialNumber:e.serialNumber})});this._addKeyAgreeRecipientInfo(a,i,{recipientCertificate:e},s)}break;default:throw new Error(`Unknown "variant" value: ${n}`)}return!0}addRecipientByPreDefinedData(e,t={},n,s=_t(!0)){if(Er.assert(e,"preDefinedData","ArrayBuffer"),!e.byteLength)throw new Error("Pre-defined data could have zero length");if(!t.keyIdentifier){let i=new ArrayBuffer(16),a=new Uint8Array(i);s.getRandomValues(a),t.keyIdentifier=i}switch(t.hmacHashAlgorithm||(t.hmacHashAlgorithm="SHA-512"),t.iterationCount===void 0&&(t.iterationCount=2048),t.keyEncryptionAlgorithm||(t.keyEncryptionAlgorithm={name:"AES-KW",length:256}),t.keyEncryptionAlgorithmParams||(t.keyEncryptionAlgorithmParams=new Kr),n){case 1:{let i=s.getOIDByAlgorithm(t.keyEncryptionAlgorithm,!0,"keyEncryptionAlgorithm"),a=new qC({version:4,kekid:new uv({keyIdentifier:new Ve({valueHex:t.keyIdentifier})}),keyEncryptionAlgorithm:new ge({algorithmId:i,algorithmParams:t.keyEncryptionAlgorithmParams}),preDefinedKEK:e});this.recipientInfos.push(new Rf({variant:3,value:a}))}break;case 2:{let i=s.getOIDByAlgorithm({name:"PBKDF2"},!0,"keyDerivationAlgorithm"),a=new ArrayBuffer(64),u=new Uint8Array(a);s.getRandomValues(u);let l=s.getOIDByAlgorithm({name:"HMAC",hash:{name:t.hmacHashAlgorithm}},!0,"hmacHashAlgorithm"),f=new v0({salt:new Ve({valueHex:a}),iterationCount:t.iterationCount,prf:new ge({algorithmId:l,algorithmParams:new Kr})}),h=s.getOIDByAlgorithm(t.keyEncryptionAlgorithm,!0,"keyEncryptionAlgorithm"),m=new HC({version:0,keyDerivationAlgorithm:new ge({algorithmId:i,algorithmParams:f.toSchema()}),keyEncryptionAlgorithm:new ge({algorithmId:h,algorithmParams:t.keyEncryptionAlgorithmParams}),password:e});this.recipientInfos.push(new Rf({variant:4,value:m}))}break;default:throw new Error(`Unknown value for "variant": ${n}`)}}addRecipientByKeyIdentifier(e,t,n,s=_t(!0)){let i=Object.assign({},cU,n||{}),a=new w0({variant:2,value:new MC({subjectKeyIdentifier:new Ve({valueHex:t})})});this._addKeyAgreeRecipientInfo(a,i,{recipientPublicKey:e},s)}_addKeyAgreeRecipientInfo(e,t,n,s=_t(!0)){let i=new jC({rid:e}),a=s.getOIDByAlgorithm({name:"AES-KW",length:t.kekEncryptionLength},!0,"keyEncryptionAlgorithm"),u=new ge({algorithmId:a}),l=s.getOIDByAlgorithm({name:"ECDH",kdf:t.kdfAlgorithm},!0,"KeyAgreeRecipientInfo"),f=new ArrayBuffer(64),h=new Uint8Array(f);s.getRandomValues(h);let m={version:3,ukm:new Ve({valueHex:f}),keyEncryptionAlgorithm:new ge({algorithmId:l,algorithmParams:u.toSchema()}),recipientEncryptedKeys:new ov({encryptedKeys:[i]})},g=new FC(Object.assign(m,n));this.recipientInfos.push(new Rf({variant:2,value:g}))}async encrypt(e,t,n=_t(!0)){let s=new ArrayBuffer(16),i=new Uint8Array(s);n.getRandomValues(i);let a=new Uint8Array(t),u=n.getOIDByAlgorithm(e,!0,"contentEncryptionAlgorithm"),l=await n.generateKey(e,!0,["encrypt"]),f=await n.encrypt({name:e.name,iv:i},l,a),h=await n.exportKey("raw",l);this.version=2,this.encryptedContentInfo=new es({disableSplit:this.policy.disableSplit,contentType:"1.2.840.113549.1.7.1",contentEncryptionAlgorithm:new ge({algorithmId:u,algorithmParams:new Ve({valueHex:s})}),encryptedContent:new Ve({valueHex:f})});let m=o(async E=>{let b=this.recipientInfos[E].value,T,A;if(b.recipientPublicKey)T=b.recipientPublicKey.algorithm.namedCurve,A=b.recipientPublicKey;else if(b.recipientCertificate){let be=b.recipientCertificate.subjectPublicKeyInfo.algorithm.algorithmParams;if(be.constructor.blockName()!==rt.blockName())throw new Error(`Incorrect "recipientCertificate" for index ${E}`);switch(be.valueBlock.toString()){case"1.2.840.10045.3.1.7":T="P-256";break;case"1.3.132.0.34":T="P-384";break;case"1.3.132.0.35":T="P-521";break;default:throw new Error(`Incorrect curve OID for index ${E}`)}A=await b.recipientCertificate.getPublicKey({algorithm:{algorithm:{name:"ECDH",namedCurve:T},usages:[]}},n)}else throw new Error("Unsupported RecipientInfo");let C=yie[T],x=await n.generateKey({name:"ECDH",namedCurve:T},!0,["deriveBits"]),B=await n.exportKey("spki",x.publicKey),F=await n.deriveBits({name:"ECDH",public:A},x.privateKey,C),R=new ge({schema:b.keyEncryptionAlgorithm.algorithmParams}),H=n.getAlgorithmByOID(R.algorithmId,!0,"aesKWAlgorithm"),q=H.length,K=new ArrayBuffer(4),G=new Uint8Array(K);for(let be=3;be>=0;be--)G[be]=q,q>>=8;let le=new fB({keyInfo:new ge({algorithmId:R.algorithmId}),entityUInfo:b.ukm,suppPubInfo:new Ve({valueHex:K})}).toSchema().toBER(!1),oe=n.getAlgorithmByOID(b.keyEncryptionAlgorithm.algorithmId,!0,"ecdhAlgorithm"),Z=await Y6(oe.kdf,F,H.length,le,n),fe=await n.importKey("raw",Z,{name:"AES-KW"},!0,["wrapKey"]),Se=await n.wrapKey("raw",l,fe,{name:"AES-KW"}),Ke=new av;return Ke.variant=3,Ke.value=UC.fromBER(B),b.originator=Ke,b.recipientEncryptedKeys.encryptedKeys[0].encryptedKey=new Ve({valueHex:Se}),{ecdhPrivateKey:x.privateKey}},"SubKeyAgreeRecipientInfo"),g=o(async E=>{let b=this.recipientInfos[E].value,T=n.getAlgorithmByOID(b.keyEncryptionAlgorithm.algorithmId,!0,"keyEncryptionAlgorithm");if(T.name==="RSA-OAEP"){let A=b.keyEncryptionAlgorithm.algorithmParams,C=new ZA({schema:A});if(T.hash=n.getAlgorithmByOID(C.hashAlgorithm.algorithmId),!("name"in T.hash))throw new Error(`Incorrect OID for hash algorithm: ${C.hashAlgorithm.algorithmId}`)}try{let A=await b.recipientCertificate.getPublicKey({algorithm:{algorithm:T,usages:["encrypt","wrapKey"]}},n),C=await n.encrypt(A.algorithm,A,h);b.encryptedKey=new Ve({valueHex:C})}catch{}},"SubKeyTransRecipientInfo"),w=o(async E=>{let b=this.recipientInfos[E].value,T=n.getAlgorithmByOID(b.keyEncryptionAlgorithm.algorithmId,!0,"kekAlgorithm"),A=await n.importKey("raw",new Uint8Array(b.preDefinedKEK),T,!0,["wrapKey"]),C=await n.wrapKey("raw",l,A,T);b.encryptedKey=new Ve({valueHex:C})},"SubKEKRecipientInfo"),y=o(async E=>{let b=this.recipientInfos[E].value,T;if(!b.keyDerivationAlgorithm)throw new Error('Please append encoded "keyDerivationAlgorithm"');if(!b.keyDerivationAlgorithm.algorithmParams)throw new Error('Incorrectly encoded "keyDerivationAlgorithm"');try{T=new v0({schema:b.keyDerivationAlgorithm.algorithmParams})}catch{throw new Error('Incorrectly encoded "keyDerivationAlgorithm"')}let A=new Uint8Array(b.password),C=await n.importKey("raw",A,"PBKDF2",!1,["deriveKey"]),x=n.getAlgorithmByOID(b.keyEncryptionAlgorithm.algorithmId,!0,"kekAlgorithm"),B="SHA-1";T.prf&&(B=n.getAlgorithmByOID(T.prf.algorithmId,!0,"prfAlgorithm").hash.name);let F=new Uint8Array(T.salt.valueBlock.valueHex),R=T.iterationCount,H=await n.deriveKey({name:"PBKDF2",hash:{name:B},salt:F,iterations:R},C,x,!0,["wrapKey"]),q=await n.wrapKey("raw",l,H,x);b.encryptedKey=new Ve({valueHex:q})},"SubPasswordRecipientinfo"),S=[];for(let E=0;E<this.recipientInfos.length;E++)switch(this.recipientInfos[E].variant){case 1:S.push(await g(E));break;case 2:S.push(await m(E));break;case 3:S.push(await w(E));break;case 4:S.push(await y(E));break;default:throw new Error(`Unknown recipient type in array with index ${E}`)}return S}async decrypt(e,t,n=_t(!0)){let s=t||{};if(e+1>this.recipientInfos.length)throw new Error(`Maximum value for "index" is: ${this.recipientInfos.length-1}`);let i=o(async S=>{let E=this.recipientInfos[S].value,b,T,A,C=E.originator;if(s.recipientCertificate){let oe=s.recipientCertificate.subjectPublicKeyInfo.algorithm.algorithmParams;if(oe.constructor.blockName()!==rt.blockName())throw new Error(`Incorrect "recipientCertificate" for index ${S}`);b=oe.valueBlock.toString()}else if(C.value.algorithm.algorithmParams){let oe=C.value.algorithm.algorithmParams;if(oe.constructor.blockName()!==rt.blockName())throw new Error(`Incorrect originator for index ${S}`);b=oe.valueBlock.toString()}else throw new Error('Parameter "recipientCertificate" is mandatory for "KeyAgreeRecipientInfo" if algorithm params are missing from originator');if(!s.recipientPrivateKey)throw new Error('Parameter "recipientPrivateKey" is mandatory for "KeyAgreeRecipientInfo"');switch(b){case"1.2.840.10045.3.1.7":T="P-256",A=256;break;case"1.3.132.0.34":T="P-384",A=384;break;case"1.3.132.0.35":T="P-521",A=528;break;default:throw new Error(`Incorrect curve OID for index ${S}`)}let x,B=n;dt.isBufferSource(s.recipientPrivateKey)?x=await n.importKey("pkcs8",s.recipientPrivateKey,{name:"ECDH",namedCurve:T},!0,["deriveBits"]):(x=s.recipientPrivateKey,"crypto"in s&&s.crypto&&(B=s.crypto.subtle)),"algorithmParams"in C.value.algorithm||(C.value.algorithm.algorithmParams=new rt({value:b}));let F=C.value.toSchema().toBER(!1),R=await n.importKey("spki",F,{name:"ECDH",namedCurve:T},!0,[]),H=await B.deriveBits({name:"ECDH",public:R},x,A);async function q(oe){oe=oe||!1;let Z=new ge({schema:E.keyEncryptionAlgorithm.algorithmParams}),fe=n.getAlgorithmByOID(Z.algorithmId,!0,"kwAlgorithm"),Se=fe.length,Ke=new ArrayBuffer(4),be=new Uint8Array(Ke);for(let lt=3;lt>=0;lt--)be[lt]=Se,Se>>=8;let we={algorithmId:Z.algorithmId};oe&&(we.algorithmParams=new Kr);let Je=new fB({keyInfo:new ge(we),entityUInfo:E.ukm,suppPubInfo:new Ve({valueHex:Ke})}).toSchema().toBER(!1),Ye=n.getAlgorithmByOID(E.keyEncryptionAlgorithm.algorithmId,!0,"ecdhAlgorithm");if(!Ye.name)throw new Error(`Incorrect OID for key encryption algorithm: ${E.keyEncryptionAlgorithm.algorithmId}`);return Y6(Ye.kdf,H,fe.length,Je,n)}o(q,"applyKDF");let K=await q(),G=o(async oe=>n.importKey("raw",oe,{name:"AES-KW"},!0,["unwrapKey"]),"importAesKwKey"),he=await G(K),le=o(async oe=>{let Z=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,fe=n.getAlgorithmByOID(Z,!0,"contentEncryptionAlgorithm");return n.unwrapKey("raw",E.recipientEncryptedKeys.encryptedKeys[0].encryptedKey.valueBlock.valueHexView,oe,{name:"AES-KW"},fe,!0,["decrypt"])},"unwrapSessionKey");try{return await le(he)}catch{let oe=await q(!0),Z=await G(oe);return le(Z)}},"SubKeyAgreeRecipientInfo"),a=o(async S=>{let E=this.recipientInfos[S].value;if(!s.recipientPrivateKey)throw new Error('Parameter "recipientPrivateKey" is mandatory for "KeyTransRecipientInfo"');let b=n.getAlgorithmByOID(E.keyEncryptionAlgorithm.algorithmId,!0,"keyEncryptionAlgorithm");if(b.name==="RSA-OAEP"){let F=E.keyEncryptionAlgorithm.algorithmParams,R=new ZA({schema:F});if(b.hash=n.getAlgorithmByOID(R.hashAlgorithm.algorithmId),!("name"in b.hash))throw new Error(`Incorrect OID for hash algorithm: ${R.hashAlgorithm.algorithmId}`)}let T,A=n;dt.isBufferSource(s.recipientPrivateKey)?T=await n.importKey("pkcs8",s.recipientPrivateKey,b,!0,["decrypt"]):(T=s.recipientPrivateKey,"crypto"in s&&s.crypto&&(A=s.crypto.subtle));let C=await A.decrypt(T.algorithm,T,E.encryptedKey.valueBlock.valueHexView),x=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,B=n.getAlgorithmByOID(x,!0,"contentEncryptionAlgorithm");if(!("name"in B))throw new Error(`Incorrect "contentEncryptionAlgorithm": ${x}`);return n.importKey("raw",C,B,!0,["decrypt"])},"SubKeyTransRecipientInfo"),u=o(async S=>{let E=this.recipientInfos[S].value;if(!s.preDefinedData)throw new Error('Parameter "preDefinedData" is mandatory for "KEKRecipientInfo"');let b=n.getAlgorithmByOID(E.keyEncryptionAlgorithm.algorithmId,!0,"kekAlgorithm"),T=await n.importKey("raw",s.preDefinedData,b,!0,["unwrapKey"]),A=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,C=n.getAlgorithmByOID(A,!0,"contentEncryptionAlgorithm");if(!C.name)throw new Error(`Incorrect "contentEncryptionAlgorithm": ${A}`);return n.unwrapKey("raw",E.encryptedKey.valueBlock.valueHexView,T,b,C,!0,["decrypt"])},"SubKEKRecipientInfo"),l=o(async S=>{let E=this.recipientInfos[S].value,b;if(!s.preDefinedData)throw new Error('Parameter "preDefinedData" is mandatory for "KEKRecipientInfo"');if(!E.keyDerivationAlgorithm)throw new Error('Please append encoded "keyDerivationAlgorithm"');if(!E.keyDerivationAlgorithm.algorithmParams)throw new Error('Incorrectly encoded "keyDerivationAlgorithm"');try{b=new v0({schema:E.keyDerivationAlgorithm.algorithmParams})}catch{throw new Error('Incorrectly encoded "keyDerivationAlgorithm"')}let T=await n.importKey("raw",s.preDefinedData,"PBKDF2",!1,["deriveKey"]),A=n.getAlgorithmByOID(E.keyEncryptionAlgorithm.algorithmId,!0,"keyEncryptionAlgorithm"),C=b.prf?n.getAlgorithmByOID(b.prf.algorithmId,!0,"prfAlgorithm").hash.name:"SHA-1",x=new Uint8Array(b.salt.valueBlock.valueHex),B=b.iterationCount,F=await n.deriveKey({name:"PBKDF2",hash:{name:C},salt:x,iterations:B},T,A,!0,["unwrapKey"]),R=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,H=n.getAlgorithmByOID(R,!0,"contentEncryptionAlgorithm");return n.unwrapKey("raw",E.encryptedKey.valueBlock.valueHexView,F,A,H,!0,["decrypt"])},"SubPasswordRecipientinfo"),f;switch(this.recipientInfos[e].variant){case 1:f=await a(e);break;case 2:f=await i(e);break;case 3:f=await u(e);break;case 4:f=await l(e);break;default:throw new Error(`Unknown recipient type in array with index ${e}`)}let h=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,m=n.getAlgorithmByOID(h,!0,"contentEncryptionAlgorithm"),g=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmParams.valueBlock.valueHex,w=new Uint8Array(g);if(!this.encryptedContentInfo.encryptedContent)throw new Error("Required property `encryptedContent` is empty");let y=this.encryptedContentInfo.getEncryptedContent();return n.decrypt({name:m.name,iv:w},f,y)}};hB.CLASS_NAME="EnvelopedData";var Op="safeContents",Dg="parsedValue",fU="contentInfos",pB=class eC extends Be{static{o(this,"AuthenticatedSafe")}constructor(e={}){super(),this.safeContents=D(e,Op,eC.defaultValues(Op)),Dg in e&&(this.parsedValue=D(e,Dg,eC.defaultValues(Dg))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Op:return[];case Dg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Op:return t.length===0;case Dg:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.contentInfos||L,value:Gr.schema()})]})}fromSchema(e){_e(e,[fU]);let t=Ie(e,e,eC.schema({names:{contentInfos:fU}}));Ae.assertSchema(t,this.className),this.safeContents=Array.from(t.result.contentInfos,n=>new Gr({schema:n}))}toSchema(){return new W({value:Array.from(this.safeContents,e=>e.toSchema())})}toJSON(){return{safeContents:Array.from(this.safeContents,e=>e.toJSON())}}async parseInternalValues(e,t=_t(!0)){if(fr.assert(e,Op),Er.assert(e.safeContents,Op,"Array"),e.safeContents.length!==this.safeContents.length)throw new Er('Length of "parameters.safeContents" must be equal to "this.safeContents.length"');this.parsedValue={safeContents:[]};for(let[n,s]of this.safeContents.entries()){let i=e.safeContents[n],a=`parameters.safeContents[${n}]`;switch(s.contentType){case MB:{Er.assert(s.content,"this.safeContents[j].content",Ve);let u=s.content.getValue();this.parsedValue.safeContents.push({privacyMode:0,value:y0.fromBER(u)})}break;case xU:{let u=new hB({schema:s.content});fr.assert(a,i,"recipientCertificate","recipientKey");let l=i,f=l.recipientCertificate,h=l.recipientKey,m=await u.decrypt(0,{recipientCertificate:f,recipientPrivateKey:h},t);this.parsedValue.safeContents.push({privacyMode:2,value:y0.fromBER(m)})}break;case NU:{let u=new pv({schema:s.content});fr.assert(a,i,"password");let l=i.password,f=await u.decrypt({password:l},t);this.parsedValue.safeContents.push({privacyMode:1,value:y0.fromBER(f)})}break;default:throw new Error(`Unknown "contentType" for AuthenticatedSafe: " ${s.contentType}`)}}}async makeInternalValues(e,t=_t(!0)){if(!this.parsedValue)throw new Error('Please run "parseValues" first or add "parsedValue" manually');if(Er.assert(this.parsedValue,"this.parsedValue","object"),Er.assert(this.parsedValue.safeContents,"this.parsedValue.safeContents","Array"),Er.assert(e,"parameters","object"),fr.assert(e,"safeContents"),Er.assert(e.safeContents,"parameters.safeContents","Array"),e.safeContents.length!==this.parsedValue.safeContents.length)throw new Er('Length of "parameters.safeContents" must be equal to "this.parsedValue.safeContents"');this.safeContents=[];for(let[n,s]of this.parsedValue.safeContents.entries())switch(fr.assert("content",s,"privacyMode","value"),Er.assert(s.value,"content.value",y0),s.privacyMode){case 0:{let i=s.value.toSchema().toBER(!1);this.safeContents.push(new Gr({contentType:"1.2.840.113549.1.7.1",content:new Ve({valueHex:i})}))}break;case 1:{let i=new pv,a=e.safeContents[n];a.contentToEncrypt=s.value.toSchema().toBER(!1),await i.encrypt(a,t),this.safeContents.push(new Gr({contentType:"1.2.840.113549.1.7.6",content:i.toSchema()}))}break;case 2:{let i=new hB,a=s.value.toSchema().toBER(!1),u=e.safeContents[n];switch(fr.assert(`parameters.safeContents[${n}]`,u,"encryptingCertificate","encryptionAlgorithm"),!0){case u.encryptionAlgorithm.name.toLowerCase()==="aes-cbc":case u.encryptionAlgorithm.name.toLowerCase()==="aes-gcm":break;default:throw new Error(`Incorrect parameter "encryptionAlgorithm" in "parameters.safeContents[i]": ${u.encryptionAlgorithm}`)}switch(!0){case u.encryptionAlgorithm.length===128:case u.encryptionAlgorithm.length===192:case u.encryptionAlgorithm.length===256:break;default:throw new Error(`Incorrect parameter "encryptionAlgorithm.length" in "parameters.safeContents[i]": ${u.encryptionAlgorithm.length}`)}let l=u.encryptionAlgorithm;i.addRecipientByCertificate(u.encryptingCertificate,{},void 0,t),await i.encrypt(l,a,t),this.safeContents.push(new Gr({contentType:"1.2.840.113549.1.7.3",content:i.toSchema()}))}break;default:throw new Error(`Incorrect value for "content.privacyMode": ${s.privacyMode}`)}return this}};pB.CLASS_NAME="AuthenticatedSafe";var Pf="hashAlgorithm",Ld="issuerNameHash",Vd="issuerKeyHash",Of="serialNumber",vie=[Pf,Ld,Vd,Of],Ys=class Ml extends Be{static{o(this,"CertID")}static async create(e,t,n=_t(!0)){let s=new Ml;return await s.createForCertificate(e,t,n),s}constructor(e={}){super(),this.hashAlgorithm=D(e,Pf,Ml.defaultValues(Pf)),this.issuerNameHash=D(e,Ld,Ml.defaultValues(Ld)),this.issuerKeyHash=D(e,Vd,Ml.defaultValues(Vd)),this.serialNumber=D(e,Of,Ml.defaultValues(Of)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Pf:return new ge;case Ld:case Vd:return new Ve;case Of:return new me;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Pf:return t.algorithmId===L&&!("algorithmParams"in t);case Ld:case Vd:case Of:return t.isEqual(Ml.defaultValues(Of));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.hashAlgorithmObject||{names:{blockName:t.hashAlgorithm||L}}),new Ve({name:t.issuerNameHash||L}),new Ve({name:t.issuerKeyHash||L}),new me({name:t.serialNumber||L})]})}fromSchema(e){_e(e,vie);let t=Ie(e,e,Ml.schema({names:{hashAlgorithm:Pf,issuerNameHash:Ld,issuerKeyHash:Vd,serialNumber:Of}}));Ae.assertSchema(t,this.className),this.hashAlgorithm=new ge({schema:t.result.hashAlgorithm}),this.issuerNameHash=t.result.issuerNameHash,this.issuerKeyHash=t.result.issuerKeyHash,this.serialNumber=t.result.serialNumber}toSchema(){return new W({value:[this.hashAlgorithm.toSchema(),this.issuerNameHash,this.issuerKeyHash,this.serialNumber]})}toJSON(){return{hashAlgorithm:this.hashAlgorithm.toJSON(),issuerNameHash:this.issuerNameHash.toJSON(),issuerKeyHash:this.issuerKeyHash.toJSON(),serialNumber:this.serialNumber.toJSON()}}isEqual(e){return!(this.hashAlgorithm.algorithmId!==e.hashAlgorithm.algorithmId||!dt.isEqual(this.issuerNameHash.valueBlock.valueHexView,e.issuerNameHash.valueBlock.valueHexView)||!dt.isEqual(this.issuerKeyHash.valueBlock.valueHexView,e.issuerKeyHash.valueBlock.valueHexView)||!this.serialNumber.isEqual(e.serialNumber))}async createForCertificate(e,t,n=_t(!0)){fr.assert(t,Pf,"issuerCertificate");let s=n.getOIDByAlgorithm({name:t.hashAlgorithm},!0,"hashAlgorithm");this.hashAlgorithm=new ge({algorithmId:s,algorithmParams:new Kr});let i=t.issuerCertificate;this.serialNumber=e.serialNumber;let a=await n.digest({name:t.hashAlgorithm},i.subject.toSchema().toBER(!1));this.issuerNameHash=new Ve({valueHex:a});let u=i.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView,l=await n.digest({name:t.hashAlgorithm},u);this.issuerKeyHash=new Ve({valueHex:l})}};Ys.CLASS_NAME="CertID";var Ud="certID",Md="certStatus",jd="thisUpdate",jl="nextUpdate",kf="singleExtensions",wie=[Ud,Md,jd,jl,kf],dB=class Fl extends Be{static{o(this,"SingleResponse")}constructor(e={}){super(),this.certID=D(e,Ud,Fl.defaultValues(Ud)),this.certStatus=D(e,Md,Fl.defaultValues(Md)),this.thisUpdate=D(e,jd,Fl.defaultValues(jd)),jl in e&&(this.nextUpdate=D(e,jl,Fl.defaultValues(jl))),kf in e&&(this.singleExtensions=D(e,kf,Fl.defaultValues(kf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ud:return new Ys;case Md:return{};case jd:case jl:return new Date(0,0,0);case kf:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Ud:return Ys.compareWithDefault("hashAlgorithm",t.hashAlgorithm)&&Ys.compareWithDefault("issuerNameHash",t.issuerNameHash)&&Ys.compareWithDefault("issuerKeyHash",t.issuerKeyHash)&&Ys.compareWithDefault("serialNumber",t.serialNumber);case Md:return Object.keys(t).length===0;case jd:case jl:return t===Fl.defaultValues(e);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Ys.schema(t.certID||{}),new Pr({value:[new yt({name:t.certStatus||L,idBlock:{tagClass:3,tagNumber:0}}),new ae({name:t.certStatus||L,idBlock:{tagClass:3,tagNumber:1},value:[new Rr,new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new zu]})]}),new yt({name:t.certStatus||L,idBlock:{tagClass:3,tagNumber:2},lenBlock:{length:1}})]}),new Rr({name:t.thisUpdate||L}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Rr({name:t.nextUpdate||L})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[wn.schema(t.singleExtensions||{})]})]})}fromSchema(e){_e(e,wie);let t=Ie(e,e,Fl.schema({names:{certID:{names:{blockName:Ud}},certStatus:Md,thisUpdate:jd,nextUpdate:jl,singleExtensions:{names:{blockName:kf}}}}));Ae.assertSchema(t,this.className),this.certID=new Ys({schema:t.result.certID}),this.certStatus=t.result.certStatus,this.thisUpdate=t.result.thisUpdate.toDate(),jl in t.result&&(this.nextUpdate=t.result.nextUpdate.toDate()),kf in t.result&&(this.singleExtensions=Array.from(t.result.singleExtensions.valueBlock.value,n=>new _i({schema:n})))}toSchema(){let e=[];return e.push(this.certID.toSchema()),e.push(this.certStatus),e.push(new Rr({valueDate:this.thisUpdate})),this.nextUpdate&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[new Rr({valueDate:this.nextUpdate})]})),this.singleExtensions&&e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[new W({value:Array.from(this.singleExtensions,t=>t.toSchema())})]})),new W({value:e})}toJSON(){let e={certID:this.certID.toJSON(),certStatus:this.certStatus.toJSON(),thisUpdate:this.thisUpdate};return this.nextUpdate&&(e.nextUpdate=this.nextUpdate),this.singleExtensions&&(e.singleExtensions=Array.from(this.singleExtensions,t=>t.toJSON())),e}};dB.CLASS_NAME="SingleResponse";var uA="tbs",Lf="version",Py="responderID",Oy="producedAt",ky="responses",Fd="responseExtensions",oh="ResponseData",tC=`${oh}.${Lf}`,qd=`${oh}.${Py}`,mB=`${oh}.${Oy}`,gB=`${oh}.${ky}`,rC=`${oh}.${Fd}`,Sie=[oh,tC,qd,mB,gB,rC],Fo=class Ha extends Be{static{o(this,"ResponseData")}get tbs(){return dt.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(D(e,uA,Ha.defaultValues(uA))),Lf in e&&(this.version=D(e,Lf,Ha.defaultValues(Lf))),this.responderID=D(e,Py,Ha.defaultValues(Py)),this.producedAt=D(e,Oy,Ha.defaultValues(Oy)),this.responses=D(e,ky,Ha.defaultValues(ky)),Fd in e&&(this.responseExtensions=D(e,Fd,Ha.defaultValues(Fd))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Lf:return 0;case uA:return Qr;case Py:return{};case Oy:return new Date(0,0,0);case ky:case Fd:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case uA:return t.byteLength===0;case Py:return Object.keys(t).length===0;case Oy:return t===Ha.defaultValues(e);case ky:case Fd:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||oh,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new me({name:t.version||tC})]}),new Pr({value:[new ae({name:t.responderID||qd,idBlock:{tagClass:3,tagNumber:1},value:[Or.schema(t.ResponseDataByName||{names:{blockName:"ResponseData.byName"}})]}),new ae({name:t.responderID||qd,idBlock:{tagClass:3,tagNumber:2},value:[new Ve({name:t.ResponseDataByKey||"ResponseData.byKey"})]})]}),new Rr({name:t.producedAt||mB}),new W({value:[new Tt({name:gB,value:dB.schema(t.response||{})})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[wn.schema(t.extensions||{names:{blockName:rC}})]})]})}fromSchema(e){_e(e,Sie);let t=Ie(e,e,Ha.schema());Ae.assertSchema(t,this.className),this.tbsView=t.result.ResponseData.valueBeforeDecodeView,tC in t.result&&(this.version=t.result[tC].valueBlock.valueDec),t.result[qd].idBlock.tagNumber===1?this.responderID=new Or({schema:t.result[qd].valueBlock.value[0]}):this.responderID=t.result[qd].valueBlock.value[0],this.producedAt=t.result[mB].toDate(),this.responses=Array.from(t.result[gB],n=>new dB({schema:n})),rC in t.result&&(this.responseExtensions=Array.from(t.result[rC].valueBlock.value,n=>new _i({schema:n})))}toSchema(e=!1){let t;if(e===!1){if(!this.tbsView.byteLength)return Ha.schema();let n=Hr(this.tbsView);Ae.assert(n,"TBS Response Data"),t=n.result}else{let n=[];Lf in this&&n.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[new me({value:this.version})]})),this.responderID instanceof Or?n.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[this.responderID.toSchema()]})):n.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:[this.responderID]})),n.push(new Rr({valueDate:this.producedAt})),n.push(new W({value:Array.from(this.responses,s=>s.toSchema())})),this.responseExtensions&&n.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[new W({value:Array.from(this.responseExtensions,s=>s.toSchema())})]})),t=new W({value:n})}return t}toJSON(){let e={};return Lf in this&&(e.version=this.version),this.responderID&&(e.responderID=this.responderID),this.producedAt&&(e.producedAt=this.producedAt),this.responses&&(e.responses=Array.from(this.responses,t=>t.toJSON())),this.responseExtensions&&(e.responseExtensions=Array.from(this.responseExtensions,t=>t.toJSON())),e}};Fo.CLASS_NAME="ResponseData";var yI="trustedCerts",vI="certs",wI="crls",SI="ocsps",EI="checkDate",AI="findOrigin",CI="findIssuer",Qf;(function(r){r[r.unknown=-1]="unknown",r[r.success=0]="success",r[r.noRevocation=11]="noRevocation",r[r.noPath=60]="noPath",r[r.noValidPath=97]="noValidPath"})(Qf||(Qf={}));var Hd=class QU extends Error{static{o(this,"ChainValidationError")}constructor(e,t){super(t),this.name=QU.NAME,this.code=e,this.message=t}};Hd.NAME="ChainValidationError";function Eie(r,e){for(let t=0;t<e.length;t++)if(dt.isEqual(r.tbsView,e[t].tbsView))return!0;return!1}o(Eie,"isTrusted");var ZU=class eM{static{o(this,"CertificateChainValidationEngine")}constructor(e={}){this.trustedCerts=D(e,yI,this.defaultValues(yI)),this.certs=D(e,vI,this.defaultValues(vI)),this.crls=D(e,wI,this.defaultValues(wI)),this.ocsps=D(e,SI,this.defaultValues(SI)),this.checkDate=D(e,EI,this.defaultValues(EI)),this.findOrigin=D(e,AI,this.defaultValues(AI)),this.findIssuer=D(e,CI,this.defaultValues(CI))}static defaultFindOrigin(e,t){e.tbsView.byteLength===0&&(e.tbsView=new Uint8Array(e.encodeTBS().toBER()));for(let n of t.certs)if(n.tbsView.byteLength===0&&(n.tbsView=new Uint8Array(n.encodeTBS().toBER())),dt.isEqual(e.tbsView,n.tbsView))return"Intermediate Certificates";for(let n of t.trustedCerts)if(n.tbsView.byteLength===0&&(n.tbsView=new Uint8Array(n.encodeTBS().toBER())),dt.isEqual(e.tbsView,n.tbsView))return"Trusted Certificates";return"Unknown"}async defaultFindIssuer(e,t,n=_t(!0)){let s=[],i=null,a=null,u=null;if(e.subject.isEqual(e.issuer))try{if(await e.verify(void 0,n))return[e]}catch{}if(e.extensions){for(let f of e.extensions)if(f.extnID===VB&&f.parsedValue instanceof FB){f.parsedValue.keyIdentifier?i=f.parsedValue.keyIdentifier:(f.parsedValue.authorityCertIssuer&&(a=f.parsedValue.authorityCertIssuer),f.parsedValue.authorityCertSerialNumber&&(u=f.parsedValue.authorityCertSerialNumber));break}}function l(f){if(i!==null&&f.extensions){let m=!1;for(let g of f.extensions)if(g.extnID===Cne&&g.parsedValue){m=!0,dt.isEqual(g.parsedValue.valueBlock.valueHex,i.valueBlock.valueHexView)&&s.push(f);break}if(m)return}let h=!1;u!==null&&(h=f.serialNumber.isEqual(u)),a!==null?f.subject.isEqual(a)&&h&&s.push(f):e.issuer.isEqual(f.subject)&&s.push(f)}o(l,"checkCertificate");for(let f of t.trustedCerts)l(f);for(let f of t.certs)l(f);for(let f=s.length-1;f>=0;f--)try{await e.verify(s[f],n)===!1&&s.splice(f,1)}catch{s.splice(f,1)}return s}defaultValues(e){switch(e){case yI:return[];case vI:return[];case wI:return[];case SI:return[];case EI:return new Date;case AI:return eM.defaultFindOrigin;case CI:return this.defaultFindIssuer;default:throw new Error(`Invalid member name for CertificateChainValidationEngine class: ${e}`)}}async sort(e=!1,t=_t(!0)){let n=[],s=o(async(y,S)=>{let E=[];function b(A){let C=!0;for(let x=0;x<A.length;x++){for(let B=0;B<A.length;B++)if(B!==x&&A[x]===A[B]){C=!1;break}if(!C)break}return C}if(o(b,"checkUnique"),Eie(y,this.trustedCerts))return[[y]];let T=await this.findIssuer(y,this,S);if(T.length===0)throw new Error("No valid certificate paths found");for(let A=0;A<T.length;A++){if(dt.isEqual(T[A].tbsView,y.tbsView)){E.push([T[A]]);continue}let C=await s(T[A],S);for(let x=0;x<C.length;x++){let B=C[x].slice();B.splice(0,0,T[A]),b(B)?E.push(B):E.push(C[x])}}return E},"buildPath"),i=o(async y=>{let S=[],E=[],b=[];if(S.push(...n.filter(T=>y.issuer.isEqual(T.subject))),S.length===0)return{status:1,statusMessage:"No certificate's issuers"};if(E.push(...this.crls.filter(T=>T.issuer.isEqual(y.issuer))),E.length===0)return{status:2,statusMessage:"No CRLs for specific certificate issuer"};for(let T=0;T<E.length;T++){let A=E[T];if(!(A.nextUpdate&&A.nextUpdate.value<this.checkDate))for(let C=0;C<S.length;C++)try{if(await E[T].verify({issuerCertificate:S[C]},t)){b.push({crl:E[T],certificate:S[C]});break}}catch{}}return b.length?{status:0,statusMessage:L,result:b}:{status:3,statusMessage:"No valid CRLs found"}},"findCRL"),a=o(async(y,S)=>{let E=t.getAlgorithmByOID(y.signatureAlgorithm.algorithmId);if(!E.name||!E.hash)return 1;for(let b=0;b<this.ocsps.length;b++){let A=await this.ocsps[b].getCertificateStatus(y,S,t);if(A.isForCertificate)return A.status===0?0:1}return 2},"findOCSP");async function u(y,S=!1){let E=!1,b=!1,T=!1,A=!1;if(y.extensions){for(let C=0;C<y.extensions.length;C++){let x=y.extensions[C];if(x.critical&&!x.parsedValue)return{result:!1,resultCode:6,resultMessage:`Unable to parse critical certificate extension: ${x.extnID}`};if(x.extnID===bne){T=!0;let B=new Uint8Array(x.parsedValue.valueBlock.valueHex);(B[0]&4)===4&&(b=!0),(B[0]&2)===2&&(A=!0)}x.extnID===kB&&"cA"in x.parsedValue&&x.parsedValue.cA===!0&&(E=!0)}if(b===!0&&E===!1)return{result:!1,resultCode:3,resultMessage:'Unable to build certificate chain - using "keyCertSign" flag set without BasicConstraints'};if(T===!0&&E===!0&&b===!1)return{result:!1,resultCode:4,resultMessage:'Unable to build certificate chain - "keyCertSign" flag was not set'};if(E===!0&&T===!0&&S&&A===!1)return{result:!1,resultCode:5,resultMessage:'Unable to build certificate chain - intermediate certificate must have "cRLSign" key usage flag'}}return E===!1?{result:!1,resultCode:7,resultMessage:"Unable to build certificate chain - more than one possible end-user certificate"}:{result:!0,resultCode:0,resultMessage:L}}o(u,"checkForCA");let l=o(async(y,S)=>{for(let E=0;E<y.length;E++)if(y[E].notBefore.value>S||y[E].notAfter.value<S)return{result:!1,resultCode:8,resultMessage:"The certificate is either not yet valid or expired"};if(y.length<2)return{result:!1,resultCode:9,resultMessage:"Too short certificate path"};for(let E=y.length-2;E>=0;E--)if(y[E].issuer.isEqual(y[E].subject)===!1&&y[E].issuer.isEqual(y[E+1].subject)===!1)return{result:!1,resultCode:10,resultMessage:"Incorrect name chaining"};if(this.crls.length!==0||this.ocsps.length!==0)for(let E=0;E<y.length-1;E++){let b=2,T={status:0,statusMessage:L};if(this.ocsps.length!==0)switch(b=await a(y[E],y[E+1]),b){case 0:continue;case 1:return{result:!1,resultCode:12,resultMessage:"One of certificates was revoked via OCSP response"}}if(this.crls.length!==0){if(T=await i(y[E]),T.status===0&&T.result)for(let A=0;A<T.result.length;A++){if(T.result[A].crl.isCertificateRevoked(y[E]))return{result:!1,resultCode:12,resultMessage:"One of certificates had been revoked"};if((await u(T.result[A].certificate,!0)).result===!1)return{result:!1,resultCode:13,resultMessage:"CRL issuer certificate is not a CA certificate or does not have crlSign flag"}}else if(e===!1)throw new Hd(Qf.noRevocation,`No revocation values found for one of certificates: ${T.statusMessage}`)}else if(b===2)return{result:!1,resultCode:11,resultMessage:"No revocation values found for one of certificates"};if(b===2&&T.status===2&&e){let A=y[E+1],C=!1;if(A.extensions)for(let x of A.extensions)switch(x.extnID){case SU:case LB:case UB:C=!0;break}if(C)throw new Hd(Qf.noRevocation,`No revocation values found for one of certificates: ${T.statusMessage}`)}}for(let[E,b]of y.entries()){if(!E)continue;if(!(await u(b)).result)return{result:!1,resultCode:14,resultMessage:"One of intermediate certificates is not a CA certificate"}}return{result:!0}},"basicCheck");n.push(...this.trustedCerts),n.push(...this.certs);for(let y=0;y<n.length;y++)for(let S=0;S<n.length;S++)if(y!==S&&dt.isEqual(n[y].tbsView,n[S].tbsView)){n.splice(S,1),y=0;break}let f=n[n.length-1],h,m=[f];if(h=await s(f,t),h.length===0)throw new Hd(Qf.noPath,"Unable to find certificate path");for(let y=h.length-1;y>=0;y--){let S=!1;for(let E=0;E<h[y].length;E++){let b=h[y][E];for(let T=0;T<this.trustedCerts.length;T++)if(dt.isEqual(b.tbsView,this.trustedCerts[T].tbsView)){S=!0;break}if(S)break}S||h.splice(y,1)}if(h.length===0)throw new Hd(Qf.noValidPath,"No valid certificate paths found");let g=h[0].length,w=0;for(let y=0;y<h.length;y++)h[y].length<g&&(g=h[y].length,w=y);for(let y=0;y<h[w].length;y++)m.push(h[w][y]);if(h=await l(m,this.checkDate),h.result===!1)throw h;return m}async verify(e={},t=_t(!0)){function n(l,f){let h=Jl(l),m=Jl(f),g=h.split("."),w=m.split("."),y=g.length,S=w.length;if(y===0||S===0||y<S)return!1;for(let E=0;E<y;E++)if(g[E].length===0)return!1;for(let E=0;E<S;E++)if(w[E].length===0){if(E===0){if(S===1)return!1;continue}return!1}for(let E=0;E<S;E++)if(w[S-1-E].length!==0&&g[y-1-E].localeCompare(w[S-1-E])!==0)return!1;return!0}o(n,"compareDNSName");function s(l,f){let h=Jl(l),m=Jl(f),g=h.split("@"),w=m.split("@");if(g.length===0||w.length===0||g.length<w.length)return!1;if(w.length===1){if(n(g[1],w[0])){let S=g[1].split("."),E=w[0].split(".");return E[0].length===0?!0:S.length===E.length}return!1}return h.localeCompare(m)===0}o(s,"compareRFC822Name");function i(l,f){let h=Jl(l),m=Jl(f),g=h.split("/");if(m.split("/").length>1)return!1;if(g.length>1){for(let S=0;S<g.length;S++)if(g[S].length>0&&g[S].charAt(g[S].length-1)!==":"){h=g[S].split(":")[0];break}}if(n(h,m)){let S=h.split("."),E=m.split(".");return E[0].length===0?!0:S.length===E.length}return!1}o(i,"compareUniformResourceIdentifier");function a(l,f){let h=l.valueBlock.valueHexView,m=f.valueBlock.valueHexView;if(h.length===4&&m.length===8){for(let g=0;g<4;g++)if((h[g]^m[g])&m[g+4])return!1;return!0}if(h.length===16&&m.length===32){for(let g=0;g<16;g++)if((h[g]^m[g])&m[g+16])return!1;return!0}return!1}o(a,"compareIPAddress");function u(l,f){if(l.typesAndValues.length===0||f.typesAndValues.length===0)return!0;if(l.typesAndValues.length<f.typesAndValues.length)return!1;let h=!0,m=0;for(let g=0;g<f.typesAndValues.length;g++){let w=!1;for(let y=m;y<l.typesAndValues.length;y++)if(w=l.typesAndValues[y].isEqual(f.typesAndValues[g]),l.typesAndValues[y].type===f.typesAndValues[g].type&&(h=h&&w),w===!0)if(m===0||m===y){m=y+1;break}else return!1;if(w===!1)return!1}return m===0?!1:h}o(u,"compareDirectoryName");try{if(this.certs.length===0)throw new Error("Empty certificate array");let l=e.passedWhenNotRevValues||!1,f=e.initialPolicySet||[Ti],h=e.initialExplicitPolicy||!1,m=e.initialPolicyMappingInhibit||!1,g=e.initialInhibitPolicy||!1,w=e.initialPermittedSubtreesSet||[],y=e.initialExcludedSubtreesSet||[],S=e.initialRequiredNameForms||[],E=h,b=m,T=g,A=[!1,!1,!1],C=0,x=0,B=0,F=w,R=y,H=S,q=1;this.certs=await this.sort(l,t);let K=[];K.push(Ti);let G=[],he=new Array(this.certs.length-1);for(let be=0;be<this.certs.length-1;be++)he[be]=!0;G.push(he);let le=new Array(this.certs.length-1),oe=new Array(this.certs.length-1),Z=E?this.certs.length-1:-1;for(let be=this.certs.length-2;be>=0;be--,q++){let we=this.certs[be];if(we.extensions){for(let Me=0;Me<we.extensions.length;Me++){let Je=we.extensions[Me];if(Je.extnID===EU){oe[be]=Je.parsedValue;for(let Ye=0;Ye<K.length;Ye++)if(K[Ye]===Ti){delete G[Ye][be];break}for(let Ye=0;Ye<Je.parsedValue.certificatePolicies.length;Ye++){let lt=-1,O=Je.parsedValue.certificatePolicies[Ye].policyIdentifier;for(let _=0;_<K.length;_++)if(O===K[_]){lt=_;break}if(lt===-1){K.push(O);let _=new Array(this.certs.length-1);_[be]=!0,G.push(_)}else G[lt][be]=!0}}if(Je.extnID===AU){if(b)return{result:!1,resultCode:98,resultMessage:"Policy mapping prohibited"};le[be]=Je.parsedValue}Je.extnID===CU&&E===!1&&(Je.parsedValue.requireExplicitPolicy===0?(E=!0,Z=be):A[0]===!1?(A[0]=!0,C=Je.parsedValue.requireExplicitPolicy):C=C>Je.parsedValue.requireExplicitPolicy?Je.parsedValue.requireExplicitPolicy:C,Je.parsedValue.inhibitPolicyMapping===0?b=!0:A[1]===!1?(A[1]=!0,x=Je.parsedValue.inhibitPolicyMapping+1):x=x>Je.parsedValue.inhibitPolicyMapping+1?Je.parsedValue.inhibitPolicyMapping+1:x),Je.extnID===Rne&&T===!1&&(Je.parsedValue.valueBlock.valueDec===0?T=!0:A[2]===!1?(A[2]=!0,B=Je.parsedValue.valueBlock.valueDec):B=B>Je.parsedValue.valueBlock.valueDec?Je.parsedValue.valueBlock.valueDec:B)}if(T===!0){let Me=-1;for(let Je=0;Je<K.length;Je++)if(K[Je]===Ti){Me=Je;break}Me!==-1&&delete G[0][be]}E===!1&&A[0]===!0&&(C--,C===0&&(E=!0,Z=be,A[0]=!1)),b===!1&&A[1]===!0&&(x--,x===0&&(b=!0,A[1]=!1)),T===!1&&A[2]===!0&&(B--,B===0&&(T=!0,A[2]=!1))}}for(let be=0;be<this.certs.length-1;be++)if(be<this.certs.length-2&&typeof le[be+1]<"u")for(let we=0;we<le[be+1].mappings.length;we++){if(le[be+1].mappings[we].issuerDomainPolicy===Ti||le[be+1].mappings[we].subjectDomainPolicy===Ti)return{result:!1,resultCode:99,resultMessage:'The "anyPolicy" should not be a part of policy mapping scheme'};let Me=-1,Je=-1;for(let Ye=0;Ye<K.length;Ye++)K[Ye]===le[be+1].mappings[we].issuerDomainPolicy&&(Me=Ye),K[Ye]===le[be+1].mappings[we].subjectDomainPolicy&&(Je=Ye);typeof G[Me][be]<"u"&&delete G[Me][be];for(let Ye=0;Ye<oe[be].certificatePolicies.length;Ye++)if(le[be+1].mappings[we].subjectDomainPolicy===oe[be].certificatePolicies[Ye].policyIdentifier&&Me!==-1&&Je!==-1)for(let lt=0;lt<=be;lt++)typeof G[Je][lt]<"u"&&(G[Me][lt]=!0,delete G[Je][lt])}for(let be=0;be<K.length;be++)if(K[be]===Ti)for(let we=0;we<Z;we++)delete G[be][we];let fe=[];for(let be=0;be<G.length;be++){let we=!0;for(let Me=0;Me<this.certs.length-1;Me++){let Je=!1;if(Me<Z&&K[be]===Ti&&K.length>1){we=!1;break}if(typeof G[be][Me]>"u"){if(Me>=Z){for(let Ye=0;Ye<K.length;Ye++)if(K[Ye]===Ti){G[Ye][Me]===!0&&(Je=!0);break}}if(!Je){we=!1;break}}}we===!0&&fe.push(K[be])}let Se=[];if(f.length===1&&f[0]===Ti&&E===!1)Se=f;else if(fe.length===1&&fe[0]===Ti)Se=f;else for(let be=0;be<fe.length;be++)for(let we=0;we<f.length;we++)if(f[we]===fe[be]||f[we]===Ti){Se.push(fe[be]);break}let Ke={result:Se.length>0,resultCode:0,resultMessage:Se.length>0?L:'Zero "userConstrPolicies" array, no intersections with "authConstrPolicies"',authConstrPolicies:fe,userConstrPolicies:Se,explicitPolicyIndicator:E,policyMappings:le,certificatePath:this.certs};if(Se.length===0||Ke.result===!1)return Ke;q=1;for(let be=this.certs.length-2;be>=0;be--,q++){let we=this.certs[be],Me=[],Je=[],Ye=[];if(we.extensions)for(let ne=0;ne<we.extensions.length;ne++){let J=we.extensions[ne];J.extnID===wU&&("permittedSubtrees"in J.parsedValue&&(Je=Je.concat(J.parsedValue.permittedSubtrees)),"excludedSubtrees"in J.parsedValue&&(Ye=Ye.concat(J.parsedValue.excludedSubtrees))),J.extnID===mU&&(Me=Me.concat(J.parsedValue.altNames))}let lt=H.length<=0;for(let ne=0;ne<H.length;ne++)switch(H[ne].base.type){case 4:{if(H[ne].base.value.typesAndValues.length!==we.subject.typesAndValues.length)continue;lt=!0;for(let J=0;J<we.subject.typesAndValues.length;J++)if(we.subject.typesAndValues[J].type!==H[ne].base.value.typesAndValues[J].type){lt=!1;break}if(lt===!0)break}break;default:}if(lt===!1)throw Ke.result=!1,Ke.resultCode=21,Ke.resultMessage="No necessary name form found",Ke;let O=[[],[],[],[],[]];for(let ne=0;ne<F.length;ne++)switch(F[ne].base.type){case 1:O[0].push(F[ne]);break;case 2:O[1].push(F[ne]);break;case 4:O[2].push(F[ne]);break;case 6:O[3].push(F[ne]);break;case 7:O[4].push(F[ne]);break;default:}for(let ne=0;ne<5;ne++){let J=!1,Xe=!1,Re=O[ne];for(let xe=0;xe<Re.length;xe++){switch(ne){case 0:if(Me.length>0)for(let ct=0;ct<Me.length;ct++)Me[ct].type===1&&(Xe=!0,J=J||s(Me[ct].value,Re[xe].base.value));else for(let ct=0;ct<we.subject.typesAndValues.length;ct++)(we.subject.typesAndValues[ct].type==="1.2.840.113549.1.9.1"||we.subject.typesAndValues[ct].type==="0.9.2342.19200300.100.1.3")&&(Xe=!0,J=J||s(we.subject.typesAndValues[ct].value.valueBlock.value,Re[xe].base.value));break;case 1:if(Me.length>0)for(let ct=0;ct<Me.length;ct++)Me[ct].type===2&&(Xe=!0,J=J||n(Me[ct].value,Re[xe].base.value));break;case 2:Xe=!0,J=u(we.subject,Re[xe].base.value);break;case 3:if(Me.length>0)for(let ct=0;ct<Me.length;ct++)Me[ct].type===6&&(Xe=!0,J=J||i(Me[ct].value,Re[xe].base.value));break;case 4:if(Me.length>0)for(let ct=0;ct<Me.length;ct++)Me[ct].type===7&&(Xe=!0,J=J||a(Me[ct].value,Re[xe].base.value));break;default:}if(J)break}if(J===!1&&Re.length>0&&Xe)throw Ke.result=!1,Ke.resultCode=41,Ke.resultMessage='Failed to meet "permitted sub-trees" name constraint',Ke}let _=!1;for(let ne=0;ne<R.length;ne++){switch(R[ne].base.type){case 1:if(Me.length>=0)for(let J=0;J<Me.length;J++)Me[J].type===1&&(_=_||s(Me[J].value,R[ne].base.value));else for(let J=0;J<we.subject.typesAndValues.length;J++)(we.subject.typesAndValues[J].type==="1.2.840.113549.1.9.1"||we.subject.typesAndValues[J].type==="0.9.2342.19200300.100.1.3")&&(_=_||s(we.subject.typesAndValues[J].value.valueBlock.value,R[ne].base.value));break;case 2:if(Me.length>0)for(let J=0;J<Me.length;J++)Me[J].type===2&&(_=_||n(Me[J].value,R[ne].base.value));break;case 4:_=_||u(we.subject,R[ne].base.value);break;case 6:if(Me.length>0)for(let J=0;J<Me.length;J++)Me[J].type===6&&(_=_||i(Me[J].value,R[ne].base.value));break;case 7:if(Me.length>0)for(let J=0;J<Me.length;J++)Me[J].type===7&&(_=_||a(Me[J].value,R[ne].base.value));break;default:}if(_)break}if(_===!0)throw Ke.result=!1,Ke.resultCode=42,Ke.resultMessage='Failed to meet "excluded sub-trees" name constraint',Ke;F=F.concat(Je),R=R.concat(Ye)}return Ke}catch(l){return l instanceof Error?l instanceof Hd?{result:!1,resultCode:l.code,resultMessage:l.message,error:l}:{result:!1,resultCode:Qf.unknown,resultMessage:l.message,error:l}:l&&typeof l=="object"&&"resultMessage"in l?l:{result:!1,resultCode:-1,resultMessage:`${l}`}}}},nC="tbsResponseData",Ly="signatureAlgorithm",Vy="signature",Kd="certs",dv="BasicOCSPResponse",yB=`${dv}.${nC}`,vB=`${dv}.${Ly}`,wB=`${dv}.${Vy}`,sC=`${dv}.${Kd}`,Aie=[yB,vB,wB,sC],lv=class Vf extends Be{static{o(this,"BasicOCSPResponse")}constructor(e={}){super(),this.tbsResponseData=D(e,nC,Vf.defaultValues(nC)),this.signatureAlgorithm=D(e,Ly,Vf.defaultValues(Ly)),this.signature=D(e,Vy,Vf.defaultValues(Vy)),Kd in e&&(this.certs=D(e,Kd,Vf.defaultValues(Kd))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case nC:return new Fo;case Ly:return new ge;case Vy:return new qt;case Kd:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case"type":{let n=Fo.compareWithDefault("tbs",t.tbs)&&Fo.compareWithDefault("responderID",t.responderID)&&Fo.compareWithDefault("producedAt",t.producedAt)&&Fo.compareWithDefault("responses",t.responses);return"responseExtensions"in t&&(n=n&&Fo.compareWithDefault("responseExtensions",t.responseExtensions)),n}case Ly:return t.algorithmId===L&&!("algorithmParams"in t);case Vy:return t.isEqual(Vf.defaultValues(e));case Kd:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||dv,value:[Fo.schema(t.tbsResponseData||{names:{blockName:yB}}),ge.schema(t.signatureAlgorithm||{names:{blockName:vB}}),new qt({name:t.signature||wB}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new W({value:[new Tt({name:sC,value:ts.schema(t.certs||{})})]})]})]})}fromSchema(e){_e(e,Aie);let t=Ie(e,e,Vf.schema());Ae.assertSchema(t,this.className),this.tbsResponseData=new Fo({schema:t.result[yB]}),this.signatureAlgorithm=new ge({schema:t.result[vB]}),this.signature=t.result[wB],sC in t.result&&(this.certs=Array.from(t.result[sC],n=>new ts({schema:n})))}toSchema(){let e=[];return e.push(this.tbsResponseData.toSchema()),e.push(this.signatureAlgorithm.toSchema()),e.push(this.signature),this.certs&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[new W({value:Array.from(this.certs,t=>t.toSchema())})]})),new W({value:e})}toJSON(){let e={tbsResponseData:this.tbsResponseData.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signature:this.signature.toJSON()};return this.certs&&(e.certs=Array.from(this.certs,t=>t.toJSON())),e}async getCertificateStatus(e,t,n=_t(!0)){let s={isForCertificate:!1,status:2},i={},a=[];for(let u of this.tbsResponseData.responses){let l=n.getAlgorithmByOID(u.certID.hashAlgorithm.algorithmId,!0,"CertID.hashAlgorithm");if(!i[l.name]){i[l.name]=1;let f=new Ys;a.push(f),await f.createForCertificate(e,{hashAlgorithm:l.name,issuerCertificate:t},n)}}for(let u of this.tbsResponseData.responses)for(let l of a)if(u.certID.isEqual(l)){s.isForCertificate=!0;try{switch(u.certStatus.idBlock.isConstructed){case!0:u.certStatus.idBlock.tagNumber===1&&(s.status=1);break;case!1:switch(u.certStatus.idBlock.tagNumber){case 0:s.status=0;break;case 2:s.status=2;break;default:}break;default:}}catch{}return s}return s}async sign(e,t="SHA-1",n=_t(!0)){if(!e)throw new Error("Need to provide a private key for signing");let s=await n.getSignatureParameters(e,t),i=s.parameters.algorithm;if(!("name"in i))throw new Error("Empty algorithm");this.signatureAlgorithm=s.signatureAlgorithm,this.tbsResponseData.tbsView=new Uint8Array(this.tbsResponseData.toSchema(!0).toBER());let a=await n.signWithPrivateKey(this.tbsResponseData.tbsView,e,{algorithm:i});this.signature=new qt({valueHex:a})}async verify(e={},t=_t(!0)){let n=null,s=-1,i=e.trustedCerts||[];if(!this.certs)throw new Error("No certificates attached to the BasicOCSPResponse");switch(!0){case this.tbsResponseData.responderID instanceof Or:for(let[f,h]of this.certs.entries())if(h.subject.isEqual(this.tbsResponseData.responderID)){s=f;break}break;case this.tbsResponseData.responderID instanceof Ve:for(let[f,h]of this.certs.entries()){let m=await t.digest({name:"sha-1"},h.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView);if(Wu(m,this.tbsResponseData.responderID.valueBlock.valueHex)){s=f;break}}break;default:throw new Error("Wrong value for responderID")}if(s===-1)throw new Error("Correct certificate was not found in OCSP response");n=this.certs[s];let a=[n];for(let f of this.certs){let h=await KU(f,n);h&&a.push(h)}if(!(await new ZU({certs:a,trustedCerts:i}).verify({},t)).result)throw new Error("Validation of signer's certificate failed");return t.verifyWithPublicKey(this.tbsResponseData.tbsView,this.signature,this.certs[s].subjectPublicKeyInfo,this.signatureAlgorithm)}};lv.CLASS_NAME="BasicOCSPResponse";var bI="tbs",xI="version",NI="subject",TI="subjectPublicKeyInfo",kp="attributes",Uy="signatureAlgorithm",My="signatureValue",A0="CertificationRequestInfo",zB=`${A0}.version`,YB=`${A0}.subject`,QB=`${A0}.subjectPublicKeyInfo`,KC=`${A0}.attributes`,Cie=[A0,zB,YB,QB,KC,Uy,My];function bie(r={}){let e=D(r,"names",{});return new W({name:e.CertificationRequestInfo||A0,value:[new me({name:e.CertificationRequestInfoVersion||zB}),Or.schema(e.subject||{names:{blockName:YB}}),na.schema({names:{blockName:QB}}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({optional:!0,name:e.CertificationRequestInfoAttributes||KC,value:Zr.schema(e.attributes||{})})]})]})}o(bie,"CertificationRequestInfo");var xie=class Ka extends Be{static{o(this,"CertificationRequest")}get tbs(){return dt.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(D(e,bI,Ka.defaultValues(bI))),this.version=D(e,xI,Ka.defaultValues(xI)),this.subject=D(e,NI,Ka.defaultValues(NI)),this.subjectPublicKeyInfo=D(e,TI,Ka.defaultValues(TI)),kp in e&&(this.attributes=D(e,kp,Ka.defaultValues(kp))),this.signatureAlgorithm=D(e,Uy,Ka.defaultValues(Uy)),this.signatureValue=D(e,My,Ka.defaultValues(My)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case bI:return Qr;case xI:return 0;case NI:return new Or;case TI:return new na;case kp:return[];case Uy:return new ge;case My:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({value:[bie(t.certificationRequestInfo||{}),new W({name:t.signatureAlgorithm||Uy,value:[new rt,new St({optional:!0})]}),new qt({name:t.signatureValue||My})]})}fromSchema(e){_e(e,Cie);let t=Ie(e,e,Ka.schema());Ae.assertSchema(t,this.className),this.tbsView=t.result.CertificationRequestInfo.valueBeforeDecodeView,this.version=t.result[zB].valueBlock.valueDec,this.subject=new Or({schema:t.result[YB]}),this.subjectPublicKeyInfo=new na({schema:t.result[QB]}),KC in t.result&&(this.attributes=Array.from(t.result[KC],n=>new Zr({schema:n}))),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}encodeTBS(){let e=[new me({value:this.version}),this.subject.toSchema(),this.subjectPublicKeyInfo.toSchema()];return kp in this&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.attributes||[],t=>t.toSchema())})),new W({value:e})}toSchema(e=!1){let t;if(e===!1){if(this.tbsView.byteLength===0)return Ka.schema();let n=Hr(this.tbsView);Ae.assert(n,"PKCS#10 Certificate Request"),t=n.result}else t=this.encodeTBS();return new W({value:[t,this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){let e={tbs:Ct.ToHex(this.tbsView),version:this.version,subject:this.subject.toJSON(),subjectPublicKeyInfo:this.subjectPublicKeyInfo.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()};return kp in this&&(e.attributes=Array.from(this.attributes||[],t=>t.toJSON())),e}async sign(e,t="SHA-1",n=_t(!0)){if(!e)throw new Error("Need to provide a private key for signing");let s=await n.getSignatureParameters(e,t),i=s.parameters;this.signatureAlgorithm=s.signatureAlgorithm,this.tbsView=new Uint8Array(this.encodeTBS().toBER());let a=await n.signWithPrivateKey(this.tbsView,e,i);this.signatureValue=new qt({valueHex:a})}async verify(e=_t(!0)){return e.verifyWithPublicKey(this.tbsView,this.signatureValue,this.subjectPublicKeyInfo,this.signatureAlgorithm)}async getPublicKey(e,t=_t(!0)){return t.getPublicKey(this.subjectPublicKeyInfo,this.signatureAlgorithm,e)}};xie.CLASS_NAME="CertificationRequest";var Uf="digestAlgorithm",Mf="digest",Nie=[Uf,Mf],Zf=class jy extends Be{static{o(this,"DigestInfo")}constructor(e={}){super(),this.digestAlgorithm=D(e,Uf,jy.defaultValues(Uf)),this.digest=D(e,Mf,jy.defaultValues(Mf)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Uf:return new ge;case Mf:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Uf:return ge.compareWithDefault("algorithmId",t.algorithmId)&&!("algorithmParams"in t);case Mf:return t.isEqual(jy.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.digestAlgorithm||{names:{blockName:Uf}}),new Ve({name:t.digest||Mf})]})}fromSchema(e){_e(e,Nie);let t=Ie(e,e,jy.schema({names:{digestAlgorithm:{names:{blockName:Uf}},digest:Mf}}));Ae.assertSchema(t,this.className),this.digestAlgorithm=new ge({schema:t.result.digestAlgorithm}),this.digest=t.result.digest}toSchema(){return new W({value:[this.digestAlgorithm.toSchema(),this.digest]})}toJSON(){return{digestAlgorithm:this.digestAlgorithm.toJSON(),digest:this.digest.toJSON()}}};Zf.CLASS_NAME="DigestInfo";var $d="eContentType",ea="eContent",Tie=[$d,ea],eh=class jf extends Be{static{o(this,"EncapsulatedContentInfo")}constructor(e={}){if(super(),this.eContentType=D(e,$d,jf.defaultValues($d)),ea in e&&(this.eContent=D(e,ea,jf.defaultValues(ea)),this.eContent.idBlock.tagClass===1&&this.eContent.idBlock.tagNumber===4&&this.eContent.idBlock.isConstructed===!1)){let t=new Ve({idBlock:{isConstructed:!0},isConstructed:!0}),n=0,s=this.eContent.valueBlock.valueHexView.slice().buffer,i=s.byteLength;for(;i>0;){let a=new Uint8Array(s,n,n+65536>s.byteLength?s.byteLength-n:65536),u=new ArrayBuffer(a.length),l=new Uint8Array(u);for(let f=0;f<l.length;f++)l[f]=a[f];t.valueBlock.value.push(new Ve({valueHex:u})),i-=a.length,n+=a.length}this.eContent=t}e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case $d:return L;case ea:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case $d:return t===L;case ea:return t.idBlock.tagClass===1&&t.idBlock.tagNumber===4?t.isEqual(jf.defaultValues(ea)):!1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.eContentType||L}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.eContent||L})]})]})}fromSchema(e){_e(e,Tie);let t=Ie(e,e,jf.schema({names:{eContentType:$d,eContent:ea}}));Ae.assertSchema(t,this.className),this.eContentType=t.result.eContentType.valueBlock.toString(),ea in t.result&&(this.eContent=t.result.eContent)}toSchema(){let e=[];return e.push(new rt({value:this.eContentType})),this.eContent&&jf.compareWithDefault(ea,this.eContent)===!1&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.eContent]})),new W({value:e})}toJSON(){let e={eContentType:this.eContentType};return this.eContent&&jf.compareWithDefault(ea,this.eContent)===!1&&(e.eContent=this.eContent.toJSON()),e}};eh.CLASS_NAME="EncapsulatedContentInfo";var Ff="mac",qf="macSalt",qo="iterations",Iie=[Ff,qf,qo],ql=class Hf extends Be{static{o(this,"MacData")}constructor(e={}){super(),this.mac=D(e,Ff,Hf.defaultValues(Ff)),this.macSalt=D(e,qf,Hf.defaultValues(qf)),qo in e&&(this.iterations=D(e,qo,Hf.defaultValues(qo))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ff:return new Zf;case qf:return new Ve;case qo:return 1;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Ff:return Zf.compareWithDefault("digestAlgorithm",t.digestAlgorithm)&&Zf.compareWithDefault("digest",t.digest);case qf:return t.isEqual(Hf.defaultValues(e));case qo:return t===Hf.defaultValues(e);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,optional:t.optional||!0,value:[Zf.schema(t.mac||{names:{blockName:Ff}}),new Ve({name:t.macSalt||qf}),new me({optional:!0,name:t.iterations||qo})]})}fromSchema(e){_e(e,Iie);let t=Ie(e,e,Hf.schema({names:{mac:{names:{blockName:Ff}},macSalt:qf,iterations:qo}}));Ae.assertSchema(t,this.className),this.mac=new Zf({schema:t.result.mac}),this.macSalt=t.result.macSalt,qo in t.result&&(this.iterations=t.result.iterations.valueBlock.valueDec)}toSchema(){let e=[this.mac.toSchema(),this.macSalt];return this.iterations!==void 0&&e.push(new me({value:this.iterations})),new W({value:e})}toJSON(){let e={mac:this.mac.toJSON(),macSalt:this.macSalt.toJSON()};return this.iterations!==void 0&&(e.iterations=this.iterations),e}};ql.CLASS_NAME="MacData";var th="hashAlgorithm",rh="hashedMessage",Bie=[th,rh],ra=class Xd extends Be{static{o(this,"MessageImprint")}static async create(e,t,n=_t(!0)){let s=n.getOIDByAlgorithm({name:e},!0,"hashAlgorithm"),i=await n.digest(e,t);return new Xd({hashAlgorithm:new ge({algorithmId:s,algorithmParams:new Kr}),hashedMessage:new Ve({valueHex:i})})}constructor(e={}){super(),this.hashAlgorithm=D(e,th,Xd.defaultValues(th)),this.hashedMessage=D(e,rh,Xd.defaultValues(rh)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case th:return new ge;case rh:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case th:return t.algorithmId===L&&!("algorithmParams"in t);case rh:return t.isEqual(Xd.defaultValues(e))===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.hashAlgorithm||{}),new Ve({name:t.hashedMessage||L})]})}fromSchema(e){_e(e,Bie);let t=Ie(e,e,Xd.schema({names:{hashAlgorithm:{names:{blockName:th}},hashedMessage:rh}}));Ae.assertSchema(t,this.className),this.hashAlgorithm=new ge({schema:t.result.hashAlgorithm}),this.hashedMessage=t.result.hashedMessage}toSchema(){return new W({value:[this.hashAlgorithm.toSchema(),this.hashedMessage]})}toJSON(){return{hashAlgorithm:this.hashAlgorithm.toJSON(),hashedMessage:this.hashedMessage.toJSON()}}};ra.CLASS_NAME="MessageImprint";var Gd="reqCert",Hl="singleRequestExtensions",Die=[Gd,Hl],$C=class Fy extends Be{static{o(this,"Request")}constructor(e={}){super(),this.reqCert=D(e,Gd,Fy.defaultValues(Gd)),Hl in e&&(this.singleRequestExtensions=D(e,Hl,Fy.defaultValues(Hl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Gd:return new Ys;case Hl:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Gd:return t.isEqual(Fy.defaultValues(e));case Hl:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Ys.schema(t.reqCert||{}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[wn.schema(t.extensions||{names:{blockName:t.singleRequestExtensions||L}})]})]})}fromSchema(e){_e(e,Die);let t=Ie(e,e,Fy.schema({names:{reqCert:{names:{blockName:Gd}},extensions:{names:{blockName:Hl}}}}));Ae.assertSchema(t,this.className),this.reqCert=new Ys({schema:t.result.reqCert}),Hl in t.result&&(this.singleRequestExtensions=Array.from(t.result.singleRequestExtensions.valueBlock.value,n=>new _i({schema:n})))}toSchema(){let e=[];return e.push(this.reqCert.toSchema()),this.singleRequestExtensions&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new W({value:Array.from(this.singleRequestExtensions,t=>t.toSchema())})]})),new W({value:e})}toJSON(){let e={reqCert:this.reqCert.toJSON()};return this.singleRequestExtensions&&(e.singleRequestExtensions=Array.from(this.singleRequestExtensions,t=>t.toJSON())),e}};$C.CLASS_NAME="Request";var lA="tbs",Wd="version",Jd="requestorName",cA="requestList",zd="requestExtensions",C0="TBSRequest",iC=`${C0}.${Wd}`,aC=`${C0}.${Jd}`,SB=`${C0}.requests`,oC=`${C0}.${zd}`,_ie=[C0,iC,aC,SB,oC],Ho=class Ko extends Be{static{o(this,"TBSRequest")}get tbs(){return dt.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(D(e,lA,Ko.defaultValues(lA))),Wd in e&&(this.version=D(e,Wd,Ko.defaultValues(Wd))),Jd in e&&(this.requestorName=D(e,Jd,Ko.defaultValues(Jd))),this.requestList=D(e,cA,Ko.defaultValues(cA)),zd in e&&(this.requestExtensions=D(e,zd,Ko.defaultValues(zd))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case lA:return Qr;case Wd:return 0;case Jd:return new Ar;case cA:case zd:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case lA:return t.byteLength===0;case Wd:return t===Ko.defaultValues(e);case Jd:return t.type===Ar.defaultValues("type")&&Object.keys(t.value).length===0;case cA:case zd:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||C0,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new me({name:t.TBSRequestVersion||iC})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[Ar.schema(t.requestorName||{names:{blockName:aC}})]}),new W({name:t.requestList||"TBSRequest.requestList",value:[new Tt({name:t.requests||SB,value:$C.schema(t.requestNames||{})})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:2},value:[wn.schema(t.extensions||{names:{blockName:t.requestExtensions||oC}})]})]})}fromSchema(e){_e(e,_ie);let t=Ie(e,e,Ko.schema());Ae.assertSchema(t,this.className),this.tbsView=t.result.TBSRequest.valueBeforeDecodeView,iC in t.result&&(this.version=t.result[iC].valueBlock.valueDec),aC in t.result&&(this.requestorName=new Ar({schema:t.result[aC]})),this.requestList=Array.from(t.result[SB],n=>new $C({schema:n})),oC in t.result&&(this.requestExtensions=Array.from(t.result[oC].valueBlock.value,n=>new _i({schema:n})))}toSchema(e=!1){let t;if(e===!1){if(this.tbsView.byteLength===0)return Ko.schema();let n=Hr(this.tbsView);if(Ae.assert(n,"TBS Request"),!(n.result instanceof W))throw new Error("ASN.1 result should be SEQUENCE");t=n.result}else{let n=[];this.version!==void 0&&n.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[new me({value:this.version})]})),this.requestorName&&n.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[this.requestorName.toSchema()]})),n.push(new W({value:Array.from(this.requestList,s=>s.toSchema())})),this.requestExtensions&&n.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:[new W({value:Array.from(this.requestExtensions,s=>s.toSchema())})]})),t=new W({value:n})}return t}toJSON(){let e={};return this.version!=null&&(e.version=this.version),this.requestorName&&(e.requestorName=this.requestorName.toJSON()),e.requestList=Array.from(this.requestList,t=>t.toJSON()),this.requestExtensions&&(e.requestExtensions=Array.from(this.requestExtensions,t=>t.toJSON())),e}};Ho.CLASS_NAME="TBSRequest";var Lp="signatureAlgorithm",Vp="signature",nl="certs",Kf=class Yd extends Be{static{o(this,"Signature")}constructor(e={}){super(),this.signatureAlgorithm=D(e,Lp,Yd.defaultValues(Lp)),this.signature=D(e,Vp,Yd.defaultValues(Vp)),nl in e&&(this.certs=D(e,nl,Yd.defaultValues(nl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Lp:return new ge;case Vp:return new qt;case nl:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Lp:return t.algorithmId===L&&!("algorithmParams"in t);case Vp:return t.isEqual(Yd.defaultValues(e));case nl:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.signatureAlgorithm||{}),new qt({name:t.signature||L}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new W({value:[new Tt({name:t.certs||L,value:ts.schema({})})]})]})]})}fromSchema(e){_e(e,[Lp,Vp,nl]);let t=Ie(e,e,Yd.schema({names:{signatureAlgorithm:{names:{blockName:Lp}},signature:Vp,certs:nl}}));Ae.assertSchema(t,this.className),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signature=t.result.signature,nl in t.result&&(this.certs=Array.from(t.result.certs,n=>new ts({schema:n})))}toSchema(){let e=[];return e.push(this.signatureAlgorithm.toSchema()),e.push(this.signature),this.certs&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new W({value:Array.from(this.certs,t=>t.toSchema())})]})),new W({value:e})}toJSON(){let e={signatureAlgorithm:this.signatureAlgorithm.toJSON(),signature:this.signature.toJSON()};return this.certs&&(e.certs=Array.from(this.certs,t=>t.toJSON())),e}};Kf.CLASS_NAME="Signature";var Qd="tbsRequest",Kl="optionalSignature",Rie=[Qd,Kl],Pie=class uC extends Be{static{o(this,"OCSPRequest")}constructor(e={}){super(),this.tbsRequest=D(e,Qd,uC.defaultValues(Qd)),Kl in e&&(this.optionalSignature=D(e,Kl,uC.defaultValues(Kl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Qd:return new Ho;case Kl:return new Kf;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Qd:return Ho.compareWithDefault("tbs",t.tbs)&&Ho.compareWithDefault("version",t.version)&&Ho.compareWithDefault("requestorName",t.requestorName)&&Ho.compareWithDefault("requestList",t.requestList)&&Ho.compareWithDefault("requestExtensions",t.requestExtensions);case Kl:return Kf.compareWithDefault("signatureAlgorithm",t.signatureAlgorithm)&&Kf.compareWithDefault("signature",t.signature)&&Kf.compareWithDefault("certs",t.certs);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||"OCSPRequest",value:[Ho.schema(t.tbsRequest||{names:{blockName:Qd}}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[Kf.schema(t.optionalSignature||{names:{blockName:Kl}})]})]})}fromSchema(e){_e(e,Rie);let t=Ie(e,e,uC.schema());Ae.assertSchema(t,this.className),this.tbsRequest=new Ho({schema:t.result.tbsRequest}),Kl in t.result&&(this.optionalSignature=new Kf({schema:t.result.optionalSignature}))}toSchema(e=!1){let t=[];return t.push(this.tbsRequest.toSchema(e)),this.optionalSignature&&t.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.optionalSignature.toSchema()]})),new W({value:t})}toJSON(){let e={tbsRequest:this.tbsRequest.toJSON()};return this.optionalSignature&&(e.optionalSignature=this.optionalSignature.toJSON()),e}async createForCertificate(e,t,n=_t(!0)){let s=new Ys;await s.createForCertificate(e,t,n),this.tbsRequest.requestList.push(new $C({reqCert:s}))}async sign(e,t="SHA-1",n=_t(!0)){if(fr.assertEmpty(e,"privateKey","OCSPRequest.sign method"),!this.optionalSignature)throw new Error('Need to create "optionalSignature" field before signing');let s=await n.getSignatureParameters(e,t),i=s.parameters;this.optionalSignature.signatureAlgorithm=s.signatureAlgorithm;let a=this.tbsRequest.toSchema(!0).toBER(!1),u=await n.signWithPrivateKey(a,e,i);this.optionalSignature.signature=new qt({valueHex:u})}verify(){}};Pie.CLASS_NAME="OCSPRequest";var Zd="responseType",e0="response",Oie=[Zd,e0],t0=class qy extends Be{static{o(this,"ResponseBytes")}constructor(e={}){super(),this.responseType=D(e,Zd,qy.defaultValues(Zd)),this.response=D(e,e0,qy.defaultValues(e0)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Zd:return L;case e0:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Zd:return t===L;case e0:return t.isEqual(qy.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.responseType||L}),new Ve({name:t.response||L})]})}fromSchema(e){_e(e,Oie);let t=Ie(e,e,qy.schema({names:{responseType:Zd,response:e0}}));Ae.assertSchema(t,this.className),this.responseType=t.result.responseType.valueBlock.toString(),this.response=t.result.response}toSchema(){return new W({value:[new rt({value:this.responseType}),this.response]})}toJSON(){return{responseType:this.responseType,response:this.response.toJSON()}}};t0.CLASS_NAME="ResponseBytes";var Up="responseStatus",Bo="responseBytes",kie=class Hy extends Be{static{o(this,"OCSPResponse")}constructor(e={}){super(),this.responseStatus=D(e,Up,Hy.defaultValues(Up)),Bo in e&&(this.responseBytes=D(e,Bo,Hy.defaultValues(Bo))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Up:return new zu;case Bo:return new t0;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Up:return t.isEqual(Hy.defaultValues(e));case Bo:return t0.compareWithDefault("responseType",t.responseType)&&t0.compareWithDefault("response",t.response);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||"OCSPResponse",value:[new zu({name:t.responseStatus||Up}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[t0.schema(t.responseBytes||{names:{blockName:Bo}})]})]})}fromSchema(e){_e(e,[Up,Bo]);let t=Ie(e,e,Hy.schema());Ae.assertSchema(t,this.className),this.responseStatus=t.result.responseStatus,Bo in t.result&&(this.responseBytes=new t0({schema:t.result.responseBytes}))}toSchema(){let e=[];return e.push(this.responseStatus),this.responseBytes&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.responseBytes.toSchema()]})),new W({value:e})}toJSON(){let e={responseStatus:this.responseStatus.toJSON()};return this.responseBytes&&(e.responseBytes=this.responseBytes.toJSON()),e}async getCertificateStatus(e,t,n=_t(!0)){let s,i={isForCertificate:!1,status:2};if(!this.responseBytes||this.responseBytes.responseType!==gA)return i;try{let a=Hr(this.responseBytes.response.valueBlock.valueHexView);Ae.assert(a,"Basic OCSP response"),s=new lv({schema:a.result})}catch{return i}return s.getCertificateStatus(e,t,n)}async sign(e,t,n=_t(!0)){var s;if(this.responseBytes&&this.responseBytes.responseType===gA)return lv.fromBER(this.responseBytes.response.valueBlock.valueHexView).sign(e,t,n);throw new Error(`Unknown ResponseBytes type: ${((s=this.responseBytes)===null||s===void 0?void 0:s.responseType)||"Unknown"}`)}async verify(e=null,t=_t(!0)){var n;if(!(Bo in this))throw new Error("Empty ResponseBytes field");if(this.responseBytes&&this.responseBytes.responseType===gA){let s=lv.fromBER(this.responseBytes.response.valueBlock.valueHexView);return e!==null&&(s.certs||(s.certs=[]),s.certs.push(e)),s.verify({},t)}throw new Error(`Unknown ResponseBytes type: ${((n=this.responseBytes)===null||n===void 0?void 0:n.responseType)||"Unknown"}`)}};kie.CLASS_NAME="OCSPResponse";var jc="type",$o="attributes",fA="encodedValue",Lie=[$o],ks=class $a extends Be{static{o(this,"SignedAndUnsignedAttributes")}constructor(e={}){super(),this.type=D(e,jc,$a.defaultValues(jc)),this.attributes=D(e,$o,$a.defaultValues($o)),this.encodedValue=D(e,fA,$a.defaultValues(fA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case jc:return-1;case $o:return[];case fA:return Qr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case jc:return t===$a.defaultValues(jc);case $o:return t.length===0;case fA:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new ae({name:t.blockName||L,optional:!0,idBlock:{tagClass:3,tagNumber:t.tagNumber||0},value:[new Tt({name:t.attributes||L,value:Zr.schema()})]})}fromSchema(e){_e(e,Lie);let t=Ie(e,e,$a.schema({names:{tagNumber:this.type,attributes:$o}}));Ae.assertSchema(t,this.className),this.type=t.result.idBlock.tagNumber,this.encodedValue=dt.toArrayBuffer(t.result.valueBeforeDecodeView);let n=new Uint8Array(this.encodedValue);if(n[0]=49,!($o in t.result)){if(this.type===0)throw new Error("Wrong structure of SignedUnsignedAttributes");return}this.attributes=Array.from(t.result.attributes,s=>new Zr({schema:s}))}toSchema(){if($a.compareWithDefault(jc,this.type)||$a.compareWithDefault($o,this.attributes))throw new Error('Incorrectly initialized "SignedAndUnsignedAttributes" class');return new ae({optional:!0,idBlock:{tagClass:3,tagNumber:this.type},value:Array.from(this.attributes,e=>e.toSchema())})}toJSON(){if($a.compareWithDefault(jc,this.type)||$a.compareWithDefault($o,this.attributes))throw new Error('Incorrectly initialized "SignedAndUnsignedAttributes" class');return{type:this.type,attributes:Array.from(this.attributes,e=>e.toJSON())}}};ks.CLASS_NAME="SignedAndUnsignedAttributes";var r0="version",$f="sid",n0="digestAlgorithm",$l="signedAttrs",s0="signatureAlgorithm",Ky="signature",Xl="unsignedAttrs",Ql="SignerInfo",EB=`${Ql}.${r0}`,$y=`${Ql}.${$f}`,AB=`${Ql}.${n0}`,lC=`${Ql}.${$l}`,CB=`${Ql}.${s0}`,bB=`${Ql}.${Ky}`,cC=`${Ql}.${Xl}`,Vie=[EB,$y,AB,lC,CB,bB,cC],XC=class In extends Be{static{o(this,"SignerInfo")}constructor(e={}){super(),this.version=D(e,r0,In.defaultValues(r0)),this.sid=D(e,$f,In.defaultValues($f)),this.digestAlgorithm=D(e,n0,In.defaultValues(n0)),$l in e&&(this.signedAttrs=D(e,$l,In.defaultValues($l))),this.signatureAlgorithm=D(e,s0,In.defaultValues(s0)),this.signature=D(e,Ky,In.defaultValues(Ky)),Xl in e&&(this.unsignedAttrs=D(e,Xl,In.defaultValues(Xl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case r0:return 0;case $f:return new St;case n0:return new ge;case $l:return new ks({type:0});case s0:return new ge;case Ky:return new Ve;case Xl:return new ks({type:1});default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case r0:return In.defaultValues(r0)===t;case $f:return t instanceof St;case n0:return t instanceof ge?t.isEqual(In.defaultValues(n0)):!1;case $l:return ks.compareWithDefault("type",t.type)&&ks.compareWithDefault("attributes",t.attributes)&&ks.compareWithDefault("encodedValue",t.encodedValue);case s0:return t instanceof ge?t.isEqual(In.defaultValues(s0)):!1;case Ky:case Xl:return ks.compareWithDefault("type",t.type)&&ks.compareWithDefault("attributes",t.attributes)&&ks.compareWithDefault("encodedValue",t.encodedValue);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:Ql,value:[new me({name:t.version||EB}),new Pr({value:[Fn.schema(t.sidSchema||{names:{blockName:$y}}),new Pr({value:[new ae({optional:!0,name:t.sid||$y,idBlock:{tagClass:3,tagNumber:0},value:[new Ve]}),new yt({optional:!0,name:t.sid||$y,idBlock:{tagClass:3,tagNumber:0}})]})]}),ge.schema(t.digestAlgorithm||{names:{blockName:AB}}),ks.schema(t.signedAttrs||{names:{blockName:lC,tagNumber:0}}),ge.schema(t.signatureAlgorithm||{names:{blockName:CB}}),new Ve({name:t.signature||bB}),ks.schema(t.unsignedAttrs||{names:{blockName:cC,tagNumber:1}})]})}fromSchema(e){_e(e,Vie);let t=Ie(e,e,In.schema());Ae.assertSchema(t,this.className),this.version=t.result[EB].valueBlock.valueDec;let n=t.result[$y];n.idBlock.tagClass===1?this.sid=new Fn({schema:n}):this.sid=n,this.digestAlgorithm=new ge({schema:t.result[AB]}),lC in t.result&&(this.signedAttrs=new ks({type:0,schema:t.result[lC]})),this.signatureAlgorithm=new ge({schema:t.result[CB]}),this.signature=t.result[bB],cC in t.result&&(this.unsignedAttrs=new ks({type:1,schema:t.result[cC]}))}toSchema(){if(In.compareWithDefault($f,this.sid))throw new Error('Incorrectly initialized "SignerInfo" class');let e=[];return e.push(new me({value:this.version})),this.sid instanceof Fn?e.push(this.sid.toSchema()):e.push(this.sid),e.push(this.digestAlgorithm.toSchema()),this.signedAttrs&&In.compareWithDefault($l,this.signedAttrs)===!1&&e.push(this.signedAttrs.toSchema()),e.push(this.signatureAlgorithm.toSchema()),e.push(this.signature),this.unsignedAttrs&&In.compareWithDefault(Xl,this.unsignedAttrs)===!1&&e.push(this.unsignedAttrs.toSchema()),new W({value:e})}toJSON(){if(In.compareWithDefault($f,this.sid))throw new Error('Incorrectly initialized "SignerInfo" class');let e={version:this.version,digestAlgorithm:this.digestAlgorithm.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signature:this.signature.toJSON()};return this.sid instanceof St||(e.sid=this.sid.toJSON()),this.signedAttrs&&In.compareWithDefault($l,this.signedAttrs)===!1&&(e.signedAttrs=this.signedAttrs.toJSON()),this.unsignedAttrs&&In.compareWithDefault(Xl,this.unsignedAttrs)===!1&&(e.unsignedAttrs=this.unsignedAttrs.toJSON()),e}};XC.CLASS_NAME="SignerInfo";var Xy="version",Gy="policy",Wy="messageImprint",Jy="serialNumber",zy="genTime",Xf="ordering",Gf="nonce",i0="accuracy",a0="tsa",o0="extensions",sa="TSTInfo",xB=`${sa}.${Xy}`,NB=`${sa}.${Gy}`,TB=`${sa}.${Wy}`,IB=`${sa}.${Jy}`,BB=`${sa}.${zy}`,fC=`${sa}.${i0}`,hC=`${sa}.${Xf}`,pC=`${sa}.${Gf}`,dC=`${sa}.${a0}`,mC=`${sa}.${o0}`,Uie=[xB,NB,TB,IB,BB,fC,hC,pC,dC,mC],tM=class Os extends Be{static{o(this,"TSTInfo")}constructor(e={}){super(),this.version=D(e,Xy,Os.defaultValues(Xy)),this.policy=D(e,Gy,Os.defaultValues(Gy)),this.messageImprint=D(e,Wy,Os.defaultValues(Wy)),this.serialNumber=D(e,Jy,Os.defaultValues(Jy)),this.genTime=D(e,zy,Os.defaultValues(zy)),i0 in e&&(this.accuracy=D(e,i0,Os.defaultValues(i0))),Xf in e&&(this.ordering=D(e,Xf,Os.defaultValues(Xf))),Gf in e&&(this.nonce=D(e,Gf,Os.defaultValues(Gf))),a0 in e&&(this.tsa=D(e,a0,Os.defaultValues(a0))),o0 in e&&(this.extensions=D(e,o0,Os.defaultValues(o0))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Xy:return 0;case Gy:return L;case Wy:return new ra;case Jy:return new me;case zy:return new Date(0,0,0);case i0:return new Fc;case Xf:return!1;case Gf:return new me;case a0:return new Ar;case o0:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Xy:case Gy:case zy:case Xf:return t===Os.defaultValues(Xf);case Wy:return ra.compareWithDefault(th,t.hashAlgorithm)&&ra.compareWithDefault(rh,t.hashedMessage);case Jy:case Gf:return t.isEqual(Os.defaultValues(Gf));case i0:return Fc.compareWithDefault(sl,t.seconds)&&Fc.compareWithDefault(il,t.millis)&&Fc.compareWithDefault(al,t.micros);case a0:return Ar.compareWithDefault(kg,t.type)&&Ar.compareWithDefault(Lg,t.value);case o0:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||sa,value:[new me({name:t.version||xB}),new rt({name:t.policy||NB}),ra.schema(t.messageImprint||{names:{blockName:TB}}),new me({name:t.serialNumber||IB}),new Rr({name:t.genTime||BB}),Fc.schema(t.accuracy||{names:{blockName:fC}}),new Wi({name:t.ordering||hC,optional:!0}),new me({name:t.nonce||pC,optional:!0}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[Ar.schema(t.tsa||{names:{blockName:dC}})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Tt({name:t.extensions||mC,value:_i.schema(t.extension||{})})]})]})}fromSchema(e){_e(e,Uie);let t=Ie(e,e,Os.schema());Ae.assertSchema(t,this.className),this.version=t.result[xB].valueBlock.valueDec,this.policy=t.result[NB].valueBlock.toString(),this.messageImprint=new ra({schema:t.result[TB]}),this.serialNumber=t.result[IB],this.genTime=t.result[BB].toDate(),fC in t.result&&(this.accuracy=new Fc({schema:t.result[fC]})),hC in t.result&&(this.ordering=t.result[hC].valueBlock.value),pC in t.result&&(this.nonce=t.result[pC]),dC in t.result&&(this.tsa=new Ar({schema:t.result[dC]})),mC in t.result&&(this.extensions=Array.from(t.result[mC],n=>new _i({schema:n})))}toSchema(){let e=[];return e.push(new me({value:this.version})),e.push(new rt({value:this.policy})),e.push(this.messageImprint.toSchema()),e.push(this.serialNumber),e.push(new Rr({valueDate:this.genTime})),this.accuracy&&e.push(this.accuracy.toSchema()),this.ordering!==void 0&&e.push(new Wi({value:this.ordering})),this.nonce&&e.push(this.nonce),this.tsa&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.tsa.toSchema()]})),this.extensions&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.extensions,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={version:this.version,policy:this.policy,messageImprint:this.messageImprint.toJSON(),serialNumber:this.serialNumber.toJSON(),genTime:this.genTime};return this.accuracy&&(e.accuracy=this.accuracy.toJSON()),this.ordering!==void 0&&(e.ordering=this.ordering),this.nonce&&(e.nonce=this.nonce.toJSON()),this.tsa&&(e.tsa=this.tsa.toJSON()),this.extensions&&(e.extensions=Array.from(this.extensions,t=>t.toJSON())),e}async verify(e,t=_t(!0)){if(!e.data)throw new Error('"data" is a mandatory attribute for TST_INFO verification');let n=e.data;if(e.notBefore&&this.genTime<e.notBefore)throw new Error("Generation time for TSTInfo object is less than notBefore value");if(e.notAfter&&this.genTime>e.notAfter)throw new Error("Generation time for TSTInfo object is more than notAfter value");let s=t.getAlgorithmByOID(this.messageImprint.hashAlgorithm.algorithmId,!0,"MessageImprint.hashAlgorithm"),i=await t.digest(s.name,new Uint8Array(n));return dt.isEqual(i,this.messageImprint.hashedMessage.valueBlock.valueHexView)}};tM.CLASS_NAME="TSTInfo";var u0="version",Yy="digestAlgorithms",Qy="encapContentInfo",l0="certificates",c0="crls",Zy="signerInfos",_g="ocsps",uh="SignedData",DB=`${uh}.${u0}`,gC=`${uh}.${Yy}`,_B=`${uh}.${Qy}`,yC=`${uh}.${l0}`,vC=`${uh}.${c0}`,wC=`${uh}.${Zy}`,Mie=[DB,gC,_B,yC,vC,wC],Qn=class extends Error{static{o(this,"SignedDataVerifyError")}constructor({message:e,code:t=0,date:n=new Date,signatureVerified:s=null,signerCertificate:i=null,signerCertificateVerified:a=null,timestampSerial:u=null,certificatePath:l=[]}){super(e),this.name="SignedDataVerifyError",this.date=n,this.code=t,this.timestampSerial=u,this.signatureVerified=s,this.signerCertificate=i,this.signerCertificateVerified=a,this.certificatePath=l}},E0=class ta extends Be{static{o(this,"SignedData")}constructor(e={}){super(),this.version=D(e,u0,ta.defaultValues(u0)),this.digestAlgorithms=D(e,Yy,ta.defaultValues(Yy)),this.encapContentInfo=D(e,Qy,ta.defaultValues(Qy)),l0 in e&&(this.certificates=D(e,l0,ta.defaultValues(l0))),c0 in e&&(this.crls=D(e,c0,ta.defaultValues(c0))),_g in e&&(this.ocsps=D(e,_g,ta.defaultValues(_g))),this.signerInfos=D(e,Zy,ta.defaultValues(Zy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case u0:return 0;case Yy:return[];case Qy:return new eh;case l0:return[];case c0:return[];case _g:return[];case Zy:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case u0:return t===ta.defaultValues(u0);case Qy:return eh.compareWithDefault("eContentType",t.eContentType)&&eh.compareWithDefault("eContent",t.eContent);case Yy:case l0:case c0:case _g:case Zy:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return t.optional===void 0&&(t.optional=!1),new W({name:t.blockName||uh,optional:t.optional,value:[new me({name:t.version||DB}),new $r({value:[new Tt({name:t.digestAlgorithms||gC,value:ge.schema()})]}),eh.schema(t.encapContentInfo||{names:{blockName:_B}}),new ae({name:t.certificates||yC,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:ih.schema().valueBlock.value}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:iv.schema(t.crls||{names:{crls:vC}}).valueBlock.value}),new $r({value:[new Tt({name:t.signerInfos||wC,value:XC.schema()})]})]})}fromSchema(e){_e(e,Mie);let t=Ie(e,e,ta.schema());if(Ae.assertSchema(t,this.className),this.version=t.result[DB].valueBlock.valueDec,gC in t.result&&(this.digestAlgorithms=Array.from(t.result[gC],n=>new ge({schema:n}))),this.encapContentInfo=new eh({schema:t.result[_B]}),yC in t.result){let n=new ih({schema:new $r({value:t.result[yC].valueBlock.value})});this.certificates=n.certificates.slice(0)}vC in t.result&&(this.crls=Array.from(t.result[vC],n=>n.idBlock.tagClass===1?new hv({schema:n}):(n.idBlock.tagClass=1,n.idBlock.tagNumber=16,new sv({schema:n})))),wC in t.result&&(this.signerInfos=Array.from(t.result[wC],n=>new XC({schema:n})))}toSchema(e=!1){let t=[];if(this.certificates&&this.certificates.length&&this.certificates.some(n=>n instanceof HA)||this.crls&&this.crls.length&&this.crls.some(n=>n instanceof sv)?this.version=5:this.certificates&&this.certificates.length&&this.certificates.some(n=>n instanceof zl)?this.version=4:this.certificates&&this.certificates.length&&this.certificates.some(n=>n instanceof TC)||this.signerInfos.some(n=>n.version===3)||this.encapContentInfo.eContentType!==ta.ID_DATA?this.version=3:this.version=1,t.push(new me({value:this.version})),t.push(new $r({value:Array.from(this.digestAlgorithms,n=>n.toSchema())})),t.push(this.encapContentInfo.toSchema()),this.certificates){let s=new ih({certificates:this.certificates}).toSchema();t.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:s.valueBlock.value}))}return this.crls&&t.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.crls,n=>{if(n instanceof sv){let s=n.toSchema();return s.idBlock.tagClass=3,s.idBlock.tagNumber=1,s}return n.toSchema(e)})})),t.push(new $r({value:Array.from(this.signerInfos,n=>n.toSchema())})),new W({value:t})}toJSON(){let e={version:this.version,digestAlgorithms:Array.from(this.digestAlgorithms,t=>t.toJSON()),encapContentInfo:this.encapContentInfo.toJSON(),signerInfos:Array.from(this.signerInfos,t=>t.toJSON())};return this.certificates&&(e.certificates=Array.from(this.certificates,t=>t.toJSON())),this.crls&&(e.crls=Array.from(this.crls,t=>t.toJSON())),e}async verify({signer:e=-1,data:t=Qr,trustedCerts:n=[],checkDate:s=new Date,checkChain:i=!1,passedWhenNotRevValues:a=!1,extendedMode:u=!1,findOrigin:l=null,findIssuer:f=null}={},h=_t(!0)){let m=null,g=null;try{let w=Qr,y=L,S=[],E=this.signerInfos[e];if(!E)throw new Qn({date:s,code:1,message:"Unable to get signer by supplied index"});if(!this.certificates)throw new Qn({date:s,code:2,message:"No certificates attached to this signed data"});if(E.sid instanceof Fn){for(let C of this.certificates)if(C instanceof ts&&C.issuer.isEqual(E.sid.issuer)&&C.serialNumber.isEqual(E.sid.serialNumber)){m=C;break}}else{let C=E.sid,x=C.idBlock.isConstructed?C.valueBlock.value[0].valueBlock.valueHex:C.valueBlock.valueHex;for(let B of this.certificates){if(!(B instanceof ts))continue;let F=await h.digest({name:"sha-1"},B.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView);if(Wu(F,x)){m=B;break}}}if(!m)throw new Qn({date:s,code:3,message:"Unable to find signer certificate"});if(this.encapContentInfo.eContentType===Une){if(!this.encapContentInfo.eContent)throw new Qn({date:s,code:15,message:"Error during verification: TSTInfo eContent is empty",signatureVerified:null,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0});let C;try{C=tM.fromBER(this.encapContentInfo.eContent.valueBlock.valueHexView)}catch{throw new Qn({date:s,code:15,message:"Error during verification: TSTInfo wrong ASN.1 schema ",signatureVerified:null,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0})}if(s=C.genTime,g=C.serialNumber.valueBlock.valueHexView.slice().buffer,t.byteLength===0)throw new Qn({date:s,code:4,message:"Missed detached data input array"});if(!await C.verify({data:t},h))throw new Qn({date:s,code:15,message:"Error during verification: TSTInfo verification is failed",signatureVerified:!1,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0})}if(i){let C=this.certificates.filter(R=>R instanceof ts&&!!KU(R,m)),x={checkDate:s,certs:C,trustedCerts:n};f&&(x.findIssuer=f),l&&(x.findOrigin=l);let B=new ZU(x);if(B.certs.push(m),this.crls)for(let R of this.crls)"thisUpdate"in R?B.crls.push(R):R.otherRevInfoFormat===gA&&B.ocsps.push(new lv({schema:R.otherRevInfo}));this.ocsps&&B.ocsps.push(...this.ocsps);let F=await B.verify({passedWhenNotRevValues:a},h).catch(R=>{throw new Qn({date:s,code:5,message:`Validation of signer's certificate failed with error: ${R instanceof Object?R.resultMessage:R}`,signerCertificate:m,signerCertificateVerified:!1})});if(F.certificatePath&&(S=F.certificatePath),!F.result)throw new Qn({date:s,code:5,message:`Validation of signer's certificate failed: ${F.resultMessage}`,signerCertificate:m,signerCertificateVerified:!1})}let b=h.getAlgorithmByOID(E.digestAlgorithm.algorithmId);if(!("name"in b))throw new Qn({date:s,code:7,message:`Unsupported signature algorithm: ${E.digestAlgorithm.algorithmId}`,signerCertificate:m,signerCertificateVerified:!0});y=b.name;let T=this.encapContentInfo.eContent;if(T)T.idBlock.tagClass===1&&T.idBlock.tagNumber===4?t=T.getValue():t=T.valueBlock.valueBeforeDecodeView.slice().buffer;else if(t.byteLength===0)throw new Qn({date:s,code:8,message:"Missed detached data input array",signerCertificate:m,signerCertificateVerified:!0});if(E.signedAttrs){let C=!1,x=!1;for(let B of E.signedAttrs.attributes)if(B.type==="1.2.840.113549.1.9.3"&&(C=!0),B.type==="1.2.840.113549.1.9.4"&&(x=!0,w=B.values[0].valueBlock.valueHex),C&&x)break;if(C===!1)throw new Qn({date:s,code:9,message:'Attribute "content-type" is a mandatory attribute for "signed attributes"',signerCertificate:m,signerCertificateVerified:!0});if(x===!1)throw new Qn({date:s,code:10,message:'Attribute "message-digest" is a mandatory attribute for "signed attributes"',signatureVerified:null,signerCertificate:m,signerCertificateVerified:!0})}if(E.signedAttrs){let C=await h.digest(y,new Uint8Array(t));if(!Wu(C,w))throw new Qn({date:s,code:15,message:"Error during verification: Message digest doesn't match",signatureVerified:null,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0});t=E.signedAttrs.encodedValue}let A=E.signatureAlgorithm.algorithmId==="1.2.840.113549.1.1.1"?await h.verifyWithPublicKey(t,E.signature,m.subjectPublicKeyInfo,E.signatureAlgorithm,y):await h.verifyWithPublicKey(t,E.signature,m.subjectPublicKeyInfo,E.signatureAlgorithm);return u?{date:s,code:14,message:L,signatureVerified:A,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0,certificatePath:S}:A}catch(w){throw w instanceof Qn?w:new Qn({date:s,code:15,message:`Error during verification: ${w instanceof Error?w.message:w}`,signatureVerified:null,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0})}}async sign(e,t,n="SHA-1",s=Qr,i=_t(!0)){var a;if(!e)throw new Error("Need to provide a private key for signing");let u=this.signerInfos[t];if(!u)throw new RangeError("SignerInfo index is out of range");!(!((a=u.signedAttrs)===null||a===void 0)&&a.attributes.length)&&"hash"in e.algorithm&&"hash"in e.algorithm&&e.algorithm.hash&&(n=e.algorithm.hash.name);let l=i.getOIDByAlgorithm({name:n},!0,"hashAlgorithm");this.digestAlgorithms.filter(g=>g.algorithmId===l).length===0&&this.digestAlgorithms.push(new ge({algorithmId:l,algorithmParams:new Kr})),u.digestAlgorithm=new ge({algorithmId:l,algorithmParams:new Kr});let f=await i.getSignatureParameters(e,n),h=f.parameters;if(u.signatureAlgorithm=f.signatureAlgorithm,u.signedAttrs)if(u.signedAttrs.encodedValue.byteLength!==0)s=u.signedAttrs.encodedValue;else{s=u.signedAttrs.toSchema().toBER();let g=dt.toUint8Array(s);g[0]=49}else{let g=this.encapContentInfo.eContent;if(g)g.idBlock.tagClass===1&&g.idBlock.tagNumber===4?s=g.getValue():s=g.valueBlock.valueBeforeDecodeView.slice().buffer;else if(s.byteLength===0)throw new Error("Missed detached data input array")}let m=await i.signWithPrivateKey(s,e,h);u.signature=new Ve({valueHex:m})}};E0.CLASS_NAME="SignedData";E0.ID_DATA=MB;var Wf="version",Jf="authSafe",Xo="macData",Rg="parsedValue",jie=[Wf,Jf,Xo],Fie=class zf extends Be{static{o(this,"PFX")}constructor(e={}){super(),this.version=D(e,Wf,zf.defaultValues(Wf)),this.authSafe=D(e,Jf,zf.defaultValues(Jf)),Xo in e&&(this.macData=D(e,Xo,zf.defaultValues(Xo))),Rg in e&&(this.parsedValue=D(e,Rg,zf.defaultValues(Rg))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Wf:return 3;case Jf:return new Gr;case Xo:return new ql;case Rg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Wf:return t===zf.defaultValues(e);case Jf:return Gr.compareWithDefault("contentType",t.contentType)&&Gr.compareWithDefault("content",t.content);case Xo:return ql.compareWithDefault("mac",t.mac)&&ql.compareWithDefault("macSalt",t.macSalt)&&ql.compareWithDefault("iterations",t.iterations);case Rg:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||Wf}),Gr.schema(t.authSafe||{names:{blockName:Jf}}),ql.schema(t.macData||{names:{blockName:Xo,optional:!0}})]})}fromSchema(e){_e(e,jie);let t=Ie(e,e,zf.schema({names:{version:Wf,authSafe:{names:{blockName:Jf}},macData:{names:{blockName:Xo}}}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.authSafe=new Gr({schema:t.result.authSafe}),Xo in t.result&&(this.macData=new ql({schema:t.result.macData}))}toSchema(){let e=[new me({value:this.version}),this.authSafe.toSchema()];return this.macData&&e.push(this.macData.toSchema()),new W({value:e})}toJSON(){let e={version:this.version,authSafe:this.authSafe.toJSON()};return this.macData&&(e.macData=this.macData.toJSON()),e}async makeInternalValues(e={},t=_t(!0)){if(Er.assert(e,"parameters","object"),!this.parsedValue)throw new Error('Please call "parseValues" function first in order to make "parsedValue" data');switch(fr.assertEmpty(this.parsedValue.integrityMode,"integrityMode","parsedValue"),fr.assertEmpty(this.parsedValue.authenticatedSafe,"authenticatedSafe","parsedValue"),this.parsedValue.integrityMode){case 0:{if(!("iterations"in e))throw new fr("iterations");fr.assertEmpty(e.pbkdf2HashAlgorithm,"pbkdf2HashAlgorithm"),fr.assertEmpty(e.hmacHashAlgorithm,"hmacHashAlgorithm"),fr.assertEmpty(e.password,"password");let n=new ArrayBuffer(64),s=new Uint8Array(n);t.getRandomValues(s);let i=this.parsedValue.authenticatedSafe.toSchema().toBER(!1);this.authSafe=new Gr({contentType:Gr.DATA,content:new Ve({valueHex:i})});let a=await t.stampDataWithPassword({password:e.password,hashAlgorithm:e.hmacHashAlgorithm,salt:n,iterationCount:e.iterations,contentToStamp:i});this.macData=new ql({mac:new Zf({digestAlgorithm:new ge({algorithmId:t.getOIDByAlgorithm({name:e.hmacHashAlgorithm},!0,"hmacHashAlgorithm")}),digest:new Ve({valueHex:a})}),macSalt:new Ve({valueHex:n}),iterations:e.iterations})}break;case 1:{if(!("signingCertificate"in e))throw new fr("signingCertificate");fr.assertEmpty(e.privateKey,"privateKey"),fr.assertEmpty(e.hashAlgorithm,"hashAlgorithm");let n=this.parsedValue.authenticatedSafe.toSchema().toBER(!1),s=new E0({version:1,encapContentInfo:new eh({eContentType:"1.2.840.113549.1.7.1",eContent:new Ve({valueHex:n})}),certificates:[e.signingCertificate]}),i=await t.digest({name:e.hashAlgorithm},new Uint8Array(n)),a=[];a.push(new Zr({type:"1.2.840.113549.1.9.3",values:[new rt({value:"1.2.840.113549.1.7.1"})]})),a.push(new Zr({type:"1.2.840.113549.1.9.5",values:[new kc({valueDate:new Date})]})),a.push(new Zr({type:"1.2.840.113549.1.9.4",values:[new Ve({valueHex:i})]})),s.signerInfos.push(new XC({version:1,sid:new Fn({issuer:e.signingCertificate.issuer,serialNumber:e.signingCertificate.serialNumber}),signedAttrs:new ks({type:0,attributes:a})})),await s.sign(e.privateKey,0,e.hashAlgorithm,void 0,t),this.authSafe=new Gr({contentType:"1.2.840.113549.1.7.2",content:s.toSchema(!0)})}break;default:throw new Error(`Parameter "integrityMode" has unknown value: ${this.parsedValue.integrityMode}`)}}async parseInternalValues(e,t=_t(!0)){switch(Er.assert(e,"parameters","object"),e.checkIntegrity===void 0&&(e.checkIntegrity=!0),this.parsedValue={},this.authSafe.contentType){case Gr.DATA:{fr.assertEmpty(e.password,"password"),this.parsedValue.integrityMode=0,Er.assert(this.authSafe.content,"authSafe.content",Ve);let n=this.authSafe.content.getValue();if(this.parsedValue.authenticatedSafe=pB.fromBER(n),e.checkIntegrity){if(!this.macData)throw new Error('Absent "macData" value, can not check PKCS#12 data integrity');let s=t.getAlgorithmByOID(this.macData.mac.digestAlgorithm.algorithmId,!0,"digestAlgorithm");if(!await t.verifyDataStampedWithPassword({password:e.password,hashAlgorithm:s.name,salt:dt.toArrayBuffer(this.macData.macSalt.valueBlock.valueHexView),iterationCount:this.macData.iterations||1,contentToVerify:n,signatureToVerify:dt.toArrayBuffer(this.macData.mac.digest.valueBlock.valueHexView)}))throw new Error("Integrity for the PKCS#12 data is broken!")}}break;case Gr.SIGNED_DATA:{this.parsedValue.integrityMode=1;let n=new E0({schema:this.authSafe.content}),s=n.encapContentInfo.eContent;fr.assert(s,"eContent","cmsSigned.encapContentInfo"),Er.assert(s,"eContent",Ve);let i=s.getValue();if(this.parsedValue.authenticatedSafe=pB.fromBER(i),!await n.verify({signer:0,checkChain:!1},t))throw new Error("Integrity for the PKCS#12 data is broken!")}break;default:throw new Error(`Incorrect value for "this.authSafe.contentType": ${this.authSafe.contentType}`)}}};Fie.CLASS_NAME="PFX";var f0="status",Gl="statusStrings",Wl="failInfo",qie=[f0,Gl,Wl],hU;(function(r){r[r.granted=0]="granted",r[r.grantedWithMods=1]="grantedWithMods",r[r.rejection=2]="rejection",r[r.waiting=3]="waiting",r[r.revocationWarning=4]="revocationWarning",r[r.revocationNotification=5]="revocationNotification"})(hU||(hU={}));var ev=class Yf extends Be{static{o(this,"PKIStatusInfo")}constructor(e={}){super(),this.status=D(e,f0,Yf.defaultValues(f0)),Gl in e&&(this.statusStrings=D(e,Gl,Yf.defaultValues(Gl))),Wl in e&&(this.failInfo=D(e,Wl,Yf.defaultValues(Wl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case f0:return 2;case Gl:return[];case Wl:return new qt;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case f0:return t===Yf.defaultValues(e);case Gl:return t.length===0;case Wl:return t.isEqual(Yf.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.status||L}),new W({optional:!0,value:[new Tt({name:t.statusStrings||L,value:new xi})]}),new qt({name:t.failInfo||L,optional:!0})]})}fromSchema(e){_e(e,qie);let t=Ie(e,e,Yf.schema({names:{status:f0,statusStrings:Gl,failInfo:Wl}}));Ae.assertSchema(t,this.className);let n=t.result.status;if(n.valueBlock.isHexOnly===!0||n.valueBlock.valueDec<0||n.valueBlock.valueDec>5)throw new Error('PKIStatusInfo "status" has invalid value');this.status=n.valueBlock.valueDec,Gl in t.result&&(this.statusStrings=t.result.statusStrings),Wl in t.result&&(this.failInfo=t.result.failInfo)}toSchema(){let e=[];return e.push(new me({value:this.status})),this.statusStrings&&e.push(new W({optional:!0,value:this.statusStrings})),this.failInfo&&e.push(this.failInfo),new W({value:e})}toJSON(){let e={status:this.status};return this.statusStrings&&(e.statusStrings=Array.from(this.statusStrings,t=>t.toJSON())),this.failInfo&&(e.failInfo=this.failInfo.toJSON()),e}};ev.CLASS_NAME="PKIStatusInfo";var tv="version",rv="messageImprint",h0="reqPolicy",p0="nonce",Go="certReq",d0="extensions",lh="TimeStampReq",RB=`${lh}.${tv}`,PB=`${lh}.${rv}`,SC=`${lh}.${h0}`,EC=`${lh}.${p0}`,AC=`${lh}.${Go}`,CC=`${lh}.${d0}`,Hie=[RB,PB,SC,EC,AC,CC],Kie=class Di extends Be{static{o(this,"TimeStampReq")}constructor(e={}){super(),this.version=D(e,tv,Di.defaultValues(tv)),this.messageImprint=D(e,rv,Di.defaultValues(rv)),h0 in e&&(this.reqPolicy=D(e,h0,Di.defaultValues(h0))),p0 in e&&(this.nonce=D(e,p0,Di.defaultValues(p0))),Go in e&&(this.certReq=D(e,Go,Di.defaultValues(Go))),d0 in e&&(this.extensions=D(e,d0,Di.defaultValues(d0))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case tv:return 0;case rv:return new ra;case h0:return L;case p0:return new me;case Go:return!1;case d0:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case tv:case h0:case Go:return t===Di.defaultValues(e);case rv:return ra.compareWithDefault("hashAlgorithm",t.hashAlgorithm)&&ra.compareWithDefault("hashedMessage",t.hashedMessage);case p0:return t.isEqual(Di.defaultValues(e));case d0:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||lh,value:[new me({name:t.version||RB}),ra.schema(t.messageImprint||{names:{blockName:PB}}),new rt({name:t.reqPolicy||SC,optional:!0}),new me({name:t.nonce||EC,optional:!0}),new Wi({name:t.certReq||AC,optional:!0}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({name:t.extensions||CC,value:_i.schema()})]})]})}fromSchema(e){_e(e,Hie);let t=Ie(e,e,Di.schema());Ae.assertSchema(t,this.className),this.version=t.result[RB].valueBlock.valueDec,this.messageImprint=new ra({schema:t.result[PB]}),SC in t.result&&(this.reqPolicy=t.result[SC].valueBlock.toString()),EC in t.result&&(this.nonce=t.result[EC]),AC in t.result&&(this.certReq=t.result[AC].valueBlock.value),CC in t.result&&(this.extensions=Array.from(t.result[CC],n=>new _i({schema:n})))}toSchema(){let e=[];return e.push(new me({value:this.version})),e.push(this.messageImprint.toSchema()),this.reqPolicy&&e.push(new rt({value:this.reqPolicy})),this.nonce&&e.push(this.nonce),Go in this&&Di.compareWithDefault(Go,this.certReq)===!1&&e.push(new Wi({value:this.certReq})),this.extensions&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.extensions,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={version:this.version,messageImprint:this.messageImprint.toJSON()};return this.reqPolicy!==void 0&&(e.reqPolicy=this.reqPolicy),this.nonce!==void 0&&(e.nonce=this.nonce.toJSON()),this.certReq!==void 0&&Di.compareWithDefault(Go,this.certReq)===!1&&(e.certReq=this.certReq),this.extensions&&(e.extensions=Array.from(this.extensions,t=>t.toJSON())),e}};Kie.CLASS_NAME="TimeStampReq";var m0="status",g0="timeStampToken",ZB="TimeStampResp",OB=`${ZB}.${m0}`,bC=`${ZB}.${g0}`,$ie=[OB,bC],Xie=class xC extends Be{static{o(this,"TimeStampResp")}constructor(e={}){super(),this.status=D(e,m0,xC.defaultValues(m0)),g0 in e&&(this.timeStampToken=D(e,g0,xC.defaultValues(g0))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case m0:return new ev;case g0:return new Gr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case m0:return ev.compareWithDefault(m0,t.status)&&!("statusStrings"in t)&&!("failInfo"in t);case g0:return t.contentType===L&&t.content instanceof St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||ZB,value:[ev.schema(t.status||{names:{blockName:OB}}),Gr.schema(t.timeStampToken||{names:{blockName:bC,optional:!0}})]})}fromSchema(e){_e(e,$ie);let t=Ie(e,e,xC.schema());Ae.assertSchema(t,this.className),this.status=new ev({schema:t.result[OB]}),bC in t.result&&(this.timeStampToken=new Gr({schema:t.result[bC]}))}toSchema(){let e=[];return e.push(this.status.toSchema()),this.timeStampToken&&e.push(this.timeStampToken.toSchema()),new W({value:e})}toJSON(){let e={status:this.status.toJSON()};return this.timeStampToken&&(e.timeStampToken=this.timeStampToken.toJSON()),e}async sign(e,t,n=_t(!0)){return this.assertContentType(),new E0({schema:this.timeStampToken.content}).sign(e,0,t,void 0,n)}async verify(e={signer:0,trustedCerts:[],data:Qr},t=_t(!0)){return this.assertContentType(),new E0({schema:this.timeStampToken.content}).verify(e,t)}assertContentType(){if(!this.timeStampToken)throw new Error("timeStampToken is absent in TSP response");if(this.timeStampToken.contentType!==bU)throw new Error(`Wrong format of timeStampToken: ${this.timeStampToken.contentType}`)}};Xie.CLASS_NAME="TimeStampResp";function Gie(){if(typeof globalThis<"u"&&"crypto"in globalThis){let r="webcrypto";"webkitSubtle"in globalThis.crypto&&(r="safari"),NC(r,new S0({name:r,crypto:globalThis.crypto}))}else if(typeof crypto<"u"&&"webcrypto"in crypto){let r="NodeJS ^15",e=crypto.webcrypto;NC(r,new S0({name:r,crypto:e}))}}o(Gie,"initCryptoEngine");Gie();var eD=null,hn=class{static{o(this,"Application")}static setEngine(e,t){eD=Object.assign(t,{name:e}),NC(e,new S0({name:e,crypto:t}))}static get crypto(){if(!eD)throw new Fe(Te.CRYPTOGRAPHIC_NO_MODULE);return eD}static isNodePlugin(){return typeof self>"u"&&typeof window>"u"}};function Wie(){hn.isNodePlugin()||hn.setEngine("W3 WebCrypto module",self.crypto)}o(Wie,"init");Wie();var GC=class{static{o(this,"XmlAlgorithm")}getAlgorithmName(){return this.namespaceURI}},ch=class extends GC{static{o(this,"HashAlgorithm")}async Digest(e){let t;if(typeof e=="string")t=vr.FromString(e,"utf8");else if(ArrayBuffer.isView(e))t=new Uint8Array(e.buffer);else if(e instanceof ArrayBuffer)t=new Uint8Array(e);else{let s=Ua(e);t=vr.FromString(s,"utf8")}let n=await hn.crypto.subtle.digest(this.algorithm,t);return new Uint8Array(n)}},pn=class extends GC{static{o(this,"SignatureAlgorithm")}async Sign(e,t,n){let s=vr.FromString(e,"utf8");return hn.crypto.subtle.sign(n,t,s)}async Verify(e,t,n){let s=this.algorithm,i=vr.FromString(e,"utf8");return hn.crypto.subtle.verify(s,t,n,i)}};var Bn="SHA-1",qn="SHA-256",Hn="SHA-384",Kn="SHA-512",b0="http://www.w3.org/2000/09/xmldsig#sha1",x0="http://www.w3.org/2001/04/xmlenc#sha256",N0="http://www.w3.org/2001/04/xmldsig-more#sha384",T0="http://www.w3.org/2001/04/xmlenc#sha512",WC=class extends ch{static{o(this,"Sha1")}constructor(){super(...arguments),this.algorithm={name:Bn},this.namespaceURI=b0}},mv=class extends ch{static{o(this,"Sha256")}constructor(){super(...arguments),this.algorithm={name:qn},this.namespaceURI=x0}},JC=class extends ch{static{o(this,"Sha384")}constructor(){super(...arguments),this.algorithm={name:Hn},this.namespaceURI=N0}},zC=class extends ch{static{o(this,"Sha512")}constructor(){super(...arguments),this.algorithm={name:Kn},this.namespaceURI=T0}};var zo="ECDSA",YC="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1",QC="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256",ZC="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384",e2="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512";function t2(r){if(r.name.toUpperCase()===zo.toUpperCase())switch(r.hash.name.toUpperCase()){case Bn:return new I0;case qn:return new B0;case Hn:return new D0;case Kn:return new _0}return null}o(t2,"fromAlgorithm");var I0=class extends pn{static{o(this,"EcdsaSha1")}constructor(){super(...arguments),this.algorithm={name:zo,hash:{name:Bn}},this.namespaceURI=YC}static fromAlgorithm(e){return t2(e)}},B0=class extends pn{static{o(this,"EcdsaSha256")}constructor(){super(...arguments),this.algorithm={name:zo,hash:{name:qn}},this.namespaceURI=QC}static fromAlgorithm(e){return t2(e)}},D0=class extends pn{static{o(this,"EcdsaSha384")}constructor(){super(...arguments),this.algorithm={name:zo,hash:{name:Hn}},this.namespaceURI=ZC}static fromAlgorithm(e){return t2(e)}},_0=class extends pn{static{o(this,"EcdsaSha512")}constructor(){super(...arguments),this.algorithm={name:zo,hash:{name:Kn}},this.namespaceURI=e2}static fromAlgorithm(e){return t2(e)}};var R0="HMAC",tD="http://www.w3.org/2000/09/xmldsig#hmac-sha1",rD="http://www.w3.org/2001/04/xmldsig-more#hmac-sha256",nD="http://www.w3.org/2001/04/xmldsig-more#hmac-sha384",sD="http://www.w3.org/2001/04/xmldsig-more#hmac-sha512";function r2(r){if(r.name.toUpperCase()===R0.toUpperCase())switch(r.hash.name.toUpperCase()){case Bn:return new gv;case qn:return new yv;case Hn:return new vv;case Kn:return new wv}return null}o(r2,"fromAlgorithm");var gv=class extends pn{static{o(this,"HmacSha1")}constructor(){super(...arguments),this.algorithm={name:R0,hash:{name:Bn}},this.namespaceURI=tD}static fromAlgorithm(e){return r2(e)}},yv=class extends pn{static{o(this,"HmacSha256")}constructor(){super(...arguments),this.algorithm={name:R0,hash:{name:qn}},this.namespaceURI=rD}static fromAlgorithm(e){return r2(e)}},vv=class extends pn{static{o(this,"HmacSha384")}constructor(){super(...arguments),this.algorithm={name:R0,hash:{name:Hn}},this.namespaceURI=nD}static fromAlgorithm(e){return r2(e)}},wv=class extends pn{static{o(this,"HmacSha512")}constructor(){super(...arguments),this.algorithm={name:R0,hash:{name:Kn}},this.namespaceURI=sD}static fromAlgorithm(e){return r2(e)}};var Yo="RSASSA-PKCS1-v1_5",n2="http://www.w3.org/2000/09/xmldsig#rsa-sha1",s2="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",i2="http://www.w3.org/2001/04/xmldsig-more#rsa-sha384",a2="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";function o2(r){if(r.name.toUpperCase()===Yo.toUpperCase())switch(r.hash.name.toUpperCase()){case Bn:return new P0;case qn:return new O0;case Hn:return new k0;case Kn:return new L0}return null}o(o2,"fromAlgorithm");var P0=class extends pn{static{o(this,"RsaPkcs1Sha1")}constructor(){super(...arguments),this.algorithm={name:Yo,hash:{name:Bn}},this.namespaceURI=n2}static fromAlgorithm(e){return o2(e)}},O0=class extends pn{static{o(this,"RsaPkcs1Sha256")}constructor(){super(...arguments),this.algorithm={name:Yo,hash:{name:qn}},this.namespaceURI=s2}static fromAlgorithm(e){return o2(e)}},k0=class extends pn{static{o(this,"RsaPkcs1Sha384")}constructor(){super(...arguments),this.algorithm={name:Yo,hash:{name:Hn}},this.namespaceURI=i2}static fromAlgorithm(e){return o2(e)}},L0=class extends pn{static{o(this,"RsaPkcs1Sha512")}constructor(){super(...arguments),this.algorithm={name:Yo,hash:{name:Kn}},this.namespaceURI=a2}static fromAlgorithm(e){return o2(e)}};function He(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(a=r[u])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i}o(He,"__decorate");function ft(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}o(ft,"__metadata");var de={DefaultCanonMethod:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315",DefaultDigestMethod:"http://www.w3.org/2001/04/xmlenc#sha256",DefaultPrefix:"ds",ElementNames:{CanonicalizationMethod:"CanonicalizationMethod",DigestMethod:"DigestMethod",DigestValue:"DigestValue",DSAKeyValue:"DSAKeyValue",DomainParameters:"DomainParameters",EncryptedKey:"EncryptedKey",HMACOutputLength:"HMACOutputLength",RSAPSSParams:"RSAPSSParams",MaskGenerationFunction:"MaskGenerationFunction",SaltLength:"SaltLength",KeyInfo:"KeyInfo",KeyName:"KeyName",KeyValue:"KeyValue",Modulus:"Modulus",Exponent:"Exponent",Manifest:"Manifest",Object:"Object",Reference:"Reference",RetrievalMethod:"RetrievalMethod",RSAKeyValue:"RSAKeyValue",ECDSAKeyValue:"ECDSAKeyValue",NamedCurve:"NamedCurve",PublicKey:"PublicKey",Signature:"Signature",SignatureMethod:"SignatureMethod",SignatureValue:"SignatureValue",SignedInfo:"SignedInfo",Transform:"Transform",Transforms:"Transforms",X509Data:"X509Data",PGPData:"PGPData",SPKIData:"SPKIData",SPKIexp:"SPKIexp",MgmtData:"MgmtData",X509IssuerSerial:"X509IssuerSerial",X509IssuerName:"X509IssuerName",X509SerialNumber:"X509SerialNumber",X509SKI:"X509SKI",X509SubjectName:"X509SubjectName",X509Certificate:"X509Certificate",X509CRL:"X509CRL",XPath:"XPath",X:"X",Y:"Y"},AttributeNames:{Algorithm:"Algorithm",Encoding:"Encoding",Id:"Id",MimeType:"MimeType",Type:"Type",URI:"URI"},AlgorithmNamespaces:{XmlDsigBase64Transform:"http://www.w3.org/2000/09/xmldsig#base64",XmlDsigC14NTransform:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315",XmlDsigC14NWithCommentsTransform:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",XmlDsigEnvelopedSignatureTransform:"http://www.w3.org/2000/09/xmldsig#enveloped-signature",XmlDsigXPathTransform:"http://www.w3.org/TR/1999/REC-xpath-19991116",XmlDsigXsltTransform:"http://www.w3.org/TR/1999/REC-xslt-19991116",XmlDsigExcC14NTransform:"http://www.w3.org/2001/10/xml-exc-c14n#",XmlDsigExcC14NWithCommentsTransform:"http://www.w3.org/2001/10/xml-exc-c14n#WithComments",XmlDecryptionTransform:"http://www.w3.org/2002/07/decrypt#XML",XmlLicenseTransform:"urn:mpeg:mpeg21:2003:01-REL-R-NS:licenseTransform"},Uri:{Manifest:"http://www.w3.org/2000/09/xmldsig#Manifest"},NamespaceURI:"http://www.w3.org/2000/09/xmldsig#",NamespaceURIMore:"http://www.w3.org/2007/05/xmldsig-more#",NamespaceURIPss:"http://www.example.org/xmldsig-pss/#"};var Fr=class extends Bs{static{o(this,"XmlSignatureObject")}};Fr=He([Mt({localName:"xmldsig",namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix})],Fr);var Ri=class extends xp{static{o(this,"XmlSignatureCollection")}};Ri=He([Mt({localName:"xmldsig_collection",namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix})],Ri);var Pi=class extends Fr{static{o(this,"DigestMethod")}constructor(e){super(),e&&(this.Algorithm=e)}};He([_r({localName:de.AttributeNames.Algorithm,required:!0,defaultValue:de.DefaultDigestMethod}),ft("design:type",String)],Pi.prototype,"Algorithm",void 0);Pi=He([Mt({localName:de.ElementNames.DigestMethod}),ft("design:paramtypes",[String])],Pi);var Zs=class extends Fr{static{o(this,"KeyInfoClause")}static canImportCryptoKey(e){return!1}};var Jie={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},V0=class extends Zs{static{o(this,"RsaKeyValue")}constructor(){super(...arguments),this.key=null,this.jwk=null,this.keyUsage=[]}static canImportCryptoKey(e){let t=e.algorithm.name.toUpperCase();return t===Yo.toUpperCase()||t===fh.toUpperCase()}async importKey(e){let t=e.algorithm.name?e.algorithm.name.toUpperCase():"";if(t!==Yo.toUpperCase()&&t!==fh.toUpperCase())throw new Fe(Te.ALGORITHM_WRONG_NAME,e.algorithm.name);this.key=e;let n=await hn.crypto.subtle.exportKey("jwk",e);return this.jwk=n,this.Modulus=vr.FromBase64Url(n.n||""),this.Exponent=vr.FromBase64Url(n.e||""),this.keyUsage=e.usages,this}async exportKey(e=Jie){if(this.key)return this.key;if(!this.Modulus)throw new Fe(Te.CRYPTOGRAPHIC,"RsaKeyValue has no Modulus");let t=vr.ToBase64Url(this.Modulus);if(!this.Exponent)throw new Fe(Te.CRYPTOGRAPHIC,"RsaKeyValue has no Exponent");let n=vr.ToBase64Url(this.Exponent),s;switch(e.name.toUpperCase()){case Yo.toUpperCase():s="R";break;case fh.toUpperCase():s="P";break;default:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.name)}switch(e.hash.name.toUpperCase()){case Bn:s+="S1";break;case qn:s+="S256";break;case Hn:s+="S384";break;case Kn:s+="S512";break}let i={kty:"RSA",alg:s,n:t,e:n,ext:!0};return hn.crypto.subtle.importKey("jwk",i,e,!0,this.keyUsage)}LoadXml(e){super.LoadXml(e),this.keyUsage=["verify"]}};He([Xt({localName:de.ElementNames.Modulus,prefix:de.DefaultPrefix,namespaceURI:de.NamespaceURI,required:!0,converter:bi}),ft("design:type",Object)],V0.prototype,"Modulus",void 0);He([Xt({localName:de.ElementNames.Exponent,prefix:de.DefaultPrefix,namespaceURI:de.NamespaceURI,required:!0,converter:bi}),ft("design:type",Object)],V0.prototype,"Exponent",void 0);V0=He([Mt({localName:de.ElementNames.RSAKeyValue})],V0);var iD="http://www.w3.org/2007/05/xmldsig-more#",aD="pss",U0=class extends Bs{static{o(this,"MaskGenerationFunction")}};He([Xt({parser:Pi}),ft("design:type",Pi)],U0.prototype,"DigestMethod",void 0);He([_r({localName:de.AttributeNames.Algorithm,defaultValue:"http://www.w3.org/2007/05/xmldsig-more#MGF1"}),ft("design:type",String)],U0.prototype,"Algorithm",void 0);U0=He([Mt({localName:de.ElementNames.MaskGenerationFunction,prefix:aD,namespaceURI:iD})],U0);var ia=class extends Bs{static{o(this,"PssAlgorithmParams")}};He([Xt({parser:Pi}),ft("design:type",Pi)],ia.prototype,"DigestMethod",void 0);He([Xt({parser:U0}),ft("design:type",U0)],ia.prototype,"MGF",void 0);He([Xt({converter:cg,prefix:aD,namespaceURI:iD}),ft("design:type",Number)],ia.prototype,"SaltLength",void 0);He([Xt({converter:cg}),ft("design:type",Number)],ia.prototype,"TrailerField",void 0);ia=He([Mt({localName:de.ElementNames.RSAPSSParams,prefix:aD,namespaceURI:iD})],ia);var fh="RSA-PSS",oD="http://www.w3.org/2007/05/xmldsig-more#rsa-pss",u2=class r extends pn{static{o(this,"RsaPssWithParams")}constructor(){super(...arguments),this.algorithm={name:fh,hash:{name:Bn}},this.namespaceURI=oD}static fromAlgorithm(e){let t=null;if(e.name.toUpperCase()===fh.toUpperCase()){switch(e.hash.name.toUpperCase()){case Bn:t=new r;break;case qn:t=new r;break;case Hn:t=new r;break;case Kn:t=new r;break}if(t)return t.algorithm.hash.name=e.hash.name,e.saltLength&&(t.algorithm.saltLength=e.saltLength),t}return null}fromMethod(e){if(!e.Any.Some(t=>{if(t instanceof ia){switch(t.DigestMethod.Algorithm.toLowerCase()){case b0:this.algorithm.hash.name=Bn;break;case x0:this.algorithm.hash.name=qn;break;case N0:this.algorithm.hash.name=Hn;break;case T0:this.algorithm.hash.name=Kn;break;default:throw new Fe(Te.CRYPTOGRAPHIC,`Unsupported hash algorithm: ${t.DigestMethod.Algorithm}`)}return t.SaltLength&&(this.algorithm.saltLength=t.SaltLength),!0}return!1}))throw new Fe(Te.CRYPTOGRAPHIC,"RSA-PSS parameters not found in SignatureMethod")}toMethod(e){let t=new ia;switch(this.algorithm.hash.name.toUpperCase()){case Bn:t.DigestMethod.Algorithm=b0;break;case qn:t.DigestMethod.Algorithm=x0;break;case Hn:t.DigestMethod.Algorithm=N0;break;case Kn:t.DigestMethod.Algorithm=T0;break;default:throw new Fe(Te.CRYPTOGRAPHIC,`Unsupported hash algorithm: ${this.algorithm.hash.name}`)}this.algorithm.saltLength&&(t.SaltLength=this.algorithm.saltLength),e.Any.Add(t)}};var ei;(function(r){r[r.BeforeDocElement=0]="BeforeDocElement",r[r.InsideDocElement=1]="InsideDocElement",r[r.AfterDocElement=2]="AfterDocElement"})(ei||(ei={}));var Ga=class{static{o(this,"XmlCanonicalizer")}constructor(e,t,n=new Np){this.propagatedNamespaces=new Np,this.result=[],this.visibleNamespaces=new Np,this.inclusiveNamespacesPrefixList=[],this.state=ei.BeforeDocElement,this.withComments=e,this.exclusive=t,this.propagatedNamespaces=n}get InclusiveNamespacesPrefixList(){return this.inclusiveNamespacesPrefixList.join(" ")}set InclusiveNamespacesPrefixList(e){this.inclusiveNamespacesPrefixList=e.split(" ")}Canonicalize(e){if(!e)throw new Fe(Te.CRYPTOGRAPHIC,"Parameter 1 is not Node");return this.WriteNode(e),this.result.join("")}WriteNode(e){switch(e.nodeType){case Ut.Document:case Ut.DocumentFragment:this.WriteDocumentNode(e);break;case Ut.Element:this.WriteElementNode(e);break;case Ut.CDATA:case Ut.SignificantWhitespace:case Ut.Text:Dc(e.parentNode)||this.WriteTextNode(e);break;case Ut.Whitespace:this.state===ei.InsideDocElement&&this.WriteTextNode(e);break;case Ut.Comment:this.WriteCommentNode(e);break;case Ut.ProcessingInstruction:this.WriteProcessingInstructionNode(e);break;case Ut.EntityReference:for(let t=0;t<e.childNodes.length;t++)this.WriteNode(e.childNodes[t]);break;case Ut.Attribute:throw new Fe(Te.CRYPTOGRAPHIC,"Attribute node is impossible here");case Ut.EndElement:throw new Fe(Te.CRYPTOGRAPHIC,"Attribute node is impossible here");case Ut.EndEntity:throw new Fe(Te.CRYPTOGRAPHIC,"Attribute node is impossible here");case Ut.DocumentType:case Ut.Entity:case Ut.Notation:case Ut.XmlDeclaration:break}}WriteDocumentNode(e){this.state=ei.BeforeDocElement;for(let t=e.firstChild;t!=null;t=t.nextSibling)this.WriteNode(t)}WriteCommentNode(e){this.withComments&&(this.state===ei.AfterDocElement?this.result.push(`
91
- <!--`):this.result.push("<!--"),this.result.push(this.NormalizeString(e.nodeValue,Ut.Comment)),this.state===ei.BeforeDocElement?this.result.push(`-->
92
- `):this.result.push("-->"))}WriteTextNode(e){this.result.push(this.NormalizeString(e.nodeValue,e.nodeType))}WriteProcessingInstructionNode(e){let t=e.nodeName||e.tagName;t!=="xml"&&(this.state===ei.AfterDocElement?this.result.push(`
93
- <?`):this.result.push("<?"),this.result.push(t),e.nodeValue&&(this.result.push(" "),this.result.push(this.NormalizeString(e.nodeValue,Ut.ProcessingInstruction))),this.state===ei.BeforeDocElement?this.result.push(`?>
94
- `):this.result.push("?>"))}WriteElementNode(e){let t=this.state;this.state===ei.BeforeDocElement&&(this.state=ei.InsideDocElement),this.result.push("<"),this.result.push(e.nodeName);let n=this.WriteNamespacesAxis(e);this.WriteAttributesAxis(e),this.result.push(">");for(let s=e.firstChild;s!=null;s=s.nextSibling)this.WriteNode(s);for(this.result.push("</"),this.result.push(e.nodeName),this.result.push(">"),t===ei.BeforeDocElement&&(this.state=ei.AfterDocElement);n--;)this.visibleNamespaces.Pop()}WriteNamespacesAxis(e){let t=[],n=0;for(let i=0;i<e.attributes.length;i++){let a=e.attributes[i];if(!uD(a)){if(a.prefix&&!this.IsNamespaceRendered(a.prefix,a.namespaceURI)){let h={prefix:a.prefix,namespace:a.namespaceURI};t.push(h),this.visibleNamespaces.Add(h),n++}continue}if(a.localName==="xmlns"&&!a.prefix&&!a.nodeValue){let h={prefix:a.prefix,namespace:a.nodeValue};t.push(h),this.visibleNamespaces.Add(h),n++}let u=null,l;(l=/xmlns:([\w.-]+)/.exec(a.nodeName))&&(u=l[1]);let f=!0;if(this.exclusive&&!this.IsNamespaceInclusive(e,u)){let h=rM(e,u);if(h>1)f=!1;else if(h===0)continue}if(!this.IsNamespaceRendered(u,a.nodeValue)&&f){let h={prefix:u,namespace:a.nodeValue};t.push(h),this.visibleNamespaces.Add(h),n++}}if(!this.IsNamespaceRendered(e.prefix,e.namespaceURI)&&e.namespaceURI!=="http://www.w3.org/2000/xmlns/"){let i={prefix:e.prefix,namespace:e.namespaceURI};t.push(i),this.visibleNamespaces.Add(i),n++}t.sort(Yie);let s=null;return t.forEach(i=>{i.prefix!==s&&(s=i.prefix,this.result.push(" xmlns"),i.prefix&&this.result.push(":"+i.prefix),this.result.push('="'),this.result.push(i.namespace||""),this.result.push('"'))}),n}WriteAttributesAxis(e){let t=[];for(let n=0;n<e.attributes.length;n++){let s=e.attributes[n];uD(s)||t.push(s)}t.sort(Qie),t.forEach(n=>{n!=null&&(this.result.push(" "),this.result.push(n.nodeName),this.result.push('="'),this.result.push(this.NormalizeString(n.nodeValue,Ut.Attribute)),this.result.push('"'))})}NormalizeString(e,t){let n=[];if(e)for(let s=0;s<e.length;s++){let i=e[s];i==="<"&&(t===Ut.Attribute||this.IsTextNode(t))?n.push("&lt;"):i===">"&&this.IsTextNode(t)?n.push("&gt;"):i==="&"&&(t===Ut.Attribute||this.IsTextNode(t))?n.push("&amp;"):i==='"'&&t===Ut.Attribute?n.push("&quot;"):i===" "&&t===Ut.Attribute?n.push("&#x9;"):i===`
95
- `&&t===Ut.Attribute?n.push("&#xA;"):i==="\r"?n.push("&#xD;"):n.push(i)}return n.join("")}IsTextNode(e){switch(e){case Ut.Text:case Ut.CDATA:case Ut.SignificantWhitespace:case Ut.Whitespace:return!0}return!1}IsNamespaceInclusive(e,t){let n=t||null;return e.prefix===n?!1:this.inclusiveNamespacesPrefixList.indexOf(n||"")!==-1}IsNamespaceRendered(e,t){if(e=e||"",t=t||"",!e&&!t||e==="xml"&&t==="http://www.w3.org/XML/1998/namespace")return!0;let n=this.visibleNamespaces.GetPrefix(e);return n?n.namespace===t:!1}};function Yie(r,e){return r==e?0:r?e?r.prefix?e.prefix?r.prefix<e.prefix?-1:r.prefix>e.prefix?1:0:1:-1:1:-1}o(Yie,"XmlDsigC14NTransformNamespacesComparer");function Qie(r,e){if(!r.namespaceURI&&e.namespaceURI)return-1;if(!e.namespaceURI&&r.namespaceURI)return 1;let t=(r.namespaceURI||"")+r.localName,n=(e.namespaceURI||"")+e.localName;return t===n?0:t<n?-1:1}o(Qie,"XmlDsigC14NTransformAttributesComparer");function rM(r,e,t=0){let n=e||null;if(r.prefix===n)return++t;if(r.attributes)for(let s=0;s<r.attributes.length;s++){let i=r.attributes[s];if(!uD(i)&&e&&r.attributes[s].prefix===e)return++t}for(let s=r.firstChild;s;s=s.nextSibling)if(s.nodeType===Ut.Element){let a=rM(s,e,t);if(s.nodeType===Ut.Element&&a)return++t+a}return t}o(rM,"IsNamespaceUsed");function uD(r){let e=/xmlns:/;return!!(r!==null&&r.nodeType===Ut.Attribute&&(r.nodeName==="xmlns"||e.test(r.nodeName)))}o(uD,"IsNamespaceNode");var l2=class extends Ri{static{o(this,"SignatureMethodOther")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==Ut.Element||n.nodeName===de.ElementNames.HMACOutputLength)continue;let s;switch(n.localName){case de.ElementNames.RSAPSSParams:s=ia;break;default:break}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};l2=He([Mt({localName:"Other"})],l2);var Wa=class extends Fr{static{o(this,"SignatureMethod")}};He([_r({localName:de.AttributeNames.Algorithm,required:!0,defaultValue:""}),ft("design:type",String)],Wa.prototype,"Algorithm",void 0);He([Xt({localName:de.ElementNames.HMACOutputLength,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,converter:cg}),ft("design:type",Number)],Wa.prototype,"HMACOutputLength",void 0);He([Xt({parser:l2,noRoot:!0,minOccurs:0}),ft("design:type",l2)],Wa.prototype,"Any",void 0);Wa=He([Mt({localName:de.ElementNames.SignatureMethod})],Wa);var M0=class extends Fr{static{o(this,"CanonicalizationMethod")}};He([_r({localName:de.AttributeNames.Algorithm,required:!0,defaultValue:de.DefaultCanonMethod}),ft("design:type",String)],M0.prototype,"Algorithm",void 0);M0=He([Mt({localName:de.ElementNames.CanonicalizationMethod})],M0);var j0=class extends Fr{static{o(this,"DataObject")}};He([_r({localName:de.AttributeNames.Id,defaultValue:""}),ft("design:type",String)],j0.prototype,"Id",void 0);He([_r({localName:de.AttributeNames.MimeType,defaultValue:""}),ft("design:type",String)],j0.prototype,"MimeType",void 0);He([_r({localName:de.AttributeNames.Encoding,defaultValue:""}),ft("design:type",String)],j0.prototype,"Encoding",void 0);j0=He([Mt({localName:de.ElementNames.Object})],j0);var Sv=class extends Ri{static{o(this,"DataObjects")}};Sv=He([Mt({localName:"xmldsig_objects",parser:j0})],Sv);var rs=class extends Fr{static{o(this,"Transform")}constructor(){super(...arguments),this.innerXml=null}GetOutput(){throw new Fe(Te.METHOD_NOT_IMPLEMENTED)}LoadInnerXml(e){if(!e)throw new Fe(Te.PARAM_REQUIRED,"node");this.innerXml=e}GetInnerXml(){return this.innerXml}};He([_r({localName:de.AttributeNames.Algorithm,defaultValue:""}),ft("design:type",String)],rs.prototype,"Algorithm",void 0);He([Xt({localName:de.ElementNames.XPath,defaultValue:""}),ft("design:type",String)],rs.prototype,"XPath",void 0);rs=He([Mt({localName:de.ElementNames.Transform})],rs);var Qo=class extends rs{static{o(this,"XmlDsigBase64Transform")}constructor(){super(...arguments),this.Algorithm=de.AlgorithmNamespaces.XmlDsigBase64Transform}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");return vr.FromString(this.innerXml.textContent||"","base64")}};var Ja=class extends rs{static{o(this,"XmlDsigC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",this.xmlCanonicalizer=new Ga(!1,!1)}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}},za=class extends Ja{static{o(this,"XmlDsigC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",this.xmlCanonicalizer=new Ga(!0,!1)}};var Zo=class extends rs{static{o(this,"XmlDsigEnvelopedSignatureTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");let e=this.innerXml.firstChild,t=[];for(;e;)Js(e)&&e.localName===de.ElementNames.Signature&&e.namespaceURI===de.NamespaceURI&&t.push(e),e=e.nextSibling;for(let n of t)n.parentNode?.removeChild(n);return this.innerXml}};var Ya=class extends rs{static{o(this,"XmlDsigExcC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#",this.xmlCanonicalizer=new Ga(!1,!0)}get InclusiveNamespacesPrefixList(){return this.xmlCanonicalizer.InclusiveNamespacesPrefixList}set InclusiveNamespacesPrefixList(e){this.xmlCanonicalizer.InclusiveNamespacesPrefixList=e}LoadXml(e){if(super.LoadXml(e),this.Element&&this.Element.childNodes)for(let t=0;t<this.Element.childNodes.length;t++){let n=this.Element.childNodes[t];if(n&&n.nodeType===1)switch(n.localName){case"InclusiveNamespaces":this.setInclusiveNamespacesElement(n);break}}}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}setInclusiveNamespacesElement(e){let t=e.getAttribute("PrefixList");t&&t.length>0&&(this.xmlCanonicalizer.InclusiveNamespacesPrefixList=t)}},Qa=class extends Ya{static{o(this,"XmlDsigExcC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments",this.xmlCanonicalizer=new Ga(!0,!0)}};function nM(r){return r.parentNode?nM(r.parentNode):r}o(nM,"lookupParentNode");var F0=class extends rs{static{o(this,"XmlDsigXPathTransform")}constructor(){super(...arguments),this.Algorithm=de.AlgorithmNamespaces.XmlDsigXPathTransform}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");this.Filter(nM(this.innerXml),this.XPath)}Filter(e,t){let n=e.childNodes,s=[];for(let i=0;n&&i<n.length;i++){let a=n.item(i);s.push(a)}s.forEach(i=>{this.Evaluate(i,t)?i.parentNode&&i.parentNode.removeChild(i):this.Filter(i,t)})}GetEvaluator(e){return typeof self<"u"?e.ownerDocument==null?e:e.ownerDocument:bp("xpath")}Evaluate(e,t){try{let n=this.GetEvaluator(e),s=this.GetXml();if(!s||!s.firstChild)throw new Error("XML element or firstChild is not defined");let i=s.firstChild,a=`boolean(${t})`,u=typeof self>"u"?bp("xpath"):self;return!n.evaluate(a,e,{lookupNamespaceURI:o(f=>i.lookupNamespaceURI(f),"lookupNamespaceURI")},u.XPathResult.ANY_TYPE,null).booleanValue}catch{return!1}}};He([Xt({localName:de.ElementNames.XPath,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,required:!0}),ft("design:type",String)],F0.prototype,"XPath",void 0);var q0=class extends Ri{static{o(this,"Transforms")}OnLoadXml(e){super.OnLoadXml(e),this.items=this.GetIterator().map(t=>{switch(t.Algorithm){case de.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:return hh(t,Zo);case de.AlgorithmNamespaces.XmlDsigC14NTransform:return hh(t,Ja);case de.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:return hh(t,za);case de.AlgorithmNamespaces.XmlDsigExcC14NTransform:return hh(t,Ya);case de.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:return hh(t,Qa);case de.AlgorithmNamespaces.XmlDsigBase64Transform:return hh(t,Qo);case de.AlgorithmNamespaces.XmlDsigXPathTransform:return hh(t,F0);default:try{let n=Ev.CreateFromName(t.Algorithm);if(!t.Element)throw new Error("Transform element is not defined");return n.LoadXml(t.Element),n}catch{throw new Fe(Te.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM,t.Algorithm)}}})}};q0=He([Mt({localName:de.ElementNames.Transforms,parser:rs})],q0);function hh(r,e){let t=new e;if(!r.Element)throw new Error("Transform element is not defined");return t.LoadXml(r.Element),t}o(hh,"ChangeTransform");var Za=class extends Fr{static{o(this,"Reference")}constructor(e){super(),this.DigestMethod=new Pi,e&&(this.Uri=e)}};He([_r({defaultValue:""}),ft("design:type",String)],Za.prototype,"Id",void 0);He([_r({localName:de.AttributeNames.URI}),ft("design:type",String)],Za.prototype,"Uri",void 0);He([_r({localName:de.AttributeNames.Type,defaultValue:""}),ft("design:type",String)],Za.prototype,"Type",void 0);He([Xt({parser:q0}),ft("design:type",q0)],Za.prototype,"Transforms",void 0);He([Xt({required:!0,parser:Pi}),ft("design:type",Pi)],Za.prototype,"DigestMethod",void 0);He([Xt({required:!0,localName:de.ElementNames.DigestValue,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,converter:bi}),ft("design:type",Uint8Array)],Za.prototype,"DigestValue",void 0);Za=He([Mt({localName:de.ElementNames.Reference}),ft("design:paramtypes",[String])],Za);var H0=class extends Ri{static{o(this,"References")}};H0=He([Mt({localName:"References",parser:Za})],H0);var eu=class extends Fr{static{o(this,"SignedInfo")}};He([_r({localName:de.AttributeNames.Id,defaultValue:""}),ft("design:type",String)],eu.prototype,"Id",void 0);He([Xt({parser:M0,required:!0}),ft("design:type",M0)],eu.prototype,"CanonicalizationMethod",void 0);He([Xt({parser:Wa,required:!0}),ft("design:type",Wa)],eu.prototype,"SignatureMethod",void 0);He([Xt({parser:H0,minOccurs:1,noRoot:!0}),ft("design:type",H0)],eu.prototype,"References",void 0);eu=He([Mt({localName:de.ElementNames.SignedInfo})],eu);var G0="http://www.w3.org/2001/04/xmldsig-more#",W0="ecdsa",ph=class extends Bs{static{o(this,"EcdsaPublicKey")}};He([Xt({localName:de.ElementNames.X,namespaceURI:G0,prefix:W0,required:!0,converter:bi}),ft("design:type",Uint8Array)],ph.prototype,"X",void 0);He([Xt({localName:de.ElementNames.Y,namespaceURI:G0,prefix:W0,required:!0,converter:bi}),ft("design:type",Uint8Array)],ph.prototype,"Y",void 0);ph=He([Mt({localName:de.ElementNames.PublicKey,namespaceURI:G0,prefix:W0})],ph);var K0=class extends Bs{static{o(this,"NamedCurve")}};He([_r({localName:de.AttributeNames.URI,required:!0}),ft("design:type",String)],K0.prototype,"Uri",void 0);K0=He([Mt({localName:de.ElementNames.NamedCurve,namespaceURI:G0,prefix:W0})],K0);var $0=class extends Bs{static{o(this,"DomainParameters")}};He([Xt({parser:K0}),ft("design:type",K0)],$0.prototype,"NamedCurve",void 0);$0=He([Mt({localName:de.ElementNames.DomainParameters,namespaceURI:G0,prefix:W0})],$0);var X0=class extends Zs{static{o(this,"EcdsaKeyValue")}constructor(){super(...arguments),this.name=de.ElementNames.ECDSAKeyValue,this.key=null,this.jwk=null,this.keyUsage=null}static canImportCryptoKey(e){return e.algorithm.name.toUpperCase()===zo.toUpperCase()}get NamedCurve(){return iM(this.DomainParameters.NamedCurve.Uri)}async importKey(e){if(!e.algorithm.name||e.algorithm.name.toUpperCase()!=="ECDSA")throw new Fe(Te.ALGORITHM_WRONG_NAME,e.algorithm.name);let t=await hn.crypto.subtle.exportKey("jwk",e);return this.key=e,this.jwk=t,this.PublicKey=new ph,this.PublicKey.X=vr.FromString(t.x||"","base64url"),this.PublicKey.Y=vr.FromString(t.y||"","base64url"),this.DomainParameters||(this.DomainParameters=new $0),this.DomainParameters.NamedCurve||(this.DomainParameters.NamedCurve=new K0),this.DomainParameters.NamedCurve.Uri=iM(t.crv||""),this.keyUsage=e.usages,this}async exportKey(e){if(this.key)return this.key;let t=vr.ToBase64Url(this.PublicKey.X),n=vr.ToBase64Url(this.PublicKey.Y),s=Zie(this.DomainParameters.NamedCurve.Uri),i={kty:"EC",crv:s,x:t,y:n,ext:!0};this.keyUsage=["verify"];let a=await hn.crypto.subtle.importKey("jwk",i,{name:"ECDSA",namedCurve:s},!0,this.keyUsage);return this.key=a,this.key}};He([Xt({parser:$0}),ft("design:type",$0)],X0.prototype,"DomainParameters",void 0);He([Xt({parser:ph,required:!0}),ft("design:type",ph)],X0.prototype,"PublicKey",void 0);X0=He([Mt({localName:de.ElementNames.ECDSAKeyValue,namespaceURI:G0,prefix:W0})],X0);function iM(r){switch(r){case"P-256":return"urn:oid:1.2.840.10045.3.1.7";case"P-384":return"urn:oid:1.3.132.0.34";case"P-521":return"urn:oid:1.3.132.0.35"}throw new Fe(Te.CRYPTOGRAPHIC,"Unknown NamedCurve")}o(iM,"GetNamedCurveOid");function Zie(r){switch(r){case"urn:oid:1.2.840.10045.3.1.7":return"P-256";case"urn:oid:1.3.132.0.34":return"P-384";case"urn:oid:1.3.132.0.35":return"P-521"}throw new Fe(Te.CRYPTOGRAPHIC,"Unknown NamedCurve OID")}o(Zie,"GetNamedCurveFromOid");var eae=class extends Map{static{o(this,"KeyInfoClauseRegistry")}},Zl=new eae;Zl.set(de.ElementNames.RSAKeyValue,V0);Zl.set(de.ElementNames.ECDSAKeyValue,X0);var c2=class{static{o(this,"KeyInfoClauseFactory")}static create(e){let t=Zl.get(e);if(!t)throw new Fe(Te.KEY_INFO_CLAUSE_NOT_SUPPORTED,e);return new t}};var Av=class extends Zs{static{o(this,"KeyValue")}set Value(e){this.element=null,this.value=e}get Value(){return this.value}constructor(e){super(),e&&(this.Value=e)}async importKey(e){for(let[,t]of Zl)if(t.canImportCryptoKey(e)){let n=new t;return await n.importKey(e),this.Value=n,this}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.algorithm.name)}async exportKey(e){if(!this.Value)throw new Fe(Te.NULL_REFERENCE);return this.Value.exportKey(e)}OnGetXml(e){if(!this.Value)throw new Fe(Te.CRYPTOGRAPHIC,"KeyValue has empty value");let t=this.Value.GetXml();t&&e.appendChild(t)}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(Js(n))try{let s=n.localName,i=c2.create(s);i.LoadXml(n),this.value=i;return}catch{}}throw new Fe(Te.CRYPTOGRAPHIC,"Unsupported KeyValue in use")}};Av=He([Mt({localName:de.ElementNames.KeyValue}),ft("design:paramtypes",[Zs])],Av);var tae={"2.5.4.3":{short:"CN",long:"CommonName"},"2.5.4.6":{short:"C",long:"Country"},"2.5.4.5":{long:"DeviceSerialNumber"},"0.9.2342.19200300.100.1.25":{short:"DC",long:"DomainComponent"},"1.2.840.113549.1.9.1":{short:"E",long:"EMail"},"2.5.4.42":{short:"G",long:"GivenName"},"2.5.4.43":{short:"I",long:"Initials"},"2.5.4.7":{short:"L",long:"Locality"},"2.5.4.10":{short:"O",long:"Organization"},"2.5.4.11":{short:"OU",long:"OrganizationUnit"},"2.5.4.8":{short:"ST",long:"State"},"2.5.4.9":{short:"Street",long:"StreetAddress"},"2.5.4.4":{short:"SN",long:"SurName"},"2.5.4.12":{short:"T",long:"Title"},"1.2.840.113549.1.9.8":{long:"UnstructuredAddress"},"1.2.840.113549.1.9.2":{long:"UnstructuredName"}},J0=class{static{o(this,"X509Certificate")}constructor(e){if(this.publicKey=null,e){let t=new Uint8Array(e);this.LoadRaw(t),this.raw=t}}get SerialNumber(){return this.simpl.serialNumber.valueBlock.toString()}get Issuer(){return this.NameToString(this.simpl.issuer)}get Subject(){return this.NameToString(this.simpl.subject)}async Thumbprint(e="SHA-1"){return hn.crypto.subtle.digest(e,this.raw)}get PublicKey(){return this.publicKey}GetRaw(){return this.raw}async exportKey(e){if(e){let t={algorithm:e,usages:["verify"]};if(t.algorithm.name.toUpperCase()===zo){let s=this.simpl.subjectPublicKeyInfo.toJSON();if("crv"in s&&s.crv)t.algorithm.namedCurve=s.crv;else throw new Error("Cannot get Curved name from the ECDSA public key")}this.isHashedAlgorithm(t.algorithm)&&typeof t.algorithm.hash=="string"&&(t.algorithm.hash={name:t.algorithm.hash});let n=await this.simpl.getPublicKey({algorithm:t});return this.publicKey=n,n}return this.simpl.subjectPublicKeyInfo.algorithm.algorithmId==="1.2.840.113549.1.1.1"?this.publicKey=await this.simpl.getPublicKey({algorithm:{algorithm:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},usages:["verify"]}}):this.publicKey=await this.simpl.getPublicKey(),this.publicKey}NameToString(e,t=","){let n=[];return e.typesAndValues.forEach(s=>{let i=s.type,a=tae[i.toString()],u=a?a.short:null;n.push(`${u||i}=${s.value.valueBlock.value}`)}),n.join(t+" ")}LoadRaw(e){this.raw=new Uint8Array(e);let t=Hr(this.raw.buffer);this.simpl=new ts({schema:t.result})}isHashedAlgorithm(e){return!!e.hash}};var f2=class extends Fr{static{o(this,"X509IssuerSerial")}};He([Xt({localName:de.ElementNames.X509IssuerName,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,required:!0}),ft("design:type",String)],f2.prototype,"X509IssuerName",void 0);He([Xt({localName:de.ElementNames.X509SerialNumber,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,required:!0}),ft("design:type",String)],f2.prototype,"X509SerialNumber",void 0);f2=He([Mt({localName:de.ElementNames.X509IssuerSerial})],f2);var dh;(function(r){r[r.None=0]="None",r[r.EndCertOnly=1]="EndCertOnly",r[r.ExcludeRoot=2]="ExcludeRoot",r[r.WholeChain=3]="WholeChain"})(dh||(dh={}));var z0=class extends Zs{static{o(this,"KeyInfoX509Data")}constructor(e,t=dh.None){if(super(),this.x509crl=null,this.SubjectKeyIdList=[],e){if(e instanceof Uint8Array)this.AddCertificate(new J0(e));else if(e instanceof J0)switch(t){case dh.None:case dh.EndCertOnly:this.AddCertificate(e);break;case dh.ExcludeRoot:this.AddCertificatesChainFrom(e,!1);break;case dh.WholeChain:this.AddCertificatesChainFrom(e,!0);break}}}async importKey(e){throw new Fe(Te.METHOD_NOT_SUPPORTED)}async exportKey(e){if(!this.Certificates.length)throw new Fe(Te.NULL_REFERENCE);return this.Key=await this.Certificates[0].exportKey(e),this.Key}get Certificates(){return this.X509CertificateList}get CRL(){return this.x509crl}set CRL(e){this.x509crl=e}get IssuerSerials(){return this.IssuerSerialList}get SubjectKeyIds(){return this.SubjectKeyIdList}get SubjectNames(){return this.SubjectNameList}AddCertificate(e){if(!e)throw new Fe(Te.PARAM_REQUIRED,"certificate");this.X509CertificateList||(this.X509CertificateList=[]),this.X509CertificateList.push(e)}AddIssuerSerial(e,t){if(e==null)throw new Fe(Te.PARAM_REQUIRED,"issuerName");this.IssuerSerialList==null&&(this.IssuerSerialList=[]);let n={issuerName:e,serialNumber:t};this.IssuerSerialList.push(n)}AddSubjectKeyId(e){if(this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),typeof e=="string"){if(e!=null){let t=vr.FromBase64(e);this.SubjectKeyIdList.push(t)}}else this.SubjectKeyIdList.push(e)}AddSubjectName(e){this.SubjectNameList==null&&(this.SubjectNameList=[]),this.SubjectNameList.push(e)}GetXml(){let e=this.CreateDocument(),t=this.CreateElement(e),n=this.GetPrefix();if(this.IssuerSerialList!=null&&this.IssuerSerialList.length>0&&this.IssuerSerialList.forEach(s=>{let i=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509IssuerSerial),a=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509IssuerName);a.textContent=s.issuerName,i.appendChild(a);let u=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509SerialNumber);u.textContent=s.serialNumber,i.appendChild(u),t.appendChild(i)}),this.SubjectKeyIdList!=null&&this.SubjectKeyIdList.length>0&&this.SubjectKeyIdList.forEach(s=>{let i=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509SKI);i.textContent=vr.ToBase64(s),t.appendChild(i)}),this.SubjectNameList!=null&&this.SubjectNameList.length>0&&this.SubjectNameList.forEach(s=>{let i=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509SubjectName);i.textContent=s,t.appendChild(i)}),this.X509CertificateList!=null&&this.X509CertificateList.length>0&&this.X509CertificateList.forEach(s=>{let i=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509Certificate);i.textContent=vr.ToBase64(s.GetRaw()),t.appendChild(i)}),this.x509crl!=null){let s=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509CRL);s.textContent=vr.ToBase64(this.x509crl),t.appendChild(s)}return t}LoadXml(e){super.LoadXml(e),this.IssuerSerialList&&(this.IssuerSerialList=[]),this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),this.SubjectNameList&&(this.SubjectNameList=[]),this.X509CertificateList&&(this.X509CertificateList=[]),this.x509crl=null;let t=this.GetChildren(de.ElementNames.X509IssuerSerial);t&&t.forEach(s=>{let i=Fr.GetChild(s,de.ElementNames.X509IssuerName,de.NamespaceURI,!0),a=Fr.GetChild(s,de.ElementNames.X509SerialNumber,de.NamespaceURI,!0);i&&i.textContent&&a&&a.textContent&&this.AddIssuerSerial(i.textContent,a.textContent)}),t=this.GetChildren(de.ElementNames.X509SKI),t&&t.forEach(s=>{if(s.textContent){let i=vr.FromBase64(s.textContent);this.AddSubjectKeyId(i)}}),t=this.GetChildren(de.ElementNames.X509SubjectName),t?.forEach(s=>{s.textContent&&this.AddSubjectName(s.textContent)}),t=this.GetChildren(de.ElementNames.X509Certificate),t&&t.forEach(s=>{if(s.textContent){let i=vr.FromBase64(s.textContent);this.AddCertificate(new J0(i))}});let n=this.GetChild(de.ElementNames.X509CRL,!1);n&&n.textContent&&(this.x509crl=vr.FromBase64(n.textContent))}AddCertificatesChainFrom(e,t){}};z0=He([Mt({localName:de.ElementNames.X509Data}),ft("design:paramtypes",[Object,Object])],z0);var Cv=class extends Zs{static{o(this,"SPKIData")}async importKey(e){let t=await hn.crypto.subtle.exportKey("spki",e);return this.SPKIexp=new Uint8Array(t),this.Key=e,this}async exportKey(e){if(!this.SPKIexp)throw new Error("SPKI data is not defined");let t=await hn.crypto.subtle.importKey("spki",this.SPKIexp,e,!0,["verify"]);return this.Key=t,t}};He([Xt({localName:de.ElementNames.SPKIexp,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,required:!0,converter:bi}),ft("design:type",Object)],Cv.prototype,"SPKIexp",void 0);Cv=He([Mt({localName:de.ElementNames.SPKIData})],Cv);var mh=class extends Ri{static{o(this,"KeyInfo")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==Ut.Element)continue;let s=null;switch(n.localName){case de.ElementNames.KeyValue:s=Av;break;case de.ElementNames.X509Data:s=z0;break;case de.ElementNames.SPKIData:s=Cv;break;case de.ElementNames.KeyName:case de.ElementNames.RetrievalMethod:case de.ElementNames.PGPData:case de.ElementNames.MgmtData:}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};He([_r({localName:de.AttributeNames.Id,defaultValue:""}),ft("design:type",String)],mh.prototype,"Id",void 0);mh=He([Mt({localName:de.ElementNames.KeyInfo})],mh);var ec=class extends Fr{static{o(this,"Signature")}};He([_r({localName:de.AttributeNames.Id,defaultValue:""}),ft("design:type",String)],ec.prototype,"Id",void 0);He([Xt({parser:eu,required:!0}),ft("design:type",eu)],ec.prototype,"SignedInfo",void 0);He([Xt({localName:de.ElementNames.SignatureValue,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,required:!0,converter:bi,defaultValue:null}),ft("design:type",Object)],ec.prototype,"SignatureValue",void 0);He([Xt({parser:mh}),ft("design:type",mh)],ec.prototype,"KeyInfo",void 0);He([Xt({parser:Sv,noRoot:!0}),ft("design:type",Sv)],ec.prototype,"ObjectList",void 0);ec=He([Mt({localName:de.ElementNames.Signature})],ec);var nae=class extends Map{static{o(this,"AlgorithmRegistry")}},hr=new nae;hr.set(n2,{type:"signature",algorithm:P0});hr.set(s2,{type:"signature",algorithm:O0});hr.set(i2,{type:"signature",algorithm:k0});hr.set(a2,{type:"signature",algorithm:L0});hr.set(n2,{type:"signature",algorithm:P0});hr.set(s2,{type:"signature",algorithm:O0});hr.set(i2,{type:"signature",algorithm:k0});hr.set(a2,{type:"signature",algorithm:L0});hr.set(oD,{type:"signature",algorithm:u2});hr.set(YC,{type:"signature",algorithm:I0});hr.set(QC,{type:"signature",algorithm:B0});hr.set(ZC,{type:"signature",algorithm:D0});hr.set(e2,{type:"signature",algorithm:_0});hr.set(YC.toUpperCase(),{type:"signature",algorithm:I0});hr.set(QC.toUpperCase(),{type:"signature",algorithm:B0});hr.set(ZC.toUpperCase(),{type:"signature",algorithm:D0});hr.set(e2.toUpperCase(),{type:"signature",algorithm:_0});hr.set(tD,{type:"signature",algorithm:gv});hr.set(rD,{type:"signature",algorithm:yv});hr.set(nD,{type:"signature",algorithm:vv});hr.set(sD,{type:"signature",algorithm:wv});hr.set(b0,{type:"hash",algorithm:WC});hr.set(x0,{type:"hash",algorithm:mv});hr.set(N0,{type:"hash",algorithm:JC});hr.set(T0,{type:"hash",algorithm:zC});var gh=class{static{o(this,"AlgorithmFactory")}static createHashAlgorithmFromNamespace(e){for(let[t,{type:n,algorithm:s}]of hr)if(n==="hash"&&t===e)return new s;throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e)}static createSignatureAlgorithmFromMethod(e){for(let[t,{type:n,algorithm:s}]of hr)if(n==="signature"&&e.Algorithm===t){let i=new s;return i.fromMethod&&i.fromMethod(e),i}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.Algorithm)}static createHashAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of hr)if(t==="hash"){let s=new n;if(s.algorithm.name.toUpperCase()===e.name.toUpperCase())return s}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.name)}static createSignatureAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of hr)if(t==="signature"){let s=n.fromAlgorithm(e);if(s)return s}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.name)}};var sae=class extends Map{static{o(this,"TransformRegistry")}},tu=new sae;tu.set(de.AlgorithmNamespaces.XmlDsigBase64Transform,Qo);tu.set(de.AlgorithmNamespaces.XmlDsigC14NTransform,Ja);tu.set(de.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform,za);tu.set(de.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform,Zo);tu.set(de.AlgorithmNamespaces.XmlDsigExcC14NTransform,Ya);tu.set(de.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform,Qa);var Ev=class{static{o(this,"CryptoConfig")}static CreateFromName(e){if(!e)throw new Fe(Te.PARAM_REQUIRED,"name");let t=tu.get(e);if(t)return new t;let n;switch(e){case de.AlgorithmNamespaces.XmlDsigBase64Transform:n=new Qo;break;case de.AlgorithmNamespaces.XmlDsigC14NTransform:n=new Ja;break;case de.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:n=new za;break;case de.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:n=new Zo;break;case de.AlgorithmNamespaces.XmlDsigXPathTransform:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e);case de.AlgorithmNamespaces.XmlDsigXsltTransform:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e);case de.AlgorithmNamespaces.XmlDsigExcC14NTransform:n=new Ya;break;case de.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:n=new Qa;break;case de.AlgorithmNamespaces.XmlDecryptionTransform:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e);default:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e)}return n}static CreateSignatureAlgorithm(e){return gh.createSignatureAlgorithmFromMethod(e)}static CreateHashAlgorithm(e){return gh.createHashAlgorithmFromNamespace(e)}static GetHashAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return gh.createHashAlgorithmFromAlgorithm(t)}static GetSignatureAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return"hash"in t&&typeof t.hash=="string"&&(t.hash={name:t.hash}),gh.createSignatureAlgorithmFromAlgorithm(t)}static CreateSignatureMethod(e){let t=new Wa;return t.Algorithm=e.namespaceURI,e.toMethod&&e.toMethod(t),t}static RegisterSignatureAlgorithm(e,t){hr.set(e,{type:"signature",algorithm:t})}static RegisterHashAlgorithm(e,t){hr.set(e,{type:"hash",algorithm:t})}static RegisterKeyInfoClause(e,t){Zl.set(e,t)}static RegisterTransform(e,t){tu.set(e,t)}};var h2=pw(QN(),1);var aM={xmldec:{version:"1.0",encoding:"UTF-8",standalone:void 0}};var oM={explicitArray:!1,explicitRoot:!1,preserveChildrenOrder:!0};var aae=o(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessageInRecord"),uM=o(r=>typeof r=="string"?lo(new Ks(r)):r instanceof Error?lo(new Ks(r.message,{cause:r.cause})):aae(r)?lo(new Ks(r.message)):lo(new Ks("unexpected error")),"leftFromError");var lM=class{static{o(this,"Xml2JsToolkit")}xml2js;constructor(e=cae){this.xml2js=e,bV({XMLSerializer:h2.default.XMLSerializer,DOMParser:h2.default.DOMParser,DOMImplementation:h2.default.DOMImplementation})}async validate(e,t,n){try{return await Y8.validate(e,t,oae.readFileSync(uae.resolve(t,n),"utf8")),Oh()}catch(s){return uM(s)}}parse(e,t){return new Promise((n,s)=>new this.xml2js.Parser({...oM,...t}).parseString(e,(i,a)=>i?s(i):n(a)))}build(e,t){return Promise.resolve(new this.xml2js.Builder({...aM,...t}).buildObject(e))}digest(e,t,n=dm){return this.hash(this.canonicalize(e,n),t)}canonicalize(e,t=dm){let n=Ci(this.clear(e));return new Ga(t.includeComments,t.exclusive).Canonicalize(n)}getNode(e,t){let s=Ci(e).documentElement.getElementsByTagName(t).item(0);return s?this.clear(Ua(s)):null}getFirstNode(e){let n=Ci(e).documentElement.firstChild;return n?this.clear(Ua(n)):null}getAttribute(e,t){return Ci(e).documentElement.getAttribute(t)}appendNode(e,t){let n=Ci(e),{documentElement:s}=Ci(t);return n.documentElement.appendChild(s),this.clear(Ua(n))}hash(e,t){return lae.createHash(t).update(e,"utf8").digest().toString("base64")}clear(e){return['xmlns:default="http://www.w3.org/2000/09/xmldsig#"',' standalone="no"',"default:",":default",`
96
- `,"\r"," "].reduce((n,s)=>n.replace(s,""),e.replace(/(>)\s*(<)/gm,"$1$2"))}};export{Ib as a,OR as b,Bb as c,Rh as d,Db as e,NK as f,hae as g,dae as h,Ks as i,kR as j,_b as k,Ph as l,Rb as m,mw as n,lo as o,Oh as p,LR as q,VR as r,mm as s,roe as t,noe as u,gw as v,UR as w,MR as x,jR as y,poe as z,FR as A,Coe as B,Doe as C,joe as D,KR as E,$R as F,XR as G,GR as H,WR as I,JR as J,zR as K,YR as L,QR as M,ZR as N,eP as O,tP as P,rP as Q,nP as R,sP as S,iP as T,aP as U,oP as V,uP as W,lP as X,cP as Y,fP as Z,hP as _,pP as $,dP as aa,mP as ba,gP as ca,yP as da,RP as ea,PP as fa,Y3 as ga,Q3 as ha,J8 as ia,uM as ja,lM as ka};
97
- /*! Bundled license information:
98
-
99
- lodash/lodash.js:
100
- (**
101
- * @license
102
- * Lodash <https://lodash.com/>
103
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
104
- * Released under MIT license <https://lodash.com/license>
105
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
106
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
107
- *)
108
-
109
- axios/dist/node/axios.cjs:
110
- (*! Axios v1.12.2 Copyright (c) 2025 Matt Zabriskie and contributors *)
111
-
112
- js-md4/src/md4.js:
113
- (**
114
- * [js-md4]{@link https://github.com/emn178/js-md4}
115
- *
116
- * @namespace md4
117
- * @version 0.3.2
118
- * @author Yi-Cyuan Chen [emn178@gmail.com]
119
- * @copyright Yi-Cyuan Chen 2015-2027
120
- * @license MIT
121
- *)
122
-
123
- sax/lib/sax.js:
124
- (*! http://mths.be/fromcodepoint v0.1.0 by @mathias *)
125
-
126
- decimal.js/decimal.mjs:
127
- (*!
128
- * decimal.js v10.6.0
129
- * An arbitrary-precision Decimal type for JavaScript.
130
- * https://github.com/MikeMcl/decimal.js
131
- * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
132
- * MIT Licence
133
- *)
134
-
135
- pvtsutils/build/index.es.js:
136
- (*!
137
- * MIT License
138
- *
139
- * Copyright (c) 2017-2024 Peculiar Ventures, LLC
140
- *
141
- * Permission is hereby granted, free of charge, to any person obtaining a copy
142
- * of this software and associated documentation files (the "Software"), to deal
143
- * in the Software without restriction, including without limitation the rights
144
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
145
- * copies of the Software, and to permit persons to whom the Software is
146
- * furnished to do so, subject to the following conditions:
147
- *
148
- * The above copyright notice and this permission notice shall be included in all
149
- * copies or substantial portions of the Software.
150
- *
151
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
152
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
153
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
154
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
155
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
156
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
157
- * SOFTWARE.
158
- *
159
- *)
160
-
161
- pvutils/build/utils.es.js:
162
- (*!
163
- Copyright (c) Peculiar Ventures, LLC
164
- *)
165
-
166
- asn1js/build/index.es.js:
167
- (*!
168
- * Copyright (c) 2014, GMO GlobalSign
169
- * Copyright (c) 2015-2022, Peculiar Ventures
170
- * All rights reserved.
171
- *
172
- * Author 2014-2019, Yury Strozhevsky
173
- *
174
- * Redistribution and use in source and binary forms, with or without modification,
175
- * are permitted provided that the following conditions are met:
176
- *
177
- * * Redistributions of source code must retain the above copyright notice, this
178
- * list of conditions and the following disclaimer.
179
- *
180
- * * Redistributions in binary form must reproduce the above copyright notice, this
181
- * list of conditions and the following disclaimer in the documentation and/or
182
- * other materials provided with the distribution.
183
- *
184
- * * Neither the name of the copyright holder nor the names of its
185
- * contributors may be used to endorse or promote products derived from
186
- * this software without specific prior written permission.
187
- *
188
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
189
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
190
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
191
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
192
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
193
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
194
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
195
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
196
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
197
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
198
- *
199
- *)
200
-
201
- @noble/hashes/esm/utils.js:
202
- (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
203
-
204
- pkijs/build/index.es.js:
205
- (*!
206
- * Copyright (c) 2014, GlobalSign
207
- * Copyright (c) 2015-2019, Peculiar Ventures
208
- * All rights reserved.
209
- *
210
- * Author 2014-2019, Yury Strozhevsky
211
- *
212
- * Redistribution and use in source and binary forms, with or without modification,
213
- * are permitted provided that the following conditions are met:
214
- *
215
- * * Redistributions of source code must retain the above copyright notice, this
216
- * list of conditions and the following disclaimer.
217
- *
218
- * * Redistributions in binary form must reproduce the above copyright notice, this
219
- * list of conditions and the following disclaimer in the documentation and/or
220
- * other materials provided with the distribution.
221
- *
222
- * * Neither the name of the {organization} nor the names of its
223
- * contributors may be used to endorse or promote products derived from
224
- * this software without specific prior written permission.
225
- *
226
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
227
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
228
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
229
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
230
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
231
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
232
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
233
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
234
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
235
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
236
- *
237
- *)
238
- */